Quote from: schnipp on February 23, 2025, 05:08:31 PMQuote from: Tuxgal on February 22, 2025, 09:11:17 PM[...]
I was doing further searches on this topic and I came across this post from last month where the exact same concern is being pointed out - https://forum.opnsense.org/index.php?topic=44448.msg224885#msg224885
Hey guys I roughly followed your conversation. In regard to the linked thread I did some more investigation over the time. Actually, I have not yet collected all the necessary information to raise a ticket on github and to describe a good solution to be implemented in future versions of Opnsense. But, the solution is rather simple. In the meantime I use a dirty hack. But, the hack will break IPv6 in case the IPv6 prefix change ( using Deutsche Glasfaser the assigned IPv6 prefix is pretty stable).
From my point of view and technical perspective, there is no difference between deriving a SLAAC address from router advertisement messages or a dedicated IPv6 prefix for the WAN interface based on DHCPv6-PD.
You can do the following for enabling IPv6 privacy extensions (example):
1. Configure IPv6 privacy extensions in tunables (adjust the time values ��according to your personal preferences)
- net.inet6.ip6.prefer_tempaddr = 1
- net.inet6.ip6.use_tempaddr = 1
- net.inet6.ip6.temppltime 3600
- net.inet6.ip6.tempvltime 604800
2. Configure the WAN interface to DHCPv6
- request only an IPv6 prefix
- configure a prefix ID
3. On the command line: Based on the dedicated prefix for the WAN interface add an additional IPv6 address with "autoconf" flag enabled (e.g. execute the following command)
- FreeBSD immediately starts generating new IPv6 privacy addresses
- Maybe, instead of assigning a new IPv6, setting the "autoconf" flag for the already existing one should also workCode Select# ifconfig <interface> inet6 <prefix><id>:1111:2222:3333:4444/64 autoconf
Tried this and it works. I see a new temporary address being generated and assigned to the interface.
Code Select
inet6 2600:1234:1111:2220:xxxx:xxxx:xxxx:xxxx prefixlen 64 autoconf temporary pltime 86349 vltime 604800
I see this is the address that is getting used for outgoing connections originating directly from OPNsense, eg.
Code Select
curl v6.ipinfo.io
The Interfaces -> Overview UI page also shows both the addresses as I would expect (even though it was stated incorrectly earlier in the thread by someone that additional addresses will not be visible in the UI).
Yeah like you suggested, if we are able to add autoconf flag to the existing address, that might work. However, not sure if ifconfig supports that. Other option would be to add this new temporary address, and remove the other one using ifconfig. Not sure if this could cause other issues in OPNsense, if it expects this address elsewhere.
Do you know how the precedence is determined for outbound connections when you have multiple GUAs on the same interface? Are temporary addresses by any chance preferred over the fixed ones?