Network Configuration - Rocky Linux 9
NetworkManager
is use to manage networking state. As of version 9, NetworkManager
is replacing Network-Scripts
.
NetworkManager
is running as service and the status can be checked using command below
systemctl status NetworkManager
NetworkManager --print-config
The default storage location (version 9) is in /etc/NetworkManager/system-connections/
nmcli
nmcli device show
nmcli device show enp0s3
nmtui
# Set IP to dynamic (DHCP)
nmcli con mod enp0s3 ipv4.gateway '' &&
nmcli con mod enp0s3 ipv4.address '' &&
nmcli con mod enp0s3 ipv4.method auto &&
nmcli con down enp0s3 && nmcli con up enp0s3
# Set DNS manually (usually we don't need this)
nmcli con mod enp0s3 ipv4.dns '8.8.8.8,8.8.4.4,192.168.1.1'
# Don't forget to activate the change by restarting the interface
nmcli con down enp0s3 && nmcli con up enp0s3
nmcli con down enp0s3
nmcli con up enp0s3
ip addr
ip a
ip route
ip r