Howto enable network interface on Centos 7 and RHEL

Howto enable network interface on Centos 7 and RHEL

CentOS

By default on Centos 7, network interface is disabled because “ONBOOT = no” in network interface configuration.

So we need enable that via command line.

Step 1: Check your network interface in CentOS system

[root@ithelpblog ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:4a:fa:46 brd ff:ff:ff:ff:ff:ff
inet brd scope global dynamic eno16777736
valid_lft 6645sec preferred_lft 6645sec
inet6 fe80::20c:29ff:fe4a:fa46/64 scope link
valid_lft forever preferred_lft forever
[root@localhost ~]#

You are using network interface with name “eno16777736”, you need modify that

Step 2: Change network interface configuration

[root@ithelpblog ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=22390c28-dc29-4710-9c1e-33c9b9f580d0
DEVICE=eno16777736
ONBOOT=yes
[root@ithelpblog ~]#

Step 3: Restart network service and receive ip address from dhcp

[root@ithelpblog ~]# service network restart
Restarting network (via systemctl): [ OK ]
[root@ithelpblog ~]#

Step 4: Check interface and ip address on Centos

[root@ithelpblog ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:4a:fa:46 brd ff:ff:ff:ff:ff:ff
inet 10.2.10.16/24 brd 10.2.10.255 scope global dynamic eno16777736
valid_lft 7181sec preferred_lft 7181sec
inet6 fe80::20c:29ff:fe4a:fa46/64 scope link
valid_lft forever preferred_lft forever
[root@ithelpblog ~]#

Thanks for using IThelpblog.com

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>