如图,R1在AS1中,R2,R3,R4在一个大AS100中(R2,R3在AS23中,R4在AS4中),5在AS5中。
BGPAs-path acl 路由过滤_第1张图片
R5(config)#ip as-path access-list 100 deny ^.100.$
R5(config-router)#neighbor 45.1.1.4 filter-list 1 in 一定要进行调用
R5#show ip bgp
BGP table version is 20, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

> 1.1.1.1/32 45.1.1.4 0 100 1 i
> 5.5.5.5/32 0.0.0.0 0 32768 i
> 200.1.1.0 45.1.1.4 0 100 1 i
> 200.1.2.0 45.1.1.4 0 100 1 i
> 200.1.3.0 45.1.1.4 0 100 1 i
> 200.1.4.0 45.1.1.4 0 100 1 i
R5#show ip bgp
BGP table version is 25, local router ID is 5.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

 Network          Next Hop            Metric LocPrf Weight Path

*> 5.5.5.5/32 0.0.0.0 0 32768 i