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

If possible use systemd's machine-id as node_id #48

Closed
wants to merge 1 commit into from
Closed

If possible use systemd's machine-id as node_id #48

wants to merge 1 commit into from

Conversation

citronalco
Copy link

If available use systemd's machine-id as node_id.
Fixes #37 and, for non babel setups, the necessity of having fixed MAC addresses on the bat interfaces.

Copy link
Contributor

@genofire genofire left a comment

Choose a reason for hiding this comment

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

I have seen this code somewhere already ;)

@rubo77
Copy link
Contributor

rubo77 commented Oct 30, 2019

Shouldn't this only change, in case there is no batman mac

@citronalco
Copy link
Author

Shouldn't this only change, in case there is no batman mac

The order is intentionally: At first try to get the machine-id, and only if's not availablle (means: no systemd on the machine) use the batman mac.
If you don't give your batman interface a mac manually it gets a new mac on every boot, while the machine-id is set during OS installation and is fixed after that. As the node_id should identify a node, a fixed node_id that survives reboots is what's required.

@jplitza
Copy link
Member

jplitza commented Oct 31, 2019

I guess @rubo77 intended to mention that upgrading mesh-announce to this change will change the node_id of already existing setups.

@neocturne
Copy link

I think this solution makes sense for Babel setups.

For batadv, I consider any setup that doesn't fix all MAC addresses broken, so this change would not be necessary - and, as already pointed out by others, problematic for existing setups.

@citronalco
Copy link
Author

citronalco commented Nov 1, 2019

OK. Seems I underestimated the dimension of this topic.

  • Batman gateways are supposed to have have static batman MAC addresses
  • Batman gateways may change their batman interfaces (multisite/domain setups), see Replace of node_id #37
  • Babel gateways do not have a batman MAC address at all
  • Probably there is a systemd machine-id on the node

If you want to avoid a breaking switch to machine-id, maybe a command line option could be added to enable the usage of machine-id instead of batman's MAC. Or one to set the node_id manually.
But that's something you have to decide.

@NeoRaider:
Can you explain why you consider setups without fixed MAC addresses on the batman interfaces broken? During the last few months I checked many publicly available saltstack/ansible setups, and only a minority of them manually sets them (while most of them do for the connected bridge devices), so it's not that obvious.

citronalco added a commit to citronalco/Ansible-Freifunk-Gateway that referenced this pull request Nov 15, 2019
Bislang ändern sich die MAC-Adressen der Batman-Interfaces bei jedem Reboot des Gateways
NeoRaider sagt: "For batadv, I consider any setup that doesn't fix all MAC addresses broken" (ffnord/mesh-announce#48 (comment))
Löst auch das Problem, dass jeder Reboot zu einem neuen und einem toten Gateway auf der Freifunk-Karte führt
@TobleMiner
Copy link
Member

TobleMiner commented Apr 16, 2020

Closing PR since the current approach presented does not make any sense.
Choosing the nodeid is not the job of mesh-announce. The nodeid is a configuration feature of the gateway. Using the systemd machine id is not a proper implementation since the identity of a gateway should be independent from the host it is deployed on.
I might consider adding a (per domain) config option for it instead.

@TobleMiner TobleMiner closed this Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace of node_id
6 participants