- to forward packets from wifi network to cellular network
Use with redsocks (https://github.com/darkk/redsocks)
sudo iptables -t nat -N REDSOCKS
sudo iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 192.168.0.0/16 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 224.0.0.0/4 -j RETURN
sudo iptables -t nat -A REDSOCKS -d 240.0.0.0/4 -j RETURN
sudo iptables -t nat -A REDSOCKS -p tcp -j REDIRECT --to-ports 12345
sudo iptables -t nat -A REDSOCKS -p udp -j REDIRECT --to-ports 10053
sudo iptables -t nat -A OUTPUT -p tcp -m owner --gid-owner socksified -j REDSOCKS
sudo iptables -t nat -A OUTPUT -p udp -m owner --gid-owner socksified -j REDSOCKSUse with tun2socks (https://github.com/xjasonlyu/tun2socks)
sudo ip tuntap add mode tun dev tun0
sudo ip link set dev tun0 up
sudo ip addr add 192.168.66.1 dev tun0sudo ip route add default dev tun0./tun2socks-linux-amd64 -device tun://tun0 -proxy socks5://192.168.36.14:4441