How to configure static ip address on CentOS 8

0
55

In this tutorial, we are going to show you how to configure a static IP address with network scripts, nmtui and nmcli utilities in CentOS 8 minimal.
See How to install CentOS 8 Minimal server

Setup network on CentOS 8 minimal

To configure a network interface, run the following nmtui command. After opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options).

# nmtui
how to configure static ip address on centos 8 5d980bc32c338 - How to configure static ip address on CentOS 8
Network manager TUI

Choose the network interface and then press enter.

how to configure static ip address on centos 8 5d980bc32c338 - How to configure static ip address on CentOS 8
Configure Network in CentOS 8

Once you click on the Edit button, it will prompt you to set up the network interface IP settings as illustrated in the below screenshot.

Tab to IPv4 CONFIGURATION and change it from Automatic to Manual.

how to configure static ip address on centos 8 5d980bc32c338 - How to configure static ip address on CentOS 8
Set Manual IPv4 Configuration

Tab to Show and press enter.

how to configure static ip address on centos 8 5d980bc32c338 - How to configure static ip address on CentOS 8
Show IPv4 Configuration


Set the IP address to the interface as per your requirement.
how to configure static ip address on centos 8 5d980bc32c338 - How to configure static ip address on CentOS 8
Set Static IP on CentOS 8

Use down arrow key to scroll down, and tab to OK and press enter to finish the IP configuration.

how to configure static ip address on centos 8 5d980bc32c338 - How to configure static ip address on CentOS 8
Finish Configuration

Press ESC key go to the connections. Select Activate a connection and press enter.

how to configure static ip address on centos 8 5d980bc32c338 - How to configure static ip address on CentOS 8
Activate connection


In order to verify the network configuration settings, you can check the content of the interface file or you can issue the below commands.
# ifconfig enp0s3
or
# ip a
how to configure static ip address on centos 8 5d980bc32c338 - How to configure static ip address on CentOS 8
Verify Network Settings in CentOS 8

Conclusion

That’s All. You have successfully configured a static IP address to a network interface in CentOS 8 / RHEL 8. Please share your feedback in the comments section.