Community discussions

MikroTik App
 
newhotelowner
just joined
Topic Author
Posts: 11
Joined: Wed Dec 04, 2019 4:10 am

Route VLAN traffic to office internet using zerotier

Thu Apr 10, 2025 3:04 am

This is my current setup.
Screenshot 2025-04-09 165808.jpg
My work and home routers are connected over zerotier. I am able to directly access work devices though zerotier at my home.

Example, My SIP phone at home is connected to my SIP gateway at work.

I set up zero tier on Mikrotik L009UiGS and added masquerade NAT to route to access office devices from home desktop
 0    chain=srcnat action=masquerade log=no log-prefix="" 
 1    ;;; defconf: masquerade
      chain=srcnat action=masquerade out-interface-list=WAN 
      ipsec-policy=out,none
I want to add VLAN 5 at my home, that will route all (internet) traffic through office internet instead of home internet.
You do not have the required permissions to view the files attached to this post.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4965
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Route VLAN traffic to office internet using zerotier

Thu Apr 10, 2025 3:34 am

Mikrotik has a discussion of Policy Routing here: https://help.mikrotik.com/docs/spaces/R ... cy+Routing

Essentially you likely need some config like this:
# add new/2nd routing table
/routing/table/add name=ztoffice fib 

# route new table via remote ZT router
/ip/route/add gateway=10.172.17.21 routing-table=ztoffice check-gateway=ping

# route rule to send VLAN5 to Cudy ZT
/routing/rule/add interface=vlan5 action=lookup table=ztoffice
Few notes:
- Above is example, not saying that be the exact commands

- You may not need the top ("0") src-nat rule... if you add "static routes" on the CudyRouter so it knows to send 192.168.88.0/24 -> 10.172.17.11 & /ip/route/add dst-address=192.168.10.0/24 gateway=10.172.17.21 on Mikrotik, you can avoid the NAT translation since both sides will know how to route between 192.168.88.0 and 192.168.10.0/24
- Or, alternatively, ZeroTier controller (generally, my.zerotier.com) lets you set routes too. So instead of above you can use ZeroTier to define a routes as show above. I believe the Cudy will add those route automatically, but you'd have to check its settings. This is bit more complex since you might mess up the Cudy, depending on the default route distance its use for ZeroTier routers. Thus, unless familiar with ZT and specifics on how it works on Cudy routers, I'd just use "Static Router" (which both Mikrotik and Cudy allow)

- You don't mention a IP address/subnet for "VLAN5"... likely you want to also set up routes for that & use the src-address=x.x.x.x/24 instead of interface=vlan5 in the /routing/rule. And/or you may need to do more to configure VLAN5 for use
 
newhotelowner
just joined
Topic Author
Posts: 11
Joined: Wed Dec 04, 2019 4:10 am

Re: Route VLAN traffic to office internet using zerotier

Thu Apr 10, 2025 3:39 pm

I did add routes to manage route. That's how I am able to access the connected devices on both network.

But I haven't figure out how to make Cuddy exit node, so that all internet traffic on VLAN goes through office wan (cuddy).
- Or, alternatively, ZeroTier controller (generally, my.zerotier.com) lets you set routes too. So instead of above you can use ZeroTier to define a