Skip to content

Instantly share code, notes, and snippets.

@vik-y
Created July 21, 2015 06:30
Show Gist options
  • Save vik-y/cc9d7f01c4a02292933f to your computer and use it in GitHub Desktop.
Save vik-y/cc9d7f01c4a02292933f to your computer and use it in GitHub Desktop.
A code for forwarding
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE #Forward on this interface
iptables -A FORWARD -i wlan0 -j ACCEPT #Tells to accept all connections coming on wlan0
# Works completely fine - Need to test it on OpenVPN
# Here the interface which has internet is eth0
# Need to understand POSTROUTING nad MASQUERADE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment