Solved

CentOS 6.0 networking

Posted on 2012-04-10
22
504 Views
Last Modified: 2012-06-27
I am having trouble with intial network (ifconfig and route) settings on my new server, doing it three different ways to no avail.  I have set the interface (ifconfig...) and the default routing (route add...), as well as use the 'setup' utility, as well as manually editing the /etc/sysconfig/network-scripts/ifcfg-eth0 (and route-eth0) files.  While I have  been able to ping the default gateway, I can't get past it.  I know that default gatework works because other devices on the net have been successful.  If I try to ping past the default I get something similar to a "route unreachable" error message.
Furthermore I can't save the configuration when I try to do it thru the setup utility or when I do a /etc/inid.d/network save and restart.  Even when I see the /etc/sysconfig/network-scripts/ifcfg-eth0  and the /etc/sysconfig/network-scripts/route-eth0 have the correct parameters...(I think)
What am I missing?
0
Comment
Question by:mrkent
  • 10
  • 6
  • 3
  • +2
22 Comments
 

Assisted Solution

by:goncalogirao
goncalogirao earned 25 total points
ID: 37826900
I Had a similar problem with a server, check if you're doing NAT on the CentOS
0
 
LVL 11

Accepted Solution

by:
un1x86 earned 91 total points
ID: 37827004
Did you check if with ping or traceroute it actually choses your router? What are your routes? You might want to post some details... It is hard to predict...
0
 

Author Comment

by:mrkent
ID: 37827297
NAT is not configured on the CentOS.  
I don't think it is choosing the gateway for outgoing.  If I remember correctly, traceroute was giving me the error message immediately just like ping was.
I can ping the gateway successfully so connectivity is there.

I'll post some details when I try it again in the next hour or so....
0
 
LVL 76

Assisted Solution

by:arnold
arnold earned 294 total points
ID: 37827424
It is not clear from your info whether the issue is that your location has a proxy and that is the only way to get out.
double check the ip/netmask matches the IP/netmask on the network.  A netmask mismatch could explain this.

/etc/network?
netstat -rn
please post
0
 

Author Comment

by:mrkent
ID: 37828194
See enclosure for all outputs.  It finally worked only AFTER I manually updated these last two files:  /etc/sysconfig/network   and
                                            /etc/sysconfig/network-scripts/ifcfg-eth0              

And the /etc/sysconfig/network-scripts/route-eth0 edit that I manually created, I'm not sure I did that right, nor am I sure that I need to have a default route in that file.

Does seem right?  It shouldn't have happened that way.  But for now, the networking works...
CentOS-config.txt
0
 
LVL 11

Assisted Solution

by:un1x86
un1x86 earned 91 total points
ID: 37830012
by default you don't need the route-eth0 file as long as you have defined GATEWAY in /etc/sysconfig/network or in the ifcfg-eth0 file
0
 

Author Comment

by:mrkent
ID: 37830605
That seems right.  The route-eth0 file was there only because I manually created it in the first place.  The last CentOS box I worked with was 5.7, and I don't know how different 6.0 is from 5.7.  I think my recollection with 5.7 was that somehow the route-eth0 file was created thru some utility I was working with.  Also,  I don't think I had an /etc/network file.

My next task is to install squid and turn this box into a proxy for local users.  So far I have only done a "yum install squid".  It was successful, now I am looking to configure and activate it.
0
 
LVL 11

Expert Comment

by:un1x86
ID: 37831201
have fun.
0
 
LVL 4

Assisted Solution

by:senseifedon
senseifedon earned 90 total points
ID: 37839371
Hi;
Maybe your problem is related with SELinux. Can you disable it? Then try to connect somewhere. Edit the file: /etc/selinux/config change the SELINUX line to
SELINUX=disabled

Open in new window

0
 

Author Comment

by:mrkent
ID: 37840744
Wow, I am afraid that is a new one to me.  I didn't realize SELinux was already part of my distribution  - I thought that was different beast altogether and I would'vd had to have that implemented separately.
I am looking this up as I write this...

(lots of "haves" in that sentence, huh)
0
 
LVL 76

Assisted Solution

by:arnold
arnold earned 294 total points
ID: 37840767
Selinux will not interfere with network setup.

