Centos

How to configure static ip address on CentOS 8

Set Static IP Address in CentOS 8

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
Network manager TUI

Choose the network interface and then press enter.

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.

Set Manual IPv4 Configuration

Tab to Show and press enter.

Show IPv4 Configuration
Show IPv4 Configuration


Set the IP address to the interface as per your requirement.

Set Static IP 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.

Finish Configuration
Finish Configuration

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

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
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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close