2020-03-06 17:10:05 +00:00
|
|
|
# nmcli connection
|
|
|
|
|
|
|
|
> Connection management with NetworkManager.
|
2022-07-30 13:23:57 +01:00
|
|
|
> This subcommand can also be called with `nmcli c`.
|
2022-03-09 04:31:08 +00:00
|
|
|
> More information: <https://networkmanager.dev/docs/api/latest/nmcli.html>.
|
2020-03-06 17:10:05 +00:00
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- List all NetworkManager connections (shows name, UUID, type and device):
|
2020-03-06 17:10:05 +00:00
|
|
|
|
|
|
|
`nmcli connection`
|
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Activate a connection by specifying a UUID:
|
2020-03-06 17:10:05 +00:00
|
|
|
|
|
|
|
`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}}`
|
2021-07-01 03:27:27 +01:00
|
|
|
|
|
|
|
- Create a VPN connection using OpenVPN from a OVPN file:
|
|
|
|
|
|
|
|
`nmcli connection import type {{openvpn}} file {{path/to/vpn_config.ovpn}}`
|