One of the vital essential factor in BGP to forestall our personal public AS for use as transit AS for different BGP AS’s. There are a number of methods to perform this as we will additionally use BGP Communities to perform this one easy approach that i’ve discovered whereas doing lab as we speak.
>> Suppose our AS is 300 and we dont need AS 200 to make use of our AS as transit AS. We are able to accomplish this through the use of an “ip as-path access-list”matching the as-path after which filtering it to the desired neighbor by BGP “filter-list”.Right here is the instance.
>>The syntax of AS-PATH access-list.
RTC(conf)#ip as-path access-list 13 allow ^$
Right here ^ is matching the begining of the string.
Right here $ is matching the top of the string.
>>The syntax of BGP filter-list.
router bgp 300
neighbor[ip address] filter-list 13 out
Subsequently by solely promoting prefixes that have been originated inside AS 300,AS 200 can not use AS 300 to achieve every other ASs like AS 100 on this situation.Within the above answer that is achieved by way of the utilization of filtering primarily based on AS-PATH data. Because the AS-PATH of a prefix just isn’t added till 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 top of the road comes instantly after the beginning of the road,and is denoted as ^$. We are able to confirm this configuration by the command:-
R1#present ip bgp neighbors [ip address of EBGP Neighbor] advertised-routes