Have to see your ifcfg-eth0 script
It also use NetworkManagerto start interfaces that are dhcp.
Netstat -rn could shed light on what is seen on your system.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Assisted Solution

by:senseifedon
senseifedon earned 90 total points
ID: 37845908
Hmmmm did you control your dns configuration?
ping 173.194.35.177
if ping responses normally, will try this one;
ping www.google.com

if you problem related with above situation, please change your dns server via following configuration;

nano /etc/resolv.conf

and insert

nameserver 8.8.8.8
nameserver 8.8.4.4

Or you should check ip address of your server. May be someone also uses same ip in your network.
0
 

Author Comment

by:mrkent
ID: 37846501
All-
Enclosed are the outputs you asked for in the last two posts.  I didn't change anything.  Anything catch your eye?
CentOS-config-2-.txt
0
 
LVL 76

Assisted Solution

by:arnold
arnold earned 294 total points
ID: 37846519
chkkconfig --list NetworkManager
chkkconfig --list network

are they set to on?

/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=Your_hostname

Are you using the available tool to configure networking, or are you trying to fill the configuration files one at a time?

/etc/resolv.conf
/etc/nsswitch.conf
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-<interface>


The entry in the routing table (netstat -rn) makes no sense
10.0.2.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0

It suggests that a DHCP request is being made.

Could you post /sbin/ifconfig -a as well as /etc/sysconfig/network-scripts/route-eth0
not sure what you have there nor why you have it.
0
 

Author Comment

by:mrkent
ID: 37847024
I've attached another file with more outputs at your request.

For the network configuration it was a combination of trying to use the configuration tool setup and making manual entries.  For the route-eth0 file I created it and configured it manually   -not sure if I needed it.
CentOS-config-3-.txt
0
 
LVL 76

Assisted Solution

by:arnold
arnold earned 294 total points
ID: 37847075
You seem to be missing the NetworkManager script.
You do not need the route-eth0

What happens when the system is booted?
What is the netstat -rn on boot?
0
 

Author Comment

by:mrkent
ID: 37847083
Do I really need the NetworkManager script?

Since I only have remote access today I don't want to reboot the system.  Last time I did that I couldn't get back in.  Apparantly not all the network config survived the reboot at that time.  It may have improved now with the latest changes that I made, but I don't want to take that chance until I am in front of the machine.  I haven't reboot the box since my lastest changes seemed to have improve things.
0
 
LVL 76

Assisted Solution

by:arnold
arnold earned 294 total points
ID: 37847099
The puzzling thing to me is the reference to the 169.254.0.0 segment referencing eth0
This segment os assigned when dhcp server can not be contacted. Your configuration does not indicate a dcp setting, your setting for eth0 further disables ipv6 yet, your ifconfig reflects ipv6 info.
We may have a similar issue. When NetwokManager is disabled, the network on a system does not comeup, but this one is configured as dhcp.

Rebooking in you first config post that included the ifcfg-eth0
You do not have NetworkManager installed, yet your config has NM_CONTROLLED=yes which should be no.
https://www.centos.org/modules/newbb/viewtopic.php?topic_id=33908&forum=58
This might explain your situation.
0
 

Author Comment

by:mrkent
ID: 37847483
Very interesting find.  That looks similar, though not exact, to my situation.  Maybe I should re-install using the "simple" server text only settings.  My initial installation was "web server" setting (because I was hoping it would give me a GUI interface for intial configuration but it turns out it didn't give me that anyway).  Thoughts?

I'm not going to try any changes now anyway because at the moment I only have remote access.  I still haven't reboot the server yet because of the reasons I said before.  And I don't know why NetworkManager wasn't installed the first time.  For now, the server is reachable from the internet.   And I still haven't started my squid proxy configuration yet, which was the reason for installing this server in the first place...
0
 
LVL 76

Assisted Solution

by:arnold
arnold earned 294 total points
ID: 37847502
Text only seems to default in including NetworkManager which is what was mentioned and something I am dealing with in trying to setup clustering which does not work with NetworkManager.
0
 

Author Comment

by:mrkent
ID: 37867078
Thanks to all.  It seems to be surviving the reboots.  And I have NM_Control=yes in my ifcfg-eth0 file.
0
 

Author Closing Comment

by:mrkent
ID: 37911679
Thanks again to all.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now