Device Eth0 Does Not Seem To Be Present, Delaying Initialization

      22

The other day I was working on a POC lab where I had to lớn simulate a DNS hệ thống, Centos version 7 in this case in GNS3. It was for one of the nuage sdwan gns3 labs I was working on.Took a copy of centos DNS VM from existing KVM host, added inlớn gns3 by going khổng lồ edit preferences and under Qemu VM’s.

Bạn đang xem: Device eth0 does not seem to be present, delaying initialization


*
Read also,How To Setup NTP. Server In Linux? (Centos, Rhel, Ubuntu) How To Set Static IPhường On Ubuntu? (GUI & CLI) 6 Easy Steps To Configure SNMPhường on Redhat Linux or CentOS How To Install And Configure SNMP on Ubuntu? In this blog, we are going lớn fix this issue by following steps.Check interface status.Cheông chồng the network configuration tệp tin.Verify with inactive interfaces on LinuxTake a backup of Linux interface network configModifying network configuration files in LinuxLet’s rename the file ifcfg-eth0Change the configuration lớn reflect the new interface ens3.Network verification

Cheông xã interface status.

That’s weird, I then ran ifconfig to lớn see whats the network interface status and guess what?I couldn’t find the interface under the IPhường configuration except for the loopbaông xã interface.< ~># ifconfiglo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0< ~>#

Check the network configuration tệp tin.

Well, what could be the issue I started lớn wonder.Then I decided lớn kiểm tra the network configuration folder /etc/sysconfig/network-scripts khổng lồ see what’s going on there.did ls lớn see the danh sách of interfaces.< network-scripts># lsifcfg-eth0ifdown-pppifup-ethifup-sitifcfg-loifdown-routesifup-ipppifup-Teamifdownifdown-sitifup-ipv6ifup-TeamPortifdown-bnepifdown-Teamifup-isdnifup-tunnelifdown-ethifdown-TeamPortifup-plipifup-wirelessifdown-ipppifdown-tunnelifup-plusbinit.ipv6-globalifdown-ipv6ifupifup-postnetwork-functionsifdown-isdnifup-aliasesifup-pppnetwork-functions-ipv6ifdown-postifup-bnepifup-routes< network-scripts>#Found the file ifcfg-eth0 was already there, which means the configuration is present. It seems that the device & the configuration files are unable khổng lồ talk for some reason.

Verify with inactive sầu interfaces on Linux

Alright, It’s time to lớn check the devices which are present on the device by entering the commvà.ifconfig -a This will not only show the active devices but the inactive interfaces as well.

Xem thêm: Series Sniffing Là Một Hình Thức Tấn Công Sniffer, Tìm Hiểu Chung Về Phương Thức Tấn Công Sniffer

< ~># ifconfig -aens3: flags=4163 mtu 1500 RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 122 bytes 10080 (9.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 122 bytes 10080 (9.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0< ~># When I looked inkhổng lồ the output I could see, In this machine by mặc định has picked up the new interface standard và picked up the device name as “ens3” instead of “eth0” So there is a mismatch between the device name và the configuration file.Now we know what to do, it is just a matter of changing the network configuration files in /etc/sysconfig/network-scripts/ifcfg-eth0 lớn reflect the device name, which is ifcfg-ens3

Take a backup of Linux interface network config

Before you vì anything make sure that you have taken a backup of network configurations file, that way you can restore it at any time if anything goes wrong.To create a backup, create a directory called “backup_network” in the linux network folder by entering the commvà below. You can name whatever the name you lượt thích as long as you remember the folder.Mkdir backup_networkOnce you created the folder copy that network interface tệp tin ifcfg-eth0 khổng lồ that backup_network folderCp ifcfg-eth0 backup_networknow you can make changes to lớn the network interface configuration without any any issues. If anything goes wrong you have the backup khổng lồ restore.< network-scripts># lsbackup_network ifdown-post ifup-bnep ifup-routesifcfg-eth0 ifdown-ppp ifup-eth ifup-sitifcfg-lo ifdown-routes ifup-ippp ifup-Teamifdown ifdown-sit ifup-ipv6 ifup-TeamPortifdown-bnep ifdown-Team ifup-isdn ifup-tunnelifdown-eth ifdown-TeamPort ifup-plip ifup-wirelessifdown-ippp ifdown-tunnel ifup-plusb init.ipv6-globalifdown-ipv6 ifup ifup-post network-functionsifdown-isdn ifup-aliases ifup-ppp network-functions-ipv6< network-scripts>#

Modifying network configuration files in Linux

Let’s rename the file ifcfg-eth0

To rename the file move the file ifcfg-eth0 lớn ifcfg-ens3 (New name)mv ifcfg-eth0 ifcfg-ens3Once done, you no longer have sầu the ifcfg-eth0 tệp tin in the network folder.< network-scripts># lsbackup_network ifdown-post ifup-bnep ifup-routesifcfg-ens3 ifdown-ppp ifup-eth ifup-sitifcfg-lo ifdown-routes ifup-ippp ifup-Teamifdown ifdown-sit ifup-ipv6 ifup-TeamPortifdown-bnep ifdown-Team ifup-isdn ifup-tunnelifdown-eth ifdown-TeamPort ifup-plip ifup-wirelessifdown-ippp ifdown-tunnel ifup-plusb init.ipv6-globalifdown-ipv6 ifup ifup-post network-functionsifdown-isdn ifup-aliases ifup-ppp network-functions-ipv6< network-scripts>#

