Connect with us


How to configure an IP address in Linux CentOS 7?


How to configure an IP address in Linux CentOS 7?

CentOS (Community Enterprise Enterprise System) is an enterprise-class Linux distribution based on free source code distributed by Red Hat and maintained by the CentOS project. For those who need stability, this is the ideal operating system.

Today we are going to teach you how to configure an IP address, mask, gateway and DNS in CentOS 7.

Centos / RHEL 7.0 adopted the systemd, which is a substitute for init daemon of Linux (but is compatible with init scripts SysV and LSB) and offers several improvements in process management, service dependency management, system initialization and shell performance.

This change resulted in the change of some commands, forcing users to know how to manage services, processes, etc.

How to configure an IP address in Linux CentOS 7?

Configure the network via nmtui command

To configure and view their network settings, the user has several commands in CentOS 7 such as ip, ifconfig, nmtui, nmcli, or route.

The simplest way to configure the network and machine name is to use the command I used to.
How to configure an IP address in Linux CentOS 7?

Then just go to Edit and if you wish to carry out a manual configuration you must select IPv4 and then Manual. To add the settings, click Show.

For a DHCP server configuration, choose the Automatic.

Note: For this tutorial we only show how to proceed with IPv4 configuration.
How to configure an IP address in Linux CentOS 7?

Then, indicate the network settings that you want. After setting select the OK which is at the end of the interface.

Then do Activate a connection

If you want to force the new settings, you can also use the command at any time:

To see the configuration you can use the command ip addr

In case the name can still use (additionally) the command nmtui-hostname.

Configuration via command line

In addition to the utility I used to, you can also configure network parameters via the command line. To do this, simply access the configuration file (in our case / etc / sysconfig / network-scripts / ifcfg-eth0)

To edit the file you can use a text editor such as vi, nano, or other.

For manual configuration, the following parameters must be indicated:


DNS1 =

After you have made the settings, save the information and restart the service associated with the network.

systemctl restart network

If you want to define a name edit the file / etc / sysconfig / network


More tutorials on Linux, can be seen at –Linux.

fbq(‘init’, ‘1664527397186427’); // Insert your pixel ID here.
fbq(‘track’, ‘PageView’);
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); = id;
js.src = “”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));

To Top

Log in

Forgot password?

Forgot password?

Enter your account data and we will send you a link to reset your password.

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy