docker-openvpn-client-socks icon indicating copy to clipboard operation
docker-openvpn-client-socks copied to clipboard

SOCKS proxy only accessible from host

Open psamim opened this issue 5 years ago • 4 comments

Hi,

I can run the container successfully and it works fine from host but I cannot connect to it from other IPs on the same local network.

Thanks,

psamim avatar May 30 '19 15:05 psamim

I too am experiencing the same issue. From the local machine things work fine, but from any other device on the local network I cannot get a response from the SOCKS5 proxy. I've made sure to open the firewall ports on 1080 tcp+udp, and I've tried many other ideas but nothing seems to work. Any suggestions?

xorr0 avatar Feb 24 '20 20:02 xorr0

my current implementation is using gost to forward socks from docker. btw i'm using this dockerfile

$> gost -L=:6666 -F socks4://127.0.0.1:1080

where 127.0.0.1:1080 is address from container openvpn proxy, and you're running gost from your current os.

afdalwahyu avatar Mar 31 '20 06:03 afdalwahyu

That is correct; the start script has --publish on 127.0.0.1. If you want to make it work outside, start by changing that (but I haven't tried it recently, so it might not work).

mook avatar Oct 03 '20 23:10 mook

Hi, I wrote my own script for this.

#!/bin/bash

if [ ! -z $SUBNET ]; then
        ip route add "$SUBNET"/24 via 172.20.0.1 dev eth0  
        [ $? -eq 1 ] && echo Subnet "$SUBNET"/24 tunneled! 
        echo "Subnet script ran"
fi

Make sure to adjust the SUBNET variable and your gateway. You can find out the device ip by grepping but I forgot where I coded that

antoniozh avatar Jun 30 '21 16:06 antoniozh