HW: Netgear DGN3500 OpenWrt 18.06.4 r7808-ef686b7292
Since upgrading to 18.06 on this router, I have been experiencing ADSL line drops several times a day. Often the link is unable to reconnect without a reboot.
The message in syslog at the start of the link drop is something like 'no LCP echo received', so I started to invesigate the LCP echo settings in the WAN 'Advanced Settings' of Luci. I wanted to set LCP echo failure threshold to 0 (ignore failures) to see if false faulures were being detected, but found that a '0' value is not reflected in the UI after saving.
Therefore I investigated the ppp command-line options that were running with '0' set in Luci:
/usr/sbin/pppd nodetach ipparam wan ifname pppoe-wan lcp-echo-interval 1 lcp-echo-failure 5 lcp-echo-adaptive ....
This is sending LCP echo requests once a second, and tearing down the connection after five failures- not ignoring failures as the UI suggests, in fact.
According to this commit (Aug 2018):
When LCP echos are disabled, the fallback is to hardcoded values in /lib/netifd/proto/ppp.sh set around line 120:
[ -n "$keepalive" ] || keepalive="5 1"
However, it seems that the hardcoded values are reversed, because
[ -n "$keepalive" ] || keepalive="1 5"
gives the expected (from Luci UI) values for lcp-echo-failure and lcp-echo-interval:
/usr/sbin/pppd nodetach ipparam wan ifname pppoe-wan lcp-echo-interval 5 lcp-echo-failure 1 lcp-echo-adaptive....
It would also appear that the 'keepalive' variable pulled by json_get function in ppp.sh is not being read, because when set to '0' it does not result in the lcp-echo prarmeters being omitted from the ppp commandline. I don't know enough about the internal structure of OpenWRT to debug this further.
I'll keep an eye on the number of disconnects I get with the longer lcp-ech-interval, but thought it worth mentioning that the ppp options were not being set as expected.