Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#39531 - [netctl] Support dhcpv6 with dhcpcd

Attached to Project: Arch Linux
Opened by Anonymous Submitter - Tuesday, 18 March 2014, 19:50 GMT
Last edited by Jouke Witteveen (jouke) - Tuesday, 17 June 2014, 11:39 GMT
Task Type Feature Request
Category Arch Projects
Status Closed
Assigned To Jouke Witteveen (jouke)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

netctl doesn’t support DHCPv6 with dhcpcd, although dhcpcd itself supports DHCPv6 just fine. Take the following netctl profile:

-----------------------------
Description='XXX WLAN'
Interface=wlan0
Connection=wireless
Security=wpa

IP=dhcp
IP6=dhcp

ESSID='XXX'
Key='XXX'
-----------------------------

If dhclient isn’t installed, netctl logs this on startup:

-----------------------------
Mär 18 20:45:22 atlantis dhcpcd[633]: version 6.3.1 starting
Mär 18 20:45:23 atlantis dhcpcd[633]: DUID 00:01:00:01:1a:93:42:fa:3c:97:0e:b6:c6:c3
Mär 18 20:45:23 atlantis dhcpcd[633]: wlan0: IAID 84:ef:a7:2b
Mär 18 20:45:23 atlantis dhcpcd[633]: wlan0: rebinding lease of 10.37.59.88
Mär 18 20:45:29 atlantis dhcpcd[633]: wlan0: leased 10.37.59.88 for 21600 seconds
Mär 18 20:45:29 atlantis dhcpcd[633]: wlan0: adding route to 10.37.59.64/26
Mär 18 20:45:29 atlantis dhcpcd[633]: wlan0: adding default route via 10.37.59.65
Mär 18 20:45:29 atlantis dhcpcd[633]: forked to background, child pid 739
Mär 18 20:45:29 atlantis network[481]: DHCP client 'dhclient' is not installed or not ready
Mär 18 20:45:29 atlantis dhcpcd[739]: wlan0: carrier lost
-----------------------------

Note the second-to-last line that tells us to install dhclient. This is not true — dhcpcd supports DHCPv6. If I use this profile instead:

-----------------------------
Description='XXX WLAN'
Interface=wlan0
Connection=wireless
Security=wpa

IP=no

ESSID='XXX WLAN'
Key='XXX'
-----------------------------

And start the wireless connection like this:

-----------------------------
# netctl start xxx-wlan
# dhcpcd wlan0
-----------------------------

Then it works:

-----------------------------
Mär 18 20:46:13 atlantis dhcpcd[1055]: version 6.3.1 starting
Mär 18 20:46:13 atlantis dhcpcd[1055]: DUID 00:01:00:01:1a:93:42:fa:3c:97:0e:b6:c6:c3
Mär 18 20:46:13 atlantis dhcpcd[1055]: wlan0: IAID 84:ef:a7:2b
Mär 18 20:46:13 atlantis dhcpcd[1055]: wlan0: soliciting an IPv6 router
Mär 18 20:46:13 atlantis dhcpcd[1055]: wlan0: rebinding lease of 10.37.59.88
Mär 18 20:46:13 atlantis dhcpcd[1055]: wlan0: Router Advertisement from fe80::fa1a:67ff:fe21:d2a7
Mär 18 20:46:13 atlantis dhcpcd[1055]: forked to background, child pid 1147
Mär 18 20:46:13 atlantis dhcpcd[1147]: wlan0: soliciting a DHCPv6 lease
Mär 18 20:46:13 atlantis sudo[1054]: pam_unix(sudo:session): session closed for user root
Mär 18 20:46:16 atlantis dhcpcd[1147]: wlan0: REPLY6 received from fe80::fa1a:67ff:fe21:d2a7
Mär 18 20:46:16 atlantis dhcpcd[1147]: wlan0: adding address 2001:4dd0:ff00:8918:2:6cc3:7bf8:b161/128
Mär 18 20:46:16 atlantis dhcpcd[1147]: wlan0: renew in 10800 seconds, rebind in 17280 seconds
Mär 18 20:46:21 atlantis dhcpcd[1147]: wlan0: leased 10.37.59.88 for 21600 seconds
Mär 18 20:46:21 atlantis dhcpcd[1147]: wlan0: adding route to 10.37.59.64/26
Mär 18 20:46:21 atlantis dhcpcd[1147]: wlan0: adding default route via 10.37.59.65
-----------------------------

