Created
November 2, 2014 02:47
-
-
Save samos123/dd6c2320507983df8b64 to your computer and use it in GitHub Desktop.
Giving a host only virtualbox network internet access by making the vboxhost a natted router
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
network_with_inet_access=wlan0 | |
private_natted_network=vboxnet1 | |
sudo iptables -t nat -A POSTROUTING -o $network_with_inet_access -j MASQUERADE | |
sudo iptables -A FORWARD -i $private_natted_network -o $network_with_inet_access -m state --state RELATED,ESTABLISHED -j ACCEPT | |
sudo iptables -A FORWARD -i $private_natted_network -o $network_with_inet_access -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment