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
- What is the Definition of a Computer Network: Components, Uses, and Types - January 19, 2022
- VLAN Tagged vs Untagged – What is the difference? - January 6, 2022
- What are VLANs and Private VLANs and How VLANs work - January 4, 2022