Red Hat IP Configuration: Using NMCLI Command Simplified

Ashwini DekaAshwini Deka
1 min read

The command nmcli connection show lists all configured network connections known to NetworkManager.

nmcli connection show

The command nmcli device statusdisplays the status of all network devices managed by NetworkManager.

nmcli device status

The command nmcli connection ens160 status will show all the details of the connection named "ens160"

nmcli connection ens160 status

The line of code below helps assign the IP address, subnet mask, gateway, DNS, and method all in one line.

nmcli connection modify ens160 ipv4.address 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns 8.8.8.8 ipv4.method manual
nmcli connection up ens160
0
Subscribe to my newsletter

Read articles from Ashwini Deka directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ashwini Deka
Ashwini Deka