[CentOS] Routing lost
Bryan J. Smith
thebs413 at earthlink.net
Mon Nov 14 08:09:16 UTC 2005
"Chris Mason (Lists)" <lists at masonc.com> wrote:
> I have a server running Centos4. I found I was seeing some
> network problems so I tried "route" and found there was no
Also remember to use the "-n" option to turn off name service
lookups. If you're on a private LAN without an internal DNS,
it will cause route to seem to "hang."
Also consider "netstat -rn" instead of "route -n" for a
variety of reasons on various UNIX platforms, including
> I thought reboot would solve it but it didn't.
Consider "service network restart" before rebooting.
> I had to manually enter a route to the default gateway,
> there is still no route to the loopback interface.
For the loopback to come up on Fedora-based distros, there
must be a /etc/sysconfig/network-scripts/ifcfg-lo file (with
properly configured entries).
> How is this possible? I thought there was default routes
> built into the kernel,
Yes, the routing table is built into the kernel. And
depending on the configuration, the kernel may or may not
assign "default route" to subnets "local" to lo, eth0, etc...
(i.e., metric 0 routes)
But no, the kernel _never_ sets a "default gateway" -- that
is done in a platform's rc/system/init/whatever script. In
Fedora-based distros, this is in either
/etc/sysconfig/network or the relevant
> taken from ifcfg-eth0.
For a single NIC system, it can be in either
> Is there an easy way to fix this? Thanks for any advice.
> # cat /etc/sysconfig/network
Yes, make your "gateway" variable "GATEWAY". Bourne [Again]
Shell ([ba]sh) variables have _always_ been case sensitive.
Constants are almost always declared as upper-case c/o legacy
> # cat /etc/sysconfig/network-scripts/ifcfg-eth0
You _should_ still have a route for 192.168.200.0/24 in your
routing table. But that, of course, won't get you to the
If "route" (or "netstat -r") are seemingly "hanging" for
minutes, then you don't have DNS for your 192.168.200.0/24
network, and use the "-n" option.
Bryan J. Smith | Sent from Yahoo Mail
mailto:b.j.smith at ieee.org | (please excuse any
http://thebs413.blogspot.com/ | missing headers)
More information about the CentOS