25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem

Started by torvaldutne, March 12, 2025, 04:52:45 PM

Previous topic - Next topic


Hello, first time poster long time lurker. I've had my first problem with opnsense.

I upgraded from 25.1.2 to 25.1.3 and after the requisite reboot my internet access did not work. I dug in and found that I also couldn't reach the web interface of the cable modem.  Eventually, I found that there was no default route at all.  I added, first, a route to the cable modems internal IP.  Looking at the modem it was connected and online with no problems.  I then added the default route and internet access was restored.

I have powered off the modem three times to no effect.  I also rebooted the firewall an additional time.

I've left the static routes in place, for now, so that internet works, but I am concerned that this is happening.  I had no issues with 25.1.2 or previous.

I searched the logs that are available to me in the firewall's web interface for messages about DHCP but found little.  I don't really know how to begin to troubleshoot this problem.  Any advice is very welcome.

Thanks.

Check your WAN_GW gateway - is "Upstream Gateway" enabled? Why that would change with the update to 25.1.3, I'm not sure, but I think it'd be the first thing to check anyway...

It was not checked.  I have checked it now.  When I have time for an interruption, I will reboot the modem and see what the routing table looks like after.  Thanks.


Not sure 25.1.2 to 25.1.3 has any changes regarding this. Also heard no other reports. Missing default gateway setting is indeed a probable cause.


Cheers,
Franco

Cycled modem to no effect. Still needed static routes. Tomorrow I will plug a laptop into the modem and see if gets routes. 

I have cable and mine works ok. 

The only thing I could think, is with cable I use the "Reject Leases From" setting...maybe this has changed on your provider modem?



EDIT: I posted this too quick, I am on 25.1.2, not 25.1.3.....




Quote from: torvaldutne on March 13, 2025, 04:41:18 AMTomorrow I will plug a laptop into the modem and see if gets routes. 
Well my new laptop does not have an ethernet port.  :-(  Luckily it's a Framework so I ordered one.

I did find this in the logs:

2025-03-13T11:19:56-04:00Noticeopnsense/usr/local/etc/rc.newwanip: plugins_configure monitor (execute task : dpinger_configure_do(,[WAN_DHCP]))
2025-03-13T11:19:56-04:00Noticeopnsense/usr/local/etc/rc.newwanip: plugins_configure monitor (,[WAN_DHCP])
2025-03-13T11:19:56-04:00Noticeopnsense/usr/local/etc/rc.newwanip: ROUTING: setting inet default route to REDACTED
2025-03-13T11:19:56-04:00Noticeopnsense/usr/local/etc/rc.newwanip: ROUTING: configuring inet default gateway on wan
2025-03-13T11:19:56-04:00Noticeopnsense/interfaces.php: plugins_configure dhcp (execute task : dhcpd_dhcp_configure())
2025-03-13T11:19:56-04:00Noticeopnsense/interfaces.php: plugins_configure dhcp ()

That suggests it IS getting the default route and applying it correctly but it's not.





Something scrubbing the default route like a freshly installed WireGuard tunnel or some other VPN?


Cheers,
Franco

I thought about that.  I had setup an openvpn and tailscale connection but both are marked disabled and I deleted the interfaces and gateways as well.  I just uninstalled tailscale.


It's been a long time since the last known bug of a missing default route was in the code and it's always difficult to debug. The biggest questions:

1. Is the default route added at all (no matter what dhclient / dhclient-script is claiming).
2. If yes, how long is the default route added? When does it disappear?
3. At the moment it disappears is there some core script running in the log?
4. What happens when you rerun this:

# /usr/local/etc/rc.configure_interface

The general absence of logging messages in this thread could easily indicate we're missing something rather obvious.


Cheers,
Franco

1. Is the default route added at all (no matter what dhclient / dhclient-script is claiming).
2. If yes, how long is the default route added? When does it disappear?

No.  No default route is ever added unless I configure the route manually.  After a reboot of the modem it's interface comes up with a private IP and it assigns a private IP to the wan interface.  This lasts for a bit while it's trying to sync to the provider.  The route for the modem's private ip DOES work during this period.  However, the interface goes down before coming back up with the internet route-able network and IP assignment on WAN.  This is when no routes are added including for the modems private IP.  I have to add a static route for that as well to access the web interface.  The modem is in "bridge mode" so the wan interface does get a public IP.

3. At the moment it disappears is there some core script running in the log? 

How can I check this?  The route for the private network does not last long.

4. What happens when you rerun this:

# /usr/local/etc/rc.configure_interface


root@OPNsense:~ # /usr/local/etc/rc.configure_interface
Configuring WAN interface...done.
Setting up routes for wan...done.
Setting up gateway monitor for WAN_DHCP...done.
Starting DHCPv4 service...done.

Before running the above command I disabled the static routes I had created.  After running the command the default route and the modem's route did not appear in the routing table.

Attached are the current state of the Route Configuration and Route Status screens.

I've got a pcap of the dhcp request and reply if needed.  Just need a way to get it to someone privately.


Are you power-cycling the modem and the OPNsense at the same time? Are both connected directly or through a switch?


Cheers,
Franco

PS: In general you want to reject the lease from the bad private router IP so that dhclient can pick up the right lease once the modem is ready (hence my power cycling question). This tends to happen on power outages more often than not when all devices boot at the same time including the modem.



Quote from: franco on March 13, 2025, 07:25:58 PM
Are you power-cycling the modem and the OPNsense at the same time? Are both connected directly or through a switch?







No, I do one or the other.  They are not going through a switch. The modem is cabled directly to the wan port of the firewall.

So I should reboot both of them at the same time?