hitsujitmo
02-11-2016, 11:34

To tackle the lack of the route add on restart. Create a script /usr/local/sbin/gateway-up.sh
Code:
#!/bin/sh route add -net XXX.XXX.XXX.254/32 -iface em0 route add default XXX.XXX.XXX.254
Code:
#!/bin/sh route del default XXX.XXX.XXX.254 route del -net XXX.XXX.XXX.254/32 -iface em0
Now we just need a hook to execute these scripts when em0 goes up and down. Create the following as /etc/devd/gateway.conf
Code:
notify 1 { match "system" "IFNET"; match "subsystem" "em0"; match "type" "LINK_UP"; action "/usr/local/sbin/gateway-up.sh"; }; notify 1 { match "system" "IFNET"; match "subsystem" "em0"; match "type" "LINK_DOWN"; action "/usr/local/sbin/gateway-down.sh"; };
You can now safely reboot at any stage.