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

Advertise an additional route only when its available in routing table

  • 1.  Advertise an additional route only when its available in routing table

    Posted 07-26-2021 20:05
    Hello.

    I am advertising a default route to my BGP neighbor via below 

    set policy-options policy-statement default-vpn term default-originate from route-filter 0.0.0.0/0 exact
    set policy-options policy-statement default-vpn term default-originate then accept
    set policy-options policy-statement default-vpn then reject


    However I also have a requirement to advertise another route 172.26.82.0/24 to my BGP neighhbor along with above. which I have done below:

    set policy-options policy-statement SH-prefixes term allowed from route-filter 172.26.82.128/28 exact
    set policy-options policy-statement SH-prefixes term allowed then accept
    set policy-options policy-statement SH-prefixes then reject


    My problem is when I do that  using below
    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.102 export default-vpn
    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.102 export SH-prefixes


    Additional route does not get advertised to neighbor . Is there anyway I can achieve this

    My second question is if route 172.26.82.128/28 is not available in BGP routing table - I want this route not to get advertised to 172.31.255.102 neighbor . Is this possible at all?



    ------------------------------
    junos sky
    ------------------------------


  • 2.  RE: Advertise an additional route only when its available in routing table

     
    Posted 07-26-2021 20:23
    You have a reject term at the end of both policies.  Since you are now doing a policy chain you will need to remove the reject from both and end the chain with a reject policy.

    set policy-options policy-statement default-vpn term default-originate from route-filter 0.0.0.0/0 exact
    set policy-options policy-statement default-vpn term default-originate then accept
    set policy-options policy-statement default-vpn term  next next policy

    set policy-options policy-statement SH-prefixes term allowed from route-filter 172.26.82.128/28 exact
    set policy-options policy-statement SH-prefixes term allowed then accept
    set policy-options policy-statement SH-prefixes term next next policy

    set policy-options policy-statement reject-all then reject


    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.102 export default-vpn
    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.102 export SH-prefixes
    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.102 export reject-all

    ------------------------------
    Steve Puluka BSEET - Juniper Ambassador
    IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
    http://puluka.com/home
    ------------------------------



  • 3.  RE: Advertise an additional route only when its available in routing table

    Posted 07-27-2021 08:45
    As per your suggestion I have tried above but that didn't help. The neighbor is receiving 0/0 route but not the one I specifically advertised 172.26.82.128/28.

    Here is my config: 

    set policy-options policy-statement default-vpn128 term default-originate from route-filter 0.0.0.0/0 exact
    set policy-options policy-statement default-vpn128 term default-originate then accept


    set policy-options policy-statement LSH-prefixes term allowed from route-filter 172.26.82.128/28 exact
    set policy-options policy-statement LSH-prefixes term allowed then accept


    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.102 export default-vpn
    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.102 export SH-prefixes


    I have BGP neighbor setup as the following



    set routing-instances vpn128 protocols bgp family inet unicast
    set routing-instances vpn128 protocols bgp group vpn type external
    set routing-instances vpn128 protocols bgp group vpn multihop
    set routing-instances vpn128 protocols bgp group vpn passive
    set routing-instances vpn128 protocols bgp group vpn import none
    set routing-instances vpn128 protocols bgp group vpn peer-as 65600
    set routing-instances vpn128 protocols bgp group vpn local-as XXXXXX
    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.98 local-address 172.31.255.97
    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.98 import CUST_PLL049-B
    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.98 export default-vpn128
    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.98 export  LSH-prefixes
    set routing-instances vpn128 protocols bgp group vpn neighbor 172.31.255.98 peer-as 63999







    ------------------------------
    junos sky
    ------------------------------



  • 4.  RE: Advertise an additional route only when its available in routing table

     
    Posted 07-27-2021 19:39
    What is the output for

    show route 172.26.82.128/28

    show route advertising protocol bgp 172.31.255.98


    ------------------------------
    Steve Puluka BSEET - Juniper Ambassador
    IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)
    http://puluka.com/home
    ------------------------------