Network Configurtion

Configuring using NetworkManager

In Centos previously,the network config file is stored in : /etc/sysconfig/network-scripts

Now it is stored in: /etc/NetworkManager/system-connections/

The /etc/netplan/00-installer-config.yaml file is the main configuration that controls whether to use Netplan or NetworkManager for managing network settings.

If it has:

network:
  version: 2 
  renderer: NetworkManager

Then NetworkManager will be used instead of Netplan.

In this case, NetworkManager stores the actual network config in /etc/NetworkManager/system-connections/ as you found.

Viewing Status:

  • nmcli device status

  • nmcli device show <int_name>

  • nmcli connection show

  • nmcli connection show <int_name>

Resetting an Adapter:

  • nmcli connection reload

  • nmcli connection down <int_name>

  • nmcli connection up <int_name>

Configuring an Adapter:

  • nmcli connection edit <int_name>

  • set connection.autoconnect yes

  • set ipv4.method manual

  • set ipv4.addr 192.168.0.2/24

  • set ipv4.dns 8.8.8.8

  • set ipv4.gateway 192.168.0.1

  • save <temporary/persistent>

  • quit

To configure a wireless network adapter:

sudo nmcli connection add con-name wlx0 ifname <wireless adapter name> type wifi ssid <ssid-name>
sudo nmcli connection modify wlx0 wifi-sec.key-mgmt wpa-psk
sudo nmcli connection modify wlx0 wifi-sec.psk <password>
sudo nmcli connection up wlx0

Last updated