0

I haven't seen any options to setup up DSL connection in /etc/netplan?
I know it's possible via pppoeconf, but I'm not sure how to modify the dsl-provider file/name (I need to setup for 2 different providers), so that it will still use it on boot time.

DenisZ
  • 123
  • 9

1 Answers1

1

netplan does not directly support PPPoE connections today (netplan 0.105). There are two possible solutions using the supported tools in Ubuntu main.

  • I use a networkd-dispatcher script in /etc/networkd-dispatcher/routable.d which starts the ppp connection whenever the ethernet device comes up:

    #!/bin/sh
    
    set -e
    
    if [ "$IFACE" != wan ]; then
            exit 0
    fi
    
    pppd call centurylink
    
    sleep 5
    
    ip route change default dev ppp0 advmss 1482
    

    I then have an additional script linked from each of /etc/networkd-dispatcher/{degraded,dormant,no-carrier,off}.d/ which stops it when it goes down:

    #!/bin/sh
    
    set -e
    
    if [ "$IFACE" != wan ]; then
            exit 0
    fi
    
    if [ -e /run/ppp-centurylink.pid ]; then
            pid=$(cat /run/ppp-centurylink.pid)
            kill "$pid"
    fi
    

    This approach connects the ppp configuration you have created (via pppoeconf or other means) to networkd.

  • You can configure your PPPoE connection directly in NetworkManager.

slangasek
  • 5,293
  • 2
  • 18
  • 26
  • Thanks @slangsek, When I ran pppoeconf it will create 2 files in `/etc/ppp/peers`, so I was able to check, update config there in the dsl-provider file, and it has a full setup. I didn't try with networkd-dispacher, not sure if any better. It's too bad netplan doesn't have that option – DenisZ Dec 30 '22 at 19:04
  • `pppoeconf` generates the config for ppp, but does not address the question of how you manage the connection. You can do it manually from the commandline, but if you want the connection to start automatically and stay up, interfacing with either networkd-dispatcher or NetworkManager is still a good idea. – slangasek Jan 01 '23 at 00:55