2

Recently I have upgraded my VM Server from CentOS 6 to 7. The upgrade completed without any error but the network interface is not showing in ifconfig and there is no file called ifcfg-eth0.

Before upgrade there were two interfaces eth0 and eth1, now there is nothing except lo.

In system-config-network under device configuration I don't find any interface.

ip addr show gives me three interfaces

lo enp0s3 and enp0s8 there is no IPADDR assign to this interface.

How can I assign it manually?

enter image description here

enter image description here

Solution

Its working with this dhclient enp0s3

8
  • 1
    ifconfig is a depricated command and you should avoid using it. Use ip command instead. Also see if NetworkManager is running. Your interfaces might be renamed like enoXX where XX is the number of the PCIe slot on your machine/server. – Valentin Bajrami Mar 16 '16 at 10:04
  • I have edited the question, I am able to run the command ip addr show but unable to locate enp0 file on the system. is there any other way to create a new interface on CentOS 7 – AReddy Mar 16 '16 at 10:26
  • Can you run dmesg | grep -i 'enp0s[38]' Also can you do a listing of /etc/sysconfig/network-scripts/ – Valentin Bajrami Mar 16 '16 at 10:36
  • There is no output from dmesg | grep -i 'enp0s[38]'. I have edited the question – AReddy Mar 16 '16 at 10:41
  • It seems that the kernel module / driver for your network card(s) is not loaded or available. Can you show the output of lspci |grep -i ether. Please provide more details like nmcli connection show as well. – Valentin Bajrami Mar 16 '16 at 11:00
1

In CentOS 7, network settings are managed by NetworkManager. So, use nmtui or nmcli to assign IP addresses. Make sure the packages NetworkManager and NetworkManager-tui are installed.

Or, if you want to revert the management method to ifcfg-* files, follow CentOS FAQ sections #2, #3 and #4.

4
  • As the interface is not there I am unable to download/install the NetworkManager package. Do you think the provided link can help me use ifcfg-eth0. I'm stuck at #3 – AReddy Mar 16 '16 at 12:40
  • @AvinashRedy kernel arguments are set in /etc/default/grub file if grub2 is properly installed. Follow these instructions. Or, if the system still uses grub-legacy, modify kernel arguments in /boot/grub/menu.lst. – Anderson Medeiros Gomes Mar 16 '16 at 13:02
  • @AvinashRedy, network interfaces seem to exist in your system. You can assign temporary addresses by running command lines like ip addr add dev enp0s3 192.168.33.33/24 and ip route add default via 192.168.33.1. Or, if your network has a DHCP server, dhclient enp0s3 or dhcpcd enp0s3. – Anderson Medeiros Gomes Mar 16 '16 at 13:03
  • Its working now thx Anderson. – AReddy Mar 16 '16 at 15:22

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.