Last active
March 18, 2018 20:49
-
-
Save lattice0/ef3812f0c20f3b2ed27d1767ab81dea5 to your computer and use it in GitHub Desktop.
This file contains 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
#On host machine | |
iptables -F | |
iptables -F -t nat | |
echo 1 >| /proc/sys/net/ipv4/ip_forward | |
iptables -t nat -A PREROUTING -p tcp -d 192.168.122.1 --dport 5037 -j DNAT --to localhost:5037 | |
iptables -t nat -A PREROUTING -p tcp -d localhost --dport 19000 -j DNAT --to 192.168.122.99:19000 | |
iptables -t nat -A POSTROUTING -j MASQUERADE | |
#On virtual machine | |
iptables -F | |
iptables -F -t nat | |
echo 1 >| /proc/sys/net/ipv4/ip_forward | |
iptables -t nat -A PREROUTING -p tcp -d localhst --dport 5037 -j DNAT --to 192.168.122.1:5037 | |
iptables -t nat -A POSTROUTING -j MASQUERADE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment