I have a debian machine with two interfaces, configured by dhcp:
allow-hotplug eth0
iface eth0 inet dhcp
allow-hotplug eth1
iface eth1 inet dhcp
On boot, a default route is added to eth1:
0.0.0.0 10.200.10.253 0.0.0.0 UG 0 0 0 eth1
10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.200.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
But I need the default route to be a gateway on eth0 instead. Deleting the default route and running dhclient after boot works:
$ sudo route del default
$ sudo dhclient -v eth0
I know I can put this on rc.local
, but is there a more "clean" way to do it?
I can't use a static address.