Routing

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 13:43
    under the interface irb.2 try to turn on the "no-advertise-adjacency-segment" knob and commit it. See if that will take it out of LSDB on the remote end. 

    https://www.juniper.net/documentation/us/en/software/junos/ospf/topics/ref/statement/no-advertise-adjacency-segment-edit-protocols-ospf-interface-level.html

    ------------------------------
    Derek Summitt
    ------------------------------



  • 3.  RE: ospf route advertisement filtering

    Posted 09-13-2021 14:57
    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




  • 4.  RE: ospf route advertisement filtering

    Posted 09-13-2021 15:58
    What is your experience with this policy that you have applied now? What is actually occurring and showing up in your LSDB?

    Do you have a term 1 before this term 2? Also you might need an accept-all term after that term 2 if the only terms in this policy is a reject statement.

    Elvin has a nice example too where it'll reject everything and you have to add in everything you want, but if you do a "set policy-options policy-statement static_to_ospf term accept-all then accept" after your term 2 I think it'll put everything in except what you are wanting to drop. 



    ------------------------------
    Derek Summitt
    ------------------------------