26.7 DHCP WAN gateway online but no IPv4 default route after boot

Started by pstretch, July 18, 2026, 06:47:39 PM

Previous topic - Next topic
I've been investigating an issue on OPNsense 26.7 where the WAN interface obtains a DHCP lease successfully and the associated gateway appears online, but the firewall does not install an IPv4 default route after boot.

Symptoms
  • WAN interface is configured via DHCP.
  • DHCP lease is acquired successfully.
  • Gateway status shows the WAN gateway as online.
  • No IPv4 default route exists in the routing table after startup.
  • As a result, outbound Internet connectivity does not work.
  • Gateway monitoring continues to report the gateway as online despite the missing default route.

Diagnosis

Immediately after boot:

  • WAN interface has a valid DHCP address.
  • Gateway object exists and is reported as online.
  • Routing table does not contain a default IPv4 route (0.0.0.0/0).

Running the following command manually restores normal operation:
configctl interface routes configure

After executing the command:

  • The default IPv4 route is installed.
  • Internet connectivity is restored immediately.
  • No further intervention is required until the next reboot.

#After reboot
netstat -rn4 | grep default
# no output

# Fix
configctl interface routes configure
 
# Afterwards
netstat -rn4 | grep default
default 83.217.167.129 UGS igb0


Has anyone seen a similar problem or have any further information, please?


I also have this exact problem. I got it to work and survive boot by editing default gateway and selecting "Disable Gateway Monitoring". I guess OPNsense doesn't set default route for gateway if getting IP address for the WAN takes too much time after boot. Something has changed in the 26.7 version. 

Hello

We are experiencing a similar problem.

The issue is not that no default gateway exists. Rather, the system selects an incorrect gateway instead of the intended upstream gateway. We believe this occurs because the correct gateway takes longer to initialize at boot, and the system temporarily uses an alternative gateway that is already available.

Other forum posts mention DHCP issues and delayed WAN interface initialization. This appears to be the common factor.

The following solutions have worked for us (temporary workaround):

Option 1: Click «Apply» in the WEB UI Router/Gateway configuration, or
Option 2: Execute: configctl interface routes configure

This forces a route recalculation and ensures the correct gateway is used.

Please note: This fix is not permanent. After a reboot, the problem reoccurs and the same steps must be repeated.

This seems to be similar to what we're experiencing here: https://forum.opnsense.org/index.php?topic=52470.0 we also have a non working default gateway (default route is not pointing to the right gateway or not there at all even though WAN is up and working). We're having this especially during HA failover.

Going in gateways (without changing anything in the gateways) and clicking simply apply fixes the routes and puts the right gateway so I guess it is likely calling configctl interface routes configure in the backend


I still appear to be having an issue with the default route being set on the WAN interface even after upgrading to 26.7.1_1. The default route eventually gets set, but only after a 120 second delay. This behavior was not present in 26.1.11. Here is an except from /var/log/system/latest.log (private date x'd out):

<13>1 2026-07-28T05:17:37-07:00 xx.xx.xx dhclient 18288 - [meta sequenceId="327"] dhclient-script: Reason PREINIT on igc0 executing
<13>1 2026-07-28T05:17:37-07:00 xx.xx.xx dhclient 19655 - [meta sequenceId="328"] dhclient-script: Reason REBOOT on igc0 executing
<13>1 2026-07-28T05:17:37-07:00 xx.xx.xx dhclient 20343 - [meta sequenceId="329"] dhclient-script: New Hostname (igc0): sdfirewall
<13>1 2026-07-28T05:17:37-07:00 xx.xx.xx dhclient 20589 - [meta sequenceId="330"] dhclient-script: New IP Address (igc0): xx.xx.xx.xx
<13>1 2026-07-28T05:17:37-07:00 xx.xx.xx 21145 - [meta sequenceId="331"] dhclient-script: New Subnet Mask (igc0): 255.255.248.0
<13>1 2026-07-28T05:17:37-07:00 xx.xx.xx dhclient 21710 - [meta sequenceId="332"] dhclient-script: New Broadcast Address (igc0): 255.255.255.255
<13>1 2026-07-28T05:17:37-07:00 xx.xx.xx dhclient 22037 - [meta sequenceId="333"] dhclient-script: New Routers (igc0): xx.xx.xx.xx
<13>1 2026-07-28T05:17:37-07:00 xx.xx.xx dhclient 23589 - [meta sequenceId="334"] dhclient-script: Creating resolv.conf
<13>1 2026-07-28T05:17:37-07:00 xx.xx.xx opnsense 25214 - [meta sequenceId="335"] /usr/local/etc/rc.newwanip: IP renewal deferred during boot on 'igc0'

After a 120 second pause, log continues and the default route and all daemons/services are started properly

<13>1 2026-07-28T05:19:37-07:00 xx.xx.xx kernel - - [meta sequenceId="1"] <118>[23] Configuring WireGuard VPN...done.
<13>1 2026-07-28T05:19:37-07:00 xx.xx.xx kernel - - [meta sequenceId="2"] <118>[145] Starting NTP service...done.
<12>1 2026-07-28T05:19:38-07:00 xx.xx.xx opnsense 927 - [meta sequenceId="3"] /usr/local/etc/rc.bootup: warning: ignoring missing default tunable request: vm.pmap.pti
<12>1 2026-07-28T05:19:38-07:00 xx.xx.xx opnsense 927 - [meta sequenceId="4"] /usr/local/etc/rc.bootup: warning: ignoring missing default tunable request: hw.ibrs_disable
<13>1 2026-07-28T05:19:39-07:00 xx.xx.xx kernel - - [meta sequenceId="5"] <118>[145] Starting Unbound DNS...done.
<13>1 2026-07-28T05:19:39-07:00 xx.xx.xx kernel - - [meta sequenceId="6"] <118>[146] >>> Invoking start script 'newwanip'
<13>1 2026-07-28T05:19:39-07:00 xx.xx.xx kernel - - [meta sequenceId="7"] <118>[146] Reconfiguring IPv4 on igc0
<13>1 2026-07-28T05:19:39-07:00 xx.xx.xx kernel - - [meta sequenceId="8"] <118>[146] >>> Invoking start script 'freebsd'
<13>1 2026-07-28T05:19:39-07:00 xx.xx.xx opnsense 18515 - [meta sequenceId="9"] /usr/local/etc/rc.newwanip: IP renewal starting (new: xx.xx.xx.xx, old: , interface: wan, device: igc0, force: yes)
<13>1 2026-07-28T05:19:39-07:00 xx.xx.xx opnsense 18515 - [meta sequenceId="10"] /usr/local/etc/rc.newwanip: ROUTING: entering configure using wan
<13>1 2026-07-28T05:19:39-07:00 xx.xx.xx opnsense 18515 - [meta sequenceId="11"] /usr/local/etc/rc.newwanip: ROUTING: configuring inet default gateway on wan
<13>1 2026-07-28T05:19:39-07:00 xx.xx.xx opnsense 18515 - [meta sequenceId="12"] /usr/local/etc/rc.newwanip: ROUTING: setting inet default route to xx.xx.xx.xx
<13>1 2026-07-28T05:19:39-07:00 xx.xx.xx opnsense 18515 - [meta sequenceId="13"] /usr/local/etc/rc.newwanip: plugins_configure monitor (,[WAN_DHCP])
...
...
...

This behavior occurs with or without Gateway Monitoring enabled. Any help on this would be greatly appreciated as my clients are offline for an additional 120 seconds everytime I have to reboot.