Install Pi-Hole + OpenVPN Server on NAT VPS


NATVPS.id – The pi hole is software DNS Server that focuses on blocking ads and sites tracker. You can install a Pi-Hole server coupled with an OpenVPN server to create your own personal adblocker VPN, while securing your connection

This article discusses the steps to create an AdBlocker VPN with Pi-Hole and OpenVPN on a NAT VPS. This article uses Ubuntu 22.04 as a reference, but you can use other distributions such as Debian and CentOS.

Port Forwarding Configuration

Considering we are using NAT, we need to add port forwarding configuration in the Virtualizor panel for OpenVPN.

This article will use port 19015. You are free to change the port according to your choice. Note this port, because we will use it again in the installation process.

Install OpenVPN

Before installing Pi-Hole, it would be a good idea to install OpenVPN first, because later Pi-Hole will only run on interface This VPN.

Run script Community-made automatic OpenVPN installation:

curl  -Lo openvpn-install.sh

FORCE_NAT=1 bash openvpn-install.sh
  • Which IPv4 address should be used? Select address Private IP NAT your VPS

To check the private VPS IP, please check via ifconfig or through dashboard Virtualization.

Wait until the installation process is complete.

Please download this configuration file to your device. The tutorial can be seen at: How to Download Files From NAT VPS.

Install Pi-Hole

Run script Pi-Hole installation:

curl -sSL  | bash

Witch Pi-Hole installation will open.

On Static IP requiredchoose Continue.

In options Select Interfacemake sure to vote tun0.

For other options, just leave it alone default and click Entering just. However, you are free to change other configurations as you wish.

If the installation is successful, a notification will appear as follows.

Change OpenVPN DNS

First, check the IP of interface tun0 using commands:

ifconfig tun0 | grep 'inet'

For example, IP tun0 is 10.8.0.1.

Then, open the OpenVPN server configuration with text editor like Nano:

apt install nano -y # Jika belum
nano /etc/openvpn/server/server.conf

In options press “DNS dhcp options”replace the existing IP address with the from address tun0 previous example 10.8.0.1.

Save the file with Ctrl-X, YouThen Entering.

Finally, restart OpenVPN by:

systemctl restart [email protected]

Connecting to OpenVPN

Use OpenVPN to connect to an OpenVPN server, with files profile previously downloaded.

Cover

That’s the end of this article regarding the steps to create a VPN AdBlocker on a NAT VPS. If you are confused or in doubt, don’t hesitate to ask in the Telegram group @IPv6Indonesia. Thank You!


News
Berita
News Flash
Blog
Technology
Sports
Sport
Football
Tips
Finance
Berita Terkini
Berita Terbaru
Berita Kekinian
News
Berita Terkini
Olahraga
Pasang Internet Myrepublic
Jasa Import China
Jasa Import Door to Door