Community discussions

MikroTik App
 
bagumka
just joined
Topic Author
Posts: 1
Joined: Wed Sep 02, 2020 5:12 pm
Location: Odesa, Ukraine
Contact:

How to filter output OSPF routes?

Wed Sep 02, 2020 5:45 pm

Image
R3 Config:
/routing ospf instance
set [ find default=yes ] distribute-default=if-installed-as-type-1 \
    redistribute-other-ospf=as-type-1 redistribute-static=as-type-1 \
    router-id=172.255.255.3

/routing ospf area
add area-id=172.16.3.0 comment=LAN name=Area172163

/routing ospf interface
add network-type=broadcast passive=yes
add interface=Tunnel2 network-type=point-to-point use-bfd=yes
add interface=Tunnel5 network-type=point-to-point use-bfd=yes

/routing ospf network
add area=Area172163 network=172.255.255.3/32 comment="mgmt ip"
add area=Area172163 network=172.16.3.0/24
add area=backbone network=192.168.2.0/30
add area=backbone network=192.168.5.0/30

R5 Config:
/routing ospf instance
set [ find default=yes ] router-id=172.255.255.5

/routing ospf area
add area-id=172.16.5.0 name=area172165

/routing ospf interface
add network-type=broadcast passive=yes
add interface=Tunnel5 network-type=point-to-point use-bfd

/routing ospf network
add area=area172165 network=172.255.255.5/32 comment="mgmt ip"
add area=area172165 network=172.16.5.0/24
add area=backbone network=192.168.5.0/30
In this configuration, all routers see all other routers and their networks, and everything working good. But, I don't want to R5 see all routes. I want to filter outgoing routes to R5. for example, Export only 127.16.1.0/24 network, and links to this network 192.168.0.0/16.
You do not have the required permissions to view the files attached to this post.
 
ORP
just joined
Posts: 1
Joined: Tue Sep 01, 2020 9:00 pm
Location: Guatemala

Re: How to filter output OSPF routes?

Fri Sep 04, 2020 8:55 am

If you don't want R5 to see all routes, you can do ospf-in filter accepting the prefixes you want R5 to see and discarding the rest of the prefixes:

R5
/routing filter
add action=accept chain=ospf-in prefix=192.168.0.0/16 prefix-length=16-32
add action=discard chain=ospf-in prefix=0.0.0.0/0 prefix-length=0-32
 
XaTTa6bl4
just joined
Posts: 18
Joined: Wed Dec 16, 2015 10:53 pm

Re: How to filter output OSPF routes?

Fri Sep 04, 2020 1:51 pm

You can make another OSPF instance for R5, or use, for example, BGP for this link

Who is online

Users browsing this forum: No registered users and 20 guests