tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: dhcpcd and routing of ipv6 prefixes



On 2016-06-14 19:43, Rhialto wrote:
On Tue 14 Jun 2016 at 09:24:07 +0100, Roy Marples wrote:
On 13/06/2016 19:16, Rhialto wrote:
> On Mon 13 Jun 2016 at 20:14:51 +0200, Gert Doering wrote:
>> Hi,
>>
>> On Mon, Jun 13, 2016 at 08:08:25PM +0200, Rhialto wrote:
>>> On Mon 13 Jun 2016 at 12:50:09 +0100, Roy Marples wrote:
>>>>
>>>> On 12/06/2016 20:37, Rhialto wrote:
>>>>> re0: adding address 2001:984:4b2a:fc::1/62
>>>>> re0: pltime 3600 seconds, vltime 7200 seconds
>>>>> if_addaddress6: Invalid argument
>>>>

	# get a /64 and assign it to re0
	ia_pd 2 re0/0

That is wrong, at least in the trunk version.
An SLA of zero without specifying the prefix length now just takes the
prefix as is and assigns it to one interface. What you want is this.

	# Try and make a /64, otherwise take what we're given.
	# (delegated prefix length + interface index) <= 64
	ia_pd 2 re0

or

	# Try and make a /64, otherwise take what we're given.
	# interface index could be >2 which fails when handed a /62.
	ia_pd 2 re0/1

I'm going to try this one:

re1: delegated prefix 2001:984:4b2a:fc::/62
re0: adding address 2001:984:4b2a:fd::1/64
re0: acquired 600226.750768155, now 600226.752412916, diff 0.001644761
re0: adj pltime 3600 seconds, vltime 7200 seconds
re0: adding route to 2001:984:4b2a:fd::/64

it now assigns a /64 addres (but a different one!) and the error message is
gone. So I'm going to try the next one with a sla_id of 0 instead:

or

	# Force a /64.
	# We could use an SLA of 0 here, but it's more clear to use >0.
	ia_pd 2 re0/1/64
  	ia_pd 2 re0/0/64

re1: delegated prefix 2001:984:4b2a:fc::/62
re0: adding address 2001:984:4b2a:fc::1/64
re0: acquired 600583.885924426, now 600583.887089799, diff 0.001165373
re0: adj pltime 3600 seconds, vltime 7200 seconds
re0: adding route to 2001:984:4b2a:fc::/64

and also no error message. I think I'll stay with this one for now.

Good that it's fixed!
Hopefully you can re-test the faulty config if once I fix it problem (sadly i ran out of time today).


Comments on how to improve dhcpcd.conf(5) to reflect this are welcome :)

I've been staring a long time at the various ids that are around.
A short glossary of them, including their range of values, their default
value, and in which context they must be unique, would be welcome.

"sla_id is an integer which must be unique inside the iaid and is added to the prefix which must fit inside prefix_len less the length of the
    delegated prefix."

could probably be clearer as something like

"sla_id (site-level aggregation identifier) is a small integer which
    must be unique inside the iaid and if omitted defaults to the
    interface index. The delegated prefix is zero-padded to the
    prefix_len, and then the sla_id is added. This must fit within the
    padding, i.e. the prefix as delegated must not change. Otherwise
    XYZ happens. This new prefix is used to form addresses."

It isn't clear to me what happens for instance if the delegated prefix
is already 64 bits, the sla_id is 1 (requiring 1 bit) and a total prefix
length of 64 is requested. Does something get truncated?

dhcpcd will refuse to delegate from the prefix because 64 (delegated length) + 1 (sla id in bits) + 64 is greater than /128.


    "The interface index is a small integer, assigned by the operating
system, identifying each interface, and is essentially equivalent to
    the interface's name."

How do I see the interface index anyway? ifconfig doesn't seem to show
it.

I see that https://tools.ietf.org/html/rfc3315 has a nice glossary, I
suppose descriptions of duid, ia, iaid could also be borrowed from there.

    "The duid (DHCP Unique Identifier) is an identification of a DHCP
    participant; each DHCP client and server have exactly one DUID."

Some typos I noticed in the manual:

     hostname name
Sends hostname to the DHCP server so it can be registered in DNS. If hostname is an empty string then the current system hostname is sent. If hostname is a FQDN (ie, contains a .) then it will
             be encoded as such.

several `hostname's should be `name'.

http://roy.marples.name/projects/dhcpcd/info/e1a9ac90521b5537

     ia_na [iaid [/ address]]
Request a DHCPv6 Normal Address for iaid. iaid defaults to the iaid option as described above. You can request more than one
             ia_na by specifying a unique iaid for each one.

what does `address' do? Is it the same/similar as `suffix' in ia_pd?

It literally requests the address you specify.
IA_NA addresses don't have a prefix as such and will always use a /128.

    ia_pd ...
	    In this case prefix_len is increased to the highest multiple
	    of 8 that can accommodate the sla_id.

should that be the lowest multiple of 8? (This might actually answer my
question about too-long sla_ids above)

I think highest is correct?
Anyone else think othewise?

Thanks

Roy


Home | Main Index | Thread Index | Old Index