My /etc/network/interfaces
looks like this:
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
address 10.0.0.99
netmask 255.255.255.0
gateway 10.0.0.1
auto eth0
iface eth0 inet dhcp
After I reboot the machine, I get
vagrant@precise64:~$ ip route
default via 10.0.2.2 dev eth0
default via 10.0.0.1 dev eth1 metric 100
10.0.0.0/24 dev eth1 proto kernel scope link src 10.0.0.99
10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15
How can I modify /etc/network/interfaces
so that my traffic goes
through 10.0.0.1 instead of 10.0.2.2 by default? I can do it manually
as follows, but I don't want to do this on every reboot:
vagrant@precise64:~$ sudo ip route del default via 10.0.2.2 dev eth0
vagrant@precise64:~$ ip route
default via 10.0.0.1 dev eth1 metric 100
10.0.0.0/24 dev eth1 proto kernel scope link src 10.0.0.99
10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15