From 928cd1cb151519fc66e528bf93e421143bec8875 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sat, 7 May 2022 13:34:15 +0200 Subject: [PATCH] nmtui: add support for activating tun/tap connections tun/tap connections can be created using a command such as: $ nmcli connection add type tun ifname tun0 mode tap owner 1000 They appear in nmcli connection as TYPE "tun". This patch adds the ability to activate and deactivate this type of connection using nmtui. Each connection of TYPE "tun" appears as: TUN/TAP () * Example: TUN/TAP (tap0) * bridge-slave-tap0 TUN/TAP (tap1) bridge-slave-tap1 --- src/libnm-core-impl/nm-connection.c | 2 ++ src/nmtui/nmt-connect-connection-list.c | 1 + 2 files changed, 3 insertions(+) diff --git a/src/libnm-core-impl/nm-connection.c b/src/libnm-core-impl/nm-connection.c index 508e07892..5f1a157a6 100644 --- a/src/libnm-core-impl/nm-connection.c +++ b/src/libnm-core-impl/nm-connection.c @@ -3184,6 +3184,8 @@ nm_connection_get_virtual_device_description(NMConnection *connection) display_type = _("IP Tunnel"); else if (nm_streq(type, NM_SETTING_WIREGUARD_SETTING_NAME)) display_type = _("WireGuard"); + else if (nm_streq(type, NM_SETTING_TUN_SETTING_NAME)) + display_type = _("TUN/TAP"); if (!iface || !display_type) return NULL; diff --git a/src/nmtui/nmt-connect-connection-list.c b/src/nmtui/nmt-connect-connection-list.c index 535cf8fd2..f3197544b 100644 --- a/src/nmtui/nmt-connect-connection-list.c +++ b/src/nmtui/nmt-connect-connection-list.c @@ -101,6 +101,7 @@ static const char *device_sort_order[] = {"NMDeviceEthernet", NM_SETTING_BRIDGE_SETTING_NAME, NM_SETTING_IP_TUNNEL_SETTING_NAME, NM_SETTING_WIREGUARD_SETTING_NAME, + NM_SETTING_TUN_SETTING_NAME, "NMDeviceModem", "NMDeviceBt"}; static const int device_sort_order_len = G_N_ELEMENTS(device_sort_order);