From 13d04428d87d2bb341b0211871435077fdabb0be Mon Sep 17 00:00:00 2001 From: exu Date: Sat, 29 Jul 2023 15:47:27 +0200 Subject: [PATCH] Add NetworkManager page --- pages/02.linux/networkmanager/default.en.md | 80 +++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 pages/02.linux/networkmanager/default.en.md diff --git a/pages/02.linux/networkmanager/default.en.md b/pages/02.linux/networkmanager/default.en.md new file mode 100644 index 0000000..d5c7a65 --- /dev/null +++ b/pages/02.linux/networkmanager/default.en.md @@ -0,0 +1,80 @@ +--- +title: "NetworkManager" +visible: true +--- + +[toc] + +## nmcli + +First, find the connection you want to edit +The full list can be shown using this command +[shuser] + +```sh +nmcli connection +(out)NAME UUID TYPE DEVICE +(out)enp5s0 889b187d-2a9f-4e4d-938c-c88b85fb5756 ethernet enp5s0 +(out)lo f61a36ee-b958-4940-8145-b61e92dc59d2 loopback lo +``` + +[/shuser] + +Enter the connection editor for an interface + +[shuser] + +```sh +nmcli connection edit 'enp5s0' +``` + +[/shuser] + +Print IPv4 settings + +``` +nmcli> print ipv4 +``` + +Set IPv4 method to "disabled", "auto", "manual", or "link-local" + +``` +nmcli> ipv4.method +``` + +``` +auto: DHCP +manual: manual configuration +``` + +Set IPv4 address(es) + +``` +nmcli> set ipv4.addresses
, ... +``` + +Set IPv4 gateway + +``` +nmcli> print ipv4.gateway
+``` + +Set IPv4 DNS + +``` +nmcli> print ipv4.dns
+``` + +Save the setting persistently + +``` +nmcli> save +``` + +Exit configuration interface + +``` +nmcli> quit +``` + +> [NetworkManager - Edit a connection](https://wiki.archlinux.org/title/NetworkManager#Edit_a_connection)