CentOS 6.0 networking

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?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I Had a similar problem with a server, check if you're doing NAT on the CentOS
Chris SandriniSenior System EngineerCommented:
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...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mrkentAuthor Commented:
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....
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

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.

netstat -rn
please post
mrkentAuthor Commented:
See enclosure for all outputs.  It finally worked only AFTER I manually updated these last two files:  /etc/sysconfig/network   and

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...
Chris SandriniSenior System EngineerCommented:
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
mrkentAuthor Commented:
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.
Chris SandriniSenior System EngineerCommented:
have fun.
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

Open in new window

mrkentAuthor Commented:
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)
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.
Hmmmm did you control your dns configuration?
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


Or you should check ip address of your server. May be someone also uses same ip in your network.
mrkentAuthor Commented:
Enclosed are the outputs you asked for in the last two posts.  I didn't change anything.  Anything catch your eye?
chkkconfig --list NetworkManager
chkkconfig --list network

are they set to on?


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


The entry in the routing table (netstat -rn) makes no sense   U         0 0          0 eth0     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.
mrkentAuthor Commented:
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.
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?
mrkentAuthor Commented:
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.
The puzzling thing to me is the reference to the 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.
This might explain your situation.
mrkentAuthor Commented:
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...
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.
mrkentAuthor Commented:
Thanks to all.  It seems to be surviving the reboots.  And I have NM_Control=yes in my ifcfg-eth0 file.
mrkentAuthor Commented:
Thanks again to all.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.