Re: DHCPv6 IA_PD, vendorclassid and waitip issues
Roy Marples
Fri Jan 17 11:50:03 2014
Hi Mike
On 17/01/2014 7:23, Mike Kazantsev wrote:
I'm trying to setup dhcpcd 6.2.0 to get delegated IPv6 range from local
ISP via DHCPv6 IA_PD mechanism.
ISP explicitly claims to support getting IA_NA (address), IA_PD (prefix
delegation) after IA_NA, and IA_PD without (preceding?) IA_NA request.
And with dhcpcd it seem to be almost working, but with three quirks I
can't seem to figure out.
1. vendorclassid configuration parameter seem to be completely
ignored for DHCPv6, yet applied for IPv4 DHCP.
With configuration file like this:
duid
persistent
option rapid_commit, classless_static_routes
require dhcp_server_identifier
nohook lookup-hostname
noipv4ll
vendorclassid dhcpcd:Linux-3.X.X:x86_64
debug
And starting dhcpcd as "dhcpcd -f /etc/dhcpcd.myisp.conf ext1" (ext1 is
an interface name), it can be clearly seen in tcpdump that for IPv4,
sepcified vendor string gets sent, but for IPv6 it's:
dhcpcd-6.2.0:Linux-3.10.19-fg.mf_master:x86_64:GenuineIntel
Which corresponds to this machine ID, which I'd prefer to override, and
expected that aforementioned option will do that, same as for IPv4
DHCP.
In DHCPv6, VendorClass ID does exist, but it requires an IANA assigned
enterprise number and thus has a different option.
From dhcpcd.conf(5):
vendclass en data
Add the Vendor Indetifying Vendor Class with the IANA
assigned
Enterprise Number en with the data. This option can be set
more
than once to add more data, but the behaviour, as per
RFC(3925)
is undefined if the Enterprise Number differs.
What could do with some improving is indicating in the man page which
are DHCPv4 only and DHCPv6 only options as that is non clear and the doc
assumes you know a little of either spec.
2. "waitip 4, 6" seem to wait for IPv4 only.
I've tried firewalling IPv6 UDP (so DHCPv6 would timeout) and that
option seem to not wait for it.
Just "wait 6" works (hangs until timeout), but I'd like for dhcpcd to
wait for both IP addresses.
Manpage suggests that it should be possible (without explaining how),
but using "wait 4" followed by "wait 6" on separate lines seem a bit
counter-intuitive - will the last line just override the first one or
will they merge?
waitip 46
is equivalent to
waitip 4
waitip 6
I have deliberately not documented that behavior though because one day
protocol 46 or 64 might exist!
I have no idea if DHCP would still be relevant then though ....
3. "ia_pd" seem to get more than one range, even though it doesn't
seem to correspond to captured traffic.
With configuration like this:
duid
persistent
option rapid_commit, classless_static_routes
require dhcp_server_identifier
nohook lookup-hostname
noipv4ll
vendorclassid dhcpcd:Linux-3.X.X:x86_64
noipv6rs
iaid b9:86:f4:39
ia_pd b9:86:f4:39 ext1/0/56
ipv6ra_own_default
debug
This configuration is invalid. dhcpcd.conf(5) needs to explicitly state
that ia_pd should fall inside an interface scope option
AND not to assign the delegated prefix to itself.
Since ia_na and ia_pd can't seem to be used together (resulting in
"dhcpcd[4030]: cannot specify a different IA type" error), is there
any other way to pass ia_pd parameters from DHCPv6 to hook script on
address assignment?
So basically dhcpcd is designed to work with either PD or NA/TA.
I don't see a good reason for allowing PD and NA/TA on the same
interface.
There seem to be ROUTERADVERT events a bit later, but they come a bit
too late, and clearly dhcpcd has that address/range way before them.
Also, dhcpcd output shows two "delegated prefix" lines, for some
reason:
dhcpcd[5044]: ext1: delegated prefix 2a02:17d0:3b0:a500::/56
dhcpcd[5044]: ext1: delegated prefix
2a02:17d0:3b0:a500:1ebd:b9ff:fe86:f439/56
dhcpcd[5044]: ext1: adding address
2a02:17d0:3b0:a500:1ebd:b9ff:fe86:f439/56
But looking at actual traffic, I can't seem to find that second prefix
anywhere, and it clearly corresponds to MAC, so I assume generated by
dhcpcd and not a bug?
A lack of scope :)
Let me draw you a picture
ext1 == connected to ISP
int1 == internal LAN
Your config, based on above should look like so:
duid
persistent
option rapid_commit, classless_static_routes
require dhcp_server_identifier
nohook lookup-hostname
noipv4ll
vendorclassid dhcpcd:Linux-3.X.X:x86_64
# Replace 1234 with your enterprise number
vendclass 1234 dhcpcd:Linux-3.X.X:x86_64
noipv6rs
ipv6ra_own_default
debug
interface ext1
ia_pd b9:86:f4:39 int1/0/56
So the last block says "the below config is for ext1 only. We will use
an IAID of b9:86:fe:39 to request a PD and then assign the result to
interface int1 with a /56 prefix length"
Thanks
Roy
Archive administrator: postmaster@marples.name