[solved] Pppd: how to disconnect/connect "gently"?

I try to setup my daily DSL reset and it seems the "dumb" way is to just cron:
0 05 * * * ifdown wan; sleep 30; ifup wan or use watchcat and do a daily reboot.

I was wondering if there is a more "gentle" way to tell pppd directly to hangup/disconnect and connect/authenticate, so that the actual WAN interface can stay up?

I don't see any init.d script so not sure how to handle a stop/start correctly.

The wan interface in your case is the pppoe. By calling the ifdown wan you are not bringing down the ethernet interface, if that is what you're asking. Also you could just call ifup wan, without ifdown wan and sleep 30, if you don't care about the half minute delay.

You could also try to kill the pppd daemon (killall -HUP pppd). The netifd service will take care of restarting pppd.

I try to debug a problem, since sometimes ifdown/up wan wont work, while a reboot always works. I noticed some services trigger on WAN up/down, so i want to see if directly triggering pppd works more reliable.

ok thanks will try this!

Just a thought:

0 5 * * * [ $(ifstatus wan | jsonfilter -e '@.uptime') -lt 3650 ] || (ubus call network.interface.wan6 down;ubus call network.interface.wan down;sleep 1;ubus call network.interface.wan up;sleep 15;ubus call network.interface.wan6 up)

You can replace the down/ up dance with a simple invocation of ifup wan, I just needed to tear down my he.net tunnel gracefully to avoid getting deadlocked.

ifdown wan ; ifstatus wan ; ifup wan ; sleep 10 ; ifstatus wan
That will show you if if* works

ok i still get those luci errors, if i just power off/on my modem (full bridge mode) and after the modem has synced the dsl line try to reconnect.

Error: Unknown error (USER_REQUEST)
Error: Connection attempt failed

Than neither a ifup wan or luci wan restart or kill pppd works to reconnect, yet a reboot does....
Not really sure what a reboot does that fixes this, problem is atm my wlan is down after a reboot (some bug) and i need to manually restart Radio1 to fix this, so a reboot would only fix the pppoe issue..

I see this in the logs?

daemon.info pppd[25951]: Plugin rp-pppoe.so loaded.
daemon.info pppd[25951]: RP-PPPoE plugin version 3.8p compiled against pppd 2.4.8
daemon.notice pppd[25951]: pppd 2.4.8 started by root, uid 0
daemon.warn pppd[25951]: Timeout waiting for PADO packets
daemon.err pppd[25951]: Unable to complete PPPoE Discovery

PS: My startup line looks like this:
/usr/sbin/pppd nodetach ipparam wan ifname pppoe-wan lcp-echo-interval 1 lcp-echo-failure 5 lcp-echo-adaptive set PEERDNS=0 nodefaultroute usepeerdns maxfail 1

Maybe i need to change the maxfail 1 option?

PS: This is from master btw (OpenWrt SNAPSHOT r12034-1322190fd3)

Timeout waiting for PADO means there is nothing received from the DSLAM, e.g.:

  • The modem is not synced
  • The Ethernet cable is not connected
  • The Ethernet port is down

It should keep trying.

Are you trying to configure and start pppd manually instead of using the UCI and netifd systems?

  • only problem is i see the "sync" LED on the modem, so it is synced.
  • should than still be "not connected" after a i reboot the router
  • its not checked via ifconfig

It also does not keep trying and only a manual reboot reconnects at this point.

Are you trying to configure and start pppd manually instead of using the UCI and netifd systems?

Not really all i try is 1) setup my 24h reconnect stuff and 2) figure out why pppd does not reconnect if a disconnect happens or as noted not even a luci-restart of WAN works reliably. It did work yesterday night with the 30s timeout, but it should always work not just "sometimes".

this is the correct answer

ok somehow now killall -HUP pppd works fine... will monitor this and also installed watchcat just in case!

thanks all

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.