4 .
/etc
/conf.d
/transocks
9 stat_busy
"Enabling transocks"
10 /usr
/bin
/transocks_ev
-p $TRANSOCKS_PORT -s $SOCKS_PORT -S $SOCKS_HOST
13 $IPTABLES -t nat
-N transocks
15 # Do not redirect traffic for the SOCKS-Server
16 $IPTABLES -t nat
-I transocks
-p tcp
-d $SOCKS_HOST --dport $SOCKS_PORT -j RETURN
18 # Do not redirect local network
19 $IPTABLES -t nat
-I transocks
-o lo
-j RETURN
20 for ip
in $LOCAL_IPS; do
21 $IPTABLES -t nat
-I transocks
-d $ip -j RETURN
25 if [ "${ENABLE_LOGGING}" == "y" ]; then
26 $IPTABLES -t nat
-A transocks
-p tcp
-j LOG
--syn --log-level info
--log-prefix "SOCKSify "
28 # Redirect all traffic that gets to the end of our chain
29 $IPTABLES -t nat
-A transocks
-p tcp
-j REDIRECT
--to-port $TRANSOCKS_PORT
31 # Filter all traffic from this computer
32 $IPTABLES -t nat
-A OUTPUT
-j transocks
34 # Filter all traffic that is routed over this host
35 if [ "${ENABLE_ROUTING}" == "y" ]; then
36 $IPTABLES -t nat
-A PREROUTING
-j transocks
42 stat_busy
"Disabling transocks"
43 /usr
/bin
/killall transocks_ev
44 $IPTABLES -t nat
-D OUTPUT
-j transocks
45 if [ "${ENABLE_ROUTING}" == "y" ]; then
46 $IPTABLES -t nat
-D PREROUTING
-j transocks
48 $IPTABLES -t nat
-F transocks
49 $IPTABLES -t nat
-X transocks
59 echo "usage: $0 {start|stop|restart}"