I’ve looked into how to configure IPv6 with DHCPv6-PD. Something that I haven’t found the answer to though is why the documentation states that the sla-id parameter must be larger than 0?
Specifically: “Specify the identifier value of the site-level aggregator (SLA) on the interface. ID must be a decimal number greater then 0 which fits in the length of SLA IDs (see below).” (source)
This doesn’t seem to be a limit enforced in the interface definitions and isn’t explained anywhere from what I can see. I’ve also seen multiple people use sla-id 0 with VyOS based on forum threads and reddit posts.
Even if this isn’t something enforced by the standard, is it some form of best practice or convention not to use sla-id 0? Is there a good reason to avoid it?
sla-id ID ;
This statement specifies the identifier value of the site-level aggregator (SLA) on the interface. ID must be a decimal integer which fits in the length of SLA IDs (see below). For example, if ID is 1 and the client is delegated an IPv6 prefix 2001:db8:ffff::/48, dhcp6c will combine the two values into a single IPv6 prefix, 2001:db8:ffff:1::/64, and will configure the prefix on the specified interface.
sla-len length ;
This statement specifies the length of the SLA ID in bits. length must be a decimal number between 0 and 128. If the length is not specified by this statement, the default value 16 will be used.
So I think the proper format should be:
<format>u32:0-2**128-1</format>
I have no idea on how to define 2^128-1 as a number in the format definition but since u32 is used Im guessing the largest allowable number would then be 2^32-1 which is 4294967295.
Ok, so there is nothing stopping me from using sla-id 0 if that results in a shorter address (i.e. if the prefix I get happens to have zeros before that which have been truncated by ::)? That matches what I found.
Thanks!
Let’s see if someone else has some wisdom to share. If not, I might just try it. The thread will probably be automatically closed before I get a chance to do so and report back though.
Well technically you have the netaddress (and broadcast) with IPv6 aswell so I think it could be wise to avoid using ::0 as a host address (that is the first IPv6 of your range) unless you have a routed network (for example one range used for routing and another for the host itself then its fine to use ::0 for IPv6 or .0 for IPv4).
As @Apachez noted, as in ipv4 using the network-bit in ipv6 is not allowed, so the first address in a subnet is not accessible to be used as a normal ip host address. (but a router could use it as a nat-destination address if your router supports it)
And as you noted you could remove the leading zeros in a block and truncate the ipv6 address on zero-blocks.
as an example:
if your’e allocated the range: 2001:0555:0045::/48 and using sla-id 0 you could use the first ip in that subnet 2001:0555:0045:0000:0000:0000:0000:0001/64 or written in the shorter way: 2001:555:45::1/64
but keep in mind that the first address is often (but not required) to be to the router in the subnet.
Using ::0:1 is just fine, which will be probably written as ::1.
I was refering to the cornercase of using ::0:0 if the network range starts with the same IPv6.
Back in the days of IPv4 there were some vendors and models who incorrectly interpreted “no ip subnet zero” as IPv4 of x.x.x.0 is always forbidden. But that is only the case of lets say 192.168.0.0/24 where 192.168.0.0 is not a valid host IP.
But if your range is lets says 192.168.0.0/16 then only 192.168.0.0 is not valid as host, 192.168.1.0 is perfectly valid as a host for that range.
192.168.0.0 is also valid routingwise (only for the local network its not valid as a host) since routers in between dont know if the range is 192.168.0.0/24 or 192.168.0.0/16 or just a default of 0.0.0.0/0.
Yeah, I just wrote it as ::0:1 to make it clear what I was talking about. As you mentioned, the point of that would be to get a shorter and nicer looking IPv6 address.
@runar Yes, I intend this to be the address for the VyOS router.
So basically we think this is a documentation error? I already submitted another fix/clarification for the docs yesterday, so if I can get some confirmation from the VyOS developers that it’s indeed wrong, I could submit a fix for that too.
Only reason I can find to not use ::1 through DHCP6-PD is that this is often used as default gateway in IPv6 world. While in IPv4 world when using /24 you normally use either .1 or .254 (I prefer the later (.254) because the hosts can then be .1 and upwards).
On the other hand something thats getting more and more common in IPv6 world is to use linklocal as default gateway and nexthops.
If they delegate a prefix to me, the ISP shouldn’t be using any of it for anything. Link-local is enough to use as the default route and the proper way to do it as far as I understand. If they don’t, they need to use an address in some other prefix as the default route. Therefore I don’t see why I wouldn’t be able to use ::1 of my first prefix for my router.
I do know there are some ISPs that have very hacky IPv6 implementations that break all kinds of rules. However, my new ISP follows the RIPE-690 recommendations from what I’ve been told.
Even if thats technically true I wouldnt be surprised if there exist some more or less “logical” inventions on how to use one or another feature such as DHCP6-PD.
After all we still have people doing PPPoE these days even if thats technically shouldnt be needed