Link to home
Start Free TrialLog in
Avatar of ewan69
ewan69

asked on

Problems writing interfaces file for dual ethernet

I am having  a problem getting the config to work with dual ethernet, the contents of the interfaces file is attached below, i am running ubuntu 9.10 and have removed the network manager.
I need all traffic to a 10.0.2 or 10.0.1 to go via eth1 and everything else via eth0.

With the current config the default route is via eth1, if i remove the bottom line it works how i want apart from 10.0.2.x goes via eth0

Thanks.

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
	address 192.168.20.130
	netmask 255.255.255.0
	gateway 192.168.20.1
up route add default 192.168.20.1 

auto eth1
iface eth1 inet static
	address 10.0.1.130
	netmask 255.255.255.0
	gateway 10.0.1.1
up route add -net 10.0.2.0 netmask 255.255.255.0 gw 10.0.1.1 dev eth1

Open in new window

Avatar of Kruger_monkey
Kruger_monkey
Flag of United Kingdom of Great Britain and Northern Ireland image

What is the output when you run route?

Is the routing table picking up your entries?

You must drop the
"gateway 10.0.1.1"
line.

And the line
"up route add default 192.168.20.1"
is unnecessary because "gateway 192.168.20.1" will do it anyway.
Avatar of ewan69
ewan69

ASKER

Thanks for your quick replies,

below is the routing table, i didn't mention that the 10.0.2.x is accessed via 10.0.1.1 so i will need to keep the
"gateway 10.0.1.1" line won't I?


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.20.0    *               255.255.255.0   U     0      0        0 eth0
10.0.1.0        *               255.255.255.0   U     0      0        0 eth1
10.0.2.0        10.0.1.1        255.255.255.0   UG    0      0        0 eth1
default         192.168.20.1    0.0.0.0         UG    100    0        0 eth0
default         10.0.1.1        0.0.0.0         UG    100    0        0 eth1

ASKER CERTIFIED SOLUTION
Avatar of hemmi
hemmi
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ewan69

ASKER

Thanks, work.