I have a TPLink TL-WDR3600 router. It connects via Ethernet to a VDSL2 modem which connects to a residential phone line. The ISP is Plusnet. The WAN link is via PPPoE, it's configured correctly, it always connects first time. I've had this setup since 2016.
The WAN link can timeout if I max out the connection for a sustained period (I can't do this reliably), or if the ISP side goes silent on me. I've already added config option keepalive '5 5'
to the WAN interface (and option pppd_options debug
)
When the PPPoE connection time outs, pppd sends PADT and hangs up. When pppd is restarted, it always alerts "Timeout waiting for PADO packets". It keeps doing this until you reboot the router. After rebooting, it always connects on first attempt.
If the WAN link goes down due to timeout, no amount of ifdown wan && ifup wan
will re-establish the WAN link until reboot. All attempts fail with "Timeout waiting for PADO packets". Waiting 5, 10 or even 30 minutes between ifdown wan
and ifup wan
does not fix the problem. You still get a PADO timeout! But the moment you reboot, just seconds later, it works immediately.
In normal circumstances (i.e. there has not been a connection timeout), you can run ifdown wan && ifup wan
and it re-establishes the WAN link without any PADO packet timeouts
I've also tried rmmod
ing the PPPoE kernel modules (pppoe pppox ppp_async ppp_generic slhc) between ifdown
and ipup
, in case the problem is some kind of lingering state held in these modules, but that does not fix the problem either. If there's a connection timeout, you can ifdown wan
, you can rmmod
all these modules, you can wait 30 minutes - you will still get a PADO timeout when you ifup wan
, and you will still get a connection seconds later once you reboot.
There is a bug filed for this by someone else, but it's marked "unconfirmed" and "very low priority".
How can I diagnose this bug further?
I'd like to get to the root cause of this problem, and if it's in the kernel, get it fixed.
Workaround
I wrote a script to reboot immediately if the error appears:
$ cat /etc/hotplug.d/iface/00-reboot-on-pado-timeout
# if router has been up for at least 5 minutes...
[ `sed 's/[. ].*//' /proc/uptime` -gt 300 ] && {
# reboot if any "Timeout waiting for PADO packets" log messages seen
[ `/sbin/logread -e 'Timeout waiting for PADO packets' | wc -l` -gt 1 ] && /sbin/reboot
}
Sample logs
Example of WAN link failure due to timeout, failure to re-establish.
Fri Feb 19 09:03:08 2021 daemon.info pppd[1444]: No response to 5 echo-requests
Fri Feb 19 09:03:08 2021 daemon.notice pppd[1444]: Serial link appears to be disconnected.
Fri Feb 19 09:03:08 2021 daemon.info pppd[1444]: Connect time 239.4 minutes.
Fri Feb 19 09:03:08 2021 daemon.info pppd[1444]: Sent 2985390766 bytes, received 729613003 bytes.
Fri Feb 19 09:03:08 2021 daemon.notice netifd: Network device 'pppoe-wan' link is down
Fri Feb 19 09:03:08 2021 daemon.notice netifd: Network alias 'pppoe-wan' link is down
Fri Feb 19 09:03:08 2021 daemon.debug pppd[1444]: Script /lib/netifd/ppp-down started (pid 3501)
Fri Feb 19 09:03:08 2021 daemon.debug pppd[1444]: sent [LCP TermReq id=0x2 "Peer not responding"]
Fri Feb 19 09:03:08 2021 daemon.notice netifd: Interface 'wan' has lost the connection
Fri Feb 19 09:03:08 2021 daemon.debug pppd[1444]: Script /lib/netifd/ppp-down finished (pid 3501), status = 0x1
Fri Feb 19 09:03:11 2021 daemon.debug pppd[1444]: sent [LCP TermReq id=0x3 "Peer not responding"]
Fri Feb 19 09:03:14 2021 daemon.notice pppd[1444]: Connection terminated.
Fri Feb 19 09:03:14 2021 daemon.debug pppd[1444]: Send PPPOE Discovery V1T1 PADT session 0xff5 length 28
Fri Feb 19 09:03:14 2021 daemon.debug pppd[1444]: dst f8:13:08:40:d3:d5 src c0:4a:00:2c:d9:fa
Fri Feb 19 09:03:14 2021 daemon.debug pppd[1444]: [host-uniq 00 00 05 a4] [AC-cookie dc 8a 2d 68 eb 52 65 0b 7a dd 09 12 42 a5 97 32]
Fri Feb 19 09:03:14 2021 daemon.info pppd[1444]: Sent PADT
Fri Feb 19 09:03:14 2021 daemon.notice pppd[1444]: Modem hangup
Fri Feb 19 09:03:14 2021 daemon.info pppd[1444]: Exit.
Fri Feb 19 09:03:14 2021 daemon.notice netifd: Interface 'wan' is now down
Fri Feb 19 09:03:14 2021 daemon.notice netifd: Interface 'wan' is disabled
Fri Feb 19 09:03:14 2021 daemon.notice netifd: Interface 'wan' is enabled
Fri Feb 19 09:03:14 2021 daemon.notice netifd: Interface 'wan' is setting up now
Fri Feb 19 09:03:14 2021 daemon.err insmod: module is already loaded - slhc
Fri Feb 19 09:03:14 2021 daemon.err insmod: module is already loaded - ppp_generic
Fri Feb 19 09:03:14 2021 daemon.err insmod: module is already loaded - pppox
Fri Feb 19 09:03:14 2021 daemon.err insmod: module is already loaded - pppoe
Fri Feb 19 09:03:14 2021 daemon.info pppd[3602]: Plugin rp-pppoe.so loaded.
Fri Feb 19 09:03:14 2021 daemon.info pppd[3602]: RP-PPPoE plugin version 3.8p compiled against pppd 2.4.7
Fri Feb 19 09:03:14 2021 daemon.notice pppd[3602]: pppd 2.4.7 started by root, uid 0
Fri Feb 19 09:03:14 2021 daemon.debug pppd[3602]: Send PPPOE Discovery V1T1 PADI session 0x0 length 12
Fri Feb 19 09:03:14 2021 daemon.debug pppd[3602]: dst ff:ff:ff:ff:ff:ff src c0:4a:00:2c:d9:fa
Fri Feb 19 09:03:14 2021 daemon.debug pppd[3602]: [service-name] [host-uniq 00 00 0e 12]
Fri Feb 19 09:03:19 2021 daemon.debug pppd[3602]: Send PPPOE Discovery V1T1 PADI session 0x0 length 12
Fri Feb 19 09:03:19 2021 daemon.debug pppd[3602]: dst ff:ff:ff:ff:ff:ff src c0:4a:00:2c:d9:fa
Fri Feb 19 09:03:19 2021 daemon.debug pppd[3602]: [service-name] [host-uniq 00 00 0e 12]
Fri Feb 19 09:03:24 2021 daemon.debug pppd[3602]: Send PPPOE Discovery V1T1 PADI session 0x0 length 12
Fri Feb 19 09:03:24 2021 daemon.debug pppd[3602]: dst ff:ff:ff:ff:ff:ff src c0:4a:00:2c:d9:fa
Fri Feb 19 09:03:24 2021 daemon.debug pppd[3602]: [service-name] [host-uniq 00 00 0e 12]
Fri Feb 19 09:03:29 2021 daemon.warn pppd[3602]: Timeout waiting for PADO packets
Fri Feb 19 09:03:29 2021 daemon.err pppd[3602]: Unable to complete PPPoE Discovery
Fri Feb 19 09:03:29 2021 daemon.info pppd[3602]: Exit.
In good times when there is no problem with the WAN connection, ifdown wan && sleep 10 && ifup wan
gives this:
Sat Feb 20 00:14:29 2021 daemon.info pppd[1447]: Terminating on signal 15
Sat Feb 20 00:14:29 2021 daemon.info pppd[1447]: Connect time 0.7 minutes.
Sat Feb 20 00:14:29 2021 daemon.info pppd[1447]: Sent 768857 bytes, received 649183 bytes.
Sat Feb 20 00:14:29 2021 daemon.notice netifd: Network device 'pppoe-wan' link is down
Sat Feb 20 00:14:29 2021 daemon.debug pppd[1447]: Script /lib/netifd/ppp-down started (pid 1937)
Sat Feb 20 00:14:29 2021 daemon.debug pppd[1447]: sent [LCP TermReq id=0x2 "User request"]
Sat Feb 20 00:14:29 2021 daemon.debug pppd[1447]: rcvd [LCP TermAck id=0x2]
Sat Feb 20 00:14:29 2021 daemon.notice pppd[1447]: Connection terminated.
Sat Feb 20 00:14:29 2021 daemon.debug pppd[1447]: Send PPPOE Discovery V1T1 PADT session 0x1d2b length 28
Sat Feb 20 00:14:29 2021 daemon.debug pppd[1447]: dst f8:13:08:40:d3:d5 src c0:4a:00:2c:d9:fa
Sat Feb 20 00:14:29 2021 daemon.debug pppd[1447]: [host-uniq 00 00 05 a7] [AC-cookie dc 8a 2d 68 eb 52 65 0b 7a dd 09 12 42 a5 97 32]
Sat Feb 20 00:14:29 2021 daemon.info pppd[1447]: Sent PADT
Sat Feb 20 00:14:29 2021 daemon.debug pppd[1447]: Waiting for 1 child processes...
Sat Feb 20 00:14:29 2021 daemon.debug pppd[1447]: script /lib/netifd/ppp-down, pid 1937
Sat Feb 20 00:14:29 2021 daemon.debug pppd[1447]: Script /lib/netifd/ppp-down finished (pid 1937), status = 0x1
Sat Feb 20 00:14:29 2021 daemon.info pppd[1447]: Exit.
Sat Feb 20 00:14:29 2021 daemon.notice netifd: Interface 'wan' is now down
Sat Feb 20 00:14:29 2021 daemon.notice netifd: Interface 'wan' is disabled
Sat Feb 20 00:14:29 2021 daemon.notice netifd: VLAN 'eth0.2' link is down
Sat Feb 20 00:14:29 2021 daemon.notice netifd: Interface 'wan' has link connectivity loss
...
Sat Feb 20 00:14:39 2021 daemon.notice netifd: Interface 'wan' is enabled
Sat Feb 20 00:14:39 2021 daemon.notice netifd: VLAN 'eth0.2' link is up
Sat Feb 20 00:14:39 2021 daemon.notice netifd: Interface 'wan' has link connectivity
Sat Feb 20 00:14:39 2021 daemon.notice netifd: Interface 'wan' is setting up now
Sat Feb 20 00:14:39 2021 daemon.err insmod: module is already loaded - slhc
Sat Feb 20 00:14:39 2021 daemon.err insmod: module is already loaded - ppp_generic
Sat Feb 20 00:14:39 2021 daemon.err insmod: module is already loaded - pppox
Sat Feb 20 00:14:39 2021 daemon.err insmod: module is already loaded - pppoe
Sat Feb 20 00:14:39 2021 daemon.info pppd[2028]: Plugin rp-pppoe.so loaded.
Sat Feb 20 00:14:39 2021 daemon.info pppd[2028]: RP-PPPoE plugin version 3.8p compiled against pppd 2.4.7
Sat Feb 20 00:14:39 2021 daemon.notice pppd[2028]: pppd 2.4.7 started by root, uid 0
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: Send PPPOE Discovery V1T1 PADI session 0x0 length 12
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: dst ff:ff:ff:ff:ff:ff src c0:4a:00:2c:d9:fa
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: [service-name] [host-uniq 00 00 07 ec]
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: Recv PPPOE Discovery V1T1 PADO session 0x0 length 52
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: dst c0:4a:00:2c:d9:fa src f8:13:08:40:d3:d5
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: [service-name] [AC-name acc-aln20.eh-don] [host-uniq 00 00 07 ec] [AC-cookie dc 8a 2d 68 eb 52 65 0b 7a dd 09 12 42 a5 97 32]
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: Send PPPOE Discovery V1T1 PADR session 0x0 length 32
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: dst f8:13:08:40:d3:d5 src c0:4a:00:2c:d9:fa
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: [service-name] [host-uniq 00 00 07 ec] [AC-cookie dc 8a 2d 68 eb 52 65 0b 7a dd 09 12 42 a5 97 32]
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: Recv PPPOE Discovery V1T1 PADS session 0x1d37 length 12
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: dst c0:4a:00:2c:d9:fa src f8:13:08:40:d3:d5
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: [service-name] [host-uniq 00 00 07 ec]
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: PADS: Service-Name: ''
Sat Feb 20 00:14:39 2021 daemon.info pppd[2028]: PPP session is 7479
Sat Feb 20 00:14:39 2021 daemon.warn pppd[2028]: Connected to f8:13:08:40:d3:d5 via interface eth0.2
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: using channel 2
Sat Feb 20 00:14:39 2021 kern.info kernel: [ 80.579823] pppoe-wan: renamed from ppp0
Sat Feb 20 00:14:39 2021 daemon.info pppd[2028]: Renamed interface ppp0 to pppoe-wan
Sat Feb 20 00:14:39 2021 daemon.info pppd[2028]: Using interface pppoe-wan
Sat Feb 20 00:14:39 2021 daemon.notice pppd[2028]: Connect: pppoe-wan <--> eth0.2
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: sent [LCP ConfReq id=0x1 <mru 1492> <magic 0xfcef8687>]
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: rcvd [LCP ConfReq id=0x17 <mru 1492> <auth chap MD5> <magic 0x11fe2551>]
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: sent [LCP ConfAck id=0x17 <mru 1492> <auth chap MD5> <magic 0x11fe2551>]
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: rcvd [LCP ConfAck id=0x1 <mru 1492> <magic 0xfcef8687>]
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: sent [LCP EchoReq id=0x0 magic=0xfcef8687]
[...chap auth...]
Sat Feb 20 00:14:39 2021 daemon.debug pppd[2028]: rcvd [LCP EchoRep id=0x0 magic=0x11fe2551]
Sat Feb 20 00:14:40 2021 daemon.debug pppd[2028]: rcvd [CHAP Success id=0x1 "CHAP authentication success"]
Sat Feb 20 00:14:40 2021 daemon.info pppd[2028]: CHAP authentication succeeded: CHAP authentication success
Sat Feb 20 00:14:40 2021 daemon.notice pppd[2028]: CHAP authentication succeeded
Sat Feb 20 00:14:40 2021 daemon.notice pppd[2028]: peer from calling number F8:13:08:40:D3:D5 authorized
Sat Feb 20 00:14:40 2021 daemon.debug pppd[2028]: sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
Sat Feb 20 00:14:40 2021 daemon.debug pppd[2028]: sent [IPV6CP ConfReq id=0x1 <addr fe80::4030:fda2:e257:4e52>]
Sat Feb 20 00:14:40 2021 daemon.debug pppd[2028]: rcvd [IPCP ConfReq id=0x1f <addr 172.16.14.227>]
Sat Feb 20 00:14:40 2021 daemon.debug pppd[2028]: sent [IPCP ConfAck id=0x1f <addr 172.16.14.227>]
Sat Feb 20 00:14:40 2021 daemon.debug pppd[2028]: rcvd [IPCP ConfNak id=0x1 <addr 147.147.154.104> <ms-dns1 212.159.6.9> <ms-dns2 212.159.6.10>]
Sat Feb 20 00:14:40 2021 daemon.debug pppd[2028]: sent [IPCP ConfReq id=0x2 <addr 147.147.154.104> <ms-dns1 212.159.6.9> <ms-dns2 212.159.6.10>]
Sat Feb 20 00:14:40 2021 daemon.debug pppd[2028]: rcvd [IPCP ConfAck id=0x2 <addr 147.147.154.104> <ms-dns1 212.159.6.9> <ms-dns2 212.159.6.10>]
Sat Feb 20 00:14:40 2021 daemon.notice pppd[2028]: local IP address 147.147.154.104
Sat Feb 20 00:14:40 2021 daemon.notice pppd[2028]: remote IP address 172.16.14.227
Sat Feb 20 00:14:40 2021 daemon.notice pppd[2028]: primary DNS address 212.159.6.9
Sat Feb 20 00:14:40 2021 daemon.notice pppd[2028]: secondary DNS address 212.159.6.10
Sat Feb 20 00:14:40 2021 daemon.debug pppd[2028]: Script /lib/netifd/ppp-up started (pid 2048)
Sat Feb 20 00:14:40 2021 daemon.notice netifd: Network device 'pppoe-wan' link is up
Sat Feb 20 00:14:40 2021 daemon.notice netifd: Interface 'wan6' is enabled
Sat Feb 20 00:14:40 2021 daemon.notice netifd: Network alias 'pppoe-wan' link is up
Sat Feb 20 00:14:40 2021 daemon.notice netifd: Interface 'wan6' has link connectivity
Sat Feb 20 00:14:40 2021 daemon.notice netifd: Interface 'wan6' is setting up now
Sat Feb 20 00:14:40 2021 daemon.notice netifd: Interface 'wan' is now up
Sat Feb 20 00:14:40 2021 daemon.debug pppd[2028]: Script /lib/netifd/ppp-up finished (pid 2048), status = 0x1