IPv6 - why clients get multiple GUA addresses?

My setup is as follows:
the primary router is pfsense and uses a static IPv6 address on the WAN, inside I have set up a DHCPv6 server and the RA mode is set to Managed (or Assisted). Then all clients on the LAN get one GUA address, nice!

On the same LAN I use an OpenWrt router to connect wireless clients, I also set a static IPv6 address on the WAN and LAN. OpenWrt assigns IPv6 to the clients, connectivity works. However, all of its clients (no matter if they are wired or cable) get 3 GUA addresses. I don't like this situation because it is impossible to predict what address will connect to the Internet.

I tried to reconfigure RA flags (M only, O only, M + O) but with no success. How to set OpenWrt to assign only one GUA to clients, what am I missing ?

See RFC4941

2 Likes

You need to disable SLAAC. If you're using LuCi then there's a checkbox on the same tab as where you can select RA flags. If editing by hand then you should add ra_slaac='0' to the lan section of /etc/config/dhcp

But how about clients which are SLAAC only e.g. Android?
Are they still usable in this setup?

Edit: as a workaround when using PBR I use the MAC address which covers both IPv4 and IPv6 so no need to use the IPv6 address in that case.

Nope, it will break them. So it's a bad idea.

The only alternative would be to disable SLAAC directly on each client (if that's a supported option). Although having multiple GUAs is (as most of us know) a perfectly normal situation when using IPv6.

2 Likes

I have looked into disabling the private extension on the client and this is doable but cumbersome, so for my PBR needs I use the MAC address instead of IPv6/IPv4 address and that works well.

1 Like

Since the client could be an Android device, I should use stateless DHCPv6. This means that the IPv6 address will be obtained using SLAAC and, optionally, other information will be obtained from DHCPv6. However, I don't know how to do this in OpenWrt. pfSense provides such a mode.

Assisted: The firewall will send out RA packets and addresses can be assigned to clients by DHCPv6 or SLAAC.

OR

Stateless DHCP: The firewall will send out RA packets and addresses can be assigned to clients by SLAAC while providing additional information such as DNS and NTP from DHCPv6.

Ipv6 is designed to have multiple addresses on an interface.
If you for some reason want a single address then configure your clients accordingly or just live with the fact. The only issue with multiple addresses is that some folks overcomplicating shit and sometimes hold it wrong.

What is the exact issue you encountered with multiple addresses?

2 Likes

You leave SLAAC enabled and set the M and/or 'O` flag on the RA. But clients will end up with multiple addresses.

1 Like

I'm mainly wondering why it's different compared to PFsense. Then look at the following Windows client example (some part of address is randomized but not Interface ID):

   IPv6 Address. . . . . . . . . . . : 2a02:570:90f:181::eb7(Preferred)
   Lease Obtained. . . . . . . . . . : 10 April 2025 12:24:18
   Lease Expires . . . . . . . . . . : 11 April 2025 00:24:18
   IPv6 Address. . . . . . . . . . . : 2a02:570:90f:181:e253:a522:fa76:d5bf(Preferred)
   Temporary IPv6 Address. . . . . . : 2a02:570:90f:181:5da0:4215:467d:672d(Preferred)
   Link-local IPv6 Address . . . . . : fe80::9124:9085:90f6:6411%5(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.1.100(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : 10 April 2025 12:24:20
   Lease Expires . . . . . . . . . . : 11 April 2025 00:24:20
   Default Gateway . . . . . . . . . : fe80::f6ec:38ff:fef3:72f2%5
                                       192.168.1.1
   DHCP Server . . . . . . . . . . . : 192.168.1.1
   DHCPv6 IAID . . . . . . . . . . . : 88086142
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2B-C8-8B-9F-40-16-7E-A9-97-CA
   DNS Servers . . . . . . . . . . . : 2a02:570:90f:181::1
                                       192.168.1.1

When I open test-ipv6.com it identify client according to "Temporary IPv6 Address" - this is confusing. I would expect one of the "IPv6 Address", preferably the first one.
I think I also encountered a problem where it was possible to ping only one GUA from Pfsense.

Not really. Windows creates temporary addresses for that very purpose. It's for outgoings connections and is intended to improve an end user's privacy. The address will regularly change so long term tracking of the IP can't be carried out.

4 Likes

Interesting, I didn't know that. But then it's strange that it doesn't happen on pfsense. And it's the same client, I'm just swapping cables in the ethernet controller (between pfsense and OpenWrt).

You can disable the Windows temporary IPv6 address see e.g.:

But for outgoing traffic e.g. for PBR, I use the MAC address, for incoming traffic I use DHCPv6 to handout a static IPv6 lease, so my windows boxes have an Static IPv6 address, a SLAAC IPv6 address and a temporary IPv6 address.

   IPv6 Address. . . . . . . . . . . : 2001:xxxx:xxxx:e900::59(Preferred)    <<<< static lease
   Lease Obtained. . . . . . . . . . : woensdag 14 mei 2025 13:41:01
   Lease Expires . . . . . . . . . . : woensdag 14 mei 2025 20:03:00
   IPv6 Address. . . . . . . . . . . : 2001:xxxx:xxxx:e900:e5dd:a465:c333:8501(Preferred)
   Temporary IPv6 Address. . . . . . : 2001:xxxx:xxxx:e900:61da:f67b:b025:38d9(Preferred)
   Link-local IPv6 Address . . . . . : fe80::e80e:bff4:4fc9:c333%13(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.0.59(Preferred)
1 Like

Again, not really. If pfsense is sending a different RA with different flags set then client behaviour will be different.

I did a packet capture, most of flags are same, expect RouterPreference.
pfsense sent this:

    MessageType: Router Advertisement, 134(0x86)
  - RouterAdvertisementFlag: 
     M:                (1.......) Managed address configuration
     O:                (.1......) Other stateful configuration
     A:                (..0.....) Not a Mobile IP Home Agent
     RouterPreference: (...11...) Reserved,3(0x3)
  - PrefixInformation: 
     PrefixLength: 60 (0x3C)
   - Flags: 192 (0xC0)
      L:   (1.......) On-Link determination allowed
      A:   (.1......) Autonomous address-configuration
      R:   (..0.....) Not router Address
      S:   (...0....) Not a site prefix
      P:   (....0...) Not a router prefix
      Rsv: (.....000)

OpenWrt sent this:

    MessageType: Router Advertisement, 134(0x86)
  - RouterAdvertisementFlag: 
     M:                (1.......) Managed address configuration
     O:                (.1......) Other stateful configuration
     A:                (..0.....) Not a Mobile IP Home Agent
     RouterPreference: (...00...) Medium,0(0x0)
  - PrefixInformation: 
     PrefixLength: 64 (0x40)
   - Flags: 192 (0xC0)
      L:   (1.......) On-Link determination allowed
      A:   (.1......) Autonomous address-configuration
      R:   (..0.....) Not router Address
      S:   (...0....) Not a site prefix
      P:   (....0...) Not a router prefix
      Rsv: (.....000)

But then I noticed a different PrefixLength and realized that SLAAC can only work with a length of 64. But in pfsense I use 60 for its interface (it's a residue from the lab experiments). After I changed the PrefixLength to 64, the client in pfsense also got more GUA addresses, mystery solved.

And there is a problem with the Windows client, once it gets IPv6 from DHCPv6, it remembers it even after rebooting the OS. So when you change the RA flags, it may seem that nothing has changed for the clients, but in fact it is an OS problem and you need to try the new RA flags with the NEW windows client. :sweat_smile:
(or does anyone know how to flush such an IP ? ipconfig /release6 doesn't help, because the IP appears back when you reconnect the cable)

So the conclusion is: when I changed the RA flags in Openwrt to "O only" and disabled the creation of a Temporary IPv6 address, then the clients only gets one GUA address. :slightly_smiling_face:

Probably Windows doesn't send RELEASE message before reboot. OpenWrt as far as I understand does the same by default (it was different in the past).

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.