From b071d6bbecff3b64f77d31727f336b596dffc7fd Mon Sep 17 00:00:00 2001 From: travisladuke Date: Fri, 14 Jul 2023 13:45:45 -0700 Subject: [PATCH] Don't apply default route until zerotier is "online" I was running into issues with restarting the zerotier service while "full tunnel" mode is enabled. When zerotier first boots, it gets network state from the cache on disk. So it immediately applies all the routes it knew about before it shutdown. The network config may have change in this time. If it has, then your default route is via a route you are blocked from talking on. So you can't get the current network config, so your internet does not work. Other options include - don't use cached network state on boot - find a better criteria than "online" --- service/OneService.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service/OneService.cpp b/service/OneService.cpp index ba321282..0a9842a7 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -2617,8 +2617,9 @@ public: r->second->sync(); } for(std::map< InetAddress, SharedPtr >::iterator r(n.managedRoutes().begin());r!=n.managedRoutes().end();++r) { - if (r->second->via()) + if (r->second->via() && (!r->second->target().isDefaultRoute() || _node->online())) { r->second->sync(); + } } }