docker openvpn ubuntu 16.04











first create a variable for assign the name volume docker

Terminal:
OVPN_DATA="ovpn-data-example"

we create to volume
Terminal:
docker volume create --name $OVPN_DATA

run the docker specif the domain of you server
Terminal:
docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://VPN.SERVERNAME.COM
generate certificates
Terminal:
docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn ovpn_initpki

start the vpn process
Terminal:
docker run -v $OVPN_DATA:/etc/openvpn -d -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn

create client without password
Terminal:
docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn easyrsa build-client-full CLIENTNAME nopass

create client with password
Terminal:
docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn easyrsa build-client-full CLIENTNAME

insert the configuration client the file

Terminal:
docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_getclient CLIENTNAME > CLIENTNAME.ovpn


full command
Terminal:
OVPN_DATA="ovpn-data-server" && CLIENTNAME=phone && sudo docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm -it kylemanna/openvpn easyrsa build-client-full $CLIENTNAME nopass && sudo docker run -v $OVPN_DATA:/etc/openvpn --log-driver=none --rm kylemanna/openvpn ovpn_getclient $CLIENTNAME > $CLIENTNAME.ovpn && cp $CLIENTNAME.ovpn /tmp/



client android or windows with openvpn application

client linux

Terminal:
sudo apt-get install openvpn


actually the client linux have a bug is necessary specif comp-lzo no
Terminal:
sudo openvpn --config CLIENTNAME.ovpn --comp-lzo no

connect without redirect
Terminal:
sudo openvpn --config CLIENTNAME.ovpn --comp-lzo no --pull-filter ignore redirect-gateway


or with gui client










client configuration no route all traffic through vpn server

remove this in file:
Terminal:
redirect-gateway def1

add this in file:

Terminal:
pull-filter ignore "dhcp-option DNS"
pull-filter ignore "route"
route-nopull
route 10.0.0.0 255.255.0.0



cliente connect check






0 comentarios :