Launch your VPN using Docker under a minute
You might be wondering that having your own VPN is very hard to configure, we thought that too. You will be surprised to know that as long as you have af_key module.
You can check it by issuing following command
sudo modprobe af_key
If you see this kind of error, that means it isn’t present and you have to change your configuration:
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.17.8-x86_64-linode110/modules.dep.bin' modprobe: FATAL: Module af_key not found in directory /lib/modules/4.17.8-x86_64-linode110
You can try adding following to /etc/modules like and remote your server but it will not work if your kernel doesn’t support it.
Run a 5$/month Linode for your own VPN
If you have Linode, you can choose GRUB2 kernel to enable af_key as shown below.
docker-compose.yml for VPN
Following is the content of your docker-compose.yml
version: '3.2' services: vpn: image: hwdsl2/ipsec-vpn-server restart: always hostname: localvpn privileged: true volumes: - "/etc/passwd:/etc/passwd:ro" - "/etc/group:/etc/group:ro" - "/lib/modules:/lib/modules:ro" ports: - "500:500/udp" - "4500:4500/udp" environment: - VPN_IPSEC_PSK=secret_code - VPN_USER=login_with_this_user - VPN_PASSWORD=login_with_this_password
docker-compose up -d
Now use above credentials to connect to your VPN and it should run without any issues.