I setup CentOS 6.5 as a second OS on my laptop.
After my installation, I tried to connect to the Internet, and determined my OS only sees the lo interface. When I run ifconfig -a
to find all the interfaces the OS sees, it only finds lo.
There is no file name as ifcfg-eth0 in the /etc/sysconfig/network-scripts/ directory.
And there is no file name as 70-persistent-net.rules in the /etc/udev/rules.d/ directory.
When I as a root user to execute ifup eth0 command, the response is
Device eth0 does not seem to be present, delaying initialization.
Can anyone help me solve this problem?
1 Answer
Just create the ifcfg-eth0 as sudo and then echo in your applicable detail for the network configurations, and then run systemctl restart network and see if that resolves the problem.
Note: Be sure to change the values of the applicable fields depending on what configurations you need in your environment when you create the interface configuration file manually.
Commands (create static IP assigned config)
echo "DEVICE=eth0 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.0.199 NETMASK=255.255.255.0 GATEWAY=192.168.0.1" >> /etc/sysconfig/network-scripts/ifcfg-eth0 systemctl restart networkCommands (create DHCP assigned IP config)
echo "DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0
Furthermore, consider rebooting the CentOS after making the needed changes with the correlated IP settings for your environment.