I have a machine that I use for a "lab" that has (at least) two ethernet ports: em0 and em1
Both are connected to different networks with their own DHCP servers. em0 is always connected to the "production" network that has Internet access and em1 is connected to the "lab" network. Sometimes the default route gets set correctly (em0) and other times it will get set incorrectly (em1).
I know that I can set the default route in /etc/rc.conf:
However, this machine could be on a different network where the IP addressing is no longer 192.168.x.x (i.e. 10.1.1.0 but the gateway obtained by DHCP on this interface would still be the default route. How can I tell (force) FreeBSD to use em0 as my default route?
Both are connected to different networks with their own DHCP servers. em0 is always connected to the "production" network that has Internet access and em1 is connected to the "lab" network. Sometimes the default route gets set correctly (em0) and other times it will get set incorrectly (em1).
I know that I can set the default route in /etc/rc.conf:
Code:
defaultrouter="192.168.1.1"
However, this machine could be on a different network where the IP addressing is no longer 192.168.x.x (i.e. 10.1.1.0 but the gateway obtained by DHCP on this interface would still be the default route. How can I tell (force) FreeBSD to use em0 as my default route?