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.