quinta-feira, 6 de junho de 2019

How to easily use your Pi-Hole outside of your personal network

0 comentários
You’ve your Pi-Hole installed on your personal network, but you want to use it outside of your home? If that’s the case stick with me and follow this tutorial that will explain to you how to integrate your Pi-Hole with Zerotier 176, an easy virtual network accessible from anywhere around the world where all traffic is encrypted end-to-end!

Advantages of using Zerotier instead of a traditional VPN

  • Zerotier works even on your personal network so you won’t have to change your DNS settings nor connect to your VPN every time you leave your house.
  • You can still use the existing Internet connection that you are using outside of your house instead of routing your current Internet connection trough your home network like you would with PiVPN and thus losing some bandwidth if your home connection is not powerful enough.
  • You don’t need to set up a dynamic DNS nor having a static IP nor configuring the port forwarding because Zerotier will do all the job for you to automatically setup the best configuration according to your network.
  • Zerotier works out of the box in every network environment (unless the administrator explicitly ban Zerotier servers), even on very restrictive network that allow only HTTP and HTTPS (proof here).

Requirement

  • An already installed Pi-Hole server

Tutorial

First part : Configure Pi-Hole on your Zerotier Network

  1. Create an account on the Zerotier website: https://my.zerotier.com/login 97
  2. After creating your account head over the network section: https://my.zerotier.com/network 15 and then click on the Create Network blue button.
  3. A new network should come up:
  4. Click on the new network and then let the page opened you will need the network ID just after a couple of steps:
  5. You may want to change the name of the network and the IPv4 Auto-Assign to numbers that are easier to remember, for example: 192.168.192.*:
  6. Open an SSH connection to your Pi-Hole server and then install Zerotier using this command:
curl -s https://install.zerotier.com/ | sudo bash
  1. When you get this message: Success! You are ZeroTier address. You are ready to join your virtual network using this command:
sudo zerotier-cli join network_id
You need to replace network_id with the Network ID specified on the Zerotier Central page that you opened a minute ago.
  1. Then you should get a success message: 200 join OK, if that’s the case return on the Zerotier Central page.
  2. Scroll down until the One device has joined this network. message.
  3. You will now need to accept your Pi-Hole server to join the network by checking the box just below the Auth?:
  4. Then wait a bit until the red line switches to green and that you get a third IP in the Managed IPs column.
  5. Give a name to your Pi-Hole server in the short name field.
  6. Change the IP of your Pi-Hole server in the Managed IPs column to numbers that are easier to remember, for example mine is 192.168.192.1 because the network is set to 192.168.192.* inside the IPv4 Auto-Assign box. Don’t forget to delete the old managed IP.
  7. Open a page to your Pi-Hole DNS Settings: http://pi.hole/admin/settings.php?tab=dns 15
  8. Check the Listen on all interfaces box to allow the devices from your Zerotier Network to use your Pi-Hole and then save:
  9. That’s it you now have configured your Pi-Hole server with Zerotier!

Second part: Configure your device(s) to use your Pi-Hole trough your Zerotier Network

Windows (7, 8, 8.1 and 10)

Setup Zerotier

  1. Install the Zerotier application: https://download.zerotier.com/dist/ZeroTier%20One.msi 6 (don’t uncheck the Start Zerotier at end the of the installation).
  2. A Zerotier One window will come up, you have to login with your account.
  3. You will then be greeted to join a network you just have to join your network:
  4. Click on done and then accept the new blue network window on the right if you are on Windows 8/8.1/10.

Change the DNS servers

I won’t explain to you in details how to change your DNS servers because there are already loads of tutorials on the Internet to guide you but here is a good tutorial to help you: https://www.lifewire.com/how-to-change-dns-servers-in-windows-2626242 4
At the configuration of the IP of the DNS server, 11th step if you followed the tutorial that I linked, you have to enter the managed IP (Zerotier) of your Pi-Hole server (available on the Zerotier Central page).
If you have followed the first part to the letter please make sure to enter 192.168.192.1 and having a similar result as mine:

Android

Setup Zerotier

  1. Install the Zerotier One app from the Google Play Store: https://play.google.com/store/apps/details?id=com.zerotier.one 9
  2. Run it and then tap on the + button right top side of the app:
  3. Enter your Network ID and then check the “Use Custom DNS servers” box:
    20190428_215243
  4. Enter the managed IP (Zerotier) of your Pi-Hole server in the first IPv4 DNS field and then tap the “Add Network” button:
  5. Return on the Zerotier Central page.
  6. You will see a new device that has a red vertical line, you just have to do the same thing as the first part click on the box in the column Auth? to allow the device to join the network.
  7. Now you are ready to initiate the connection on the Zerotier One app on your Android device by activating the slider inside the network box:

Linux (Ubuntu, Linux Mint, Fedora and more)

Setup Zerotier

The installation of Zerotier on Linux is very similar to the first part. You just have to follow from the 6th step to the 10th step.
Note to ArchLinux users. There is an official package for Zerotier: https://www.archlinux.org/packages/community/x86_64/zerotier-one/ 2

Change the DNS servers

Configuring the DNS servers on Linux highly depend on the graphical interface, but here are anyway some tutorials for the popular Linux distributions:
At the configuration of the IP of the DNS server enter the managed IP (Zerotier) of your Pi-Hole server, if you have followed the first part to the letter please make sure to enter 192.168.192.1.

MacOS

Setup Zerotier

I don’t personally own an Apple device but it’s possible to install Zerotier on your Mac by installing the .pkg available on the Zerotier’s download page: https://www.zerotier.com/download.shtml 6 (Apple Macintosh).
If you need some help here is a good tutorial that I found on the Internet: https://www.stratospherix.com/support/setupvpn_02a.php 2

Change the DNS servers

Here is a tutorial to help you change the DNS servers on your Mac: https://serverguy.com/kb/change-dns-server-settings-mac-os/ 2
At the configuration of the IP of the DNS server enter the managed IP (Zerotier) of your Pi-Hole server, if you have followed the first part to the letter please make sure to enter 192.168.192.1.

iOS (iPhone / iPad / iPod Touch)

Setup Zerotier

You can install Zerotier on your iOS device by installing the official app from the App Store: https://itunes.apple.com/us/app/zerotier-one/id1084101492?mt=8 25
If you need some help here is a good tutorial that I found on the Internet: https://www.stratospherix.com/support/setupvpn_03.php 15

Change the DNS servers

Here is a tutorial to help you change the DNS servers on your iOS based device: https://appleinsider.com/articles/18/04/22/how-to-change-the-dns-server-used-by-your-iphone-and-ipad 26
At the configuration of the IP of the DNS server enter the managed IP (Zerotier) of your Pi-Hole server, if you have followed the first part to the letter please make sure to enter 192.168.192.1.

Fonte: https://discourse.pi-hole.net/t/how-to-easily-use-your-pi-hole-outside-of-your-personal-network/18878/1

Leave a Reply