Configuring CentOS 6/7 Network Interface

This manual will explain how to configure network interface.

Viewing interfaces

Enter the command that will list all interfaces of the server

ifconfig -a

To configure an interface, create a configuration file for it, enter the command:

touch /etc/sysconfig/network-scripts/ifcfg-ens34

 (Important! : a network interface may have a different name in your server; in such case, you need to specify correct interface name instead of "ens34" at the end of the command)

Installing Nano

We need an editor to make the following settings. Install it from the repository. We will use the editor "nano".

Enter the following command:

yum install nano

During the installation process, you will be asked whether you agree to continue the installation. Tick 'agree'nano_0.png:

Now when the editor is installed, our configuration file can be edited.

Configuring interface

Enter the command:

nano /etc/sysconfig/network-scripts/ifcfg-Ваш интерфейс

The interface editor has opened

Enter the following values, each with a new line:

DEVICE=Your Intf
IPADDR= (Your ip-addr)
NETMASK= (Your masc)


Save the changes „Ctrl + O“ and "Enter" , Exit the editor „Ctrl + X“

Starting interface

Enter the command:

ifup Your interface

Let's restart the network services of our server:

service network restart


After successful restart, enter:

ifconfig -a


The interface we configured is ready for use