Static routes using routes/ifroutes-eth-id.. files and default gateway disabled
I am configuring static routes on SLES 10 SP1 & SP2 but I believe that these are to a certain extent general problems.
I have come across a number of things that I have had to work around and I was hoping to get other people's feedback on them.
There are a number of config outputs etc below to make it easier to explain.
Basically I am setting up static routes on a 3 NIC host and if:-
I only use the routes file I get the error right at the bottom ..."This needs NOT to be AN ERROR"... so after digging around I use the ifroute-eth-id-... file (see below) as well and remove the default gateway from the bottom of the routes file.
I can't find a decent explanation of why I need to use the ifroute-eth.. file(s) over routes anywhere.
The error goes but then "yast lan" does not show the gateway. Am I to assume that once you use these files it is outside of yast's view of the world?
I also have specified a class A route (10.0.0.0/8) via a NIC that is not the overall default gateway. However, the overall default gateway address is also within this address range. The net effect is that the default gateway doen't work.
In other networking it is usually the most specific route that takes precedence but this doesn't seem to be happening here. Note you can ping devices that are on the local network so I know that the NIC works. In addition when I change the class A to a class B (10.240.0.0/16) hence the hash everything works again.
Can anybody please give me more insight into why/how/fixes etc.
Thanks in advance.
======================= Configs and Outputs =========================
#> ifconfig -a | grep HW -A 1 | tr A-Z a-z
eth0 link encap:ethernet hwaddr 00:0c:29:d7:eb:42
inet addr:10.240.252.158 bcast:10.240.252.159 mask:255.255.255.248
eth1 link encap:ethernet hwaddr 00:0c:29:d7:eb:4c
inet addr:10.242.252.3 bcast:10.242.252.7 mask:255.255.255.248
eth2 link encap:ethernet hwaddr 00:0c:29:d7:eb:56
inet addr:10.230.230.99 bcast:10.230.230.255 mask:255.255.255.0
#> netstat -rnv
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
10.240.252.152 0.0.0.0 255.255.255.248 U 0 0 0 eth0
10.242.252.0 0.0.0.0 255.255.255.248 U 0 0 0 eth1
10.242.64.240 10.230.230.1 255.255.255.240 UG 0 0 0 eth2
10.230.230.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
10.241.0.0 10.242.252.1 255.255.0.0 UG 0 0 0 eth1
10.240.0.0 10.240.252.153 255.255.0.0 UG 0 0 0 eth0
192.168.0.0 10.240.252.153 255.255.0.0 UG 0 0 0 eth0
172.16.0.0 10.240.252.153 255.240.0.0 UG 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.242.252.1 0.0.0.0 UG 0 0 0 eth1
#> cd /etc/sysconfig/network
#> cat routes
10.241.0.0 10.242.252.1 255.255.0.0 eth-id-00:0c:29:d7:eb:4c
10.240.0.0 10.240.252.153 255.255.0.0 eth-id-00:0c:29:d7:eb:42
#10.0.0.0 10.240.252.153 255.0.0.0 eth-id-00:0c:29:d7:eb:42
172.16.0.0 10.240.252.153 255.240.0.0 eth-id-00:0c:29:d7:eb:42
192.168.0.0 10.240.252.153 255.255.0.0 eth-id-00:0c:29:d7:eb:42
10.242.64.240 10.230.230.1 255.255.255.240 eth-id-00:0c:29:d7:eb:56
#default 10.242.252.1 - -
#> cat ifroute-eth-id-00\:0c\:29\:d7\:eb\:4c
default 10.242.252.1 0.0.0.0 eth1
>>> messages when default gateway is NOT hashed above in routes <<<
>>> file and ifroute-eth-id-00:0c:29:d7:eb:4c above is removed <<<
Setting up network interfaces:
lo IP address: 127.0.0.1/8 done
eth0 configuration: eth-id-00:0c:29:d7:eb:42
eth0 IP address: 10.240.252.158/29
Warning: Could not set up default route via interface
Command ip route replace to default via 10.242.252.1 returned:
. RTNETLINK answers: Network is unreachable
Configuration line: default 10.242.252.1 - -
This needs NOT to be AN ERROR if you set up multiple interfaces.
See man 5 routes how to avoid this warning.
eth1 configuration: eth-id-00:0c:29:d7:eb:4c
eth1 IP address: 10.242.252.3/29 done
eth2 configuration: eth-id-00:0c:29:d7:eb:56
eth2 IP address: 10.230.230.99/24 done
Setting up service network . . . . . . . . . . . . . . done