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

dhcpcd 10.0.5 needs restart when MAC changes #303

Open
juhaj opened this issue Mar 3, 2024 · 1 comment
Open

dhcpcd 10.0.5 needs restart when MAC changes #303

juhaj opened this issue Mar 3, 2024 · 1 comment

Comments

@juhaj
Copy link

juhaj commented Mar 3, 2024

The behaviour of dhcpcd when the interface MAC changes is odd. It seems that dhcpcd tries to use whatever MAC the interface had when dhcpcd started even if it has been changed since e.g. by iwd when changing to a different wifi AP. Sometimes dhcpcd just simply stops sending requests at all and neither dhcpcd --rebind nor dhcpcd --renew causes it to send a new one.

My expectation would be that this sequence (both dhcpcd and iwd are running) gets me a new IP on the new wifi:

dhcpcd --release # I need to do this because I have "persistent" turned on in the config file
iwctl station wlan0 disconnect
iwctl station wlan0 connect some_other_AP_different_from_current
dhcpcd --renew

but instead I only get the IPv6 RA stateless addresses (if the network of the new AP has any). If I instead restart the whole daemon, things work:

dhcpcd --release
dhcpcd --exit
iwctl station wlan0 disconnect
iwctl station wlan0 connect some_other_AP_different_from_current
dhcpcd -b

It looks to me as if dhcpcd reads the LL address once at startup and if that changes (as it will on most modern systems when changing networks), it does not notice and reread the new value.

The config file is the default supplied (comments removed), though I tried quite a few different options, too:

duid
persistent
vendorclassid
option domain_name_servers, domain_name, domain_search
option classless_static_routes
option interface_mtu
option host_name
option rapid_commit
require dhcp_server_identifier
slaac private

Another oddity is that the RA-derived addresses of the old network are not deleted - I would have expected them to be deleted, but maybe that is iwd's job when it disconnects the AP?

@rsmarples
Copy link
Member

You should not need to do anything with dhcpcd, it listens to carrier changes. It also listens to hardware (MAC) address changes just fine which IIRC can only be made when the interface is in the down state. You've not said what dhcpcd version you're running? I do recall changing how carrier works on Linux wireless recently and that latest version reflects that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants