Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exclude static route with via ip in route helper #1791

Merged
merged 1 commit into from
Jan 20, 2023

Conversation

zwf
Copy link
Contributor

@zwf zwf commented Nov 23, 2022

When adding some routes to zerotier's managed routes, the helper script will add a route rule without via ip to the container's ip route, so the address of the destination ip segment cannot be routed correctly within the container.
Here, based on the contents of the routes key in json of
zerotier-cli -j listnetworks, by determining whether the via key has an ip address, if it is not null, helper will no longer add this route rule.

for example:

  • suppose our managed routes in my.zerotier.com like this: 10.10.0.0/16 via 172.23.0.1 and a LAN 172.23.0.0/16.
  • the Route Helper script will add two routes in container like this:
    172.23.0.0/16 dev $IFNAME scope link
    10.10.0.0/16 dev $IFNAME scope link
    
  • but the right route should be like this:
    172.23.0.0/16 dev $IFNAME scope link
    10.10.0.0/16 via 172.23.0.1 dev $IFNAME metric 5000 //should be added by zerotier automaticlly
    

When adding Routes to zerotier's Managed Routes, the helper will
add a route rule to the device that does not have a via ip,
so that the address of the Destination segment cannot be routed
correctly within the container.
Here, based on the contents of the routes key in
`zerotier-cli -j listnetworks`,
by determining whether the via key has an ip address,
if it is not null, helper will no longer add route rules.
@joseph-henry
Copy link
Contributor

This is great. I appreciate you fixing this.

@joseph-henry joseph-henry merged commit 15cfa3b into zerotier:dev Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants