I installed Zerotier on my devices and set it all up so I can access my home network remotely.
It’s working perfectly, i.e. I can access all my NAS, router etc. at home from abroad.
However, my internet connection is not being routed through my home router. This is needed because I would like to watch local news videos etc.
Could someone help me on how to do this?
Here is the output of route etc.
piclient@piclient-desktop:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 601 0 0 wlan1
10.42.0.0 0.0.0.0 255.255.255.0 U 600 0 0 wlan0
link-local 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0
192.168.0.0 0.0.0.0 255.255.254.0 U 0 0 0 zerotier12
192.168.1.0 0.0.0.0 255.255.255.0 U 601 0 0 wlan1
piclient@piclient-desktop:~$ ip route list
default via 192.168.1.1 dev wlan1 proto dhcp metric 601
10.42.0.0/24 dev wlan0 proto kernel scope link src 10.42.0.1 metric 600
169.254.0.0/16 dev wlan0 scope link metric 1000
192.168.0.0/23 dev zerotier12 proto kernel scope link src 192.168.0.3
192.168.1.0/24 dev wlan1 proto kernel scope link src 192.168.1.103 metric 601
root@piclient-desktop:/home/piclient#
Do I need to change something on the server? Since everything else is working just fine, I am guessing that my client just somehow needs to be told to route all internet traffic through Zerotier rather than directly through wlan1, correct?
Hello Travis,
thank you for your reply. I actually saw that article during me search. So it is not a question of just changing the default gateway in Ubuntu Mate but actually changing the server and the Zerotier config?
If so, the article mentions my public IP.
I do not have a public IPv4. That’s why I am using Zerotier because all other VPNs are not able to connect from an IPv4 only hotel hotspot to my IPv6 only home network.
So will this solution not work for me then?
Edit:
Additional question from me: Is my traffic right now already being routed through my Zerotier interface but then not directed to my home network because it is not a LAN request?
Setup:
Raspberry Pi running Ubuntu Mate 20.04 set up as my “Server” in my home. Currently 192.168.0.2
Raspberry Pi running Ubuntu Mate 20.04 set up as my “Client” in my hotel room (route output posted above). Currently 192.168.0.3.
I want all internet traffic from any app on the “Client” to go through the router connected to my “Server” with the IP 192.168.0.1
Right now I can access 192.168.0.x from my “Client” but not the internet through 192.168.0.1
So is this a problem in my Zerotier network configuration (online), my “Server” configuration, my “Client” configuration or all of them?
It seems like this should be so simple. Just tell the “Client” to send all internet traffic through 192.168.0.1 but I am guessing it is not?
Can you make your zerotier subnet be something other than 192.168.0.0/23. It looks like one of your physical networks is 192.168.1.0/24 which overlaps (and 192.168.1.0/24 is super common). Just use one of the “easy” ranges.
The " Route between ZeroTier and Physical Networks" article should work for this as far as firewall config goes. The masquerade stuff goes on the “server”; You don’t need to change the firewall on the “client”
zerotier will add the [0.0.0.0/0] via [server-zerotier-ip] managed route, as long as sudo zerotier-cli set <networkId> allowDefault=1 is enabled. This is how the “client” os knows to route through “server”
I always end up locking myself out eventually.
You can do something like questionable iptables commands; sleep 60; iptables-restore failsafe-rules
It’s the other way around.
My physical network is 192.168.0.0 and my Zerotier is 192.168.1.0.
Is there a mistake in one of my settings? I am just asking because you swapped the two which maybe was because you read something that points to this conclusion?
To change it to an “easy” range, would I just need to change it on the WebUI config? Or would I need to adjust the server or client manually as well? If I change it to something like 10.50.x.x, will I still be able to access my LAN at home (range 192.168.0.x) without changing anything other than the assigned IPs on the WebUI?
Sorry, I made a mistake!
The 192.168.1.0 IP range is NOT part of the Zerotier network. It is my second wifi adapter (wlan1) which is used as a hotspot.
So, starting from that configuration, what would be the correct approach to route all internet traffic through my Raspberry Pi “Server” at home (IP 192.168.0.2) or alternatively through the actual router at home which has the IP 192.168.0.1 but is of course not running Zerotier.
Please help me. I am really confused right now which approach to take/how to adjust my current system without destroying what is already working.
Sorry you’ve spent so much time on this.
That article is for a different use case and won’t help you route all traffic through ZeroTier. It might be easier to start over.
The Full Tunnel article, but with masquerade instead of snat.
I think we will edit the article to explain this.
No, I meant I originally set it up that way. And that is how I am connecting to the server right now.
So th question is whether I can leave all the settings as they are (stated in my previous post) and just adjust the iptables or whether I will have to start over (which is a problem because I have no physical access to my server and must not lose the Zerotier connection at any point.
OK. So just so I’m clear here. You’ve already configured your ZT network as a bridge to a physical network and that all works correctly? And you want your ZT clients to route all traffic through the default route of your physical network?
If all of the above is true, then all you have to do is add a default route to your zerotier network on the network config page:
0.0.0.0/0 via $ROUTER_IP_ADDRESS
Then on each client on the zerotier network, you have to set allowDefault=1. from the command line: