Adding ppp interface to systemd-networkd

Hello

How to add network to systemd-networkd ?

I am trying to add a ppp network to systemd_networkd and get the following errors.

error: cannot read snap file: layout “/run/systemd/network/10-netplan-ppp0.network” in an off-limits area

cannot update snap namespace: cannot write to “/etc/systemd/network/10-netplan-ppp0.network” because it would affect the host in “/etc/systemd/network” snap-update-ns failed with code 1: File exists

The image is “Ubuntu Core 18 RPi”.

I am also using wvdial.

Thanks

how exactly are you “trying” this, please give a bit more information …

normally you’d use the network-manager/modem-manager snaps to set up ppp, then use the network-manager interface from your application snap via nmcli commands …

https://core.docs.ubuntu.com/en/stacks/network/modem-manager/docs/
https://core.docs.ubuntu.com/en/stacks/network/network-manager/docs/

Hello

I have staged in my snap
#
stage-packages:
- wvdial

I am using a 4G radio module.

wvdial brings in pppd and other ppp support items.

I layout ppp items in write area
#needs to be in read/write
#our startup script will copy from $SNAP/etc/ppp/ to $SNAP_DATA/etc/ppp
/etc/ppp:
bind: $SNAP_DATA/etc/ppp
# wvdial
/etc/chatscripts:
bind: $SNAP/etc/chatscripts
/etc/init.d/pppd-dns:
bind-file: $SNAP/etc/init.d/pppd-dns
/etc/logrotate.d/ppp:
bind-file: $SNAP/etc/logrotate.d/ppp
/etc/pam.d/ppp:
bind-file: $SNAP/etc/pam.d/ppp
#needs to be in read/write
#our startup script will copy from $SNAP/etc/ppp/ to $SNAP_DATA/etc/ppp
/etc/ppp:
bind: $SNAP_DATA/etc/ppp

When my snap runs, i then copy $SNAP/etc/ppp to $SNAP_DATA/etc/ppp, and run wvdial.
${SNAP}/usr/bin/wvdial -C ${SNAP_DATA}/wvdial.conf ${MODEM} &
systemctl restart systemd-networkd.service

The ppp0 interface comes up, but the default route is still eth0.

So I think if I update /run/systemd/network with my ppp network information, then restart that might work.

I will also look at network-manager.