How can i set a metric for the default route via OSPF.
We want router1 to be the primary default and router2 the back-up for all other routers in our network.
In V6 you could do it under the Instance settings, see screenshot.
In v7 there is no such option, i have tried it with a route filter like: add chain=ospf-out-v2 rule=“if (dst==0.0.0/0) {set ospf-ext-metric 20; accept;}”
But it lookes like it is getting ignored.
Setting metric in v7 is possible only with filters and it looks like you did everything correctly.
Are you using ‘originate-default=always’?
It works for me:
Unfortunately the problem here is that the filters wont work on default dst originated from ‘originate-default=always’.
In my case the default is originated from routing table dst.
So i need to disable the originate-default option
Create a filte rule with: add chain=ospf-out-v2 rule=“if (dst==0.0.0/0) {set ospf-ext-metric 20; accept;}”
And then i lose you, because if i do so no default route is given..
Sorry for not being clear.
Currently it is not possible to change metric for default originated with ‘originate-default=always’ as the filters are not applied in that case.
In my case I had default route within my routing table (static) and so the filter worked as expected.
Oké but on my router1 and router2 i also have a static default route
so in theory i should be possible to give it through to other routers (router3 router4 etc) via a route filter? if i understand you correctly..