62 Commits

Author SHA1 Message Date
Adam Ierymenko f6d52dd96c Rest -> MPL except controller. 2025-08-06 12:16:44 -04:00
Adam Ierymenko 5eb3cd2699 clang-format this branch to match dev 2025-07-03 14:10:44 -04:00
Joseph Henry cd191778c2 Add custom management plane for 3rd party vendors 2025-02-26 10:27:23 -08:00
Adam Ierymenko 1982071d46 1.14.0 version bump for Linux and macOS, date update. 2024-03-19 14:38:48 -07:00
travisladuke 557b92a167 More reliable full tunnel on macOs
This makes switching between physical networks
with full tunnel mode enabled more reliable.
There were issues with the physical default route or device
changing.
2023-09-08 12:19:08 -07:00
travisladuke 1d095e81d9 fix macos default route again
see commit fb6af1971 * Fix network DNS on macOS
adding that stuff to System Config causes this extra route to be added
which breaks ipv4 default route.
We figured out a weird System Coniguration setting
that works.

--- old
couldn't figure out how to fix it in SystemConfiguration
so here we are# Please enter the commit message for your changes. Lines starting

We also moved the dns setter to before the syncIps stuff
to help with a race condition. It didn't always work when
you re-joined a network with default route enabled.
2023-08-14 17:06:05 -07:00
travis laduke 22ab673480 Apply default route a different way - macOS
The original way we applied default route, by forking
0.0.0.0/0 into 0/1 and 128/1 works, but if mac os has any networking
hiccups -if you change SSIDs or sleep/wake- macos erases the system default route.
And then all networking on the computer is broken.

to summarize the new way:
allowDefault=1
```
sudo route delete default 192.168.82.1
sudo route add default 10.2.0.2
sudo route add -ifscope en1 default 192.168.82.1
```

gives us this routing table
```
Destination        Gateway            RT_IFA             Flags        Refs      Use    Mtu          Netif Expire    rtt(ms) rttvar(ms)
default            10.2.0.2           10.2.0.18          UGScg          90        1   2800       feth4823
default            192.168.82.1       192.168.82.217     UGScIg
```

allowDefault=0
```
sudo route delete default
sudo route delete -ifscope en1 default
sudo route add default 192.168.82.1
```

Notice the I flag, for -ifscope, on the physical default route.

route change does not seem to work reliably.
2023-07-20 13:37:05 -07:00
travis laduke e2dad367b4 Don't re-apply routes on BSD
See issue #1986
2023-05-17 14:41:59 -07:00
travis laduke a6742b7f82 Prevent shadowing VM routes as default route (macOS)
If you have a VM host like parallels, sometimes you get these link-local
default routes:

```
netstat -nrfinet | grep "default\|\/1"
0/1                10.2.0.12          UGScg        feth4823
default            192.168.82.1       UGScg             en1
0/1                192.168.82.1       UGScIg            en1
default            link#22            UCSIg       bridge101      !
128.0/1            10.2.0.12          UGSc         feth4823
128.0/1            192.168.82.1       UGScI             en1
```

(the link#22 one)

The _getRTEs function inclused these routes in the list it makes as like:

device: bridge101, target: 0.0.0.0/0

If it happens to be first in the list, bridge101 gets
selected as the default route.

Then Full Tunnel Mode doesn't work.

The other routes in the list are like:
device: en1 target: 192.168.1.0/24 via:  metric: 0 ifscope: 0
device: en1 target: 192.168.1.1/32 via:  metric: 0 ifscope: 0

We only need the device name from this, so either one will work.
2022-12-23 16:18:00 -08:00
Sean OMeara 10170b41c3 Revert "Improve default route on macOS (#1680)"
This reverts commit 117d7194af.
2022-12-13 18:32:07 +01:00
Travis LaDuke 117d7194af Improve default route on macOS (#1680)
re: issue #1088
and probably: https://discuss.zerotier.com/t/default-route-issue-osx-monterey-m1/6974

// current zerotier.
// allow default adds two sets of routes.
```
netstat -rnfinet | grep "/1\|default" | sort
0/1                10.2.0.2           UGScg        feth4823
0/1                192.168.82.1       UGScIg            en7
128.0/1            10.2.0.2           UGSc         feth4823
128.0/1            192.168.82.1       UGScI             en7
default            192.168.82.1       UGScg             en7
```

Then, something chaotic happens eventually, and networking stops working.

// after patch
```
netstat -rnfinet | grep "/1\|default" | sort
0/1                10.2.0.2           UGScg        feth4823
128.0/1            10.2.0.2           UGSc         feth4823
default            192.168.82.1       UGScg             en7
```

After the change, I can still:
- use default route
- route to other subnets

I tested on high sierra through monterey
and on freebsd13.1
2022-12-13 11:52:21 +01:00
Travis LaDuke fa25b45198 Keep interface name on via routes on linux
See issue #1498
2022-01-07 11:58:42 -08:00
staphen 1c956494a4 Use lowercase when including Windows headers 2021-12-29 16:29:08 -05:00
Adam Ierymenko fabfb10b97 Remove managed routes in destructor (regression fix). 2021-11-15 19:48:07 -05:00
Adam Ierymenko 594853e251 Remove deprecated vfork call on Mac, and make Mac route application more robust. 2021-10-26 22:15:06 -04:00
Adam Ierymenko d2c3ea6901 Another route fix on BSD. 2021-09-15 13:31:18 -04:00
Adam Ierymenko 6bb1598fa3 Another fix for routing and interface issues on MacOS 2021-09-15 11:50:54 -04:00
Adam Ierymenko 1b8917a57c Fix for MacOS interface setup and config timing bugs. 2021-09-09 09:30:48 -04:00
Adam Ierymenko d1c88971ae Possible Mac route borking fix. 2021-09-02 15:23:26 -04:00
Dave Cottlehuber b37e9de24d BSD: add debug fprintfs for external commands 2021-04-15 06:37:01 +00:00
Adam Ierymenko 250f0ef9db Remove dead code. 2020-11-16 13:51:27 -05:00
Adam Ierymenko 4aab9121d9 Linux build fixes, and new route code seems to work. 2020-11-13 22:25:12 -05:00
Adam Ierymenko 5ea7ef6b65 Rework Linux route setting to actually consult netlink interface. 2020-11-13 22:06:58 -05:00
Adam Ierymenko e8be28734b Linux netlink and route setting... work in progress. 2020-11-13 19:07:54 -05:00
Adam Ierymenko 6c5a097711 Use LinuxNetLink for routes on Linux... still needs testing/debugging on an actual Linux machine. 2020-11-13 18:16:14 -05:00