Change the configuration to lớn reflect the new interface ens3.

Open the configuration file editor và make changes to the Name & Device fields.From below< network-scripts># cát ifcfg-ens33 TYPE="Ethernet"BOOTPROTO="none"DEFROUTE="yes"IPV4_FAILURE_FATAL="no"IPV6INIT="no"NAME="eth0"DEVICE="eth0"ONBOOT="yes"IPADDR="192.168.1.29"PREFIX="26"GATEWAY="192.168.1.1"DOMAIN="thietkewebhcm.com.vn"< backup_network>#To< network-scripts># cat ifcfg-ens3TYPE="Ethernet"BOOTPROTO="static"DEFROUTE="yes"IPV4_FAILURE_FATAL="no"IPV6INIT="no"NAME="ens3"DEVICE="ens3"ONBOOT="yes"IPADDR="192.168.1.29"PREFIX="26"GATEWAY="192.168.1.1"DOMAIN="thietkewebhcm.com.vn"< network-scripts>#That’s it, let’s restart the network servicesService network restart

Network verification

Now if you bởi vì ifconfig or ip addr you can see the device interface details appeared.Ifconfig< ~># ifconfigens3: flags=4163 mtu 1500 inet 10.101.8.29 netmask 255.255.255.192 broadcast 10.101.8.63 inet6 fe80::ebd:33ff:fe04:3900 prefixlen 64 scopeid 0x20 ether 0c:bd:33:04:39:00 txqueuelen 1000 (Ethernet) RX packets 10715 bytes 3430245 (3.2 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1324 bytes 115370 (112.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 122 bytes 10080 (9.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 122 bytes 10080 (9.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0< ~>#IP addr< network-scripts># ip addr1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 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 forever2: ens3: mtu 1500 qdisc pfifo_fast state UP. qlen 1000 link/ether 0c:bd:33:04:39:00 brd ff:ff:ff:ff:ff:ff inet 10.101.8.29/26 brd 10.101.8.63 scope global ens3 valid_lft forever preferred_lft forever inet6 fe80::ebd:33ff:fe04:3900/64 scope links valid_lft forever preferred_lft forever< network-scripts># You can also start pinging the mặc định gateway to see if it’s responding or not.< network-scripts># ping 192.168.1.1PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.64 bytes from 192.168.1.1: icmp_seq=1 ttl=255 time=5.28 ms64 bytes from 192.168.1.1: icmp_seq=2 ttl=255 time=2.04 ms64 bytes from 192.168.1.1: icmp_seq=3 ttl=255 time=1.09 ms64 bytes from 192.168.1.1: icmp_seq=4 ttl=255 time=3.10 ms64 bytes from 192.168.1.1: icmp_seq=5 ttl=255 time=1.05 ms64 bytes from 192.168.1.1: icmp_seq=6 ttl=255 time=1.35 ms64 bytes from 192.168.1.1: icmp_seq=7 ttl=255 time=1.21 ms64 bytes from 192.168.1.1: icmp_seq=8 ttl=255 time=1.13 ms64 bytes from 192.168.1.1: icmp_seq=9 ttl=255 time=2.24 ms^C--- 192.168.1.1 ping statistics ---9 packets transmitted, 9 received, 0% packet loss, time 8014msrtt min/avg/max/mdev = 1.058/2.058/5.283/1.313 ms< network-scripts># yes, it’s responding. which means the network is up và running.To make sure everything works great you can verify one more thing.Use the interface shutdown comm& to lớn see if the interface goes down, & use the unshut command to bring up the interface baông chồng.To shut the interface in linux typeifdown esn3To unshut interfaceifup ens3 You can see the device came backup as well.< network-scripts>#ifup ens3 < network-scripts># ifconfigens3: flags=4163 mtu 1500 inet 192.168.1.29 netmask 255.255.255.192 broadcast 192.168.1.63 inet6 fe80::ebd:33ff:fe04:3900 prefixlen 64 scopeid 0xđôi mươi ether 0c:bd:33:04:39:00 txqueuelen 1000 (Ethernet) RX packets 11073 bytes 3495029 (3.3 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1489 bytes 136118 (132.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 122 bytes 10080 (9.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 122 bytes 10080 (9.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0< network-scripts># < network-scripts># < network-scripts># ip addr1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 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 forever2: ens3: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 0c:bd:33:04:39:00 brd ff:ff:ff:ff:ff:ff inet 192.168.1.29/26 brd 192.168.1.63 scope global ens3 valid_lft forever preferred_lft forever inet6 fe80::ebd:33ff:fe04:3900/64 scope liên kết valid_lft forever preferred_lft forever< network-scripts>#