Junos OS

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.



Expand all | Collapse all

ospf route advertisement filtering

  • 1.  ospf route advertisement filtering

     
    Posted 09-12-2021 15:26
    hi all

    I want to prevent certain directly connected routes from being advertise into OSPF

    How do i do that ?

    set policy-options policy-statement static_to_ospf term 2 from protocol direct
    set policy-options policy-statement static_to_ospf term 2 from route-filter 192.168.1.0/24 exact
    set policy-options policy-statement static_to_ospf term 2 then reject
    set protocols ospf area 0.0.0.0 interface irb.2
    set protocols ospf area 0.0.0.0 interface irb.97
    set protocols ospf export static_to_ospf

    irb.2 is directly connected to 192.168.1.0/24
    i want to prevent 192.168.1.0/24 from being advertised though irb.97 but still able to receive routing updates

    Thank you


  • 2.  RE: ospf route advertisement filtering

    Posted 09-13-2021 15:58
    Doing it by policy is certainly the way to go, below is the policy to advertise lo0.0 only:
    # Policy for advertising lo0.0 only:
    set policy-options policy-statement OSPF-EXPORT term LO0 from interface lo0.0
    set policy-options policy-statement OSPF-EXPORT term LO0 then accept
    set policy-options policy-statement OSPF-EXPORT term ELSE-REJECT then reject
    
    # Set the policy in OSPF:
    set protocols ospf export OSPF-EXPORT​


    Regards,

    Elvin