ZeroTier router to access my home network

Never had the real need to access my home network from the outside but recently as working back at the office is becoming a reality, I just wanted to be able to check on my local deployments or be able to do minor tasks on my local network.

The option of setting up a standard VPN like OpenVPN is not viable, because my ISP is using CGNAT, like most these days.

So thanks to the Andreas Spiess YouTube channel (highly recommended) I came across ZeroTier.

What ZeroTier does is creating a virtual network on top of any network, so devices can communicate directly with each other. And this works with a CGNAT ISP.

ZeroTier has a free service up to 25 devices, which is great because my plan was to create a local ZT router at home, and access the remaining hosts through that host.

As I had a couple of Raspberry Pi’s with no usage, decided to use one of them to create the local ZT router.

Installing ZT and enabling local network routing

The first step is to install Raspberry Pi OS on an SD card and assign a fixed IP address on my local network. There is a ton of documentation on how to do this on the official Raspberry Pi documentation site.

After having the Pi running, it’s time to install ZeroTier.

There are many different networking configurations, in my case the simplest one is working. It’s the routing between ZeroTier and physical networks as described on this documentation.

Some things to consider here:

  • When adding the managed route make sure to use all your local network address range (ie: and the address used in the “via” field is the address assigned by ZeroTier to your router upon first connection (check the members section and Managed IPs column).
  • Make sure to configure IP forwarding.
  • Make sure to configure iptables and save the routes after reboot.

Having all these ready, you can connect to your router by installing the ZT client of your chosen OS and accessing either your router (the Raspberry PI) or any other host by IP address.

DNS resolution for your local network

While connecting by IP address is great, it’s not very functional, and in my case I have some local applications that I access using local domain names that I need to use when connecting through ZT to achieve the functionality I’m expecting.

So what I need is to have the same level of DNS resolution I have when at home. I’m locally using PiHole as a DNS resolver on my local network.

ZeroTier has a basic DNS resolution feature that when configured properly, is more than enough for my use case. Let’s keep in mind that ZT is actually meant to be used to connect to other devices in the ZT network, so this is kind of a workaround.

ZT can add a DNS resolver to your connected devices upon connection that instructs the device/host to use a specific DNS for an specific domain.

In my case all my local domains end with “.lan”, so by adding the value “lan” in the Search Domain field and my local DNS IP address in the Server Address field, I can achieve DNS resolution for all my local domains when connected to my home network using ZeroTier.

I also added all the hosts names as “host.lan” to be also able to connect to them using SSH.

I tested this solution on the road and works perfectly, still using the free ZT tier and connecting to any host I have at home.

Hope this article helps you resolve your connectivity needs, also let me know in the comments section if you are using ZeroTier in any other configurations and what’s your use case.


Related Posts

Deploying WordPress in Kubernetes exposed via Cloudflare Tunnels

So this is the story of how you are reading this blog, technically speaking. When thinking about creating this blog, I realized that already had available compute…

Add shared storage to MicroK8s Kubernetes cluster

A big feature of any Kubernetes cluster is its capability to deploy running workloads among the different compute nodes depending on many factors, but primarily assuring availability…

NFS share with external SSD Raid 1 disks

When planning to provide my Kubernetes cluster with a dynamic storage provisioning option, I decided to use NFS to be able to attach volumes to multiple nodes…

Backup script for KVM virtual machines

KVM is a great virtualization engine, open source and light way. I’m running my Home Assistant VM inside an Intel NUC without any issues and super stable….

Expose Home Assistant on CG-NAT networks

There is no doubt that Home Assistant is a great home automation software that lets automate a wide range of home appliances. Open source and in constant…

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments