cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
874
Views
0
Helpful
4
Replies

OSPF Route filter

MJU-NETDESIGN
Level 1
Level 1

I have a testlab with 2 routers, for testing some OSPF routning.

(Router 1 is connected to router 2)

Router 1 has the network 10.10.0.0/16 and 172.16.10.0/24

Router 2 has the network 10.100.100.0/24

Is it possible to have af filter on router 1, that only allow the network 10.10.0.0/16 to be routed til router 2 ?

1 Accepted Solution

Accepted Solutions

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Mickey,

as Toshi has observed OSPF filtering can occur only on area borders:

if router 1 is ABR connected to area 0 and area 1.

And router 2 is in area 1 there is a chance to use the command

area x filter-list

that invokes a prefix-list

so that you can permit only the 10.10/16

area 1 filter-list onlynet10 in

ip prefix-list onlynet10 permit 10.10.0.0/16

see

http://www.cisco.com/en/US/docs/ios/iproute/command/reference/irp_osp1.html#wp1011184

other solutions like distribute-list are not technically ospf filters but filters on the IP routing table mantainer process: if a third router is downstream R2 it still receive the OSPF LSA describing net 172.16.10./24.

Hope to help

Giuseppe

View solution in original post

4 Replies 4

hi Mickey,

Are you runing all routers in one area? You can exclude 172.16.10.0/24 from the network statement within an ospf process. If you are asking for "filtering" then you can use "distribution-list in" on Router2 to filter a particular route.

Note: Assuming that you're runing all routers in one area. They have to know the same picture of the area. So what you can do is filter routes to be installed in RIB at Router2

Toshi

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Mickey,

as Toshi has observed OSPF filtering can occur only on area borders:

if router 1 is ABR connected to area 0 and area 1.

And router 2 is in area 1 there is a chance to use the command

area x filter-list

that invokes a prefix-list

so that you can permit only the 10.10/16

area 1 filter-list onlynet10 in

ip prefix-list onlynet10 permit 10.10.0.0/16

see

http://www.cisco.com/en/US/docs/ios/iproute/command/reference/irp_osp1.html#wp1011184

other solutions like distribute-list are not technically ospf filters but filters on the IP routing table mantainer process: if a third router is downstream R2 it still receive the OSPF LSA describing net 172.16.10./24.

Hope to help

Giuseppe

Edison Ortiz
Hall of Fame
Hall of Fame

Another option is using redistribution in router 1 instead of the network statement.

R1:

router ospf 1

network [common subnet between R1 and R2] area 0

redistribute connected subnets route-map CONNECTED

route-map CONNECTED

match ip address CONNECTED

ip access-list standard CONNECTED

permit 10.10.0.0 0.0.255.255

HTH,

__

Edison.

Thx all

I find the solution whit this config :)

router ospf 1

log-adjacency-changes

area 0 filter-list prefix import0 in

area 1 range 10.30.0.0 255.255.0.0

network 10.0.10.0 0.0.0.255 area 0

network 10.0.20.0 0.0.0.255 area 1

ip prefix-list import0 seq 10 permit 10.30.0.0/16

ip prefix-list import0 seq 15 permit 10.100.10.0/24

ip prefix-list import0 seq 20 permit 10.0.20.0/24

Review Cisco Networking products for a $25 gift card