Black Friday AI Writer Deal
In dual-homing network scenarios, one of the important features to implement in BGP is to prevent our BGP AS number to be used as a transit AS between two service providers. Although there are a number of methods to perform for example using BGP Communities, etc. One easy approach is to use BGP filtering to achieve this design.
>> Suppose our AS is 300 and we don’t want BGP AS 200 to use our AS as a transit AS. We are able to accomplish this through the use of an “IP as-path access-list” and by matching the as-path and then filtering it to the desired neighbor by BGP “filter-list”. Below is an example –
>>The syntax of AS-PATH access-list.
RTC(conf)#ip as-path access-list 13 allow ^$
Right here ^ is matching the beginning of the string.
Right here $ is matching the end of the string.
>>The syntax of BGP filter-list.
router bgp 300
neighbor[ip address] filter-list 13 out
By doing this, we are only advertising network prefixes originated in local AS which is AS300 to our neighbors AS100 and AS 200. The result of this filter list will be that AS 200 will not be able to use AS 300 to reach AS 100. This is achieved by using filtering primarily based on AS-PATH data. Because the AS-PATH of a prefix was not added when the prefix leaves the AS, prefixes which have been originated inside AS could have an empty AS-PATH. This may be simply matched with a REGULAR EXPRESSION which specifies that the end of the as-path string comes instantly after the beginning of the AS path string and is denoted as ^$.
Let’s check our configuration by the command:-
R1#show ip bgp neighbors [ip address of EBGP Neighbor] advertised-routes
- OSPF Authentication: What, Why, and How to Configure? - November 17, 2022
- OSPF Troubleshooting Commands Cheat Sheet - November 8, 2022
- 4 Simple Tips on how to choose your VPS hosting provider for Web Hosting - October 25, 2022
Thanks for reading till the end!