Skip to content

Instantly share code, notes, and snippets.

@vzool
Last active June 30, 2016 21:40
Show Gist options
  • Save vzool/13c193005c100c77ad8e08c6a30167de to your computer and use it in GitHub Desktop.
Save vzool/13c193005c100c77ad8e08c6a30167de to your computer and use it in GitHub Desktop.
iptables Rules to forward clients into openvpn tunnel (WiFi Pineapple)
#!/bin/bash
iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o tun0 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o tun0 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i tun0 -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment