Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to set up two virtual networks(different subnets) to test site to site VPN in my Laptop. My host OS is Debian Wheezy and i am using Virtual box to virtualise my setup. I have two aliased private IP addresses on my host NIC along with a public IP address assigned from ISP provider. Below is my interface file.


 # The loopback network interface
 auto lo
 iface lo inet loopback

 # The primary network interface
 allow-hotplug eth0
 iface eth0 inet dhcp

 auto eth0:1
 iface eth0:1 inet static

 auto eth0:2
 iface eth0:2 inet static

Output of command "ip a"(only the relevant parts)

 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
   link/ether 00:1b:38:99:c3:22 brd ff:ff:ff:ff:ff:ff
   inet brd scope global eth0:1
   inet brd scope global eth0:2
   inet brd scope global eth0
   inet6 fe80::21b:38ff:fe99:c322/64 scope link 
   valid_lft forever preferred_lft forever

Output of command "ip r"

default via dev eth0 dev eth0  proto kernel  scope link  src dev eth0  proto kernel  scope link  src dev eth0  proto kernel  scope link  src dev vboxnet0  proto kernel  scope link  src dev vboxnet1  proto kernel  scope link  src dev vboxnet2  proto kernel  scope link  src 

Now i have two VM's bridged to eth0 of host. VM Ip address details.

VM1 --- IP Address -->
VM2 --- IP Address -->

I can ping both the VM's from the host. Even i can access internet from both the VM's as i have a iptables MASQUERADE rule and ip forwarding enabled on the host.

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

sandy@sdebby:~$ sudo iptables -t nat -nvL POSTROUTING
Chain POSTROUTING (policy ACCEPT 47 packets, 2928 bytes)
pkts bytes target     prot opt in     out     source               destination         
1629  103K MASQUERADE  all  --  *      eth0   

sandy@sdebby:~$ sudo sysctl -p
net.ipv4.ip_forward = 1

But i can't ping one VM from the other and vice versa. All firewall rules are disabled on the VM's. When i do a tcpdump on the outer interface of the VM, i can see its receiving only icmp echo requests but not replying back. Below is the tcpdump output.

Tcpdump on VM1( while pinging from VM2(

[Expert@fw1-gw1]# tcpdump -ni eth0 host
tcpdump: listening on eth0
12:13:29.435073 > icmp: echo request (DF)
12:13:30.461966 > icmp: echo request (DF)
12:13:31.511685 > icmp: echo request (DF)

Tcpdump on VM2( while pinging from VM1(

[Expert@fw1-gw2]# tcpdump -ni eth0 host
tcpdump: listening on eth0
12:15:55.228300 > icmp: echo request (DF)
12:15:56.270639 > icmp: echo request (DF)
12:15:57.295431 > icmp: echo request (DF)

I have checked each VM can reach till the gateway of the other VM but not beyond that. So, i am suspecting that my routes are not working although they seems to be proper to me.

Do you see anything that i am missing? Any help will be highly appreciated.

Otherwise i will have to change my setup to keep both the VM's in same network, and i will be very unhappy with that.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.