Hi
I am going to filter OSPF routes on JunOS but I can reach my goal completely.
Here is the scenario:
On the R5 I could write a policy statement which can filter the most of the routes and what I can see on R1 is like this now:
O 10.10.25.0/24 [110/2] via 10.10.15.5, 02:09:47, GigabitEthernet1.15
O E1 10.10.35.0/24 [110/21] via 10.10.15.5, 00:36:08, GigabitEthernet1.15 ! unwanted, needs to be filteredO E1 10.10.45.0/24 [110/21] via 10.10.15.5, 00:36:08, GigabitEthernet1.15 ! unwanted, needs to be filteredO E1 10.110.0.0/16 [110/21] via 10.10.15.5, 00:36:07, GigabitEthernet1.15
O E1 10.220.0.0/16 [110/21] via 10.10.15.5, 00:36:07, GigabitEthernet1.15
O E1 10.224.0.0/16 [110/21] via 10.10.15.5, 00:36:07, GigabitEthernet1.15
O E1 10.225.0.0/16 [110/21] via 10.10.15.5, 00:36:07, GigabitEthernet1.15
O E1 10.230.0.0/16 [110/21] via 10.10.15.5, 00:36:07, GigabitEthernet1.15
O E1 10.234.247.3/32
[110/21] via 10.10.15.5, 00:36:08, GigabitEthernet1.15
O E1 10.234.247.4/32
[110/21] via 10.10.15.5, 00:36:08, GigabitEthernet1.15
O E1 10.234.247.5/32
[110/21] via 10.10.15.5, 00:36:08, GigabitEthernet1.15
My issue is I could not write a filter so I will be able to filter prefixes like
10.10.35.0/24 or 1
0.10.45.0/24
Here is my configuration on R5:
set policy-options route-filter-list OSPF1->OSPF2 10.0.0.0/8 prefix-length-range /16-/16set policy-options route-filter-list OSPF1->OSPF2 10.234.247.0/24 prefix-length-range /32-/32set policy-options route-filter-list STATIC->OSPF2 10.234.247.5/32 exactset policy-options route-filter-list STATIC->OSPF2 10.0.0.0/8 prefix-length-range /16-/16set policy-options policy-statement OSPF2_EXPORT term 1 from protocol staticset policy-options policy-statement OSPF2_EXPORT term 1 from route-filter-list STATIC->OSPF2set policy-options policy-statement OSPF2_EXPORT term 1 then metric 20set policy-options policy-statement OSPF2_EXPORT term 1 then external type 1set policy-options policy-statement OSPF2_EXPORT term 1 then acceptset policy-options policy-statement OSPF2_EXPORT term 2 from protocol ospfset policy-options policy-statement OSPF2_EXPORT term 2 from route-filter-list OSPF1->OSPF2set policy-options policy-statement OSPF2_EXPORT term 2 then metric 20set policy-options policy-statement OSPF2_EXPORT term 2 then external type 1set policy-options policy-statement OSPF2_EXPORT term 2 then acceptset policy-options policy-statement OSPF2_EXPORT term 4 from protocol directset policy-options policy-statement OSPF2_EXPORT term 4 then metric 20set policy-options policy-statement OSPF2_EXPORT term 4 then external type 1set policy-options policy-statement OSPF2_EXPORT term 4 then acceptset routing-instances OSPF2 instance-type no-forwardingset routing-instances OSPF2 protocols ospf export OSPF2_EXPORT
The same output is observable on R3 or R4 on OSPF domain 1.
Would you please guide how can I filter those mentioned prefixes?
I attached the whole configuration of the router as well
Thank you
Alireza
------------------------------
Ali Soltan
------------------------------