PPPoE reset on gateway down
-
Hi,
I'm using PPPoE to connect to my ISP. During connection the interface is given a static IP and a dynamic gateway is assigned automatically. There are three gateways that are being served - x.x.x.50, x.x.x.51 and x.x.x.52. The last one has been giving me troubles for the past week. Whenever the 52-gateway is used (one in three chance) there is no internet connection. Manual reconnect - different gateway and everything is fine. The ISP is aware of the problem and is supposedly working on it. In the mean time, what can I do to force the PPPoE connection to reconnect when the Gateway Monitoring shows it as being down?
-
There is no automated way of dropping PPP connections involving a particular gateway, or of dropping connections based on gateway monitoring.
PPP will drop automatically if LCP echo fails. However, if LCP echo works but no IP traffic flows, the connection will just sit there until a manual Disconnect and Connect. I cannot recall a situation with my ISP where IP traffic has failed but LCP echo stays working.
I would argue that your ISP are at fault. If they have a defective gateway, they should remove it from service, not leave it accepting connections where the PPP layer is functional but no IP traffic flows.
A possible future enhancement would be for gateway monitoring to have the ability to tear down a PPP(oE) connection, but the unreliability of the current apinger daemon used for gateway monitoring might lead to unintended consequences. Hopefully this unreliable code will be replaced in by the time pfSense 2.3 is released.
The logic of PPP re-establishment based on gateway monitoring is not entirely straightforward either, as a single PPP connection can have an IPv4 gateway, an IPv6 gateway and any number of gateways on tunneled connections. I would argue that the correct approach is to ignore tunneled connections. I would also argue that if both IPv4 and IPv6 gateways are configured, both should have to fail in order to prevent tearing down working states and stop the connection from flapping, but this will miss some potential failure scenarios.
-
I would argue that your ISP are at fault. If they have a defective gateway, they should remove it from service, not leave it accepting connections where the PPP layer is functional but no IP traffic flows.
Yes, they are and they promised to fix it. I was just looking for a solution to minimize the downtime in the mean time.
-
The ISP fixed it, but in the mean time I managed to mitigate the problem by executing the following script every few minutes via a cron job:
#!/bin/sh ALLDEST="8.8.8.8 208.67.222.222" COUNT=1 while [ $COUNT -le 2 ] do for DEST in $ALLDEST do ping -c1 $DEST >/dev/null 2>/dev/null if [ $? -eq 0 ] then exit 0 fi done if [ $COUNT -le 1 ] then /usr/local/sbin/pfSctl -c 'interface reload wan' >/dev/null 2>&1 exit 1 fi COUNT=`expr $COUNT + 1` done
The script is a hybrid based on this script and the command in the last post here since the ifconfig doesn't work for pppoe. Big thanks to those guys. All credits go to them.