0

I have an OpenVPN server running on a VPS with OpenVPN client running on my computer. I'm trying to route my client's traffic over an external 4g proxy after it reaches the OpenVPN server so my vps IP is not exposed. I want it like this :

COmputer<-->VPN<-->Socks5<-->Internet

I figured out the best way is redsocks+iptables : Here are the current iptables rules for the 'nat' table

  redsocks {
  
        local_ip = 0.0.0.0;
        local_port = 12345;

       
        ip = xxx.xxx.xxx.xx;
        port = 15259;
      
        type = socks5;

         login = "xxx";
         password = "xxxx";

And the iptables :

   *nat
-P PREROUTING ACCEPT
-P INPUT ACCEPT
-P OUTPUT ACCEPT
-P POSTROUTING ACCEPT
-N REDSOCKS
-A REDSOCKS -d 0.0.0.0/8 -j RETURN
-A REDSOCKS -d 100.64.0.0/10 -j RETURN
-A REDSOCKS -d 127.0.0.0/8 -j RETURN
-A REDSOCKS -d 169.254.0.0/16 -j RETURN
-A REDSOCKS -d 172.16.0.0/12 -j RETURN
-A REDSOCKS -d 192.168.0.0/16 -j RETURN
-A REDSOCKS -d 198.18.0.0/15 -j RETURN
-A REDSOCKS -d 224.0.0.0/4 -j RETURN
-A REDSOCKS -d 240.0.0.0/4 -j RETURN
-A REDSOCKS -d xxx.xxx.xxx.xx/32 -j RETURN
-A REDSOCKS -p tcp -j REDIRECT --to-ports 12345
-A OUTPUT -p tcp -j REDSOCKS
-A PREROUTING -i tun0 -p tcp -j REDSOCKS
-A POSTROUTING -s 10.8.0.0/24 -o ens160 -j MASQUERADE

It is not working, what am I missing?

0

You must log in to answer this question.

Browse other questions tagged .