[CentOS] Re: new CentOS 5 install, 'Network is unreachable'

Sat Aug 4 03:48:55 UTC 2007
Robert Nichols <rnicholsNOSPAM at comcast.net>

centos at swhi.net wrote:
> I've a new CentOS 5 minimalist install; this will be the name server 
> from my prior thread.  I have configured eth0 during setup with the 
> static IP the unit will have when in production.  During this setup 
> phase, selinux is set to permissive.
> 
> Setting up on a different network, I did this:
> 
> dhclient eth0 and successfully got a private address; I also validated 
> that the resolv.conf file was created by the dhclient-script and it was, 
> accurately pointing to my gateway and listing a domain name server by IP.
> 
> That's where the fun stops.  Even pinging an IP, so as not to rely on 
> name resolution, I get the dreaded 'Network is unreachable' error.

Without DHCP in the picture you're not getting the needed default route
set up.  I'm not sure what you mean by "resolv.conf ... accurately
pointing to my gateway."  AFAIK, resolv.conf has nothing to do with
routing gateways.  If you're not going to be using DHCP, you need to
run system-config-network, edit the entry for your network device, and,
under the "Route" tab, enter an explicit default route and gateway
address.

As a quick check before doing the above, just run

          route add default gw nnn.nnn.nnn.nnn dev eth0

supplying the appropriate gateway address and device, of course.

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.