Web Hosting Talk







View Full Version : What's all this junk in my routing table?


pmak0
07-22-2002, 01:47 PM
I have the following in my routing table:

$ ip route show
66.28.98.32/27 via 66.28.98.34 dev eth1
66.28.98.32/27 dev eth1 scope link
64.94.46.0/23 via 64.94.47.253 dev eth0
64.94.46.0/23 dev eth0 scope link
127.0.0.0/8 dev lo scope link
default via 66.28.98.34 dev eth1 src 66.28.98.55
default via 66.28.98.34 dev eth1 src 66.28.98.54
default via 66.28.98.34 dev eth1 src 66.28.98.53
default via 64.94.47.253 dev eth0
default via 66.28.98.34 dev eth1 src 66.28.98.55 metric 1
default via 66.28.98.34 dev eth1 src 66.28.98.54 metric 1
default via 66.28.98.34 dev eth1 src 66.28.98.53 metric 1

Does anyone know how I can make it so that I only have the following default route when the machine boots?

default via 66.28.98.34 dev eth1

I'm running Red Hat Linux 7.2. I'm guessing the files I would have to configure are in /etc/sysconfig/network-scripts, but I'm not sure how to go about it. I also don't know how the "metric 1" routes got in there, or why there is no "default via 66.28.98.34 dev eth1 src 66.28.98.52" (I have an interface on that IP).

Any ideas? Thanks.

P.S. I know about "ip route del" and "ip route append", but changes I make using those commands don't last between reboots.

Noldar
07-22-2002, 03:13 PM
What does your /etc/sysconfig/network file look like? Here is an example of one with a single interface:

NETWORKING=yes
FORWARD_IPV4="no"
HOSTNAME="hostname.domain.com"
DOMAINNAME=domain.com
GATEWAY="192.168.0.1"
GATEWAYDEV="eth0"

Richard

pmak0
07-22-2002, 03:14 PM
[root@lina network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@lina network-scripts]# ls ifcfg-eth*
ifcfg-eth0 ifcfg-eth1 ifcfg-eth1:0 ifcfg-eth1:1 ifcfg-eth1:2
[root@lina network-scripts]# for x in ifcfg-eth*; do echo === $x ===; cat $x; done
=== ifcfg-eth0 ===
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=64.94.46.199
NETMASK=255.255.254.0
GATEWAY=64.94.47.253
=== ifcfg-eth1 ===
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
IPADDR=66.28.98.52
NETMASK=255.255.255.224
GATEWAY=66.28.98.34
=== ifcfg-eth1:0 ===
DEVICE=eth1:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=66.28.98.53
NETMASK=255.255.255.224
GATEWAY=66.28.98.34
=== ifcfg-eth1:1 ===
DEVICE=eth1:1
ONBOOT=yes
BOOTPROTO=static
IPADDR=66.28.98.54
NETMASK=255.255.255.224
GATEWAY=66.28.98.34
=== ifcfg-eth1:2 ===
DEVICE=eth1:2
ONBOOT=yes
BOOTPROTO=static
IPADDR=66.28.98.55
NETMASK=255.255.255.224
GATEWAY=66.28.98.34

Noldar
07-22-2002, 04:43 PM
Under /etc/sysconfig you should have a file called network. You may also have a file called static-routes. What are in those two files?

Richard

pmak0
07-22-2002, 09:07 PM
Oops. I'm embarassed I didn't read your question carefully and sent you the wrong file! Here's network and static-routes:

[root@lina sysconfig]# cat network
GATEWAYDEV=""
NETWORKING=yes
FORWARD_IPV4=no
HOSTNAME=lina.aaanime.net
GATEWAY=66.28.98.34
[root@lina sysconfig]# cat static-routes
eth0 net 64.94.46.0 netmask 255.255.254.0 gw 64.94.47.253
eth1 net 66.28.98.32 netmask 255.255.255.224 gw 66.28.98.34

Noldar
07-23-2002, 02:13 PM
You should be able to remove the two lines from the static-routes file since those routes get set up from ifcfg-eth* files. That should get rid of the metric 1 entries. You can also change your network file to add the gateway device:

GATEWAYDEV="eth1"

That should give you the minimum needed routes set up.

Richard