FreeBSD and two different networks

doroseracledes at gmail.com doroseracledes at gmail.com
Fri Oct 2 03:42:18 UTC 2015


How about dhclient enter-hooks:

‎http://www.macfreek.nl/memory/DHCP_Client_Script_Examples

"If you want to have more control, e.g. only set the default route for em0, but not for other interface, add the following lines to /etc/dhclient-enter-hooks:
# Do not set default route on any interface except em0
if [ "$interface" != "em0" ]
then
    unset new_routers
fi
"

There's also "supersede" in dhclient.conf to overwrite what dhcp provides and set to something you want (think overwrite) ‎

Theodoros
Sent from a smartphone
  
> Dear All,
>
> I have a FreeBSD machine at work. It's mostly connected to the so-called
> "internal" network that has a static ip: let it be 172.16.1.113/12. The
> default gateway for that network is 172.16.1.1.
> Sometimes, I need to connect this machine to another network that uses DHCP.
> Its network mask differs: it's 192.168.1.0/24. The second network uses DHCP.
>
> The question is: can I set both of the default gateways (skip DHCP: I can
> configure the interface for the "external" network manually) in some way? Can
> I set up some kind of a daemon that checks whether one of my gateways is
> accessible and forwards all of the traffic through that gateway? Thank you
> very much in advance.




More information about the freebsd-questions mailing list