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

I'm using Open vSwitch to create a switched network between virtualBox guest machines, and i want that the host OS (Ubuntu 12.04) join this network and to configure it as the gateway of this virtual network:

First, i created a vswitch and i added ports to tap devices (that virtual machines use them as bridged interfaces):

ovs-vsctl add-br sw0
ovs-vsctl add-port sw0 tap0

After that, i set statically the ip of Lubuntu 12.04 virtual machine :

ifconfig eth0 up
route add -net gw

In the host os side, i also set the ip address :

ifconfig sw0 up

At this time, i can ping from Lubunut to Ubunutu. I want now, in the host machine to use IP masquerade to forward traffic from network to my physical interace (connected to Internet) :

sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -o eth1 -s -j MASQUERADE

So from Lubuntu (the virtual machine), i can ping the Ubuntu eth1 interface, but i cannot reach the real network (e.g: the gateway on real LAN), i have tried :

nslookup google.com
dig @ yahoo.com
dig @ google.com

Network Topology

   Internet (real gw) ------ Host OS -------- vswitch -------- VBox Guest 1
    ip masquerade
                                                 ------------ VBox Guest 2
share|improve this question
Please add any progress if you had. I have the same problem. –  Masood_mj Oct 9 '14 at 15:48

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.