Skip to content

Instantly share code, notes, and snippets.

@adiberr
Last active December 6, 2025 22:34
Show Gist options
  • Select an option

  • Save adiberr/0c68fafc3eb9af64a254972cef5072a9 to your computer and use it in GitHub Desktop.

Select an option

Save adiberr/0c68fafc3eb9af64a254972cef5072a9 to your computer and use it in GitHub Desktop.
EdgeRouter: Auto-Reconnect PPPoE Before DHCP Lease Expires

My ISP provides a dynamic IP with a DHCP lease that expires roughly 24 hours after the last reboot. When it expires, PPPoE renegotiation sometimes takes too long and I end up rebooting the router or SSH'ing in to clear the session.
This scheduler forces a clean reconnect at a fixed time so the renewal happens on my terms.

Configuration

configure

set system task-scheduler task reconnect-pppoe crontab-spec "0 6 * * *"
set system task-scheduler task reconnect-pppoe executable path "/opt/vyatta/bin/vyatta-op-cmd-wrapper"
set system task-scheduler task reconnect-pppoe executable arguments "clear interfaces connection pppoe0"

commit
save
exit

What It Does

  • Runs daily at 06:00.
  • Clears the pppoe0 session using the VyOS wrapper (executes shell commands without separate scripts).
  • Forces a fresh PPPoE negotiation.

Schedule Options

Modify 0 6 * * * cron expression as needed (cron generator):

  • 0 4 * * * — 4 AM daily
  • 0 */12 * * * — Every 12 hours
  • 0 3 * * 0 — Sundays at 3 AM

Tags: EdgeRouter, PPPoE, dynamic IP, ISP lease, DHCP renewal, cron, task scheduler, WAN reset, network automation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment