The above makes it so that when eth1 is plugged in, its routes will take precedence over routes from eth0. This may be better because you allow the routes to failover, so that it will still have a default route even if the eth1 interface is unplugged.
This doesn't affect dns settings, so depending on exactly what you want you may still have to uncomment and amend the line in /etc/dhcp3/dhclient.conf:
#prepend domain-name-servers 127.0.0.1;
and remove domain-name-servers from the request list that immediately follows.
I don't think there's an exactly analagous command for /etc/network/interfaces; you'll have to set things up the way you like via the post-up command, most likely.
If you control the DHCP server then set the settings you want for this specific host based on the MAC address, otherwise setting a post-up script in /etc/network/interfaces is probably the simplest option
edit /etc/dhcp3/dhclient.conf
check the line:
and uncomment it and set whatever dns servers you want to use
then in the request section below there will be something like this:
remove domain-name-servers and routers, that should remove the dns server and router/gateway requests via dhcp
While not doing exactly what you've asked for, the ifmetric package may provide a better solution.
Then in your /etc/network/interfaces file assign metrics to your interfaces. Note that not having a metric is the same as having a zero metric.
The above makes it so that when eth1 is plugged in, its routes will take precedence over routes from eth0. This may be better because you allow the routes to failover, so that it will still have a default route even if the eth1 interface is unplugged.
This doesn't affect dns settings, so depending on exactly what you want you may still have to uncomment and amend the line in /etc/dhcp3/dhclient.conf:
and remove domain-name-servers from the request list that immediately follows.
I don't think there's an exactly analagous command for /etc/network/interfaces; you'll have to set things up the way you like via the post-up command, most likely.
If you control the DHCP server then set the settings you want for this specific host based on the MAC address, otherwise setting a post-up script in /etc/network/interfaces is probably the simplest option