I'm setting up a FreeBSD carp router/firewall backup, my provider is giving out IP by DHCP, it's static and tied to MAC address of my NIC, so when carp switches state I'm trying to switch off the interface on one machine and switch it on on another. It works. So good so far...
My problem is when I reboot BACKUP machine the interface is getting configured after reboot - it talks to the DHCP-server with a MAC which is used in the network already, and gets an answer. Not good at all - for a moment arp tables of my switches are directing packets to the wrong port.
I tried to:
start
dhclient em0
on switching to the MASTER state andifconfig_em0="down"
in rc.conf, but if eventually interface goes to link down state the dhclient exits and doesn't resume as devd, which is supposed to resume it, checks withdhcpif
fromnetwork.subr
- and tells that "em0 is not dhcp-enabled interface".set
ifconfig_em0="down dhcp"
and removedhclient.leases.em0
file, then reboot - my interface is down and configured after startup(probably it even was up, and then disabled by my script when entered carp BACKUP state).
As far as I understand there's no way to set a NIC as DHCP-enabled, to have on-link-up dhclient started by devd, but keeping it totally silent during boot process?