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

Use ClientID instead of DUID in dhcpcd requests #18

Merged
merged 1 commit into from
May 6, 2024

Conversation

prenetic
Copy link
Contributor

@prenetic prenetic commented May 2, 2024

This change has shown to be helpful for those affected by the issue. For cases where DUID is not respected by the DHCP server for DHCPv4 requests, this change has no impact.

Diff after change:

diff dhcpcdOLD.conf dhcpcdNEW.conf 
11c11
< #clientid
---
> clientid
16c16
< duid
---
> #duid

- With DUID, new DHCP leases would be issued upon reboot when paired with DHCP servers that respect DUID, instead of reusing the existing DHCP lease.
- The MiSTer installation process now generates a random hardware address, so DUID is unnecessary. Including DUID results in wasted leases within a DHCP scope, and can also lead to DNS resolution issues when accessing the device.
- More details
  - MiSTer-devel/Linux-Kernel_MiSTer#29 (comment)
  - MiSTer-devel/Linux-Kernel_MiSTer#29 (comment)
  - https://misterfpga.org/viewtopic.php?p=74311#p74311
@birdybro
Copy link
Member

birdybro commented May 4, 2024

Just to add a little context for one thing, the random pulling of an APIPA address to a second interface has been occurring since before the change that added the randomization of MAC addresses.

@sorgelig
Copy link
Member

sorgelig commented May 4, 2024

  • With DUID, new DHCP leases would be issued upon reboot when paired with DHCP servers that respect DUID, instead of reusing the existing DHCP lease.

do you mean MiSTer WiFi will get new IP with every reboot? Doesn't sound good.

@sigboe
Copy link

sigboe commented May 6, 2024

I also experience this issue with my Mikrotik router, if I set a static IP for MiSTer on the router, it is not respected. And I can have multiple dhcp leases active if I reboot multiple times in the same day. In limited testing this also solved the problem for me

I can't use mdns over vpn, and It takes time to update to the new IP if I am on the same network (there is probably a way to make that go faster? But shouldn't need to do that)

@prenetic
Copy link
Contributor Author

prenetic commented May 6, 2024

  • With DUID, new DHCP leases would be issued upon reboot when paired with DHCP servers that respect DUID, instead of reusing the existing DHCP lease.

do you mean MiSTer WiFi will get new IP with every reboot? Doesn't sound good.

That is the current behavior when paired with routers/DHCP servers which respect DUID, every reboot results in a new lease because the DUID.

This change corrects that behavior to ensure existing leases are reused upon reboot by removing the DUID from the DHCPv4 request.

@sorgelig sorgelig merged commit 3df5ed0 into MiSTer-devel:master May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants