1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 16:42:08 +02:00
tldr/pages/linux/nmcli-connection.md
CleanMachine1 13840352d1
nmcli-connection: add import VPN example (#6185)
Co-authored-by: Axel Navarro <navarroaxel@gmail.com>
2021-07-01 07:57:27 +05:30

1 KiB

nmcli connection

Connection management with NetworkManager. More information: https://man.archlinux.org/man/nmcli.1.

  • List all NetworkManager connections (shows name, uuid, type and device):

nmcli connection

  • Activate a connection by specifying an uuid:

nmcli connection up uuid {{uuid}}

  • Deactivate a connection:

nmcli connection down uuid {{uuid}}

  • Create an auto-configured dual stack connection:

nmcli connection add ifname {{interface_name}} type {{ethernet}} ipv4.method {{auto}} ipv6.method {{auto}}

  • Create a static IPv6-only connection:

nmcli connection add ifname {{interface_name}} type {{ethernet}} ip6 {{2001:db8::2/64}} gw6 {{2001:db8::1}} ipv6.dns {{2001:db8::1}} ipv4.method {{ignore}}

  • Create a static IPv4-only connection:

nmcli connection add ifname {{interface_name}} type {{ethernet}} ip4 {{10.0.0.7/8}} gw4 {{10.0.0.1}} ipv4.dns {{10.0.0.1}} ipv6.method {{ignore}}

  • Create a VPN connection using OpenVPN from a OVPN file:

nmcli connection import type {{openvpn}} file {{path/to/vpn_config.ovpn}}