[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dhcp-client default gateway with multiple interfaces, race condition
From: |
Richard Sent |
Subject: |
Re: dhcp-client default gateway with multiple interfaces, race condition? |
Date: |
Fri, 14 Jun 2024 14:55:01 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Felix!
Felix Lechner <felix.lechner@lease-up.com> writes:
> I believe the 'dhcp-configuration' is not quite sophisticated enough so
> you may have to use the config-file option and include this content:
>
> # Assign this interface an IP address only.
> # (This disables setting the gateway router, DNS, domain, etc.)
> interface "eth1" {
> request subnet-mask, broadcast-address, interface-mtu;
> }
>
> That idea came from here. [1] It could also be enough to use the
> 'nogateway' option as suggested in the link you posted already. [2]
Thanks for helping out! I think the existing code only supports
providing a config file to dhcpd (dhcp server), not dhcp-client (aka
dhclient, dhcp client).
I submitted a patch for specifying a dhclient config file just now in
dhcp-client-configuration [1]. Unfortunately while the patch itself
seems fine, the config file doesn't seem to have an effect in my case.
--8<---------------cut here---------------start------------->8---
# Problem still occurs if we run the command manually like this
$ dhclient -nw -I -pf /var/run/dhclient.pid \
-cf /gnu/store/blah-dhclient.conf
--8<---------------cut here---------------end--------------->8---
Annoyingly that nogateway option I mentioned seems to be a feature of
dhcpcd [2], which has no organizational relationship to dhclient or
dhcpd.
I have confirmed the issue is solved if I manually invoke dhclient,
don't provide a config file, and only specify eth0 as an interface. e.g.
--8<---------------cut here---------------start------------->8---
$ dhclient -nw -I -pf /var/run/dhclient.pid eth0
--8<---------------cut here---------------end--------------->8---
Curiously providing the config file causes the error to appear again
even if eth0 is the only interface provided at the command line.
Presumably the fact that the config file references eth1 is enough for
dhclient to scan it.
For completeness, this is the contents of dhclient.conf:
--8<---------------cut here---------------start------------->8---
# Assign this interface an IP address only.
# (This disables setting the gateway router, DNS, domain, etc.)
interface \"eth1\" {
request subnet-mask, broadcast-address, interface-mtu;
}
--8<---------------cut here---------------end--------------->8---
[1]: https://issues.guix.gnu.org/71561
[2]: https://github.com/NetworkConfiguration/dhcpcd
--
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.