The <path-to-vpn-folder> should contain all the necessary config files for starting the VPN server.
server.ovpn and client.template there.docker run \
--rm -it \
--net host \
--name openvpn-server \
--env EASYRSA_REQ_CN="my.vpn.example.com" \
--env EASYRSA_BATCH="yes" \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
--volume <path-to-vpn-folder>:/opt/openvpn:rw \
fialakarel/openvpn-server:latest
--net host and do --publish 1194:1194/udp if you do not need to modify the host networking.
For example, you need to make secure connection between the clients only.docker run \
--detach \
--restart always \
--net host \
--name openvpn-server \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
--volume <vpn-storage>:/opt/openvpn:rw \
fialakarel/openvpn-server:latest
docker exec openvpn-server create-user <user>
<vpn-storage>/clients/<user>/.<user>-bundle.ovpn contains client configuration and all required certs and keys.crl.pem validity is 10 years.docker exec openvpn-server update-crl
docker exec openvpn-server revoke-certificate <user>
;client-config-dir "/opt/openvpn/client-config" in your server.ovpn.client-config directory on the same level as server.ovpn file is.echo "ifconfig-push 192.168.111.4 255.255.255.0" >client-config/myntb to set static IP to myntb. Please, make sure that the myntb is the existing client (certificate) name.Probably, you will need to masquerade (or routing) your VPN traffic.
# Modify and add this line to your /etc/rc.local
iptables -t nat -A POSTROUTING -s 192.168.111.0/24 ! -o tun0 -j MASQUERADE
Content type
Image
Digest
Size
4.9 MB
Last updated
over 5 years ago
docker pull fialakarel/openvpn-server