Junos OS

 View Only
last person joined: yesterday 

Ask questions and share experiences about Junos OS.
Expand all | Collapse all

How do you check for BGP advertised and received routes in JUNOS

  • 1.  How do you check for BGP advertised and received routes in JUNOS

    Posted 12-08-2009 05:03

    Does anyone know how to check BGP's advertised and received routes in JUNOS for a BGP neighbor?  I cannot figure it out in JUNOS.   In Cisco IOS it is simple:

     

    show ip bgp neighbor 10.1.1.1 advertised-routes

    show ip bgp neighbor 10.1.1.1 received-routes

     

    Thank you.



  • 2.  RE: How do you check for BGP advertised and received routes in JUNOS
    Best Answer

    Posted 12-08-2009 06:10

    Entering a question mark (?) at the JUNOS prompt allows you to obtain a list of commands available 🙂

     

    IOS# show ip bgp neighbor 10.1.1.1 advertised-routes

    JUNOS> show route advertising-protocol bgp 10.1.1.1

     

    IOS# show ip bgp neighbor 10.1.1.1 received-routes

    JUNOS# show route receive-protocol bgp 10.1.1.1



  • 3.  RE: How do you check for BGP advertised and received routes in JUNOS

    Posted 12-08-2009 06:41

    Thank you!Smiley Happy



  • 4.  RE: How do you check for BGP advertised and received routes in JUNOS

    Posted 12-11-2009 08:27

    Please correct me if I'm wrong (cause my memory is a little murky)...

     

    But doesn't the "show route advertise-protocol bgp" command show results AFTER export policies have been applied while "show route receive-protocol bgp" shows results BEFORE import policies have been applied? I could be offbase but I thought that was the case.



  • 5.  RE: How do you check for BGP advertised and received routes in JUNOS

    Posted 12-11-2009 08:30

    Hi,

     

    you are correct. Add-on: to see results after import policies processing use "show route".

     

    Kind Regards

    Michael Pergament



  • 6.  RE: How do you check for BGP advertised and received routes in JUNOS

    Posted 12-17-2014 15:54

    I'm not sure question from OP was fully answered if i'm reading the thread correctly?.

     

    its almost becoming confused around the question of bgp table vs routing table, where routes in bgp table are *not* automatically promoted and entered into rt, but remain eledgible unless explicity denied by policy filter.

     

    have i just confused the issue?



  • 7.  RE: How do you check for BGP advertised and received routes in JUNOS

    Posted 12-18-2014 22:06

    Yes, the question from teh OP was clearly and completely answered in the accepted solution. Here is some additional information to your query.

    Adjacency-RIB-IN: Contains all received routes from each peer. The Adjacency-RIB-In tables are the pre-policy tables, meaning that the routes in these tables have not been filtered or modified by routing policies. An Adjacency-RIB-In table is created on the local router for each established BGP peer. All routes received from the peer are placed in the appropriate memory table. There’s one notable exception to this rule: Routes containing an AS Path loop are immediately discarded by the local route
    RIB-LOCAL: Contains routes the local router uses to forward traffic. The Local-RIB tables are the post-policy tables. Even though some vendor may implement 3 different routing table, Junipers implementation use the local inet.0 as the BGP Local-RIB
    Adjacency-RIB-OUT: Contains all advertised routes sent to each peer and are placed in the appropriate memory table. In other words, a BGP router advertises only routes that it is currently using to forward data traffic. By default, all Local-RIB routes are placed in each Adjacency-RIB-O



  • 8.  RE: How do you check for BGP advertised and received routes in JUNOS

    Posted 08-19-2016 17:34

    how to you view the received routes if you are using a routing instance?



  • 9.  RE: How do you check for BGP advertised and received routes in JUNOS

    Posted 08-20-2016 07:00

    The show route receive-protocol bgp is based on the ip adddress of the neighbor, so it will not matter what routing instance the BGP peer is configured in to see these routes.  But these are the routes before your import policy is applied so they are the raw routes you get from that neighbor.

     

    show route receive-protocol bgp 1.1.1.1

    When looking at the live routing table then you will need to specifiy the routing instance table name to see which of these routes appear in that routing table.

     

    show route table NAME.inet.0


  • 10.  RE: How do you check for BGP advertised and received routes in JUNOS

    Posted 08-20-2016 13:19

    he does have the flexibility to view the routes per routing instance per neoghbor. Thats a nother cool feature.

    show route table <instance_name.inet.0> receive-protocol bgp 1.1.1.1

     



  • 11.  RE: How do you check for BGP advertised and received routes in JUNOS

    Posted 01-23-2022 05:42
    Hi mate,

    Sorry this is obviously an old thread but obviously still relevant and will ALWAYS be.

    Just wanna make a comment here:
    Adjacency-RIB-IN:
             Contains all received routes from each peer.
             The Adjacency-RIB-In tables are the pre-policy tables, meaning that the routes in these tables have not been filtered or modified by routing policies. 

    This is what I expect from documentation as well
    https://www.juniper.net/documentation/us/en/software/junos/routing-policy/topics/concept/policy-routing-policies-overview.html

    However I played with this example:
    https://www.juniper.net/documentation/us/en/software/junos/bgp/topics/topic-map/troubleshooting-bgp-sessions.html#id-verify-bgp-peers

    Lets simplify it for the sake of this chat:
    Assume you have AS12 with routers R1 and R2, and AS34 with routers R3 and R4
         - R1 and R2 are iBGP, and  also are R3 and R4
         - R1 eBGP peers with R3, while R2 eBGP peers with R4

    Now assume both R1 and R2 inject 2 (same) subnets into their eBGP peers (nothing between themselves as mentioned)
             Static 100.100.1.0/24
             Static 200.200.2.0/24

    - AS34 doesn't advertise anything to AS12 yet

    So back to the discussion, just to show you guys what I observed:
    Lets say R3 has an import filter that tags 100.100.1.0/24 with LP=200) from R1

    So then when you run the "show route receive-protocol bgp R1-IP" on R3 you'd notice that ONLY 100.100.1.0/24 has "*"

    user@R3> show route receive-protocol bgp R1-IP
    inet.0: x destinations, y routes (z active, 0 holddown, 0 hidden)
    Prefix                         Nexthop       MED        Lclpref      AS path
    *100.100.1.0/24  x.x.x.x                                                      AS12 I
    100.100.2.0/24    x.x.x.x                                                      AS12 I

    And interestingly, if you do the same on R4 (against R2), you'd notice that ONLY 200.200.2.0/24 has "*".

    So what does that say about RIB-IN guys?
    Can someone check? I found that quite interesting really...

    ------------------------------
    NELSON MOLWANTWA
    ------------------------------



  • 12.  RE: How do you check for BGP advertised and received routes in JUNOS

    Posted 07-19-2017 08:43

    You need to add "all" at the end to see raw received routes BEFORE filter:

     

    show ip bgp neighbor 10.1.1.1 received-routes all

     

    At least that's the case on JUNOS Software Release [12.3X48-D30.7]