There have been situations wherein we see that in ospf external routes are not filtered on ABR by any of the routers. So we have to configure the external route Filtration on the ASBR Router only. If the Routes enter OSPF domain and traverses without being filtered at ASBR, no filter-list command can be fruitful. Filter-list will only filter Type 3 LSA and not Type 5 LSA.Only workaround would be to configure distribute list on the destination OSPF router requiring limited routes to be learnt. Let’s understand the same with an example –
Router R1 is learning Routes from internal OSPF domain (192.168.x.x and Router Loopbacks) and External Network domain (172.16.x.x).Below snapshot is the output from “show ip route ospf” –
Now , on the ASBR Router we will redistribute only network 172.16.4.0/24 network and deny 172.16.1.0/24 , 172.16.2.0/24 , 220.127.116.11/24 from being propagated into OSPF domain.
Now that we configured selective redistribution (of 172.16.4.0/24 network only) on ASBR , lets see the output on R1 is per expectation –
Now, let’s see how the “area filter-list “command handles the Type 5 and Type 3 LSA.
Important to note that 172.16.1.0/24 upto 172.16.4.0/24 are external LSA Typ5 learnt routes while 18.104.22.168/24, 22.214.171.124/24, 126.96.36.199/24 and 188.8.131.52/24, 192.168.34.0/24 are LSA Type 3 learnt routes.Now on R2, we create Area filter list to deny all the inter-area and externally leant routes via below commands –
Once the filter list on R2 ABR is configured to filter routes learnt by Area 1 , the “show ip route ospf” shows that externally learnt routes are still showing in routing table of R1 while Inter-area (LSA Type 3 learnt) routes are still filtered.
Please see the below link for more information on Type 3 LSA Filtering: