I'm attempting to automatically establish a VPN connection after reboot. I created the profile via the network manager GUI and everything works well. I can use nm-connection-editor to edit the ethernet (and wifi) config to check the "Automatically connect to VPN." If I restart either interface (wlan0 or eth0), the VPN connection will be established.
When I reboot, however, the VPN connection is not established over eth0. When I re-run nm-connection-editor, the auto connect to VPN box is now unchecked. If I re-check it and restart the interface, the VPN is once again automatically established. Rebooting again reverts the setting. Each time I check that box after rebooting, a NEW config file is generated in /etc/NetworkManager/system-connections. It starts with netplan-eth0, then netplan- and gets a 1-up number with each new save.
netplan-eth0-626dd384-8b3d-3690-9511-192b2c79b3fd-1.nmconnection
netplan-eth0-626dd384-8b3d-3690-9511-192b2c79b3fd.nmconnection
netplan-eth0.nmconnection
The wireless connection actually works flawlessly. If I disable the wired connection and use only wifi, the VPN is established immediately upon rebooting.
All of my troubleshooting of netplan and all the options in NetworkManager have come up empty. I'm trying to set up a raspi to send to a relative and want it to establish a vpn connection by just plugging it in to ethernet, so I need it to work with the wired connection. Any help is appreciated.
Below is a paste of netplan-eth0.nmconnection. Note that it is the "secondaries" option that ties the VPN to this interface. If I had to guess, NetworkManager is ignoring this config for eth0 after rebooting.
[connection]
id=netplan-eth0
uuid=626dd384-8b3d-3690-9511-192b2c79b3fd
type=ethernet
interface-name=eth0
metered=2
permissions=
secondaries=f3f0c99a-c2c5-47fd-9bce-9104f3665dfc;
timestamp=1638470039
[ethernet]
mac-address-blacklist=
wake-on-lan=0
[ipv4]
dns-search=
method=auto
[ipv6]
addr-gen-mode=eui64
dns-search=
method=ignore