Created
April 15, 2015 03:46
-
-
Save tomdavidson/e18df4beeed367d32fc4 to your computer and use it in GitHub Desktop.
Android route hotspot traffic over vpn
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
##!/system/bin/sh | |
iptables -t filter -F FORWARD | |
iptables -t nat -F POSTROUTING | |
iptables -t filter -I FORWARD -j ACCEPT | |
iptables -t nat -I POSTROUTING -j MASQUERADE | |
ip rule add from 192.168.43.0/24 lookup 61 | |
ip route add default dev tun0 scope link table 61 | |
ip route add 192.168.43.0/24 dev wlan0 scope link table 61 | |
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, could you tell me what can I do when I don't want to route all (internet) traffic but only set routes to my networks behind VPN server (10.0.10.0/24 192.168.100.0/24 etc)?