Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two virtual machines running on virtual box. The master has one interface(eth0) bridged to the host nic(eth0) and another one connected to the internal network(eth1). This acts as a gateway to the internal network. The second virtual machine is connected to the internal network only (using eth0).

I cant seem to access the internet from the second virtual machine nor can i do ping -I eth1 for example.

Here is the script i use to setup nat

iptables -A FORWARD -i eth1 -j ACCEPT
iptables -A FORWARD -o eth1 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth1 -j ACCEPT

I dont know what i am doing wrong please help.




share|improve this question

migrated from Nov 14 '13 at 14:53

This question came from our site for system and network administrators.

What is the output of 'route -n'? – ethrbunny Nov 14 '13 at 13:33
route -n is showing the gateway as (which is correct). I can ping both the interfaces on master ( and I cant however ping the machine that is hosting the virtual machines ( nor can i ping Both result in ping returning destination host prohibited. – qwrty Nov 15 '13 at 5:44
Hello, i disabled iptables on the server and rebooted the machine, ran the nat script posted above and everything works perfectly :) thanks for your help. – qwrty Nov 15 '13 at 6:06

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.