OPNsense Forum

English Forums => General Discussion => Topic started by: Linwood on June 20, 2026, 09:08:34 PM

Title: Help with OSFP setup and default gateway advertisement
Post by: Linwood on June 20, 2026, 09:08:34 PM
I'm missing something, all the postings I've found didn't wor (but I may have missed some).

I have two opnsense systems that are local and trying to set up as a test bed for a future WAN deployment.

Right now I have them connected via an ethernet interface (VLAN 23) and am running ospf on each to exchange routes. That works fine for the subnets attached to each (that are selected).

But I want one of them to advertise it's default gateway to the other so that this other (downstream) opnsense sees this VLAN 23 connection as a default gateway.

More specifically:
   OPNsense A (upstream, internet connected) :
    WAN connection (external internet) is up, marked as upstream and a gateway.  It's the only (ipv4) gateway
    OSPF - set to advertise default gateway (with a metric of 33 so it shows oddly)
    Various settings of Route Redistribution tried, in particular Connected and Statically
    Area 0.0.0.166, stub, no-summary (can't selected anything but stub or worse)
    Networks: VLAN for interconnect's subnet, plus LAN subnet
    Interfaces: VLAN for interconnect and LAN
   Opnsense B:
    WAN connection currently disabled
    Interconnect VLAN does NOT inherit a default gateway from DHCP (I have it explicitly off in DHCP option 3 for A)
    No default gateay under system, gateway
    OSPF no redistribution set (though i've tried several)
    Area: 0.0.0.166, stub, no-summary
    Networks: subnet of LAN, subnet of interconnected VLAN (i.e. same as set in A)
    Interfaces: VLAN for interconnect, LAN

I end up with all the routes exactly as expected to the various VLAN's.

Under diagnostics, OSPF, I see a "N IA" entry for 0.0.0.0/0 cost 2 for the address on VLAN 23 for A.  Metric is not the 33(+/-) I expected.

On B a shell netstat -r shows no default gateway.

So it's seeing a default gateway (though inter-area not redistributed), but not adding it to the route table.

Nothing interesting in the frr/ospf logs (loading done)

Listing 0.0.0.0/0 on A as a subnet seems to have no impact.

I can distribute the actual WAN's subnet and that works fine, but it doesn't yield a default gateway, only an external subnet's visibility.

Am I missing something?  Do I have to create a static route to the default gateway (right now it's a WAN DHCP from ISP, but it's present and marked upstream)?

PS. Least someone ask this is preparation for a solar powered remote device which will have a cellular modem and also a RF connection.  That RF connection will normally provide the default gateway when it's up, but when down the cellular should, so I want to inject the default via OSPF otherwise it gets "stuck" if it comes in via DHCP as due to the hardware involved the ethernet interface can still be up if the RF connection is down, but OSPF will go away, which will take its routes away, and I want 0.0.0.0 included.