Thursday, October 18, 2018

Help please! Openvpn to socks5, how to setup server?

To moders: i had posted here yesterday, but not yet passed moderation because my account is too young. So i read "You are welcome to resubmit your thread or comment in ~24 hrs or so" and try now resubmit.

There is my post (little modified)

Hello guys! Can you help me?

I have multiple VPS: SERVER1 with openvpn , SERVER2 - just ssh, SERVER3 - socks5, etc

I want to connect to openvpn with same client config (without any edit on client side), but get IP at the end from SERVER2/SERVER3/etc and be able to change fast it.

I think that i must setup transparent proxy that redirect all traffic throw local socks5 (ssh tunnel from SERVER1 to SERVER2) or remote socks5 (SERVER3).

CLIENT (permanent openvpn config) - SERVER1 (VPN tun0) - SERVER1 (LOCAL TRANSPARENT SOCKS5) - SERVER2 (SSH TUNNEL) - INTERNET

or

CLIENT (permanent openvpn config) - SERVER1 (VPN tun0) - SERVER1 (LOCAL TRANSPARENT SOCKS5) - SERVER3 (REMOTE SOCKS5) - INTERNET

Is there any way to redirecting UDP or just TCP awailable ? I read that it can possible to use shadowsocks-libev as transparent udp proxy -https://github.com/shadowsocks/shadowsocks-libev / https://hub.docker.com/r/gists/shadowsocks-libev/ , but i can't understand how to setup routing propertly.

I am found this

#!/bin/sh _trans_port="9040" _int_if="tun0" iptables -t nat -A PREROUTING -i $_int_if -p udp --dport 53 -j REDIRECT --to-ports 53 iptables -t nat -A PREROUTING -i $_int_if -p tcp --syn -j REDIRECT --to-ports $_trans_port 

"By the way, remember this code. This is a universal way to redirect all traffic from a given network card through a transparent proxy" (r)

How i can do this? What port number i need to setup.

Can you post practical examples?

Thank you.



No comments:

Post a Comment