mook / docker-openvpn-client-socks

OpenVPN client tied to SOCKS proxy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working

alecrobertson1 opened this issue · comments

I've run using docker run and the Initialization Sequence completes but the proxy is not accessible, e.g. running curl --proxy socks5://local.docker:1081 ipinfo.io, nothing happens. Setting up the proxy in browsers results in webpages not being able to load.

commented

Hi there,

In order to troubleshoot this, could you give me the full command line you used for docker run? Also, don't daemonize it, and paste the output too. (Please feel free to censor hostnames and the like.)

The key is having the relevant capabilities and --publish so it's exposed, I think.

(curl is usually the better test, yes. If you're not publishing, though, the in-container interface listens on port 1080; I just have it set to be exposed on 1081 on the host.)

Hi there.

Here's the full command line for docker run:

docker run -t -i --device=/dev/net/tun --cap-add=NET_ADMIN --volume /Users/Gigabit/Desktop/London1.ovpn:/ovpn.conf:ro mook/openvpn-client-socks

Output:

Tue Sep 13 21:05:23 2016 OpenVPN 2.3.10 x86_64-alpine-linux-musl [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Jan 26 2016
Tue Sep 13 21:05:23 2016 library versions: OpenSSL 1.0.2e 3 Dec 2015, LZO 2.09
Enter Auth Username:username
Enter Auth Password:
Tue Sep 13 21:05:31 2016 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Tue Sep 13 21:05:31 2016 UDPv4 link local: [undef]
Tue Sep 13 21:05:31 2016 UDPv4 link remote: [AF_INET]94.229.68.210:443
Tue Sep 13 21:05:31 2016 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Tue Sep 13 21:05:31 2016 VERIFY OK: depth=1, C=GB, ST=LN, L=London, O=vpnsvc, OU=vpnsvc, CN=vpnsvc.com, name=vpnsvc, emailAddress=noc@vpnsvc.com
Tue Sep 13 21:05:31 2016 VERIFY OK: nsCertType=SERVER
Tue Sep 13 21:05:31 2016 VERIFY OK: depth=0, C=GB, ST=LN, L=London, O=vpnsvc, OU=vpnsvc, CN=vpnsvc, name=vpnsvc, emailAddress=noc@vpnsvc.com
Tue Sep 13 21:05:52 2016 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Tue Sep 13 21:05:52 2016 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Sep 13 21:05:52 2016 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Tue Sep 13 21:05:52 2016 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Sep 13 21:05:52 2016 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Tue Sep 13 21:05:52 2016 [vpnsvc] Peer Connection Initiated with [AF_INET]94.229.68.210:443
Tue Sep 13 21:05:54 2016 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:5: block-outside-dns (2.3.10)
Tue Sep 13 21:05:54 2016 TUN/TAP device tun0 opened
Tue Sep 13 21:05:54 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Sep 13 21:05:54 2016 /sbin/ip link set dev tun0 up mtg 1500
Tue Sep 13 21:05:54 2016 /sbin/ip addr add dev tun0 10.10.20.67/26 broadcast 10.10.20.127
Tue Sep 13 21:05:54 2016 /usr/local/bin/sockd.sh tun0 1500 1542 10.10.20.67 255.255.255.192 init
Tue Sep 13 21:05:55 2016 Initialization Sequence Completed

Not to worry, I've fixed it. Turns out I've been pretty stupid.

Running docker run --rm --tty --interactive --device=/dev/net/tun --cap-add=NET_ADMIN --publish 127.0.0.1:1081:1080 --volume "/Users/Gigabit/Desktop/London1.ovpn:/ovpn.conf:ro" mook/openvpn-client-socks works perfectly.

What I might suggest is modifying the readme to make it perhaps a little bit clearer that you need to run it as above.

commented

People aren't stupid, code and (lack of) docs are.

Added --publish in 425f86a

I'm surprised that it works on a mac - good to know.