Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I change the default route to utilize eth1 (DHCP), instead of eth0 (static)? I want this to be a permanent solution persistent through reboots.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         RT-C0C1C0CF879F 0.0.0.0         UG    100    0        0 eth0
10.0.0.0        *               255.255.255.0   U     0      0        0 eth0
1.1.1.0         *               255.255.240.0   U     0      0        0 eth1

I want the direct route (eth1) to be default, not through the NAT.

Using Ubuntu 12.04

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I found the answer in: http://xmodulo.com/2012/03/how-to-set-default-route-in-linux.html


Removing any unnecessary default route leveraging post-up command in /etc/network/interfaces as follows. This will enable default route through eth0

$ sudo vi /etc/network/interfaces

allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug eth1
iface eth1 inet dhcp
post-up route del default dev $IFACE
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.