Community discussions

MikroTik App
 
tommyd
just joined
Topic Author
Posts: 14
Joined: Mon Apr 03, 2017 10:37 am

7.2 redistribute BGP to OSPF

Fri Apr 15, 2022 10:39 am

How do I change distance of routes imported into OSPF from BGP, and generally how can I control what is redistributed ?

I've tried to set ospf out filter to
if (dst in 10.126.22.0/24) { set ospf-ext-metric 40; set ospf-ext-type type1; set distance 40; accept}
but it doesn't seem to do anything
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7042
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: 7.2 redistribute BGP to OSPF

Fri Apr 15, 2022 2:38 pm

You cannot set distance for output routes, because distance is local to the router. You can set other parametrer like ospf metric or route tag which can then be used to match specific routes and adjust the distance on the remote routers input.
 
eduplant
Member Candidate
Member Candidate
Posts: 139
Joined: Tue Dec 19, 2017 9:45 am

Re: 7.2 redistribute BGP to OSPF

Fri Apr 15, 2022 8:15 pm

I haven’t tested this myself yet but reading @mrz’s response I’m curious. Since setting distance is conceptually invalid in this case, is the result that the entire filter clause fails to be applied? I would naïvely expect that it would just ignore the irrelevant set statement. It seems reasonable that it would still do the match, set the OSPF metric, set the OSPF type, and then accept the route.

@mrz are you just pointing this out for @tommyd’s benefit or are you saying that this is why no routes are being matched at all?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7042
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: 7.2 redistribute BGP to OSPF

Tue Apr 19, 2022 7:51 am

In the original post there is no mention that prefix is not matched at all. Setting distance in the output will not fail to match anything, rule in the first post will still apply ospf ext type and ext metric.
 
tommyd
just joined
Topic Author
Posts: 14
Joined: Mon Apr 03, 2017 10:37 am

Re: 7.2 redistribute BGP to OSPF

Tue Apr 19, 2022 10:24 am

set ospf-ext-metric 40;
doesn't work either
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7042
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: 7.2 redistribute BGP to OSPF

Tue Apr 19, 2022 11:07 am

Then does the prefixes you are trying to match and set ext metric are actually external (LSA type should be "external")?

Who is online

Users browsing this forum: No registered users and 14 guests