Problem with dual Ethernet network routing and gateways

Mark Jackson mpfj-list at newflow.co.uk
Thu May 9 14:42:23 UTC 2013


I have a dual Ethernet AM335x board which I'm trying to set up, as follows:-

$ cat /etc/network/interfaces
auto lo eth0 eth1
iface lo inet loopback
iface eth1 inet static
address 10.0.101.1
netmask 255.255.0.0
gateway 10.0.0.1
iface eth0 inet static
address 10.1.101.1
netmask 255.255.0.0

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:18:31:93:49:34
          inet addr:10.1.101.1  Bcast:0.0.0.0  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:56

eth1      Link encap:Ethernet  HWaddr 00:18:31:93:49:35
          inet addr:10.0.101.1  Bcast:0.0.0.0  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2756 errors:0 dropped:0 overruns:0 frame:0
          TX packets:607 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:465648 (454.7 KiB)  TX bytes:168843 (164.8 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:50 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4066 (3.9 KiB)  TX bytes:4066 (3.9 KiB)

But my routing table is:-

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.1.0.1        0.0.0.0         UG    0      0        0 eth0
10.0.0.0        *               255.255.0.0     U     0      0        0 eth1
10.1.0.0        *               255.255.0.0     U     0      0        0 eth0

As you can see the gateway for eth1 has not been added to the routing table.

I'm using avahi and udhcpc, and I have done nothing special with the network
config.

So with only eth1 connected, I am unable to ping anything outside my local
network.

Can anyone tell me how to get the correct routing added automatically ?

Cheers
Mark J.


More information about the busybox mailing list