Editing Nmcli
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | <code>nmcli</code> is [[NetworkManager]]'s built-in command-line interface added in 2010<ref>https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=c2ec07f17d69a590b45797de5c8a0f26a4c45eaa</ref>, it is used at least in [[Red Hat Enterprise Linux|RHEL]]. nmcli allows easy display of NetworkManager's current status, manage at least [[Ethernet]] and [[WiFi]] connections and devices, monitor connections. | |
− | <code>nmcli</code> is [[NetworkManager]]'s built-in command-line interface added in 2010<ref>https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=c2ec07f17d69a590b45797de5c8a0f26a4c45eaa</ref>, it is used at least in [[Red Hat Enterprise Linux|RHEL]]. | ||
Line 6: | Line 5: | ||
See RHEL 8.0 official documentation: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_and_managing_networking/index | See RHEL 8.0 official documentation: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_and_managing_networking/index | ||
* Show network connections: | * Show network connections: | ||
− | + | <pre>nmcli connection show | |
− | + | NAME UUID TYPE DEVICE | |
− | + | Profile 1 db1060e9-c164-476f-b2b5-caec62dc1b05 ethernet ens3 | |
− | + | bond0 aaf6eb56-73e5-4746-9037-eed42caa8a65 ethernet -- | |
− | + | </pre> | |
− | + | * <code>nmcli connection show --active</code> | |
− | + | * <code>nmcli device status</code> | |
− | + | <pre> | |
− | + | DEVICE TYPE STATE CONNECTION | |
− | + | ens3 ethernet connected Profile 1 | |
− | + | ens4 ethernet disconnected -- | |
− | <code>nmcli connection show --active</code> | + | lo loopback unmanaged -- |
− | + | </pre> | |
− | + | * <code>nmcli device show</code> (Includes link or carrier status). See also: <code>[[ethtool]]</code> | |
− | + | <pre> | |
− | + | GENERAL.DEVICE: ens33 | |
− | + | GENERAL.TYPE: ethernet | |
− | + | GENERAL.HWADDR: 00:0C:29:54:F7:20 | |
− | + | GENERAL.MTU: 1500 | |
− | + | GENERAL.STATE: 100 (connected) | |
− | + | GENERAL.CONNECTION: ens33 | |
− | + | GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/5 | |
− | + | WIRED-PROPERTIES.CARRIER: on | |
− | + | IP4.ADDRESS[1]: 192.168.219.150/24 | |
− | + | IP4.GATEWAY: 192.168.219.2 | |
− | + | IP4.DNS[1]: 192.168.219.2 | |
− | <code> | + | IP4.DOMAIN[1]: localdomain |
+ | IP6.ADDRESS[1]: fe80::3442:365:1982:aa4b/64 | ||
+ | IP6.GATEWAY: | ||
+ | </pre> | ||
== Configure commands == | == Configure commands == | ||
− | * Configure | + | * Configure DNS: <code>nmcli con mod test-lab ipv4.dns "8.8.8.8 8.8.4.4"</code> |
− | * Activate Ethernet connection: <code> | + | * Activate Ethernet connection: <code>nmcli con up test-lab ifname ens9</code> |
* View details: <code>nmcli -p con show test-lab</code> | * View details: <code>nmcli -p con show test-lab</code> | ||
* Configure IP in eth0: | * Configure IP in eth0: | ||
− | + | <pre> | |
− | + | nmcli c add type ethernet ifname eth0 con-name "My_New_Connection" ip4 192.168.1.166/24 gw4 192.168.1.1 | |
− | + | Connection "My_New_Connection" (xxxxxxx-sdafasfsdf-adfasdfaf-adsfads) suceessfully added. | |
− | + | </pre> | |
− | |||
== Activities == | == Activities == | ||
Line 49: | Line 50: | ||
== See also == | == See also == | ||
− | |||
* {{Netplan}} | * {{Netplan}} | ||
− | |||
* {{Linux networking commands}} | * {{Linux networking commands}} | ||
[[Category:RHEL]] | [[Category:RHEL]] |
Advertising: