Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Static IPv6 address allocation based on MAC

    Scheduled Pinned Locked Moved IPv6
    8 Posts 3 Posters 856 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hiryu
      last edited by

      Searched around first and couldn't find an answer, though I'm sure SOMEONE must have asked about this before.

      Is it possible to allocate addresses via PfSense/DHCPv6 based on just the Mac address? I need to allocate a consistent address to a device regardless of whether it's booted into another OS, or if the OS has been reinstalled.

      It seems this might be possible with DUID-EN, however, I'm unsure if it's possible for DHCPv6 to insist on DUID-EN.

      While I have worked with IPv6 in the past somewhat, this is my first experience with DHCPv6.

      JKnottJ 1 Reply Last reply Reply Quote 0
      • JKnottJ
        JKnott @hiryu
        last edited by

        @hiryu

        If you want addresses based on the MAC, you don't need DHCPv6. It happens automagically with SLAAC. However, depending on the configuration, a consistent random number might be used instead. The details for changing that depend on the operating system.

        PfSense running on Qotom mini PC
        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
        UniFi AC-Lite access point

        I haven't lost my mind. It's around here...somewhere...

        1 Reply Last reply Reply Quote 0
        • H
          hiryu
          last edited by

          This would require some manual tuning of multiple OS's to result in an identical OS.

          At this point, it's probably easier/faster to just assign the same static address across them... Which means each time there's a new install on any of these machines, manual intervention in terms of network configuration will be necessary...

          Which I suppose isn't the end of the world and probably faster than recreating the static mappings for the update DUID's, and OS installs aren't going to be super common.

          In theory, my prefix is supposed to be static as well.

          JKnottJ 1 Reply Last reply Reply Quote 0
          • JKnottJ
            JKnott @hiryu
            last edited by

            @hiryu said in Static IPv6 address allocation based on MAC:

            In theory, my prefix is supposed to be static as well.

            Mine virtually is. In my experience, the MAC is used with Linux, at least openSUSE, but Windows uses a random number, However, that might be one of the things that can be changed with policies on the domain controller, but I don't know, as I don't work with that sort of thing.

            Regardless, while I haven't tried it on IPv6, pfSense does support static mapping for it, just as it does for IPv4.

            PfSense running on Qotom mini PC
            i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
            UniFi AC-Lite access point

            I haven't lost my mind. It's around here...somewhere...

            1 Reply Last reply Reply Quote 0
            • H
              hiryu
              last edited by

              Yeah, that's the issue... Each OS seems to do its own thing, and then I'm given a different address per OS per machine.

              Interestingly, Ubuntu seems to provide the same DUID/IAID/etc for each interface and I get the same IP for Ethernet as I do for WiFi on my laptop... Which is pretty great and exactly what I want there. I'll have to have different IP's for my laptop in windows, but I'm in linux about 98% (or more) of the time.

              This leaves 3 machines where I'll have to do some manual configuration each time an OS is reinstalled... The rest of the stuff on my network is pretty static as far as changes go. I guess I can live with that.

              I wish there was an option to handle things by mapping IP's directly to MAC addresses like with DHCPv4 as I think this makes sense in some situations, but the above is workable and it is what it is.

              As it stands right now, IPv6 support for my network is beginning to shape up nicely.

              Thanks for the help!

              JKnottJ 1 Reply Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator
                last edited by

                I believe the duid for windows would be here

                HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters\Dhcpv6DUID

                You should be able to change it there to match what you want it to be so it gets the same IP as when you boot your other OSes.

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

                H 1 Reply Last reply Reply Quote 0
                • JKnottJ
                  JKnott @hiryu
                  last edited by

                  @hiryu said in Static IPv6 address allocation based on MAC:

                  Interestingly, Ubuntu seems to provide the same DUID/IAID/etc for each interface and I get the same IP for Ethernet as I do for WiFi on my laptop... Which is pretty great and exactly what I want there.

                  I use openSUSE, but get different addresses for WiFi and Ethernet. However, given that the addresses are MAC based, they'd have to be. However, when connected via Ethernet, the WiFi address is reachable, unlike with Windows.

                  PfSense running on Qotom mini PC
                  i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
                  UniFi AC-Lite access point

                  I haven't lost my mind. It's around here...somewhere...

                  1 Reply Last reply Reply Quote 0
                  • H
                    hiryu @johnpoz
                    last edited by

                    @johnpoz Thanks! This may prove useful!

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.