Skip to content

erikh/zerotier-systemd-manager

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get ZeroTier playing nice with systemd-networkd and resolvectl

This is a small tool to enable the systemd-networkd service as well as resolvectl to enable per-interface DNS settings. We take this directly from zerotier-one (on your machine) metadata. This service does not reach out to the internet on its own.

The result is per-interface DNS settings, which is especially nice when you are using zeronsd with multiple networks.

Usage

Compile it with golang:

# be outside of gopath when you do this
go get github.com/zerotier/zerotier-systemd-manager

Install our slightly modified zerotier-one.service file in /usr/lib/systemd/system on Ubuntu, but this location may be different for other operating systems. This will make zerotier-one depend on systemd-networkd.

Ensure systemd-networkd is properly configured and resolvectl works as intended.

Finally, run the tool as root: zerotier-systemd-manager. If you have interfaces with DNS assignments in ZeroTier, it will populate files in /etc/systemd/network. No DNS assignment, no file. Unless you have passed -auto-restart=false, it will restart systemd-networkd for you if things have changed.

Finally, if you have left a DNS-controlled network it will try to remove the old files if -reconcile=true is set (the default). This way you can stuff it in cron and not think about it too much.

Enjoy!

Author

Erik Hollensbe github@hollensbe.org

License

BSD 3-Clause

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 89.5%
  • Shell 10.5%