Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 531
  • Last Modified:

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?
0
mrkent
Asked:
mrkent
  • 10
  • 6
  • 3
  • +2
11 Solutions
 
goncalogiraoCommented:
I Had a similar problem with a server, check if you're doing NAT on the CentOS
0
 
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...
0
 
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....
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
arnoldCommented:
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
 
mrkentAuthor Commented:
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
 
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
0
 
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.
0
 
Chris SandriniSenior System EngineerCommented:
have fun.
0
 
senseifedonCommented:
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
 
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)
0
 
arnoldCommented:
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
 
senseifedonCommented:
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
 
mrkentAuthor Commented:
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
 
arnoldCommented:
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
 
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.
CentOS-config-3-.txt
0
 
arnoldCommented:
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
 
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.
0
 
arnoldCommented:
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
 
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...
0
 
arnoldCommented:
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
 
mrkentAuthor Commented:
Thanks to all.  It seems to be surviving the reboots.  And I have NM_Control=yes in my ifcfg-eth0 file.
0
 
mrkentAuthor Commented:
Thanks again to all.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 10
  • 6
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now