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

UUID used for DHCP request instead of real MAC address #80

Open
fedegiova opened this issue Dec 10, 2020 · 4 comments
Open

UUID used for DHCP request instead of real MAC address #80

fedegiova opened this issue Dec 10, 2020 · 4 comments

Comments

@fedegiova
Copy link

fedegiova commented Dec 10, 2020

Hi, I've almost succeded to configure the mkinitcpio to remote unlock a luks volume, the remaining issue is that in the initramfs context the DHCP requests made to acquire a lease from the DHCP server are make using an UUID instead of the ethernet device's MAC address.
This means that the IP address of the PC is jumping around the subnet at every reboot.

I've found some information on the topic but I haven't managed to fix it,

my initrd-network

[Match]

# use kernel interface names
Name=eth*

# TODO use predictable network interface names
#Name=en*

[Network]
DHCP=ipv4

[DHCP]
UseHostname=true
Anonymize=false

It's the stock one but I've added the Anonymize=false option without success, note that the MAC of the card is not changed, ip a still show the correct one, it's just not used for the DHCP request which uses a much longer UUID o sort of.

I've found that using UUID for DHCP requests it's a feature of networkmanager: https://www.reddit.com/r/archlinux/comments/6ls9gn/how_to_disable_random_mac_address/ but actually we're not using network manager, I've also searched in the man page of systemd-networkd but found no way to disable the behaviour.

Any clue?

Regards
Federico

@Andrei-Pozolotin
Copy link
Collaborator

  1. it seems that your network usage case is not initrd - specific

  2. perhaps it would be easier to debug this setup outside of initrd
    and then apply discovered settings to the initrd-network.network file

@kittydoor
Copy link

I'm also struggling from this (at least the symptom of jumping addresses, not sure if the same underlying cause) on my own setup. I'm not sure what further steps to take to diagnose and resolve as I'm not familiar with the nuance of the environment all of this is running in (as opposed to after full system boot is complete). Can anyone provide help / directions?

@Andrei-Pozolotin
Copy link
Collaborator

to verify if dhcp client or dhcp server is an issue:
try to force the the same link mac address in both initrd and normal mode:

https://www.freedesktop.org/software/systemd/man/latest/systemd.link.html

for example, provide link files with these snippets:

/etc/systemd/network/initrd-network.link

# need to include into initrd build
[Link]
# Override MAC address (spoof MAC address)
MACAddress=11:22:33:44:55:66

/etc/systemd/network/normal-network.link

# need to include into existing or override the normal link
[Link]
# Override MAC address (spoof MAC address)
MACAddress=11:22:33:44:55:66

and also updated initrd-network.service to include initrd-network.link the image

# include network activated in initramfs
InitrdPath=/etc/systemd/network/initrd-network.link source=/etc/mkinitcpio-systemd-tool/network/initrd-network.link
InitrdPath=/etc/systemd/network/initrd-network.network source=/etc/mkinitcpio-systemd-tool/network/initrd-network.network

@Andrei-Pozolotin
Copy link
Collaborator

Another way to resolve this is to ensure the same mac-based ClientIdentifier
in both initrd and normal system networks dhcp sections:

https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html#ClientIdentifier=

[DHCPv4]
ClientIdentifier=mac

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

No branches or pull requests

3 participants