OPNsense Forum

English Forums => 25.1, 25.4 Production Series => Topic started by: torvaldutne on March 12, 2025, 04:52:45 PM

Title: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: torvaldutne on March 12, 2025, 04:52:45 PM


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.
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: dseven on March 12, 2025, 06:27:39 PM
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...
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: torvaldutne on March 12, 2025, 06:32:26 PM
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.

Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: franco on March 12, 2025, 08:07:09 PM
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
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: torvaldutne on March 13, 2025, 04:41:18 AM
Cycled modem to no effect. Still needed static routes. Tomorrow I will plug a laptop into the modem and see if gets routes. 
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: ProximusAl on March 13, 2025, 09:04:53 AM
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?

(https://i.ibb.co/7xCDhTX4/weee.png) (https://ibb.co/twK6RN4X)

EDIT: I posted this too quick, I am on 25.1.2, not 25.1.3.....
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: torvaldutne on March 13, 2025, 04:28:58 PM



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.




Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: franco on March 13, 2025, 05:23:23 PM
Something scrubbing the default route like a freshly installed WireGuard tunnel or some other VPN?


Cheers,
Franco
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: torvaldutne on March 13, 2025, 05:31:18 PM
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.

Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: franco on March 13, 2025, 05:38:30 PM
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
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: torvaldutne on March 13, 2025, 06:08:30 PM
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.
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: torvaldutne on March 13, 2025, 06:49:54 PM
I've got a pcap of the dhcp request and reply if needed.  Just need a way to get it to someone privately.

Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: 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?


Cheers,
Franco
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: franco on March 13, 2025, 07:27:13 PM
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.
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: torvaldutne on March 13, 2025, 07:30:10 PM


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?

Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: franco on March 13, 2025, 07:32:58 PM
> So I should reboot both of them at the same time?

No but see my PS above.  Sometimes modems give out a private defunct range because they lost sync or are restarting. This can cause a dead end for the client because it's happy with the lease it gets but it's not the one you want.
Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: torvaldutne on March 13, 2025, 07:35:55 PM
Ok I'm going to do what ProximusAl (https://forum.opnsense.org/index.php?action=profile;u=34128) suggested and add the modem's ip to reject leases from and reboot.


Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: torvaldutne on March 13, 2025, 07:39:05 PM
That had no effect. I didn't see the WAN get a private ip, so the setting worked, but I still didn't get the routes.

Attached is the route table while the modem rebooted.

Title: Re: 25.1.3 - DHCP on WAN interface does not pickup any routes from cable modem
Post by: ProximusAl on March 13, 2025, 11:35:05 PM
I just updated to 25.1.3 and it's all fine with my cable modem. Just thought I'd let you know.