CentoOS 6.5 OS missing ifcfg-eth0 and cannot connect to the Internet

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.

  1. 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 network
  2. Commands (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.

Supporting Resources

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like