IPv6 Address Keeps Changing on MacOS With PfSense

I’ve been having this issue for a few weeks, where my IPv6 address kept changing on my laptop. It doesn’t affect me on other devices because they don’t have long-lived connections to things like SSH.

Turns out it’s a bug in pfSense which turned up in a recent update of radvd, where it’s not RFC8106 compilant due to mis-handling RA lifetimes.

There’s supposedly a fix coming in a future version (see here), but for now I need a working network!

Update!

@fabrizior responded in the netgate forum to inform me that the System_Patches package was probably a better way of doing this…

  1. Make a backup of /etc/inc/services.inc
  2. Review the diff for the actual source commit and copy the URL for the “unified diff” link at the bottom of the page
  3. Install the System_Patches package
  4. Add a Patch (System > Patches; Add New Patch)
  5. Click Save
  6. Click “Fetch” for the newly added patch entry and wait for it to update.
  7. Click “Test” and review output
  8. Click “Apply”
  9. Restart the RADVD service
  10. Verify with a grep for “AdvRDNSSLifetime” in /var/etc/radvd.conf - one entry per interface

I tested this and it seemed to do the thing that’s needed, so I reverted my patch and did that. 🧐

The previous fix…

Edit /etc/services.inc, it’s a PHP file that has the functions for handling service restarts.

Go to line 291 (type :set number to turn on line numbering) and add this new line: $radvdconf .= "AdvRDNSSLifetime 3060\n";. You can search for or search for ‘DHCP-PD’` too.

It should look like this if you’ve got line numbers on:

290                 }
291                 $radvdconf .= "AdvRDNSSLifetime 360\n";
292                 $radvdconf .= "};\n";
293         }
294
295         /* handle DHCP-PD prefixes and 6RD dynamic interfaces */

And again lower down, search for write radvd:

386                 }
387                 $radvdconf .= "AdvRDNSSLifetime 360\n";
388                 $radvdconf .= "};\n";
389         }
390
391         /* write radvd.conf */

To restart the service, go into the web interface and do it that way.

Hopefully this’ll fix it!

References



#php #pfsense #ipv6 #rfc8106