OPNsense Forum

English Forums => 25.7 Series => Topic started by: nerd on July 27, 2025, 11:14:53 PM

Title: Assign prefix ID
Post by: nerd on July 27, 2025, 11:14:53 PM
Can someone explain the details regarding getting/offering the correct/a specific prefix from an ISP?

Say I should get the following range:
eg. 2001:db8:ffff:ff00:0000:0000:0000:0000/56   
The prefix in this would be    2001:db8:ffff:ff00::0/56

Now, say i want 2001:db8:ffff:ff01::0/64 for one vlan 1  and 2001:db8:ffff:ff02::0/64 for vlan 2 and 2001:db8:ffff:ff79::0/64 for vlan 79.
How do I go about configuring OPNsense prefix IDs to enable that?

Should the prefix ID for vlan 1: 01, vlan 2: 02 and vlan 79: 79?

Or am I completely wrong here? Or is my ISP not giving me the correct range?




Title: Re: Assign prefix ID
Post by: meyergru on July 27, 2025, 11:32:43 PM
You are correct, the assigned prefix ID is exactly the remaining 128-64-56 = 8 bits, because an IPv6 has 128 bits, of which the subnet has 64 and you got 56 bits prefix, to which you add 8 bits per VLAN.
Title: Re: Assign prefix ID
Post by: bimbar on July 28, 2025, 11:14:07 AM
Pretty much, but I would like to add the following:

2001:db8:ffff:ff00:0000:0000:0000:0000/56 != 2001:db8:ffff:ff::0/56
2001:db8:ffff:ff00:0000:0000:0000:0000/56 == 2001:db8:ffff:ff00::0/56
Title: Re: Assign prefix ID
Post by: nerd on July 28, 2025, 12:48:55 PM
uch, you are correct off course. corrected my previous post.

Follow-up Q:
The Optional interface ID is then simply the last 64 bits (60 really) to select the actual interface IP address?

Interface ID 0000000000000001 for 2001:db8:ffff:ff79:0000:0000:0000:0001 interface IP or
Interface ID 0000000000000254 for 2001:db8:ffff:ff79:0000:0000:0000:0254 interface IP or (at most)
Interface ID 7fffffffffffffff for 2001:db8:ffff:ff79:7fff:ffff:ffff:ffff interface IP?  (so actually the last 60 bits)

Title: Re: Assign prefix ID
Post by: meyergru on July 28, 2025, 01:19:49 PM
Yes. You can override the EUI-64 that would be used otherwise.
Title: Re: Assign prefix ID
Post by: nerd on July 28, 2025, 01:24:36 PM
cool, much appreciated for the answers (and corrections).