Posts tagged with “openvpn”

How make openvpn work with docker & avoid entering the password every time

I met this issue today morning and find the solution from the link I just refered.

I have made a few change to the solution to meet my case, this is why I wrote this article.

My version of

echo "Adding custom route to $route_vpn_gateway with /24 mask..."
# ip route add via $route_vpn_gateway
ip route add via $route_vpn_gateway

echo "Removing /1 routes..."
ip route del via $route_vpn_gateway
ip route del via $route_vpn_gateway

I didn't use ip route add default via $route_vpn_gateway line because I didn't want to route everything through my VPN.

Changes to my openvpn profile

You can see I added an extra askpass line besides what the author has done. That line was added to help me get ride of the annoyance of entering the password for my private key every time I run the openvpn client program.

auth SHA256
verb 3
askpass /home/davidwei/ovpn/pass.txt
script-security 2
route-up /etc/openvpn/

My ovpn start one-line script

[email protected]:~$ cat ~/bin/ovpn 
sudo openvpn ~/shukebeta.ovpn > /dev/null 2>&1 &

My pass.txt

[email protected]:~$ cat ~/ovpn/pass.txt