summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2022-05-07 13:34:15 +0200
committerThomas Haller <thaller@redhat.com>2022-05-09 21:14:59 +0200
commit928cd1cb151519fc66e528bf93e421143bec8875 (patch)
tree2dc38d076311d45c9e058a339494e47e588497e4
parent24d898069209d72b6476928a62c09f5cde3e0f74 (diff)
downloadNetworkManager-928cd1cb151519fc66e528bf93e421143bec8875.tar.gz
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 (<ifname>) * <connection-name> Example: TUN/TAP (tap0) * bridge-slave-tap0 TUN/TAP (tap1) bridge-slave-tap1
-rw-r--r--src/libnm-core-impl/nm-connection.c2
-rw-r--r--src/nmtui/nmt-connect-connection-list.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/libnm-core-impl/nm-connection.c b/src/libnm-core-impl/nm-connection.c
index 508e07892f..5f1a157a65 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 535cf8fd26..f3197544b5 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);