DHCPv6-PD – First Steps
sha256.net
sha256.net
The answer to this is usually something like “duh, use DNS”, but how are you going to configure that DNS server if your whole network’s IP address range could change at any time? Yes, multicast DNS is a thing, but it’s not supported in all software (I’m looking at you, OpenBSD, which has no out of the box support for it and I’ve not figured out how to configure it.)
So the real answer is to create a ULA prefix on the side that you generate randomly (or make an easy to remember one because this is residential use, who cares about collisions, it’s a private space) and use that for any use case that involves hardcoded IPs, like DNS server configuration.
But it still feels like a compromise to me. I wish more software was “prefixless”, including DNS server indication and even DNS zone files, such that a lack of prefix means “prepend the prefix you are already communicating on”… Firewall configuration would be simpler, DNS zone files could survive re-prefixing, all sorts of configuration could be made to work this way, but instead you’re left with either a ton of automation to reconfigure things when the prefix changes, a bunch of manual work, or just bite the bullet and use ULA.
Oh, and did I mention that in my particular setup, all my devices would keep trying to communicate on their old addresses even after a new prefix gets assigned and the new RA’s are sent? Meaning they essentially lose all connectivity if you’re using an IPv6-mostly setup like I have? Oh sure, they grab addresses on the new prefix, but they don’t drop the old one until the lifetime expires, which defaults to 4 hours in the environment I’m in (I think the rad daemon in OpenBSD inherits the lifetimes from its upstream router’s lifetimes, which makes the duration Comcast’s fault, but the proper thing to do is rescind the old RA’s when the interface changes addresses, and rad does not do this out of the box for me, or if it does it doesn’t work right.)
Ok rant over. I want to like IPv6 but dynamic prefixes are really the Achilles heel for me.
The current IP allocation/usage procedures are a bit beyond most people
ULA would let you maintain your internal lan with custom subnets and DNS even if you switch carriers or use multiple carriers. No need to update your internal DNS servers for ULA.
If you're running a server on your dynamic residential service, you must be using dyndns for ipv4. So do the same with ipv6.
Residential random prefixes is the nature of residential networks, as ISPs don't want to preserve state. With a business grade service, you'd get a static prefix, much like static ipv4. Then the only time you need to update anything is when you switch your ISP and need to update global DNS addresses for your servers.
[0] Ideally pure v6 if possible; I think there's some way to encapsulate/NAT v4 traffic out from a pure v6 network so I don't actually need dual stack.
Maybe I will write one this weekend and make a hn post.
As for the actual configuration you'll want something specific to your exact network device as learning any of it with a guide for how another device expects the configuration to be entered will be hair pulling.
Multiple carriers has no (consumer level) solution I've found myself happy with. It's anywhere from "hope all your devices handle multiple public prefixes quickly and without errors" to "NAT and deal with the pain you had from v4 again" to "Use some other way to relay or host your static services which need to be externally accessible" to "go back to dealing with trying to automatically update that DNS server entry on and making sure it always stays consistent"
Unless the router says the old prefix now has a valid lifetime of 0 the proper thing to do is actually to wait for the prefix to expire like it seems to be doing. I never had this missing lifetime change problem with Comcast but it's very possible they do things differently in different service areas/for different service types.
And yeah, folks need to understand that ULA addresses are functionally equivalent to RFC 1918 addresses, and ask themselves why they'd expect an ISP who charges extra for an unchanging globally-routable IPv4 address to give you an unchanging globally-routable IPv6 prefix for free.
That's not the same for not changing an ipv6 address
Over the last several decades of me having residential Internet service from a variety of ISPs here in the US, I've never had an IPv4 address that was not globally-accessible. Relatedly, I've never had a guaranteed-static IPv4 address, but I COULD get one if I paid the ISP additional money.
I understand that in other regions of the world NOT being behind CGN is not guaranteed.
> That's not the same for not changing an ipv6 address
Hopefully you now understand the context in which I made my remarks. In the world that I (and many other folks) live in, I get one globally-accessible, but definitely-not-static IPv4 address.
If I use a global unicast prefix, the IPs I see on my devices are their real honest to goodness routable IP. That is great!
But I can’t use that IP in any configuration because it will change. That’s not so great.
So I have to compromise by not using the routable IP in places where I need to put the address in a config file.
Nobody wants ULA. ULA is a solution for the fact that your prefix will change, which I wish didn’t happen.
You can say it’s unreasonable to expect a stable prefix (and we could argue about that all day) but don’t pretend it wouldn’t be massively beneficial if I could rely on one. It is absolutely a compromise. A necessary one? Yes. A reasonably simple solution to implement? Yes. But it’s still a compromise.
> don’t pretend it wouldn’t be massively beneficial
It would be barely beneficial to me.
I don't want to memorize my global prefix anyway.
This is the proper ipv6 solution.
With ipv6, one ethernet interface is _supposed_ to have multiple addresses. You wouldn't want your lan routing to stop working when your ISP goes down, right? So configure your internal DNS with ULA (which should be stable for each machine for a given prefix, even with SLAAC) and be done with it, much like internal DNS using private addresses in ipv4.
For externally visible servers, do the normal thing, that is, those servers dynamically update global dns, much the same way with ipv4 dyndns.
Another learning curve for ipv6 is that people get frustrated by dynamic prefixes, but it's the nature of residential networks: the ISPs want a stateless solution, so customers get a dynamic prefix. Maintaining the same prefix across power outages needs a stateful solution, so only business plans offer them for an extra fee, much like static ipv4 addresses.
And we've had dyndns for decades now for exactly that use case. Just keep using that.
I'm surprised based on my experience: in 15 years of residential IPv6 usage I've always had the same IPv6 prefix (for a given ISP contract of course), even for those ISPs that insisted on handing out dynamic IPv4 with no option for a static one plus had no qualms renewing the IP at any moment, not just power down.
> stateful solution
I'm seeing this the other way around: dynamic needs lease tracking while static just needs a permanent record attached to the already present auth mechanism.
Out of curiosity, what residential ISPs were handing out IPv6 15 years ago?
- I think Free had it since forever and a half, although IIRC it was some weird 6rd or something. Freebox v6 (2011) for sure had it, v5 (2006) may had supported it from the start and for sure supported it down the road, I think v4 could have had it too through an update at least but honestly can't recall.
- Orange in France had a public opt-in experiment for native IPv6 over ADSL to which I enrolled at the time.
- Then I lost IPv6 because I moved to a cable operator which did not support DOCSIS 3.0 (a requirement for IPv6 on cable connections) at the time.
- After that FTTH rolled out and basically every ISP provided native IPv6 on it from the get go.
Non-biz IPv6 support in France is sitting in the ballpark of 99% these days, both residential and mobile. National regulations helped a lot. Residentially there has been a huge plan towards a national FTTH rollout, including in remote areas (the idea being that no one should be cast aside of a full speed internet); this plan also had specific requirements to enforce competition to prevent regional or local monopolistic situations such as the one that historically happened with cable operators (or like the ones I keep hearing about in the US). For mobile it was simpler: you want a radio license for 5G? you have to support IPv6, or else.
Is it that you'd still have the globally addressable addresses on NICs with a ULA too, just that's not what you'd use for routing internally? (Not that I'm really sure of the benefit of that residentially either?)
Whose power outage?
The ISP needs to reliably track allocations despite some of their equipment going out, except in the extreme edge case of their entire operation cold starting.
If the client modem goes out it can just be told the same number again when it boots.
And that's not even getting into how trivially small this amount of information is to save to disk.
Non-persistent allocation has technical benefits when your devices keep moving between nodes or when they're offline most of the time. Otherwise not so much.
If you want stable local addressing, announce a ULA on your LAN. Not all routers support it, unfortunately, but you can announce a ULA from any device. Just don't announce your raspberry Pi as an outbound router.
ULAs use SLAAC and will derive at least one IP address from your devices' MAC address. There's a chance of instability if you have devices with the same MAC addresses (there's detection for that problem but you end up with a race condition after a network reboot), but your network will probably break in other ways if you have such a setup.
I get an /56 by my ISP and have 6 or so different /64 in my residence.
A real world example my ISP provides /56 at the router level but if you put a firewall behind it, that gets a /64 (cannot be changed). Now the firewall cannot further delegate prefixes since it's already used. Some firewalls allow RA pass-through but in my case this wasn't an option so I had to set up NAT66 (non-standard :/) just to get outbound ipv6 connectivity.
What? SLAAC configures addresses on all -er- not-expired prefixes advertised on the link. So, if the border router advertises a ULA prefix and a globally-routeable prefix, SLAAC assigns two addresses to the computer.
If whatever network-configuration tooling you're using causes your computer to not generate an address for every advertised prefix (and you've not told the tooling to behave in this way) then it's broken.
That's a configuration problem on your end. Your border router needs to notice that it's being instructed to switch delegated prefixes and instruct radvd (or whatever route advertising daemon it's using) to advertise the now-defunct prefixes with a zero lifetime just before or just as you're advertising the new prefixes.
With this information, devices on your LAN that aren't asleep will do the right thing, and devices that were asleep should reconfigure their network interfaces when they wake up... assuming that the world hasn't changed while they've been asleep is something only morons would do (coughAppleComputerscough).
I’ll let you guess what daemon is deprecated, and what daemon is the new one you’re supposed to use in OpenBSD.
Upstream:
[DHCPv6]
PrefixDelegationHint=::/56
Downstream: [DHCPv6PrefixDelegation]
Token=::1My config looks like this with systemd 255:
wan.network:
[Network]
DHCP=yes
IPv6AcceptRA=yes
IPForward=yes
[IPv6AcceptRA]
UseDNS=no
DHCPv6Client=yes
[DHCPv6]
UseDNS=no
UseHostname=no
UseDomains=no
PrefixDelegationHint=::/56
[Link]
RequiredForOnline=routable
lan.network:
[Network]
Address=xx.xx.xx.1/24
IPForward=yes
DHCPv6PrefixDelegation=yes
[DHCPv6PrefixDelegation]
SubnetId=0
Token=static:::1
That lan config can be re-used on other vlan interfaces too, to take full advantage of the /56 prefix. Just increment the SubnetID (hex only for some reason, so the next is 0x1).It is mute now. I deployed a new Ubiquiti network including cameras about 6 months ago resulting in the linux router/firewall being replaced with a Dream Machine Pro.
To make it more concrete, imagine for a moment that one's border router has multiple WAN interfaces, each with its own prefix delegated to it.
I notice that there's an UplinkInterface parameter [0], but if the documentation is not silent on whether or not there's any support at all for delegating multiple prefixes to the same LAN interface, then I missed it.
[0] <https://man.archlinux.org/man/systemd.network.5#%5BDHCPPREFI...>
So, some interesting history for the not-network-engineers out there on ipv6 fun. https://issuetracker.google.com/issues/36949085
Why do people hate ipv6? Google comes to mind as one place to start.
In IPv6, you can get an address using RA. DHCPv6 only if you want to smuggle some unrelated metadata as options (which, of course, not widely used outside enterprise). DHCPv6-PD are used only when you need a whole prefix.
If everybody implement all the specs out there, we will have two different DNS record type, 4 or 5 address allocation schemes, a handful of IPv6-over-IPv4 protocol, whole a lots of incomplete and incompatible IPv4-ovr-IPv6 protocol.... Etc... while telling everybody ipv6 is simple and ask why we haven't got there yet
If only RA wasn't mandatory part of IPv6, I am all for DHCPv6.
It's the fault of early IPv6 designers with NIH syndrome created this mess.
But the big loss was that I had no control to reserve a particular IPv6 address for a particular MAC address inside the DHCP server, or assign DNS names automatically, etc. since it's basically 1 way - device receives a RA then configures itself with a random address.
Probably true in a home network, probably not at the office. I hope not at the office.
It's not optimal, but the upstream network provider does not budge, and now everything except Android devices get IPv6 address via DHCPv6.
A lot of the complaints I have seen in the last decade is from ISPs doing silly things and cutting their teeth on fresh IPv6 deployments. My ISP seems to have their collective ducks in a row now, and it has been rock solid for years.
I actually had a case recently where a misbehaving IPv4 IoT device consumed my entire DHCP pool. IPv6 devices kept chugging along without any problem.
Network operators can do crazy things, but if you color outside the lines things may break.
It's common, almost necessary even, for environments with dynamic clients to use /64 subnets (precisely so that SLAAC works), but in a static environment it's perfectly fine to use prefixes larger than /64 (e.g. delegate a /80 to each individual host in a datacenter, for virtualization applications etc).
Hence, I'm wondering what the spec is you mention that is broken?
and to your point, yeah you can step outside the spec and things can work in controlled environments, but "there be dragons" when your dealing with interoperability on a large scale (in this case Android expecting /64s per the RFC)
https://datatracker.ietf.org/doc/html/draft-mishra-6man-vari...
*EDIT*: dhcp6leased landed in base yesterday: https://www.undeadly.org/cgi?action=article;sid=202406040850...
- IPv6 has many different address types.
- Depending on the type you want to bind to it needs to be handled different.
- Some types need an interface ID appended to them.
- This is conditional on the type of the OS.
- Windows has no easy way to get the ID programmatically.
- Some address types need additional bind info like the 'scope id.'
- Whether you can reach a specific addr type in a con depend on the addr you bind to.
- IPv6 was designed to have plenty of addresses so that NAT isn't needed. Guess what: IPv6 can still do NAT like NAT6. In which case you won't have any nice global scope addresses to bind to.
Writing good network code depends on being able to list the interfaces on a machine and the addresses that they have. With IPv6 this is desirable since it lets you know if you have any global scope addresses, what your local-scope addresses are, and other kinds. But from what I've seen seen most programming languages fall back to using default routes for everything. This means that the programmer literally can't lookup the addresses and interfaces for their software.
Also lastly: getting a modern router that properly supports IPv6 isn't easy at all. I literally have a cupboard filled with PoS routers that can't do IPv6 properly. Everything that Telstra and Optus tend to give customers; most Dovado routers; GL inet routers (can do NAT6 but who wants that); 'netgear nighthawk' (I found a security vuln in netgears router when testing v6); and so on. People will say 'just slap Open-wrt on something and call it a day.' But these are the kinds of people who will spend 120+ hours reading the open-wrt wiki and learning electronic basics to setup a custom router. What they think is 'easy' doesn't take into account all the time they've already spent learning such niche BS. I have better things to do than (((just waste 1 billion hours with open-wrt and end up with someone that still doesn't work.)))
'IPv6 is easy. It just works.'
Your other comments simply aren't a substantial concern at end-user sites in the real world.
* The only scopes that end-user sites might care about are global and link-local. I expect that situation is the same at nearly all non-end-user sites. Reading through the RFCs, it looks like the other scopes are ONLY relevant in multicast [0][1]... and even then, anything other than interface-local, link-local, and global looks like it's programmed into the routers and switches of the network, rather than host computers themselves.
* If you have functional IPv6 service at your site, your application software cares as much about the interface's fe80::/10 link-local address as it does about the 169.254.0.0/16 link-local address... that is, not at all. The rule is simple: "If you want to talk globally, use an interface with a global address. If there's no global address, send it to the 'default' router and hope for the best.". It's actually a better situation than in IPv4 where you pretty much never have a globally-connected address.
* Yes, you can do IPv6 NAT. In that case, you're no worse off than in the usual end-user IPv4 deployment. The cool thing about IPv6 is not that NAT doesn't exist, it's that there's far, far more than enough address space to make it so that you don't HAVE to deploy NAT at end-user sites. That doesn't mean that it's impossible for stupid, frightened, currently-ignorant, or revenue-maximizing ISPs to deploy NAT.