·掌握如何使用as-path-acl来过滤BGP路由。
·掌握如何使用ip-prefix来过滤BGP路由。
拓扑图:
过程:
IP地址配置:
[H3C]sys RTA
[RTA]int g0/0
[RTA-GigabitEthernet0/0]ip add 10.10.10.1 30
[RTA-GigabitEthernet0/0]int s1/0
[RTA-Serial1/0]ip add 10.10.20.1 30
[RTA-Serial1/0]int loop 0
[RTA-LoopBack0]ip add 1.1.1.1 32
[RTA-LoopBack0]qu
[H3C]sys RTB
[RTB]INT G0/0
[RTB-GigabitEthernet0/0]ip add 10.10.10.2 30
[RTB-GigabitEthernet0/0]int g0/1
[RTB-GigabitEthernet0/1]ip add 10.10.10.6 30
[RTB-GigabitEthernet0/1]int loop 0
[RTB-LoopBack0]ip add 2.2.2.2 32
[RTB-LoopBack0]qu
[H3C]sys RTC
[RTC]int g0/1
[RTC-GigabitEthernet0/1]ip add 10.10.10.5 30
[RTC-GigabitEthernet0/1]int g0/0
[RTC-GigabitEthernet0/0]ip add 10.10.10.9 30
[RTC-GigabitEthernet0/0]int loop 0
[RTC-LoopBack0]ip add 3.3.3.3 32
[RTC-LoopBack0]qu
[H3C]sys RTD
[RTD]INT G0/0
[RTD-GigabitEthernet0/0]ip add 10.10.10.10 30
[RTD-GigabitEthernet0/0]int s1/0
[RTD-Serial1/0]ip add 10.10.20.2 30
[RTD-Serial1/0]int loop0
[RTD-LoopBack0]ip add 4.4.4.4 32
[RTD-LoopBack0]qu
BGP基本配置:
[RTA]bgp 65000
[RTA-bgp]rou
[RTA-bgp]router-id 1.1.1.1
[RTA-bgp]imp
[RTA-bgp]imp
[RTA-bgp]peer 10.10.10.2 as
[RTA-bgp]peer 10.10.10.2 as-number 65002
[RTA-bgp]peer 10.10.20.2 as-number 65002
[RTA-bgp]add
[RTA-bgp]address-family ip
[RTA-bgp]address-family ipv4 un
[RTA-bgp]address-family ipv4 unicast
[RTA-bgp-ipv4]imp
[RTA-bgp-ipv4]import-route dir
[RTA-bgp-ipv4]import-route direct
[RTA-bgp-ipv4]peer 10.10.10.2 en
[RTA-bgp-ipv4]peer 10.10.20.2 en
[RTB]bgp 65002
[RTB-bgp]rou
[RTB-bgp]router-id 2.2.2.2
[RTB-bgp]peer 10.10.10.1 as
[RTB-bgp]peer 10.10.10.1 as-number 65000
[RTB-bgp]peer 10.10.10.5 as-number 65003
[RTB-bgp]add
[RTB-bgp]address-family ip
[RTB-bgp]address-family ipv4 un
[RTB-bgp