0

I am trying to configure a tun2socks server that forwards all traffic to an external proxy found online. I also want to retain the ability to ssh into the server so I had to take this into consideration. So far the steps I have gathered are the following:

  1. Download the latest release of tun2socks from github
  2. ip tuntap add mode tun dev tun0
  3. ip addr add 198.18.0.1/15 dev tun0
  4. ip link set dev tun0 up
  5. ip route del default
  6. ip route add default via 198.18.0.1 dev tun0 metric 1
  7. ip route add default via 172.17.0.1 dev eth0 metric 10
  8. iptables -t nat -A PREROUTING -i eth0 -d 172.17.0.1 -j DNAT --to 192.18.0.1
  9. iptables -A FORWARD -i eth0 -d 172.17.0.1 --dport 22 -j REJECT
  10. iptables -A FORWARD -i eth0 -d 172.17.0.1 -j ACCEPT
  11. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  12. sudo ./tun2socks-linux-amd64-v3 -device tun://tun0 -proxy socks5://external-proxy:port

What am I doing wrong? I know there are a lot of commands here but it seems like there should be some instructions somewhere for this.

0 Answers0