dhclient -6: Can't bind to dhcp address: Cannot assign requested address
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ifupdown (Debian) |
Fix Released
|
Unknown
|
|||
ifupdown (Ubuntu) |
Fix Released
|
Medium
|
Dan Streetman | ||
Xenial |
Fix Released
|
Medium
|
Dan Streetman |
Bug Description
[Impact]
When using dhcpv6 configured via ifupdown, the interface's dhcp client fails to start at boot with the error:
Can't bind to dhcp address: Cannot assign requested address
This is because ifupdown doesn't wait, after bringing the interface up, for it to complete its link-local Duplicate Address Detection (DAD), and the dhcp client can't bind to the link-local address because it's still in "tentative" state (until DAD completes).
This is fixed upstream in debian ifupdown in version 0.8.11 by adding '-tentative' to the /lib/ifupdown/
[Test Case]
Original test case, before dhclient was fixed:
Configure an interface, using ifupdown, with dhcpv6 (e.g. iface eth0 inet6 dhcp) and reboot. It will fail to get a dhcp address during boot.
New test case, showing failure when using dhclient in 'stateless' mode:
Configure ifupdown like:
auto eth0
iface eth0 inet6 auto
dhcp 1
When eth0 is down, run 'sudo ifup eth0', and it will fail as dhclient fails to start on the interface.
[Regression Potential]
As this modifies the wait-for-dad function, its potential for regression is to introduce failures in starting dhclient, possibly by failing to wait for DAD to complete or due to some other failure in the wait for dad function.
[Other Info]
After upgrading to Ubuntu 15.04 my computer is unable to obtain an IPv6 address via DHCPv6. The root cause is that dhclient is exiting with the following message:
-------
Can't bind to dhcp address: Cannot assign requested address
Please make sure there is no other dhcp server
running and that there's no entry for dhcp or
bootp in /etc/inetd.conf. Also make sure you
are not running HP JetAdmin software, which
includes a bootp server.
If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging..
exiting.
-------
The problem seems to exist in isc-dhcp-client 4.3.1-5ubuntu2 (15.04 version) because downgrading to isc-dhcp-client 4.2.4-7ubuntu14 (14.10 version) allows me to obtain an address.
NetworkManager is the one launching dhclient. The two invocations (one for IPv4 and one for IPv6) are:
dhclient_start(): running: /sbin/dhclient -d -q -sf /usr/lib/
dhclient_start(): running: /sbin/dhclient -d -q -6 -N -sf /usr/lib/
I do not see anything suspicious with the way both dhclients are invoked.
Given that a downgrade allows me to obtain an IPv6 address I think this might be a bug in the ISC DHCP client rather than in NetworkManager.
Related Bugs:
* bug 1633479: dhclient does not wait for ipv6 dad (duplicate address detection)
Changed in dhcp: | |
status: | Unknown → New |
description: | updated |
Changed in ifupdown (Ubuntu Xenial): | |
assignee: | nobody → Dan Streetman (ddstreet) |
Changed in ifupdown (Ubuntu Precise): | |
assignee: | nobody → Dan Streetman (ddstreet) |
Changed in ifupdown (Ubuntu Trusty): | |
assignee: | nobody → Dan Streetman (ddstreet) |
Changed in ifupdown (Ubuntu): | |
status: | New → Fix Released |
affects: | dhcp → ifupdown |
Changed in ifupdown (Ubuntu Precise): | |
status: | New → Invalid |
Changed in ifupdown (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in ifupdown (Ubuntu Trusty): | |
status: | New → In Progress |
importance: | Undecided → Medium |
Changed in ifupdown (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in ifupdown (Ubuntu): | |
importance: | Undecided → Medium |
Changed in ifupdown (Ubuntu Precise): | |
importance: | Undecided → Medium |
Changed in ifupdown: | |
status: | New → Fix Released |
affects: | ifupdown → ubuntu-translations |
Changed in ubuntu-translations: | |
importance: | Unknown → Undecided |
status: | Fix Released → New |
no longer affects: | ubuntu-translations |
no longer affects: | ifupdown (Ubuntu Trusty) |
no longer affects: | ifupdown (Ubuntu Precise) |
description: | updated |
Changed in ifupdown (Debian): | |
status: | Unknown → Fix Released |
tags: | added: sts-sponsor |
description: | updated |
tags: |
added: sts-sru-done removed: sts-sru |
description: | updated |
description: | updated |
A quick update -- This seems to be a timing issue, i.e. dhclient trying to bind to the DHCPv6 port (UDP 546) on a link-local address when the interface is not ready, but I am not sure. What I do know is that the following patch to isc-dhcp-client 4.3.1 works around the problem:
--- a/common/socket.c
+++ b/common/socket.c
@@ -170,6 +170,11 @@
if ((info->flags & INTERFACE_STREAMS) == INTERFACE_UPSTREAM) {
*do_multicast = 0;
}
+
+ /*
+ * Wait a little before calling bind(). See LP #1447715.
+ */
+ sleep(5);
break;
#endif /* DHCPv6 */
With this patch dhclient -6 waits 5 seconds before attempting to bind(), and that allows me to obtain an IPv6 address from the DHCPv6 server.
A machine running ArchLinux and network-manager 1.0 does not have this problem of dhclient quitting after failing to bind(). Ubuntu 15.04 uses network-manager 0.9.10.0 so this might be a problem with Network Manager after all. We will have to wait and see until Ubuntu has Network Manager 1.0. In the meantime, I am all see with the above "workaround".
Cheers,
Eloy Paris.-