The address is assigned:

-----------------------------
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 1c:3e:84:ef:a7:2b brd ff:ff:ff:ff:ff:ff
inet 10.37.59.88/26 brd 10.37.59.127 scope global wlan0
valid_lft forever preferred_lft forever
inet6 2001:4dd0:ff00:8918:2:6cc3:7bf8:b161/128 scope global dynamic
valid_lft 21512sec preferred_lft 21512sec
inet6 fe80::1e3e:84ff:feef:a72b/64 scope link
valid_lft forever preferred_lft forever
-----------------------------


Additional info:

netctl version is 1.6.

Steps to reproduce:

1. Create a netctl profile with IP6=dhcp.
2. Start it with netctl
3. Watch netctl reject dhcpcd for DHCPv6.
This task depends upon

Closed by  Jouke Witteveen (jouke)
Tuesday, 17 June 2014, 11:39 GMT
Reason for closing:  Implemented
Additional comments about closing:  92e90
Comment by Matthias Dienstbier (fs4000) - Tuesday, 18 March 2014, 21:07 GMT
This isn't a bug report, it's a feature request. ;)
Comment by Henrik Juul Pedersen (henrikjuul) - Tuesday, 01 April 2014, 08:14 GMT
I'd say its more a bug than a feature. It makes no sense to use two dhcp clients.
Also, dhclient does not use resolvconf natively, so it overwrites the resolv.conf file without regard to existing IPv4 DNS servers listed.
Comment by Henrik Juul Pedersen (henrikjuul) - Wednesday, 02 April 2014, 08:52 GMT
We've toyed around with this at the office today, and has come to the conclusion that dhclient will obtain an IPv6 lease without a router advertisement, whereas dhcpcd seems to require this.
Maybe one should be offered a choice of:
IP6=dhcp: dhclient
IP6=dhcpcd: dhcpcd
for those on networks with router advertisements/neighbor solicitation enabled?
Comment by Jouke Witteveen (jouke) - Wednesday, 02 April 2014, 09:59 GMT
As can be read in netctl.profile(5), the dhcp client used for IPv6 can be set using the DHCP6Client variable.

It is easy to add/extend the functionality of the possible client-values. See https://projects.archlinux.org/netctl.git/tree/src/lib/dhcp (and read the README over there) for the details.
Last time I checked there was no way to implement information-only configurations (noaddr) using dhcpcd. Currently, all IPv6 requests via dhcpcd are denied, but it shouldn't be hard to change this into only rejecting noaddr requests. Patches are welcome and should not be difficult.

Whenever dhcpcd functionality on IPv6 in netctl comes on-par with the dhclient version, I will consider changing the default value of DHCP6Client from dhclient to dhcpcd.
Comment by Henrik Juul Pedersen (henrikjuul) - Wednesday, 02 April 2014, 12:20 GMT
I've attached a patch which I believe mixes the best of all worlds. I might have missed something, but please have a look.

/Henrik
Comment by Henrik Juul Pedersen (henrikjuul) - Wednesday, 02 April 2014, 12:30 GMT
I see that I forgot to remove some of the notices I used for debugging...
Comment by Henrik Juul Pedersen (henrikjuul) - Wednesday, 09 April 2014, 10:32 GMT
Updated patch without extra notices attached
Comment by Jouke Witteveen (jouke) - Wednesday, 09 April 2014, 10:51 GMT
Thanks for the patch, but I need to think about this a bit more. Unfortunately, it seems impossible to run two instances of dhcpcd on the same interface. It might be possible to talk to a running interface, but I have not looked into this very deeply. Indeed, as is done in your patch, this means we have to make sure we start just one instance taking care of all our needs. I don't like this approach, as it goes against the current organization of the netctl code. I see two possibilities:

1) Change the netctl logic so that 'dhcp start' is issued only once, with argument 4, 6, or 46, depending on the required protocol(s). The client script may decide to launch two instances of the client program.

2) Propose a patch to dhcpcd where a running instance on an interface with a given protocol can be ordered to process another protocol as well.

The first is probably easier, the second may be more soothing.
Comment by Jouke Witteveen (jouke) - Thursday, 29 May 2014, 15:27 GMT
The upcoming version of dhcpcd supports starting separate instances for IPv4 and IPv6. This means netctl can add support more easily than via the proposed patch.

Loading...