cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
562
Views
20
Helpful
8
Replies
Highlighted
Beginner

BGP order of preference

Hi All, 

 

Im confused with the following documents on how bgp process updates and result on my lab

 

 

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/5816-bgpfaq-5816.html#one

For outbound updates the order of preference is:

  1. filter-list

  2. route-map | unsuppress-map

  3. advertise-map (conditional-advertisement)

  4. prefix-list|distribute-list

  5. ORF prefix-list (a prefix-list the neighbor sends us)

 

 

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/5816-bgpfaq-5816.html#one

123123123123123123123.PNG

 

When i tried on my lab the result is, it updates outbound using route-map

 

 

My route-map is used to filter network 100.100.100.0

and

My filter list to advertised all local routes on my AS (1.1.1.0   &   10.10.10.0   &  100.100.100.0 )

 

 

router bgp 1111
bgp log-neighbor-changes
network 1.1.1.0 mask 255.255.255.0
network 10.10.10.0 mask 255.255.255.0
network 100.100.100.0 mask 255.255.255.0
neighbor 192.168.1.2 remote-as 1111
neighbor 192.168.1.2 route-map Local_route-out out
neighbor 192.168.1.2 filter-list 1 out
neighbor 192.168.1.6 remote-as 1111
neighbor 192.168.1.6 route-map Local_route-out out
!
ip forward-protocol nd
!
ip as-path access-list 1 permit ^$
!
no ip http server
no ip http secure-server
!
!
ip prefix-list Local_routes seq 5 permit 1.1.1.0/24
ip prefix-list Local_routes seq 10 permit 10.10.10.0/24
!
route-map Local_route-out permit 10
match ip address prefix-list Local_routes
!

 

 

R1# clear ip bgp * soft out
R1#show ip bgp neighbors 192.168.1.2 advertised-routes
BGP table version is 8, local router ID is 10.10.10.10
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 0.0.0.0 0 32768 i
*> 10.10.10.0/24 0.0.0.0 0 32768 i

Everyone's tags (1)
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Hall of Fame Guru

Re: BGP order of preference

 

The order of preference tells you which order they are applied to your route advertisements but they are all applied. 

 

So as Francesco says the filter list is applied first and allows all prefixes through and then the route map is applied. 

 

Jon

View solution in original post

Highlighted
VIP Advisor

Re: BGP order of preference

@jon answered this question.
All are applied but they're applied in the order you have seen in the reference document you gave.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

View solution in original post

8 REPLIES 8
Highlighted
VIP Advisor

Re: BGP order of preference

Hi

That's normal you think it advertises prefixes based on route-map because:
- your as-path access-list filters locally originated prefixes (^$) which means only the 3 subnets as network statement (based on your bgp config)
- then a second policy filters only 2 subnets from those 3 based on your route-map/prefix-list
- finally the result you got is the sum of the previous 2 policies.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question
Highlighted
Beginner

Re: BGP order of preference

Hi,

So you mean, all filter(filter-list,route-map, prefix list) applied on neighbor will be executed? I thought only filter list or the one who is in first order of the preference.

Thanks,

Highlighted
Hall of Fame Guru

Re: BGP order of preference

 

The order of preference tells you which order they are applied to your route advertisements but they are all applied. 

 

So as Francesco says the filter list is applied first and allows all prefixes through and then the route map is applied. 

 

Jon

View solution in original post

Highlighted
VIP Advisor

Re: BGP order of preference

@jon answered this question.
All are applied but they're applied in the order you have seen in the reference document you gave.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

View solution in original post

Highlighted
Beginner

Re: BGP order of preference

Francesco's answer is correct.

The routes pass through the filter-list first and all three are allowed, but then the route-map filter is configured to allow only two, which is where the third route gets dropped.

Regards,

Hemant

Highlighted

Re: BGP order of preference

We are confusing here with the routes and the actual traffic. 

 

The policy we are applying manipulates when the route is learnt in inbound meaning for the out traffic. and viceversa. 

 

I think its working as expected. 

 

R1-1.1.1.1-----------b-R2-a--------------R3 3.3.3.3

If my internet is at 3.3.3.3 and if I apply policy on "a" with route map so my traffic from R1 to R3 will be manipulated. 

Please do not hesitate to click the STAR button if you are satisfied with my answer.
Highlighted
VIP Advisor

Re: BGP order of preference

Not sure i follow you. What policy do you apply?

Also not sure it's related to the original question. Can you create a new post?

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question
Highlighted

Re: BGP order of preference

He is just confused between the function of dataplane and the control plane as we know the policy or filter list etc we apply we do it control the control plane updates to our Routing table from RIB in table, so the traffic from inside network will get impacted. 

Please do not hesitate to click the STAR button if you are satisfied with my answer.