1

I have some socks5 proxy and I am able to create tunnel using https://github.com/ambrop72/badvpn/wiki/Tun2socks. Also I have openvpn server on the same machine.

The question is how to implement client -> openvpn -> tun2socks (socks5) connection? How to add, like, default gateway for openvpn server? I've created tun2socks tunnel using

ip tuntap add dev tun51 mode tun user root
ifconfig tun1 10.0.0.1 netmask 255.255.255.0
/root/badvpn-build/tun2socks/badvpn-tun2socks --tundev tun51 --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr x.x.x.x:port
route add (x.x.x.x socks server ip) (y.y.y.y eth0 gateway) metric 5

For openvpn - I used https://github.com/angristan/openvpn-install, so I have 10.8.0.0 network: gateway is 10.8.0.1 and client is 10.8.0.2.

So what routes should I add? Or what settings should I apply?

Stuggi
  • 3,506
  • 4
  • 19
  • 36
iwex
  • 111
  • 5

1 Answers1

0

Solved it using policy based routing.

ip route add default via 10.0.0.2 table 101
ip rule add from 10.8.0.2 table 101
iwex
  • 111
  • 5