I had initially thought this might be related to OPNSense, but I've found dhclient is not installing the default gateway under *certain circumstances*.
The circumstances are using a netgear cable modem and getting double DHCP. Apparently initially the netgear device (CM2000) hands out an RFC1918 address, along with default gateway. Right afterwards, the cableco offers a public ipv4 on a /23, and while the address changes, the default gateway does not.
It seems like something's happening slightly out of sequence on the second (and final) public IP DHCP, where the default gateway is in fact, not getting installed.
The workaround is that I ssh into the system from a different local interface and manually set the default gateway using "route add" - it's very easy to do, but also very mandatory on every reboot.
I can also leave it untouched for multiple cycles and it doesn't seem to repair itself. Not 100% sure what's breaking but also in the logs I get these two messages (with some context before/after):
Not blaming by any stretch, seems like weird behavior for the cable modem, I'm wondering if there's a way to resolve or if /etc/dhclient.conf can be adjusted to somehow work around this cable modem behavior. My current dhclient.conf is empty aside from comments (no adjustments yet).
FWIW I spent quite a bit of time with FreeBSD and IPFW way back in the day. A little more later with PF, but went away from it for years, stayed near with JunOS, and just came back to non commercialized FreeBSD a few months ago running OPNSense for the home router.
Forgot how much I loved the efficiency of the OS, and the performance of the IP stack / kernel fw
The circumstances are using a netgear cable modem and getting double DHCP. Apparently initially the netgear device (CM2000) hands out an RFC1918 address, along with default gateway. Right afterwards, the cableco offers a public ipv4 on a /23, and while the address changes, the default gateway does not.
It seems like something's happening slightly out of sequence on the second (and final) public IP DHCP, where the default gateway is in fact, not getting installed.
The workaround is that I ssh into the system from a different local interface and manually set the default gateway using "route add" - it's very easy to do, but also very mandatory on every reboot.
Code:
<13>1 2025-07-25T18:32:54+00:00 OPNsense.localdomain dhclient 25176 - [meta sequenceId="353"] dhclient-script: Reason PREINIT on igc0 executing
<13>1 2025-07-25T18:32:54+00:00 OPNsense.localdomain dhclient 28704 - [meta sequenceId="354"] dhclient-script: Reason EXPIRE on igc0 executing
<13>1 2025-07-25T18:32:54+00:00 OPNsense.localdomain dhclient 32152 - [meta sequenceId="355"] dhclient-script: Reason PREINIT on igc0 executing
<13>1 2025-07-25T18:32:54+00:00 OPNsense.localdomain dhclient 34599 - [meta sequenceId="356"] dhclient-script: Reason ARPSEND on igc0 executing
<13>1 2025-07-25T18:32:54+00:00 OPNsense.localdomain dhclient 35609 - [meta sequenceId="357"] dhclient-script: Reason ARPCHECK on igc0 executing
<13>1 2025-07-25T18:32:55+00:00 OPNsense.localdomain dhclient 36796 - [meta sequenceId="358"] dhclient-script: Reason BOUND on igc0 executing
<13>1 2025-07-25T18:32:55+00:00 OPNsense.localdomain dhclient 37792 - [meta sequenceId="359"] dhclient-script: New IP Address (igc0): 192.168.100.10
<13>1 2025-07-25T18:32:55+00:00 OPNsense.localdomain dhclient 38707 - [meta sequenceId="360"] dhclient-script: New Subnet Mask (igc0): 255.255.255.0
<13>1 2025-07-25T18:32:55+00:00 OPNsense.localdomain dhclient 39854 - [meta sequenceId="361"] dhclient-script: New Broadcast Address (igc0): 192.168.100.255
<13>1 2025-07-25T18:32:55+00:00 OPNsense.localdomain dhclient 41450 - [meta sequenceId="362"] dhclient-script: New Routers (igc0): 192.168.100.1
<13>1 2025-07-25T18:32:55+00:00 OPNsense.localdomain dhclient 44951 - [meta sequenceId="363"] dhclient-script: Creating resolv.conf
<13>1 2025-07-25T18:33:56+00:00 OPNsense.localdomain dhclient 56021 - [meta sequenceId="398"] dhclient-script: Reason EXPIRE on igc0 executing
<13>1 2025-07-25T18:33:56+00:00 OPNsense.localdomain dhclient 59211 - [meta sequenceId="399"] dhclient-script: Reason PREINIT on igc0 executing
<13>1 2025-07-25T18:33:56+00:00 OPNsense.localdomain dhclient 62005 - [meta sequenceId="400"] dhclient-script: Reason ARPSEND on igc0 executing
<13>1 2025-07-25T18:33:57+00:00 OPNsense.localdomain dhclient 63406 - [meta sequenceId="401"] dhclient-script: Reason ARPCHECK on igc0 executing
<13>1 2025-07-25T18:33:57+00:00 OPNsense.localdomain dhclient 64503 - [meta sequenceId="402"] dhclient-script: Reason BOUND on igc0 executing
<13>1 2025-07-25T18:33:57+00:00 OPNsense.localdomain dhclient 67460 - [meta sequenceId="403"] dhclient-script: New IP Address (igc0): xxx.xxx.207.105
<13>1 2025-07-25T18:33:57+00:00 OPNsense.localdomain dhclient 68265 - [meta sequenceId="404"] dhclient-script: New Subnet Mask (igc0): 255.255.254.0
<13>1 2025-07-25T18:33:57+00:00 OPNsense.localdomain dhclient 69227 - [meta sequenceId="405"] dhclient-script: New Broadcast Address (igc0): xxx.xxx.207.255
<13>1 2025-07-25T18:33:57+00:00 OPNsense.localdomain dhclient 70453 - [meta sequenceId="406"] dhclient-script: New Routers (igc0): xxx.xxx.206.1
<13>1 2025-07-25T18:33:57+00:00 OPNsense.localdomain dhclient 73338 - [meta sequenceId="407"] dhclient-script: Creating resolv.conf
Code:
<13>1 2025-07-25T18:31:51+00:00 OPNsense.localdomain dhclient 57809 - [meta sequenceId="345"] dhclient-script: Reason RENEW on igc0 executing
<13>1 2025-07-25T18:31:51+00:00 OPNsense.localdomain dhclient 59145 - [meta sequenceId="346"] dhclient-script: Creating resolv.conf
<27>1 2025-07-25T18:32:20+00:00 OPNsense.localdomain dhclient 63149 - [meta sequenceId="348"] connection closed
<26>1 2025-07-25T18:32:20+00:00 OPNsense.localdomain dhclient 63149 - [meta sequenceId="349"] exiting.
<13>1 2025-07-25T18:32:54+00:00 OPNsense.localdomain dhclient 25176 - [meta sequenceId="353"] dhclient-script: Reason PREINIT on igc0 executing
<13>1 2025-07-25T18:32:54+00:00 OPNsense.localdomain dhclient 28704 - [meta sequenceId="354"] dhclient-script: Reason EXPIRE on igc0 executing
<13>1 2025-07-25T18:32:54+00:00 OPNsense.localdomain dhclient 32152 - [meta sequenceId="355"] dhclient-script: Reason PREINIT on igc0 executing
FWIW I spent quite a bit of time with FreeBSD and IPFW way back in the day. A little more later with PF, but went away from it for years, stayed near with JunOS, and just came back to non commercialized FreeBSD a few months ago running OPNSense for the home router.
Forgot how much I loved the efficiency of the OS, and the performance of the IP stack / kernel fw

