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

nixos/zerotierone: prevent systemd from changing MAC address #77405

Merged
merged 1 commit into from Mar 2, 2020

Conversation

danielfullmer
Copy link
Contributor

Motivation for this change

zerotier has been very flaky for me after this commit fe3da83. Somehow adding tap to boot.kernelModules was causing issues on cloud hosted instances--as well as in qemu.

While debugging, I found that systemd was sometimes changing the MAC address of the interface after it was brought up by zerotier. This is even without using systemd-networkd. This PR disables that behavior from systemd for zerotier interfaces.

Note that i'm not using the systemd.network.link.<name> option in my PR since it is only active when systemd.network.enable is set. It's not clear to me if this should be the case or not.

I have my own nixos test for zerotier here:
https://github.com/danielfullmer/nixos-config/blob/master/tests/zerotier/default.nix
It only works if this fix is used.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @obadz

Copy link
Contributor

@misuzu misuzu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had similar issue, outgoing ping requests was failing with Destination unreachable: Address unreachable and several restarts after boot was needed to make zerotier work and this problem seem to go away with this fix.

@aanderse
Copy link
Member

@danielfullmer for the last month or two I haven't been able to use zerotierone on my linode VPS because it stopped working for reasons unknown to me. This PR fixes that. Thank you 🍻

@obadz obadz merged commit c319584 into NixOS:master Mar 2, 2020
@obadz
Copy link
Contributor

obadz commented Mar 2, 2020

Yes! Thank you for putting an end to my year (!!!) without zerotier!

@obadz
Copy link
Contributor

obadz commented Mar 2, 2020

We need to cherry-pick this to 19.09 and 20.03. What's the best way of doing this these days?

@cole-h
Copy link
Member

cole-h commented Mar 2, 2020

https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md#backporting-changes

Basically, check out the branch, git cherry-pick -x <original hash>, and open a PR against the branch.

@obadz
Copy link
Contributor

obadz commented Mar 4, 2020

Thanks @cole-h.

@flokli
Copy link
Contributor

flokli commented Mar 10, 2020

Urgh - this really should have gone to systemd.network.links.zerotier.

Only creating these .link files is a bug - .link files are parsed by udev - even with networkd not being enabled.

Can you create a follow-up PR fixing that behaviour in systemd.network.link.<name> - we should also add it to the 20.03 release notes.

@flokli
Copy link
Contributor

flokli commented Mar 10, 2020

Hm, it's a bit more messy - I'll post a followup PR myself. Thanks for raising this!

@flokli
Copy link
Contributor

flokli commented Mar 11, 2020

Followed-up in #82310.

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.

None yet

6 participants