Advertisement
AnrDaemon

vboxnet0 internet NAT

Feb 15th, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. To get network address translation (internet) on the hostonly network of a Linux host?
  2. Assuming default configuration, do the following on the host:
  3. 1. Enable port forwarding
  4. sysctl -w 'net.ipv4.ip_forward=1'
  5. 2. Enable masquerading of the hostonly network
  6. iptables -t nat -A POSTROUTING -s 192.168.56.0/24 ! -d 192.168.56.0/24 ! -d 127.0.0.0/8 -j MASQUERADE
  7. 3. Write down your DNS server IP's and supply them to the guests.
  8. 4. Tell guests that 192.168.56.1 is their default gateway.
  9. Now, you should have internet in the hostonly network.
  10. This is one-time change, and will reset after reboot.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement