0

I've just download and installed the latest version of CentOS inside a VirtualBox VM. Installation went OK, but when I start the VM and log in, if I try and ping anything I get an error due to lack of network interface.

if I try and issue the ifup eth0 command, I'm told

network is unreachable

. If I list the network interfaces using ip link show the interfaces that are listed are:

lo
enp0s3

I know what the loopback interface is for, but what is the latter? I was expecting eth0 or wlan0.

Inside virtual box I've set my network adapter to NAT, Bridged and Host Only but it makes no difference to the resultant Linux machine

As you can guess, I'm a tad new to all this, so any help on getting networking working inside my VM is appreciated.

Many thanks

****edit**: so now I know the new (rather confusing) naming convention, thats good. Been a while since i used Linux. I followed this guide: http://blog.zwiegnet.com/linux-server/configuring-network-centos-6/ but when I run service network restart it fails. Looking at the log it says:

Failed to start LSB: Bring up/down networking.

**

LDJ
  • 101
  • 1
    it is no longer in old ethx format. enp0s3 is your eth0. – Ijaz Ahmad Dec 29 '15 at 13:05
  • what is the ip of your host and what is the ip of enp0s3 on vm – Ijaz Ahmad Dec 29 '15 at 13:08
  • @ljaz: its not showing me an ipv4 address, just an ipv6 address link/ether 08:00:27:21:f7:8c brd ff:ff:ff:ff:ff:ff

    on my host the ip is 192.168.0.4 and the virtual box host only adapter is 192.168.56.1

    – LDJ Dec 29 '15 at 13:19
  • Try a bridged configuration and reboot your vm after that. check the ip addresses again. they should be on the same network. – Ijaz Ahmad Dec 29 '15 at 13:40
  • reverted back t bridged and restarted the VM but its the same – LDJ Dec 29 '15 at 13:53
  • may be you need a demo. https://www.youtube.com/watch?v=KZm-b34OnaY – Ijaz Ahmad Dec 29 '15 at 14:05
  • Thanks. The adapter is visible inside my VM, but I have no networking capability inside the CentOS VM – LDJ Dec 29 '15 at 14:43

2 Answers2

1

Linux currently uses stable names for the network interfaces, depending on where/how the interface is connected to the machine. lo is loopback, enp0s3 is an onboard Ethernet card. Here I have enp0s20u2(Ethernet connected via USB) and wlp3s0 (onboard WiFi).

The previous ethN names could very well change each boot (yes, I happened to suffer from this with a machine with two Ethernet ports, sometimes after updating the kernel or some other, semi-random operations, the names changed and required reconfiguring networking). No so now.

vonbrand
  • 18,253
0

udev changed (ie. ruined) the way it names interfaces to make them (somehow) more predictable. The 'enp0s3' interface you're seeing is your NIC which you're expecting to be named 'eth0'. You can either use it as it is or switch back to the better naming standard by adding the kernel parameter 'net.ifnames=0' to the kernel line of your grub.conf file and rebooting.

David King
  • 3,147
  • 9
  • 23