Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To get network address translation (internet) on the hostonly network of a Linux host?
- Assuming default configuration, do the following on the host:
- 1. Enable port forwarding
- sysctl -w 'net.ipv4.ip_forward=1'
- 2. Enable masquerading of the hostonly network
- 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
- 3. Write down your DNS server IP's and supply them to the guests.
- 4. Tell guests that 192.168.56.1 is their default gateway.
- Now, you should have internet in the hostonly network.
- This is one-time change, and will reset after reboot.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement