Set up a VPN server that pomotes a pihole DNS server that is only acessible throught the vpn network.
You have to replace 'insert-random-string' with a real password. Also read throught the docker-compose.yml and see if you need to make any changes to the ip adresses and ports.
See: https://github.com/pi-hole/docker-pi-hole/#installing-on-ubuntu
Even if not specified in the docker-compose.yml, the pihole image will publish the DNS Server to the public internet. If you do not want this, you have to block port 53 in the firewall on the host system. For example, use:
sudo ufw deny 53
docker-compose run --rm openvpn ovpn_genconfig -u udp://VPN.SERVERNAME.COM
docker-compose run --rm openvpn ovpn_initpki
sudo chown -R $(whoami): ./openvpn-data
You need to paste the content of the openvpn.conf
file in this gist at the end of the file ./openvpn-data/conf/openvpn.conf
docker-compose up -d
docker-compose logs -f
export CLIENTNAME="your_client_name"
# with a passphrase (recommended)
docker-compose run --rm openvpn easyrsa build-client-full $CLIENTNAME
# without a passphrase (not recommended)
docker-compose run --rm openvpn easyrsa build-client-full $CLIENTNAME nopass
docker-compose run --rm openvpn ovpn_getclient $CLIENTNAME > $CLIENTNAME.ovpn
# Keep the corresponding crt, key and req files.
docker-compose run --rm openvpn ovpn_revokeclient $CLIENTNAME
# Remove the corresponding crt, key and req files.
docker-compose run --rm openvpn ovpn_revokeclient $CLIENTNAME remove
Some content is from: https://github.com/kylemanna/docker-openvpn/blob/master/docs/docker-compose.md