Sorting by

×
zorruno wikki: OpenVPNSetup with Docker

Revision [5181]

This is an old revision of OpenVPNDocker made by ZorrUno on 2020-02-09 08:18:44.

 

OpenVPNSetup with Docker


Using information from: https://hub.docker.com/r/linuxserver/openvpn-as/

Note this the web setup is non-free and allows two clients only (unless paid). OpenVPN itself is free however.

Get the container up

Use this docker-compose.yml

Put the right details for your mapped docker storage in the volumes section

version: "2"
services:
  openvpn-as:
	image: linuxserver/openvpn-as
	container_name: openvpn-as
	cap_add:
	  - NET_ADMIN
	environment:
	  - TZ=Pacific/Auckland
	volumes:
	  - /dockervolumes/openvpn-as:/config
	ports:
	  - 943:943
	  - 9443:9443
	  - 1194:1194/udp
	restart: unless-stopped


run
docker-compose up -d


Set up the web interface

Probably set up the security before port forwarding. Go to https://ipaddressofserver:943/admin
Default username/pass is admin/password

Go into the User Permissions menu on the left

Create a new user and give it Admin permissions. Save Settings.

Click 'More Settings' for the Admin user, and give it a password.

Go down to access control (Use NAT should be set) and give the networks you want to the user to be able to access when connected, eg 192.168.1.0/24 (add multiple subnets one below the other)

Log out of web interface and log in again as new user.

Go to user management and 'Deny Access' or delete the admin user.

Other (Optional)
You can set network addressing in Configuration/VPN Settings menu.
You can choose how DNS service is allocated in Configuration/VPN Settings menu
You can set default routing, rather than user specific settings in Configuration/VPN Settings menu

Do some port forwarding in your router

Forward these ports in your router to your server running docker. Note that 943 is the web interface - you will need to forward this and expose the this to the outside world to get the clients up and running, but can then turn it off.

Forward
1194:UDP
9443:TCP
943:TCP

Set up the Android App

You will need the external address or domain name of your server (IP address via whatsmyip.com or dyndns etc)

Install the OpenVPN Connect app on your phone, it is this one
https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=en

Run the app and add a profile with the + button

it will ask for the url. If your IP is 122.50.5.11, you'll use:

https: 122.50.5.11:943







--
CategoryMicrocontrol
CategoryHomeAutomation
CategoryRaspberryPi
CategoryLinux