ifstated: Fix dna-gw config for OpenBSD 7.6

This commit is contained in:
Timo Makinen 2024-10-12 19:42:38 +00:00
parent aaeae7002a
commit 4b27e6c316

View file

@ -17,10 +17,9 @@ state master {
init { init {
# spoof mac to keep dhcp lease in sync with both gw's # spoof mac to keep dhcp lease in sync with both gw's
run "/sbin/ifconfig vio1 lladdr {{ gw_home_mac }} up" run "/sbin/ifconfig vio1 lladdr {{ gw_home_mac }} up"
# flush routes and run dhclient and dhcpcd # flush routes and renew lease
run "/sbin/route -qn flush" run "/sbin/route -qn flush"
run "/sbin/dhclient vio1" run "/usr/sbin/dhcpleasectl vio1"
#run "/sbin/rcctl restart dhcpcd > /dev/null"
# reset firewall rules # reset firewall rules
run "sleep 5 ; pfctl -f /etc/pf.conf" run "sleep 5 ; pfctl -f /etc/pf.conf"
} }
@ -31,8 +30,6 @@ state master {
state backup { state backup {
init { init {
# kill dhclient (TODO: better command for this)
run "pkill -9 dhclient"
# bring down interface and reset mac # bring down interface and reset mac
run "/sbin/ifconfig vio1 delete lladdr {{ gw_home_mac }} down" run "/sbin/ifconfig vio1 delete lladdr {{ gw_home_mac }} down"
# flush routes and fix default route # flush routes and fix default route