/etc/rc.gateway_alarm not called for PPPoE UP
-
Hello,
I am try to use this script which needs to be called from /etc/rc.gateway_alarm when a PPPoE connection is back up. I can see /etc/rc.gateway_alarm being used when the connection goes down, however it is not invoked when the connection comes back up.I inserted the following line in /etc/rc.gateway_alarm
/usr/bin/logger -t gwdebug "${GW}" "${alarm_flag}" exit $?
When i pull the cable out from the router, pfsense detects its and prints
$cat /var/log/system.log | grep gwdebug Jan 5 09:19:30 pfSense gwdebug[94669]: WAN3_PPPOE 1
However, when i plug back the cable back in, /etc/rc.gateway_alarm getting triggered.
Is there a better file to hook into when a connection comes back up?
Thanks
-
@trumee Looks like there might be a solution that uses the devd subsystem
see this thread
-
Thanks for the tip. I created a devd file for the interface corresponding to the PPPOE connection and restarted the devd service,
#cat /usr/local/etc/devd/ix2.conf notify 100 { match "system" "IFNET"; match "type" "LINK_UP"; match "subsystem" "(ix2)"; #action "/usr/bin/logger -t gwdebug ix2 up"; action "/root/wgfix.sh WAN3_PPPOE 0"; };
I also increased the time from 10s to 20s in your script. This seems to work now. This is what i get after plugging the cable back in.
$ cat /var/log/system.log | grep wgfix Jan 5 21:41:27 pfSense wgfix[96125]: /root/wgfix.sh called, args: WAN3_PPPOE 0 Jan 5 21:41:27 pfSense wgfix[96591]: acquiring lockfile Jan 5 21:41:27 pfSense wgfix[96606]: WAN UP: WAN3_PPPOE Jan 5 21:41:27 pfSense wgfix[96954]: WG endpoint: redactedip:51823 Jan 5 21:41:27 pfSense wgfix[97050]: pausing 20s to allow gateway change to occur Jan 5 21:41:47 pfSense wgfix[84581]: Default gateway iface: pppoe2 Jan 5 21:41:47 pfSense wgfix[86264]: found 1 bad states; bouncing wg service Jan 5 21:41:47 pfSense wgfix[25831]: killing state 0200000061e127c4/e9fc5eb0 Jan 5 21:41:54 pfSense wgfix[94319]: /root/wgfix.sh called, args: WG_home 1 Jan 5 21:41:54 pfSense wgfix[94760]: ignoring WAN down event Jan 5 21:41:54 pfSense wgfix[94934]: done, removing lockfile Jan 5 21:41:55 pfSense wgfix[13317]: done, removing lockfile Jan 5 21:41:58 pfSense wgfix[49741]: /root/wgfix.sh called, args: WG_home 1 Jan 5 21:41:58 pfSense wgfix[49744]: ignoring WAN down event Jan 5 21:41:58 pfSense wgfix[50019]: done, removing lockfile Jan 5 21:42:05 pfSense wgfix[56610]: /root/wgfix.sh called, args: WG_home 1 Jan 5 21:42:05 pfSense wgfix[56658]: ignoring WAN down event Jan 5 21:42:05 pfSense wgfix[56724]: done, removing lockfile Jan 5 21:42:25 pfSense wgfix[90808]: /root/wgfix.sh called, args: WG_home 1 Jan 5 21:42:25 pfSense wgfix[90889]: ignoring WAN down event Jan 5 21:42:25 pfSense wgfix[91062]: done, removing lockfile Jan 5 21:42:33 pfSense wgfix[86162]: /root/wgfix.sh called, args: WG_home 0 Jan 5 21:42:33 pfSense wgfix[86752]: acquiring lockfile Jan 5 21:42:33 pfSense wgfix[86809]: WAN UP: WG_home Jan 5 21:42:33 pfSense wgfix[87390]: WG endpoint: redactedip:51823 Jan 5 21:42:33 pfSense wgfix[87588]: pausing 20s to allow gateway change to occur Jan 5 21:42:53 pfSense wgfix[5585]: Default gateway iface: pppoe2 Jan 5 21:42:53 pfSense wgfix[6860]: no bad states found Jan 5 21:42:53 pfSense wgfix[7159]: done, removing lockfile
-
@trumee Glad to see you got it working. I don't have any access to a system with a PPPoE interface to test with but I'll see if I can put these notes in the instructions for others who might want to do the same.
-
-
-
-
-
-
-