Created
February 7, 2018 09:28
-
-
Save nyrahul/a6ba884c9ab67318bd4f9027b9fdbe72 to your computer and use it in GitHub Desktop.
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 | |
[[ "`whoami`" != "root" ]] && echo "Got to be root. Use sudo." && exit | |
export LOG_LEVEL=DBG | |
export OVERRIDE_IP=192.168.100.100 | |
./server_proxy & | |
sleep 1 | |
sysctl -w net.ipv4.ip_forward=1 | |
iptables -t nat -C POSTROUTING -j MASQUERADE -s $OVERRIDE_IP | |
if [ $? -ne 0 ]; then | |
iptables -t nat -A POSTROUTING -j MASQUERADE -s $OVERRIDE_IP | |
fi | |
ifconfig mpti0 up | |
ip route add $OVERRIDE_IP/32 dev mpti0 | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment