Docker container to connect to an OpenVPN network. The network is exposed to your host PC using SOCKS5 proxy.
Build the container
./build.sh
Place your OpenVPN config file in the ./config/ directory.
Start the container (Host PC)
./start.sh
Launch your OpenVPN config file (inside container)
launch *.ovpn
On your host PC, access the network using SOCKS5 proxy on port 9050
Halt your OpenVPN instance (inside container)
halt
Stop the container (Host PC)
./stop.sh
The container simply has an OpenVPN installation and a network interface tun0 for it.
Dante SOCKS Server is used. It listens on eth0 (the network from the host PC) and connects to this tun0 network (the OpenVPN network).
Test if it work on your host
curl --socks5 localhost:9050 http://ipinfo.io/
If you can't find danted process in the ps -ef inside container
-
either check the syslog
-
or change
logoutputin/etc/danted.confto a location you can locate easily, such as/var/log/danted/danted.log(you need to make sure the directory exists)
If you find something such as unresolved host tun0 in your danted process's log
- after setup your vpn connection, run
ifconfigto check your interface's name, mine istun0, replace thetun0by your interface name
If you can't find openvpn process in the ps -ef inside container
- run
openvpn --config *.ovpnmanually to see what's going on, it may be caused by wrong password or wrong server configuration
openvpn connected successfully but danted need to be started manually
- For thoese who need manually enter the username and password, 3 seconds may not enough, change
sleep 3tosleep 60inDockerfilebeforebuild, or change it in~/.bashrcmanually