You are not logged in.
Is there a way to make NetworkManager apply a profile to a tun interface, but not create a new tun interface when the original one disappears and deactivate the profile instead?
I have a software that creates a tun interface and assigns it an IP4, and a NetworkManager profile that configures everything else (DNS, route, route-rules). I want the profile to activate / be applied when I run the software to create the tun interface, and deactivate when the software closes and removes the interface. However, currently NM creates a new interface when the original one is removed and stays up.
NetworkManager[794]: <info> [1767995913.6539] device (ss-tun): state change: activated -> unmanaged (reason 'unmanaged', managed-type: 'removed')
NetworkManager[794]: <info> [1767995913.6550] policy: auto-activating connection 'ss-tun' (32fa7031-9fa5-43ad-b21e-f682fb5e1668)
NetworkManager[794]: <info> [1767995913.6565] device (ss-tun): state change: unmanaged -> unavailable (reason 'managed', managed-type: 'external')
NetworkManager[794]: <info> [1767995913.6577] device (ss-tun): state change: unavailable -> disconnected (reason 'user-requested', managed-type: 'full')
NetworkManager[794]: <info> [1767995913.6581] device (ss-tun): Activation: starting connection 'ss-tun' (32fa7031-9fa5-43ad-b21e-f682fb5e1668)
NetworkManager[794]: <info> [1767995913.6584] device (ss-tun): state change: disconnected -> prepare (reason 'none', managed-type: 'full')
NetworkManager[794]: <info> [1767995913.6587] device (ss-tun): state change: prepare -> config (reason 'none', managed-type: 'full')
NetworkManager[794]: <info> [1767995913.6591] device (ss-tun): state change: config -> ip-config (reason 'none', managed-type: 'full')
NetworkManager[794]: <info> [1767995915.6619] device (ss-tun): state change: ip-config -> ip-check (reason 'none', managed-type: 'full')
NetworkManager[794]: <info> [1767995915.6642] device (ss-tun): state change: ip-check -> secondaries (reason 'none', managed-type: 'full')
NetworkManager[794]: <info> [1767995915.6645] device (ss-tun): state change: secondaries -> activated (reason 'none', managed-type: 'full')
NetworkManager[794]: <info> [1767995915.6652] device (ss-tun): Activation: successful, device activated.Another issue in the post is now split to https://bbs.archlinux.org/viewtopic.php?pid=2282293
Last edited by Beemo (Yesterday 23:19:46)
Offline
"nmcli device down ss-tun"?
Are you btw looking for https://archlinux.org/packages/extra/x8 … trongswan/ ?
Offline
I just tried nmcli dev down, but it deactivates the connection too, and once the tun interface appears again the profile is not activated:
NetworkManager[794]: <info> [1767998506.4724] device (ss-tun): state change: unmanaged -> unavailable (reason 'connection-assumed', managed-type: 'external')
NetworkManager[794]: <info> [1767998506.4727] device (ss-tun): state change: unavailable -> disconnected (reason 'connection-assumed', managed-type: 'external')
NetworkManager[794]: <info> [1767998506.4733] device (ss-tun): Activation: starting connection 'ss-tun' (52d2a421-4dba-4025-9674-78096a192d96)
NetworkManager[794]: <info> [1767998506.4750] device (ss-tun): state change: disconnected -> prepare (reason 'none', managed-type: 'external')
NetworkManager[794]: <info> [1767998506.4751] device (ss-tun): state change: prepare -> config (reason 'none', managed-type: 'external')
NetworkManager[794]: <info> [1767998506.4752] device (ss-tun): state change: config -> ip-config (reason 'none', managed-type: 'external')
NetworkManager[794]: <info> [1767998506.4755] device (ss-tun): state change: ip-config -> ip-check (reason 'none', managed-type: 'external')
NetworkManager[794]: <info> [1767998506.5003] device (ss-tun): state change: ip-check -> secondaries (reason 'none', managed-type: 'external')
NetworkManager[794]: <info> [1767998506.5005] device (ss-tun): state change: secondaries -> activated (reason 'none', managed-type: 'external')
NetworkManager[794]: <info> [1767998506.5007] device (ss-tun): Activation: successful, device activated.I just realized the connection ID is different. NM is automatically creating a new connection.
Even with the old profile (by nmcli con up and then start the software) the DNS severs are still not present in sd-resolved.
Last edited by Beemo (2026-01-09 22:56:25)
Offline
"nmcli device down ss-tun"?
Are you btw looking for https://archlinux.org/packages/extra/x8 … trongswan/ ?
Haha it's not really strongswan
Last edited by Beemo (2026-01-09 22:50:03)
Offline
post split
Last edited by Beemo (2026-01-10 01:32:42)
Offline
post split
Last edited by Beemo (2026-01-10 01:33:02)
Offline
Seems like the choices are either fully managing an interface or not at all, and perhaps for a reason: https://unix.stackexchange.com/question … ap-devices
Offline
it deactivates the connection too, and once the tun interface appears again the profile is not activated
I thought that was the plan?
I want the profile to activate / be applied when I run the software to create the tun interface, and deactivate when the software closes and removes the interface. However, currently NM creates a new interface when the original one is removed and stays up.
The idea would be to explicitly activate/deactivate the interface w/ whatever script you're running (sorry, thought "ss" would refer to strongswan)
Offline
Originally I wanted the profile to deactivate when the interface disappears, like for a physical interface, but it creates a new tun interface instead.
The idea would be to explicitly activate/deactivate the interface w/ whatever script you're running
Yea seems to be the way.
Offline
Beemo, [Closed] is reserved for mods and indicates no more posts can be added to a thread.
Please use another term like [solved] and edit the title.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline