cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
690
Views
3
Helpful
3
Replies

BGP Attributes

cupkeyk
Level 1
Level 1

Hello Experts! 

Good Day, everyone. 

I've been trying to understand the BGP attributes but I'm having hard time understanding some areas of each attributes.  

Main issue is what will be the best suited attribute to use in an inbound traffic coming from eBGP. 

I have a confusion in what is the best attribute to use. 

I have a little understanding that the best one to use is AS_Path prepending but i cannot understand how to use it properly in an INBOUND setting. The proper syntax/configuration of route-map and as-path access list, if below sample is acceptable 

neighbor 192.168.x.x route-map prepend in 

route-map prepend permit 10 

set as-path prepend 42000 (remote as)  40000 (local as) 

Aside from that I know i can also use WEIGHT but it is being use for iBGP. 

I hope someone can help me understand it more. 

Thank you in advance! 

2 Accepted Solutions

Accepted Solutions

M02@rt37
VIP
VIP

Hello @cupkeyk 

To influence inbound traffic coming from eBGP peers, AS_Path prepending is indeed a commonly used attribute. AS_Path prepending involves adding additional AS numbers to the AS_Path attribute of BGP updates, making the path appear longer and less preferable to incoming traffic. However, AS_Path prepending is applied on outbound advertisements to influence inbound traffic.

The configuration you provided is almost correct, but it's typically used on OUTBOUND advertisements to eBGP peers rather than inbound. 

Prepend YOUR local AS multiple times.

neighbor 192.168.x.x route-map prepend out

route-map prepend permit 10 

set as-path prepend 40000 40000 

 

 

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

many confuse in this point but I will try summary it 
control Inbound prefix will effect Outbound traffic 

control Outbound prefix will effect Inbound traffic 

here you control Inbound prefix (rotue-map with IN direction) this effect outbound traffic not inbound traffic 

MHM

View solution in original post

3 Replies 3

pman
Spotlight
Spotlight

Hi,

  • Use weight for outbound traffic control within a single router (it is not BGP attribute). this value is only locally significant on the router and the information is not passed between neighbors. Weight is a Cisco-specific parameter and it is only locally significant in the Router where it is configured
  • Use local preference to choose the exit path for an AS. The BGP preference has to be set inbound on routes being received to influence the outbound routing behaviour.
  • Use AS-path prepending for inbound traffic control from external ASes.

However, it's essential to understand that these are just guidelines, and the actual implementation may vary based on network design, traffic engineering requirements, and specific business needs.

 

Weight

A path with the highest Weight attribute is preferred (other vendors ignore this attribute).

The BGP Weight Path attribute is the first path attribute BGP checks in the election of the best path in the BGP table on Cisco IOS Routers.

BGP prefers the path for the entry with the highest Weight. Weight is a Cisco-specific parameter and it is only locally significant in the Router where it is configured

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.html#toc-hId-896934059

Real Case Scenario

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/213285-understand-the-importance-of-bgp-weight.html#toc-hId-1312231744

 

Local Preference

A path with the highest “local preference” is preferred (usually set to 100).

  • Local preference is the second BGP attribute.
  • You can use local preference to choose the outbound external BGP path.
  • Local preference is sent to all internal BGP routers in your autonomous system.
  • Not exchanged between external BGP routers.
  • The default value is 100.
  • The path with the highest local preference is preferred

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.html#toc-hId--910520404

https://networklessons.com/bgp/how-to-configure-bgp-local-preference-attribute

Locally Originated

A path that was locally originated using “network” or “aggregate” command or using redistribution from IGP is preferred.

Local paths that are sourced by the network or redistribute commands are preferred over local aggregates that are sourced by the aggregate-address command.

 

AS Path

To influence inbound traffic from eBGP neighbors, AS_Path prepending is a commonly used technique.

In the event that the enterprise has two or more ISP connections, incoming traffic destined for those advertised IP addresses may enter the network via any one of those connections.

It is possible to influence incoming BGP traffic such that it enters the enterprise network via the desired link. This can be done by manipulating one or more BGP attributes in one of the following ways:

  • AS Path Prepending - by making the AS path longer for a particular entry point into our BGP AS, it is less likely that the neighboring AS will use that route to enter our network.
  • MED - the metric for a particular entry point into your AS can be advertised to let other ASes know via which entry point you prefer them to enter.
  • Leaking more specific routes
  • Community/Local pref agreement.

Keep in mind however that these attributes can only influence incoming traffic. You do not have ultimate control over how traffic enters your BGP AS. Administrators of remote BGP ASes can override all of your attempts to influence incoming traffic. Any such attempts may be perceived as hostile, or unprofessional so it is always best to talk with the ISP that manages the neighboring AS to let them know what you want to achieve.

 

How to configure BGP AS Path Prepending

RTC advertises its own network 172.16.10.0 to two different ASs, AS100 and AS200.

AS600 know 172.16.10.0 via two different routes.

  • The first route is via AS100 (RTA) with path (100, 300)
  • the second one is via AS400 with path (400, 200, 300).

If all other attributes are the same, AS600 picks the shortest path and chooses the route via AS100.(<--- If this paragraph is not clear please indicate and I will elaborate for you)

now because AS300 (RTC) gets all traffic via AS100 (RTA) and If you want to influence this decision from the AS300 end, you can make the path through AS100 appear to be longer than the path that goes through AS400.

You can do this if you prepend AS numbers to the current path information that is advertised to AS100. A common practice is to repeat your own AS number.

The result will be that AS600 receives updates about 172.16.10.0 (RTC) via AS100 (RTA) with path information of: (100, 300, 300, 300). This path information is longer than the (400, 200, 300) that AS600 received from AS400.

pman_0-1714886157791.png

 

RTC# 
router bgp 300 
 network 172.16.10.0 
 neighbor 10.2.2.2 remote-as 100
 neighbor 10.2.2.2 route-map SETPATH out 

route-map SETPATH 
 set as-path prepend 300 300

 

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.html#toc-hId-1380478924

 

Origin

A path with the lowest origin type is preferred. Origin types are preferred in this order:- IGP- EGP- Incomplete

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.html#toc-hId--2074123639

 

Multi-exit Discriminator (MED)

A path with the lowest MED is preferred. By default, the MED is compared only if the neighbour AS is the same for the paths that are compared (this is configurable). There are multiple commands related to how and when to treat the MED value of the paths, which, due to its complexity, is outside the scope of this article.

https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/26634-bgp-toc.html#toc-hId-1576992429

 

Prefer eBGP over iBGP paths 

A path that is an External BGP path is preferred (versus internal).

 

lowest IGP metric to the BGP next hop


A path with the lowest IGP metric for BGP next-hop is preferred. At this point, if multipath is configured, the Router installs the routes. If not, the algorithm continues to the next step.
If both routes are external, the oldest route is preferred. This step is skipped if the BGP is configured to compare the router-ID or the paths have the same router-ID.

 

https://www.catchpoint.com/bgp-monitoring/bgp-attributes

M02@rt37
VIP
VIP

Hello @cupkeyk 

To influence inbound traffic coming from eBGP peers, AS_Path prepending is indeed a commonly used attribute. AS_Path prepending involves adding additional AS numbers to the AS_Path attribute of BGP updates, making the path appear longer and less preferable to incoming traffic. However, AS_Path prepending is applied on outbound advertisements to influence inbound traffic.

The configuration you provided is almost correct, but it's typically used on OUTBOUND advertisements to eBGP peers rather than inbound. 

Prepend YOUR local AS multiple times.

neighbor 192.168.x.x route-map prepend out

route-map prepend permit 10 

set as-path prepend 40000 40000 

 

 

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

many confuse in this point but I will try summary it 
control Inbound prefix will effect Outbound traffic 

control Outbound prefix will effect Inbound traffic 

here you control Inbound prefix (rotue-map with IN direction) this effect outbound traffic not inbound traffic 

MHM