Problem with dual Ethernet network routing and gateways
Mark Jackson
mpfj-list at newflow.co.uk
Thu May 9 15:09:10 UTC 2013
On 09/05/13 15:42, Mark Jackson wrote:
> 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
If I add:-
$ route add default gw 10.0.0.1
... I get a gateway on eth1 and my routing table becomes:-
$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.0.0.1 0.0.0.0 UG 0 0 0 eth1
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
... and then I *can* ping out on eth1.
So for a *dual* Ethernet system, how do I get both default gateway entries using
ifup / ifdown / etc ?
Cheers
Mark J.
More information about the busybox
mailing list