In this quick article, I’ll show you How to configure a static IP address on the CentOS 8 virtual machine.
There are various ways to configure a static IP address on the CentOS machine. For this article, I’ll demonstrate the Graphical & Command lines ways to configure the static IP address.
Lets configure following settings for our centos system
IP Address: 192.168.1.10
Net Mask: 255.255.255.0
1.Configure Static IP via Graphical Interface
Click the “Wired Settings” for open the network settings.
Click the setting button next to the ON/OFF toggle button.
From “Wired Settings” window, you can easily configure a static IP address as following.
Click “Apply” to save settings and turn on the wired connection.
2.Configure Static IP via Command Line
Next way is configure a static IP via command line. Open the network interface config file using any text editor. I’ll use the vim editor.
Set the BOOTPROTO parameter to STATIC and add the following lines into file.
Change the IP address, netmask, and DNS as yours. Save the file and restart the network-manager service using the following command.
systemctl restart NetworkManager
You can check the IP address using following command.
That’s all about configuring static IP address on centOS machine. If you have any questions, leave a comment below.