Junos OS

last person joined: 7 days ago 

Ask questions and share experiences about Junos OS.
  • 1.  How to show all bgp neighbors a particular route is being advertised to?

    Posted 07-10-2019 14:06

    My apologies if this has been covered before, but a search did not reveal what I am looking for.

     

    Is there a JunOS command that will allow me to search for all bgp neighbors that I am advertising a particular route to?

     

    I know that "show route advertising-protocol bgp x.x.x.x" will show me all the routes being advertised to that particular neighbor, but that's not what I'm looking for.

     

    Thank you ahead of time!



  • 2.  RE: How to show all bgp neighbors a particular route is being advertised to?

     
    Posted 07-10-2019 20:32

    Hi Andrew,

     

    Please clarify if this is just a cosmetic requirement or if there is a particular use-case.  The closest to this I've seen is a BMP feature that monitors the RIB-OUT (supported 19.1 onwards) but not a simple command to check the neighbors where a route is advertised.

     

    root@R1# set protocols bgp bmp monitor enable route-monitoring rib-out ?
    Possible completions:
    <[Enter]> Execute this command
    post-policy Send post-policy adj-ribs-out route monitoring messages
    pre-policy Send pre-policy adj-ribs-out route monitoring messages
    | Pipe through a command

     

    Hope this helps.

    Regards,
    -r.

    --------------------------------------------------

    If this solves your problem, please mark this post as "Accepted Solution."
    Kudos are always appreciated :).



  • 3.  RE: How to show all bgp neighbors a particular route is being advertised to?
    Best Answer

     
    Posted 07-10-2019 21:43

    Hi Andrew ,

     

    You can use the below shell sctipt as an interim solution 🙂 

    i have not tested it extenselvely , it take the route advertised as command line argument and gives the result 

     

    #!/bin/sh

    prefix="$1"
    echo "$prefix"
    for i in `cli -c "show bgp summary | match Estab" | awk {'print $1'}`
    do
    echo "$i"
    check=`cli -c "show route advertising-protocol bgp $i | grep $prefix" | awk {'print $2'} `
    echo "$check"
    if [ $check ]
    then
    echo "Prefix is advertised to $i"
    fi
    done


    To run go to start shell
    vi test.sh , paste the script
    sh test.sh <prefix>

    Eg from Lab :-
    % sh test.sh 60.60.60.0

    11.11.11.11
    60.60.60.0/30
    Prefix is advertised to 11.11.11.11
    172.26.226.29
    60.60.60.0/30
    Prefix is advertised to 172.26.226.29

     

    Thx

    Anish 

    If this solves your problem, please mark this post as "Accepted Solution."
    Kudos are always appreciated .



  • 4.  RE: How to show all bgp neighbors a particular route is being advertised to?

    Posted 07-11-2019 10:50

    Thank you very much!

     

    This is just a case where we were attempting to determine which, if any, bgp neighbors we were advertising a certain route to.

     

    I knew I could go look to see the advertised-route to each individual bgp neighbor, but that's very time consuming.

     

    I'll give that script a try.  Thanks!



  • 5.  RE: How to show all bgp neighbors a particular route is being advertised to?

     
    Posted 07-11-2019 11:31

    Not any CLI output that I am aware of. No straightforward command I guess. 

     

    Probably you should be condifence in the BGP route selection algorithm and Junos implementation. Whatever neighbor it should be advertising to(usually to RR and EBGP peers), unless it's blocked by a policy, it should just advertise. 



  • 6.  RE: How to show all bgp neighbors a particular route is being advertised to?

    Posted 07-11-2019 11:40

    Well, as we all know...how things are *supposed* to work, and whether they do or not is a different thing.  And sometimes, we need to be able to "prove" it to the powers that be, so to speak.

     

    If everything always worked perfect, we'd all be out of a job.  🙂

     

    Thank you folks for the suggestions!  I am going to give that script a try as soon as I am able.



  • 7.  RE: How to show all bgp neighbors a particular route is being advertised to?

    Posted 08-21-2019 23:21
    You can use "show route extensive" command see advertise to which BGP group. hope which helps you. 23.0.0.0./21 (1 entry, 1 announced) TSI: KRT in-kernel 23.0.0.0./21 -> {list:172.16.12.38, 172.16.12.42} Page 0 idx 0, (group EBGP_v4 type External) Type 1 val 0x496a3d0 (adv_entry) Advertised metrics: Nexthop: Self AS path: [10] I Communities: 64050:21079 64050:30079