daily pastebin goal
60%
SHARE
TWEET

command

a guest Sep 19th, 2017 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. PROXY_IP=192.168.1.137
  3. PROXY_PORT=8888
  4. LAN_IP=`nvram get lan_ipaddr`
  5. LAN_NET=$LAN_IP/`nvram get lan_netmask`
  6. iptables -t nat -A PREROUTING -i br0 -s $LAN_NET -d $LAN_NET -p tcp --dport 80 -j ACCEPT
  7. iptables -t nat -A PREROUTING -i br0 -s ! $PROXY_IP -p tcp --dport 80 -j DNAT --to $PROXY_IP:$PROXY_PORT
  8. iptables -t nat -A PREROUTING -i br0 -s $LAN_NET -d $LAN_NET -p tcp --dport 9292 -j ACCEPT
  9. iptables -t nat -A PREROUTING -i br0 -s ! $PROXY_IP -p tcp --dport 9292 -j DNAT --to $PROXY_IP:$PROXY_PORT
  10. iptables -t nat -A PREROUTING -i br0 -s $LAN_NET -d $LAN_NET -p tcp --dport 8001 -j ACCEPT
  11. iptables -t nat -A PREROUTING -i br0 -s ! $PROXY_IP -p tcp --dport 8001 -j DNAT --to $PROXY_IP:$PROXY_PORT
  12. iptables -t nat -I POSTROUTING -o br0 -s $LAN_NET -d $PROXY_IP -p tcp -j SNAT --to $LAN_IP
  13. iptables -I FORWARD -i br0 -o br0 -s $LAN_NET -d $PROXY_IP -p tcp  -m multiport --dports $PROXY_PORT -j ACCEPT
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top