2
Here's my situation:
- an Ubuntu 12.04 Host running VirtualBox;
- two guest VMs running Ubuntu Server 12.04
- home network, so my Host pc has a wireless connection to the router of my ISP.
My problem is in one of the virtual machines: it has 3 NICs, one in NAT mode and the others in Host Only mode. My purpose is to use eth0 (NAT) for Internet access and eth1, eth2 (Host Only) for management of internal virtual network (eth1 uses a VBoxNet with this IP 192.168.69.254).
Whenever I try to $ping 8.8.8.8
I get Destination Host Unreachable
.
While if I $ping 192.168.69.10
, that is the IP of the other VM, it works.
I can't also ping my Host nor my router
My /etc/network/interfaces
file is:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.69.1
netmask 255.255.255.0
auto eth2
iface ifconfig $IFACE 0.0.0.0 up
up ip link set $IFACE promisc on
down ip link set $IFASE promisc off
down ifconfig $IFACE down
$route -n
returns:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.2.2 0.0.0.0 UG 100 0 0 eth0
10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.69.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
Forgetting for now what eth2 needs to do and its setup, why I can't go outside the Host box?
What can I do to help you helping me? :-)
-Edit-
On my Host:
$ ifconfig -a
eth0 Link encap:Ethernet IndirizzoHW 00:26:9e:d5:1a:bb
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
collisioni:0 txqueuelen:1000
Byte RX:0 (0.0 B) Byte TX:0 (0.0 B)
eth1 Link encap:Ethernet IndirizzoHW c4:17:fe:17:31:b3
indirizzo inet:192.168.1.186 Bcast:192.168.1.255 Maschera:255.255.255.0
indirizzo inet6: fe80::c617:feff:fe17:31b3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1774067 errors:3 dropped:0 overruns:0 frame:3371346
TX packets:1486276 errors:266 dropped:0 overruns:0 carrier:0
collisioni:0 txqueuelen:1000
Byte RX:1642836807 (1.6 GB) Byte TX:170395284 (170.3 MB)
Interrupt:16
lo Link encap:Loopback locale
indirizzo inet:127.0.0.1 Maschera:255.0.0.0
indirizzo inet6: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:9119 errors:0 dropped:0 overruns:0 frame:0
TX packets:9119 errors:0 dropped:0 overruns:0 carrier:0
collisioni:0 txqueuelen:0
Byte RX:1089979 (1.0 MB) Byte TX:1089979 (1.0 MB)
vboxnet0 Link encap:Ethernet IndirizzoHW 0a:00:27:00:00:00
indirizzo inet:192.168.69.254 Bcast:192.168.69.255 Maschera:255.255.255.0
indirizzo inet6: fe80::800:27ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:2314 errors:0 dropped:0 overruns:0 carrier:0
collisioni:0 txqueuelen:1000
Byte RX:0 (0.0 B) Byte TX:345450 (345.4 KB)
vboxnet1 Link encap:Ethernet IndirizzoHW 0a:00:27:00:00:01
indirizzo inet:192.168.57.1 Bcast:192.168.57.255 Maschera:255.255.255.0
indirizzo inet6: fe80::800:27ff:fe00:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:2082 errors:0 dropped:0 overruns:0 carrier:0
collisioni:0 txqueuelen:1000
Byte RX:0 (0.0 B) Byte TX:331256 (331.2 KB)
can you show the output of ifconfig -a on the host? – MariusMatutiae – 2013-10-24T09:47:17.490
Is there a reason why you're using NAT for eth0 instead of bridged? – Der Hochstapler – 2013-10-24T10:16:05.163
@Oliver Salzburg Can you bridge over wlan0? His host is connected to his router via wifi – MariusMatutiae – 2013-10-24T10:18:13.093
@Danidan Could you just make an experiment? Comment out all lines referring to eth1 and eth2 in /etc/network/interfaces on your guest, and restart the VM. Can you connect to the internet right now? – MariusMatutiae – 2013-10-24T10:21:18.680
@MariusMatutiae: I don't see why not, but I've never tried. – Der Hochstapler – 2013-10-24T10:25:14.983
@MariusMatutiae I edited the question with
ifconfig -a
as you requested. Also I commented the lines you said in my guest VM and nothing changed... – Danidan – 2013-10-24T10:47:24.930@Oliver Salzburg read David Schwartz's reply at the bottom of this page http://superuser.com/questions/597834/bridging-wifi-to-ethernet-on-ubuntu-not-working
– MariusMatutiae – 2013-10-24T10:49:20.450@OliverSalzburg I tried also bridged but with no luck. Furthermore I added port forwarding on port 80 in NAT mode... – Danidan – 2013-10-24T10:49:22.953
@Danidan Back in NAT mode, try running
ifconfig
inside the guest to find out ifeth0
got a valid IP address. Then, from the guest, try to ping the host (which should be 10.0.2.2, based on your routing table). Does the host system respond to ping? – user149408 – 2014-02-13T12:07:43.580