I have a local gateway for all other subnet traffic
0.0.0.0/0 via 10.0.1.1 distance 1
I have an OSPF running for network 10.0.2.0/24 and I want that to go out 10.0.2.1
the router has a 10.0.2.2 address which it correctly advertises
it can also see 10.0.2.1 correctly on the two links
10.0.2.1/32 via 10.220.66.45%vlan66_sfp2 distance 110
10.0.2.1/32 via 10.221.66.45%vlan66_sfp2 distance 110
I can can ping between 10.0.2.1 and 10.0.2.2 correctly
If I create an ospf default gateway it gives me
0.0.0.0/0 via 10.220.66.45%vlan66_sfp2 distance 110
0.0.0.0/0 via 10.221.66.45%vlan66_sfp2 distance 110
So the 10.0.2.2 traffic still goes out local
if I increase the main gateway > 110 everything tries to go out the ospf
So how do I get only the traffic from 10.0.2.2 traffic to go out 10.0.2.1 ???
Make an export to a text file of your router’s current configuration. Remove confidential information (passwords, serial numbers, etc.) from this file and post it in this thread in the CODE tags.
TBF your description is not clear (at least for me).
By default, if you have, for example, 0.0.0.0/0 via ISP and 10.0.2.0/24 via vlan66, no matter the distance, 10.0.2.0/24 should go via vlan ignoring default gateway, as more “strict” routes have priority.
Since it doesn’t work for you as described, better provide a diagram with network destinations you desire
Its four routers and the Public route complexity dwarfs the problem of this which is monitoring.
However the setup comes up normally with a backup access link so perhaps lets start there
So if you have a connection to an ISP and a gsm plugged in for private out of band access
So the default route is to the isp
0.0.0.0/0 next-hop xxx.xxx.xxx.xxx distance 1 table=main
The backup route on a route table will be to the gsm
0.0.0.0/0 next-hop yyy.yyy.yyy.yyy distance 1 table=gsm_out
You the mangle mark the packets coming in from gsm to go back out the gsm table
No problem.
So now replace the the GSM with an OSPF I somehow need to get a route into the OSPF the eqivalent of
0.0.0.0/0 next-hop yyy.yyy.yyy.yyy distance 1 table=ospf_out
If I add static route redistribution to the ospf I also get the main ISP route and I can’t filter it because they
are both 0.0.0.0/0
The filter I need is the route table but that isn’t available, so is there another way?
By default OSPF instances will use the main routing table, you can specify a VRF to be used instead.
Otherwise you may be able to use protocol property in your existing filter to determine the source, there are also rtab and vrf properties for routing table and VRF names.