Network is unreachable linux virtualbox

CentOS no network interface after installation in VirtualBox

I have Ubuntu 12.10 on which I installed virtual box on which I setup Centos 6.4 i386. On Ubuntu I have: 3.5.0-17-generic kernel running. On virtual box I install Centos 6.4 and everything works fine, however when I boot into VM machine, there is only on loopback interface. Nothing else. I tried to manually add ifcfg-eth0 file but nothing happens. On VM settings I have added NAT and HostOnly interfaces but whenever I boot into Centos there is just lo interface. What should I do?

12 Answers 12

You need to enable networking during installation. You can do it post install as well. This is a change in the CentOS installation in the 6.x versions which throws a lot of people off, including myself.

Starting with CentOS 6.x you can either opt to have NetworkManager manage your network setups or still do it the old fashion way and set them up manually using /etc/sysconfig/network-scripts/ifcfg-eth0 types of files. Given this is a VM I’d recommend using NetworkManager .

To invoke the connection editor tool do the following:

You’ll be presented with a GUI like this:

ss of conn. editor

From this GUI you’ll need to edit the eth0 setup like so:

ss of nm #1

ss of nm #2

ss of nm #3

Without a GUI

If you’re attempting to do this on a headless server you can edit the following files and reboot to get your eth0 networking device to come up enabled and acquire an IP address from a DHCP server. Change these 2 options in the file, /etc/sysconfig/network-scripts/ifcfg-eth0 :

ONBOOT="yes" NM_CONTROLLED="no" 

References

The Without a GUI steps threw me off a bit until I checked out the next few answers. In CentOS min, instead of eth0 it is something else, so please update your answer to ifcfg-XXXX. Also, NM_CONTROLLED was not listed and as the others did not specify it I did not add it so that must be the default. Network is up and running now. If you can also update answer to redirect ‘NO GUI’ guys, or place it above the GUI answer that would be great, as I suspect n/w would be disabled only on min distros, if it is disabled on normal distros, that is questionable as it would befuddle a lot of noobs.

Читайте также:  Top linux all users

@killjoy — what CentOS version are you using. What I showed above was how it was in 2013 when I wrote this up. Things may have changed in newer versions. Also the NM_CONTROLLED is how you can explicitly do this. Hence why I showed it.

@slim — latest 7 version as of the date of the post, in fact some others have different values also. On my work VM, it is ‘-eno’, so yeah I guess it is not a static eth0 as before.

Источник

Out-of-the-box CentOS in VirtualBox (NAT): Network is unreachable [duplicate]

enter image description here

My host is a freshly installed Ubuntu 2013.04, wireless network access worked out-of-the-box so I don’t have any strange network configuration. In VirtualBox 4.2.10, with default (NAT) settings, I installed CentOS 6.4 minimal.
Immediately after install, the first thing I did was ping 173.194.38.98 (google) and I a told connect: Network is unreachable . I tried running /etc/init.d/network start as root, no joy.
I downloaded a VM image and tried it: exact same problem. When I installed Ubuntu and Windows VMs, they are able to access the Internet without any problem.
What’s wrong with this one? On the VM: On the host (values never change, except byte counts):

eth0 Link encap:Ethernet HWaddr f0:de:f1:c0:ad:b3 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:20 Memory:f3900000-f3920000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:32272 errors:0 dropped:0 overruns:0 frame:0 TX packets:32272 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4263162 (4.2 MB) TX bytes:4263162 (4.2 MB) wlan0 Link encap:Ethernet HWaddr 60:d8:19:c9:42:59 inet addr:192.168.0.67 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::62d8:19ff:fec9:4259/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1221151 errors:0 dropped:0 overruns:0 frame:0 TX packets:845193 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1438957835 (1.4 GB) TX bytes:133904229 (133.9 MB) 

Источник

Читайте также:  Linux ssh внешний ip

Network unreachable on Ubuntu guest after trying to set up a host only network on Virtualbox

I have a Mac OS X host and a bunch of guests including Ubuntu and Arch Linux. I was trying to set up a host-only network at eth1 to let me ssh into the system. But now eth0 isn’t working properly either. Ubuntu can no longer connect to remote hosts or browse the internet. It tells me that the network is unreachable. What’s gone wrong here? I’ve included some diagnostics below.

$ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:10968 errors:0 dropped:0 overruns:0 frame:0 TX packets:10968 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:897264 (897.2 KB) TX bytes:897264 (897.2 KB) 
$sudo lspci -n 00:00.0 0600: 8086:1237 (rev 02) 00:01.0 0601: 8086:7000 00:01.1 0101: 8086:7111 (rev 01) 00:02.0 0300: 80ee:beef 00:03.0 0200: 8086:100e (rev 02) 00:04.0 0880: 80ee:cafe 00:05.0 0401: 8086:2415 (rev 01) 00:06.0 0C03: 106B:003F 00:07.0 0680: 8086:7113 (REV 08) 00:0D.0 0106: 8086:2829 (REV 02) $sudo lshw -c network *-network DISABLED description: Ethernet interface product: 82540EM Gigabit Ethernet Controller vendor: Intel Corporation physical id: 3 bus info: pci@0000:00:03.0 logical name: eth0 version: 02 serial: 08:00:27:7d:22:df size: 1Gbit/s capacity: 1Gbit/s width: 32 bits clock: 66MHz capabilities: pm pcix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full firmware=N/A latency=64 link=no mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s resources: irq:19 memory:f0000000-f001ffff ioport:d010(size=8) $lsmod Module Size Used by nls_utf8 12557 1 isofs 40257 1 vboxsf 43743 2 vesafb 13844 1 snd_intel8x0 38570 2 snd_ac97_codec 134869 1 snd_intel8x0 ac97_bus 12730 1 snd_ac97_codec snd_pcm 97275 2 snd_intel8x0,snd_ac97_codec snd_seq_midi 13324 0 snd_rawmidi 30748 1 snd_seq_midi snd_seq_midi_event 14899 1 snd_seq_midi rfcomm 47604 0 snd_seq 61929 2 snd_seq_midi,snd_seq_midi_event bnep 18281 2 bluetooth 180113 10 rfcomm,bnep ppdev 17113 0 psmouse 97519 0 snd_timer 29990 2 snd_pcm,snd_seq joydev 17693 0 snd_seq_device 14540 3 snd_seq_midi,snd_rawmidi,snd_seq vboxvideo 12622 1 serio_raw 13211 0 snd 79041 11 snd_intel8x0,snd_ac97_codec,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device soundcore 15091 1 snd vboxguest 235498 7 vboxsf parport_pc 32866 0 drm 241971 2 vboxvideo i2c_piix4 13301 0 snd_page_alloc 18529 2 snd_intel8x0,snd_pcm mac_hid 13253 0 lp 17799 0 parport 46562 3 ppdev,parport_pc,lp usbhid 47238 0 hid 99636 1 usbhid e1000 108589 0 

Источник

Оцените статью
Adblock
detector