What is wrong with my route-map?

I am getting a default gateway via OSPF but I would like to put the default gateway into a separate table. So I created a route-map as follows:

policy {
     prefix-list default4 {
         rule 10 {
             action permit
             prefix 0.0.0.0/0
         }
     }
     route-map ospf-def-gw {
         rule 10 {
             action permit
             match {
                 ip {
                     address {
                         prefix-list default4
                     }
                 }
             }
             set {
                 table 44
             }
         }
     }
}

system {
     ip {
         protocol ospf {
             route-map ospf-def-gw
         }
     }
}

In my understanding, this should filter all routes from OSPF, match 0.0.0.0/0 and set routing table 44.

However:

vyos@SunGate1# run restart ospf
WARNING: This is a potentially unsafe function!
You may lose the connection to the router or active configuration after
running this command. Use it at your own risk!

Continue? [y/N] y
[edit]
vyos@SunGate1# 
vyos@SunGate1# run show ip route table 44
[edit]
vyos@SunGate1# run show ip route 
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

O>* 0.0.0.0/0 [110/10000] via 192.0.2.185, wg0, weight 1, 00:00:02
[...]
[edit]

So the default route still seems to land in the default table and not table 44.
What is wrong with this config?

Thanks!!

The very painful observation is that this only seems to work for BGP, not OSPF.

1 Like