Junos OS

 View Only

IMPORTANT MODERATION NOTICE

This community is currently under full moderation, meaning  all posts will be reviewed before appearing in the community. Please expect a brief delay—there is no need to post multiple times. If your post is rejected, you'll receive an email outlining the reason(s). We've implemented full moderation to control spam. Thank you for your patience and participation.



  • 1.  Filtering OSPF routes

    Posted 12-01-2021 05:46
      |   view attached
    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 filtered
    O E1 10.10.45.0/24 [110/21] via 10.10.15.5, 00:36:08, GigabitEthernet1.15 ! unwanted, needs to be filtered
    O 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 10.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-/16
    set policy-options route-filter-list OSPF1->OSPF2 10.234.247.0/24 prefix-length-range /32-/32
    set policy-options route-filter-list STATIC->OSPF2 10.234.247.5/32 exact
    set policy-options route-filter-list STATIC->OSPF2 10.0.0.0/8 prefix-length-range /16-/16

    set policy-options policy-statement OSPF2_EXPORT term 1 from protocol static
    set policy-options policy-statement OSPF2_EXPORT term 1 from route-filter-list STATIC->OSPF2
    set policy-options policy-statement OSPF2_EXPORT term 1 then metric 20
    set policy-options policy-statement OSPF2_EXPORT term 1 then external type 1
    set policy-options policy-statement OSPF2_EXPORT term 1 then accept
    set policy-options policy-statement OSPF2_EXPORT term 2 from protocol ospf
    set policy-options policy-statement OSPF2_EXPORT term 2 from route-filter-list OSPF1->OSPF2
    set policy-options policy-statement OSPF2_EXPORT term 2 then metric 20
    set policy-options policy-statement OSPF2_EXPORT term 2 then external type 1
    set policy-options policy-statement OSPF2_EXPORT term 2 then accept
    set policy-options policy-statement OSPF2_EXPORT term 4 from protocol direct
    set policy-options policy-statement OSPF2_EXPORT term 4 then metric 20
    set policy-options policy-statement OSPF2_EXPORT term 4 then external type 1
    set policy-options policy-statement OSPF2_EXPORT term 4 then accept

    set routing-instances OSPF2 instance-type no-forwarding
    set 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
    ------------------------------

    Attachment(s)

    txt
    JMX.txt   8 KB 1 version