I've done some more looking at this and the bug runs pretty deep. During `netplan try`, netplan backs up both its configuration in /etc/netplan and the backend configurations for systemd-networkd and NetworkManager [1]. The problem with this is that the restored config files aren't picked up by systemd-networkd (even with `networkctl reload`), because a `systemctl daemon-reload` is required in order to detect the changed files.
I stat'ed /run/systemd/network during a `netplan try`; the inode numbers change after the revert since the backup directory was moved. ``` $ stat network File: network Size: 60 Blocks: 0 IO Block: 4096 directory Device: 0,26 Inode: 5739 Links: 2 Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2025-03-21 10:43:06.922283238 -0500 Modify: 2025-03-21 10:43:06.703278532 -0500 Change: 2025-03-21 10:43:06.703278532 -0500 Birth: 2025-03-21 10:14:58.081808256 -0500 $ stat network File: network Size: 60 Blocks: 0 IO Block: 4096 directory Device: 0,26 Inode: 6005 Links: 2 Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2025-03-21 10:43:13.057415020 -0500 Modify: 2025-03-21 10:42:28.856463577 -0500 Change: 2025-03-21 10:43:13.055414977 -0500 Birth: 2025-03-21 10:43:13.055414977 -0500 ``` It was a nice idea to avoid running the netplan generator during revert [2]; it just doesn't work. Indeed, writing a static IP for an interface that was using dhcp and `netplan try`ing it doesn't revert the static IP. Working on a PR to address this in netplan upstream. [1] https://github.com/canonical/netplan/blob/main/netplan_cli/configmanager.py#L126 [2] https://github.com/canonical/netplan/blob/main/netplan_cli/cli/commands/try_command.py#L145 ** Also affects: netplan.io (Ubuntu) Importance: Undecided Status: New ** Also affects: netplan.io (Ubuntu Oracular) Importance: Undecided Status: New ** Also affects: netplan.io (Ubuntu Noble) Importance: Undecided Status: New ** Also affects: netplan.io (Ubuntu Jammy) Importance: Undecided Status: New ** Also affects: netplan.io (Ubuntu Plucky) Importance: Undecided Status: New ** Also affects: netplan.io (Ubuntu Focal) Importance: Undecided Status: New ** Changed in: netplan Status: Confirmed => In Progress -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2083029 Title: Try does not recover network To manage notifications about this bug go to: https://bugs.launchpad.net/netplan/+bug/2083029/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
