Logo

How to Configure Static IP Address on Rocky Linux 9

Dec 20, 2023

To configure a static IP address on Rocky Linux 9, follow the steps below.

Step 1 : Obtain a list of network interfaces along with their UUIDs.

nmcli connection show

Step 2 : Edit the configuration for the desired interface, setting the IP address to 192.168.1.30 with a subnet mask of /24.

sudo nmcli connection modify enp0s3 ipv4.addresses 192.168.1.30/24

Step 3 : Set the gateway for the interface.

sudo nmcli connection modify enp0s3 ipv4.gateway 192.168.1.1

Step 4 : Configure DNS servers for the interface.

sudo nmcli connection modify enp0s3 ipv4.dns 8.8.8.8

Step 5 : Set the connection method to manual.

sudo nmcli connection modify enp0s3 ipv4.method manual

Step 6 : Restart the network service to apply the changes.

sudo nmcli connection down enp0s3 && sudo nmcli connection up enp0s3

Step 7 : Verify the configuration by displaying the IP address of the interface.

ip addr show

Congratulations! You have successfully configured a static IP address on Rocky Linux 9.

Recommended