05-04-2024 01:39 PM
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!
Solved! Go to Solution.
05-05-2024 12:50 AM - edited 05-05-2024 12:51 AM
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
05-05-2024 01:00 AM
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
05-04-2024 10:38 PM - edited 05-04-2024 11:20 PM
Hi,
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.
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
Real Case Scenario
A path with the highest “local preference” is preferred (usually set to 100).
https://networklessons.com/bgp/how-to-configure-bgp-local-preference-attribute
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.
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:
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.
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.
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
A path with the lowest origin type is preferred. Origin types are preferred in this order:- IGP- EGP- Incomplete
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.
A path that is an External BGP path is preferred (versus internal).
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.
05-05-2024 12:50 AM - edited 05-05-2024 12:51 AM
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
05-05-2024 01:00 AM
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
01-15-2025 05:07 PM
The BGP path attributes and the BGP path selection refer to the BGP router’s process of examining the competing BGP paths (routes) or NLRIs (Network Layer Reachability Information) in its BGP table. The goal is to choose one route as the best route for each prefix (destination subnet). Please refer to BGP Path Attributes: Your BGP Path Selection Master Guide for full content with a LAB demo explanation.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide