mwarning / zerotier-openwrt

A OpenWrt package for ZeroTier One - Pull requests are welcome!
669 stars 140 forks source link

Can I run this, going to my normal full tunnel exit point #110

Closed ggoodloff closed 1 month ago

ggoodloff commented 1 year ago

Can I run this, but now as the main exit point. Basically in all my devices I run the zerotier-cli Set allowDefault=1.

Behind my home ISP This work on EVERY Linux device I have no matter the flavor. My exit point is my cloud based VM and all my Linux devices show that cloud ip as the exit point. None of my windows machine respect this and always show my home IP.

First question, can I run the allowDefault=1 setting on the OpenWrt (PC based).

Second, can I still route all my home traffic through the OpenWrt/zerotier PC to exit out my cloud node?

I have a thin client I want to use this for with a WiFi in from the house and out through zerotier via Ethernet direct to my router.

Being a thin client I could travel as well with this.

Any insight would be great.

Thanks

ogarcia commented 1 year ago

First question, can I run the allowDefault=1 setting on the OpenWrt (PC based).

Yes, the same as with any other machine.

Second, can I still route all my home traffic through the OpenWrt/zerotier PC to exit out my cloud node?

Yes, by telling the router that your outgoing route to the internet is the ZT interface, the rest of the traffic leaving your router will also go that way.

In short, the scheme would be as follows:

LAN -> ROUTER -> (ZT TUNNEL) -> OUTPUT -> INTERNET

Your local network would be routed through the router and the router would be routed through the ZT tunnel to the exit node.

For this to work you should enable in the Zerotier configuration a config_path, something similar to this:

config zerotier 'myzerotier'
    option enabled '1'
    option config_path '/etc/zerotier'
    option copy_config_path '1'
    list join 'networkid'
        option secret 'networksecret'

So that once you start Zerotier you can run the command zerotier-cli set <network_id> allowDefault=1 and it will be persistent.

You can also create a /etc/zerotier/networks.d/<network-id>.local.conf file to enter the allowDefault setting so that you do not need to run the zerotier-cli set <network_id> allowDefault=1 command. See here for more information.