Hi All,
I want to bring down the WAN interface intentionally, preferably scripted for something I would like to test in a CARP setup...
I notice that my script is actually doing what it's suppose to do, but for some reason I cannot bring down the WAN interface on the CARP BACKUP system.
Like for example: ifconfig vtnet0 down, the interface goes back up after several seconds... which is not what I want...
I also have been looking and came by configctl interface linkup stop vtnet0 but it results in the same behaviour...
Is there any way to come around this so I can manually decide what interface should be up or down?
Regards,
Steven
Coming back to my own question :), For those who are interested in this because I know a lot of people are trying to use CARP with a single ISP (DHCP/DHCPv6/...) running into some problems like I do... I am currently scripting this to CARP events so that in case of MASTER/BACKUP the WAN link on the BACKUP stays down until needed.
Bringing the interface down:
pkill -f dhclient
pkill -f dhcp6c
pkill -f dpinger
ifconfig <iface> -alias <wan-ipv4>
ifconfig <iface> inet6 <wan-ipv6> delete
configctl interface linkup stop <iface>
ifconfig <iface> down
Bringing the interface up again:
configctl interface linkup start <iface>
configctl interface reconfigure <iface>
I might post a full script etc. if wanted...
Regards,
Steven