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
This commit is contained in:
Olivier Gayot
2022-05-07 13:34:15 +02:00
committed by Thomas Haller
parent 24d8980692
commit 928cd1cb15
2 changed files with 3 additions and 0 deletions

View File

@@ -3184,6 +3184,8 @@ nm_connection_get_virtual_device_description(NMConnection *connection)
display_type = _("IP Tunnel"); display_type = _("IP Tunnel");
else if (nm_streq(type, NM_SETTING_WIREGUARD_SETTING_NAME)) else if (nm_streq(type, NM_SETTING_WIREGUARD_SETTING_NAME))
display_type = _("WireGuard"); display_type = _("WireGuard");
else if (nm_streq(type, NM_SETTING_TUN_SETTING_NAME))
display_type = _("TUN/TAP");
if (!iface || !display_type) if (!iface || !display_type)
return NULL; return NULL;

View File

@@ -101,6 +101,7 @@ static const char *device_sort_order[] = {"NMDeviceEthernet",
NM_SETTING_BRIDGE_SETTING_NAME, NM_SETTING_BRIDGE_SETTING_NAME,
NM_SETTING_IP_TUNNEL_SETTING_NAME, NM_SETTING_IP_TUNNEL_SETTING_NAME,
NM_SETTING_WIREGUARD_SETTING_NAME, NM_SETTING_WIREGUARD_SETTING_NAME,
NM_SETTING_TUN_SETTING_NAME,
"NMDeviceModem", "NMDeviceModem",
"NMDeviceBt"}; "NMDeviceBt"};
static const int device_sort_order_len = G_N_ELEMENTS(device_sort_order); static const int device_sort_order_len = G_N_ELEMENTS(device_sort_order);