19 May

Centos 7 Network Configuration

After installation Centos 7 on your dedicated servers or VPS hosting , may your server not able to connect to net or use yum update , this all because your server  Ethernet interfaces are not enabled by default.

Network configuration on Centos 7

Here two easy way for setup your network configuration on Centos  machine

1- use “nmcli d” command by Putty at your ssh command line  to  quick list ethernet card installed on your machine

centos network setup

Centos 7 network setup

after that type “nmtui” command in your terminal to open Network manager. by opening Network manager chose “Edit connection” and press Enter (Use TAB button for choosing options). and select your network interface and click EDIT

DHCP configuration

change your IPv4  configuration to manual and put your IP full detail as IP address , subnet and …

 

2- Configuration from commend line

 

Go to the /etc/sysconfig/network-scripts directory, and locate its configuration file as (ifcfg-enp0s3) or maybe ifcfg-eth0 or something similar to this . Create it if not found

Now start the editing said file

vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

then check your entries should be something like this

 HWADDR=08:00:27:6C:FF:91
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPADDR=192.168.0.88
GATEWAY=192.168.1.1
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s3
UUID=ea68db6e-461e-427d-b9a8-bfcf6e1a4fc6
ONBOOT=yes

 

now save it and close the file

3- after that we need check  server default getaway configuration 

vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=hostname
GATEWAY=your IP gataway detail

in the end restart your dedicated servers or VPS hosting network 

/etc/init.d/network restart

for more detail see this video

Share this

Leave a Reply

1 Comment on "Centos 7 Network Configuration"

Notify of
avatar
Sort by:   newest | oldest | most voted
Ali
Guest

very usefull
thanks

wpDiscuz