1

I'm using two hosts, one under Ubuntu 14.04 x64, the other under Ubuntu 15.10 x64. Both are up to date. I'm running on each machine the same VirtualBox version : 5.0.16 r105871, installed from the official repository.

I have two VMs, both Debian i586, both with VirtualBox additions installed on it :

  • one with 2 virtual network cards : the 1st is NAT-ed (with the traditional IP 10.0.2.15), the 2nd is on the internal network called intnet. I manually assign the IP address 192.168.0.1 to this NIC ;

  • one with 1 virtual network card, on the same internal network called intnet. I manually assign the IP address 192.168.0.2 to this NIC.

My purpose is educative : showing to students how to build a router, a firewall, etc.

Until recently, I could perfectly communicate between the two VMs : for example, ping 192.168.0.2 was OK from 192.168.0.1 and ping 192.168.0.1 was OK from 192.168.0.2. But for some weird reason, it is now impossible (error destination host unreachable)... but only on my Ubuntu 14.04 host ! Everything remains OK on my Ubuntu 15.10 hosts !

Weirder : if I run ping 192.168.0.2 on 192.168.0.1, and I run tcpdump -i eth0 on 192.168.0.2, I see ARP requests "who-has 192.168.0.2 tell 192.168.0.1" !

Weirder and weirder : I created 2 more VMs, with no virtual disk, just booting on SystemRescueCD ISO image. Same idea : one VM with 2 NICs, one NAT and the 2nd on intnet, the other VM with 1 NIC on intnet. I manually set the same IPs, and the result is the same : no ping... But suddenly the manual settings of the IPs vanish in the air (DHCP client on SystemRescueCD ? I thus stopped the service NetworkManager, which seems to address this peculiar problem, but without the slightest effect on my main difficulty). As I refixed the IP, I sometimes get one ping passing through, and getting an answer ! That's all. After this 1st success, it all fails. But tcpdump on 192.168.0.2 shows ICMP reply from 192.168.0.2 to 192.168.0.1... while 192.168.0.1 does not show anything !

Precision : routes are OK. And they are logically useless here, as the 2 VMs are on the same network.

It's driving me crazy...

There is undoubtly a bug, certainly in Ubuntu 14.04. I really need this VMs to communicate on my laptop - the host running under Ubuntu 14.04. Any help would be very appreciated. Thanks in advance.

2
  • This morning everything works. I cannot understand what happened. Computers are deterministic, but sometimes way beyond human thinking...
    – natsirt
    Commented Mar 17, 2016 at 10:36
  • This afternoon the problem is back. It makes me really mad. I suspect a nasty bug between Ubuntu 14.04 (as host) and VirtualBox 5.0.16. Could someone using Ubuntu 14.04 install VirtualBox and test ? It would be very nice...
    – natsirt
    Commented Mar 17, 2016 at 18:25

1 Answer 1

0

Try this: On the one with 2 netcards create a network.sh file and put this in it:

#!/bin/sh
 echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT 
/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

Then on the client machine set the default gateway to 192.168.0.1:

route del default
route add default gw 192.168.0.1

Hope this helps. It works for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .