BGP Route Refresh in JUNOS

What happens when you change a BGP import routing policy in your neighbor configuration? Changes take effect immediately or we need to issue the soft-inbound command to request the routes? Let’s see by an example.

We received the route 10.83.0.0/24 from 10.82.1.9 already as you see below.

root@J29> show route protocol bgp terse 10.83.0.0/24 

inet.0: 46 destinations, 48 routes (46 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

A Destination        P Prf   Metric 1   Metric 2  Next hop         AS path
* 10.83.0.0/24       B 170       2000            >10.82.1.9        600 500 I

Now I change the local preference from 2000 to 1999 in the import policy and commit the config.

root@J29> show route protocol bgp terse 10.83.0.0/24    

inet.0: 46 destinations, 48 routes (46 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

A Destination        P Prf   Metric 1   Metric 2  Next hop         AS path
* 10.83.0.0/24       B 170       1999            >10.82.1.9        600 500 I <--LP changed

Aha.. local preference has been updated but shouldn't the import policy needs to be re-processed by requesting full routes again as the BGP route updates are incremental? Why don't we need to run the command "clear bgp neighbor 10.82.1.9 soft-inbound" the thing is as per the juniper doc, we keep all the routes we learn. if you run this soft reset command, you will see that a ROUTE REFRESH request message is sent to the peer and peer responds with UPDATE messages i.e all routes it sent. What happens if we change this behavior. (I have already tested it:)

Let's disable this feature first and commit.

set group ISPD neighbor 10.82.1.9 keep none

This will flap your BGP session though.

Now, I have changed local preference on the import policy to 2001 to see if it will be processed automatically or not.

root@J29> show route protocol bgp terse 10.83.0.0/24    

inet.0: 46 destinations, 48 routes (46 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

A Destination        P Prf   Metric 1   Metric 2  Next hop         AS path
* 10.83.0.0/24       B 170       2001            >10.82.1.9        600 500 I <--LP changed

Hmm, local preference changed again. I didn't run the "clear bgp" command again. The difference is that as soon as you commit the change, JUNOS sends the ROUTE-REFRESH message for you and routes are re-sent from the neighbor.

route-refresh-automatically

About: rtoodtoo

Worked for more than 10 years as a Network/Support Engineer and also interested in Python, Linux, Security and SD-WAN // JNCIE-SEC #223 / RHCE / PCNSE


3 thoughts on “BGP Route Refresh in JUNOS”

  1. I think setting localprefrence value to import policy has nothing to do with your neighbor.
    What it does is, it sets localprefrence when sending routes from adj_rib_in to RIB.

Leave a Reply to Nay Lin KyawCancel reply

Discover more from RtoDto.net

Subscribe now to keep reading and get access to the full archive.

Continue reading