1. 实验拓扑图
2. 配置
1、合理划分IP地址
总划分:172.16.0.0/16
172.16.0.0/17 AS64512
172.16.128.0/17 AS64513
AS64512划分:172.16.0.0/17
172.16.0.0/24 AR2环回
172.16.1.0/24 AR3环回
172.16.2.0/24 AR4环回
172.16.3.0/24 骨干172.16.4.0/24 对等体建立专用环回
172.16.4.0/32 AR2
172.16.4.1/32 AR3
172.16.4.2/32 AR4AS64513划分:172.16.128.0/17
172.16.128.0/24 AR5环回
172.16.129.0/24 AR5环回
172.16.130.0/24 AR5环回
172.16.131.0/24 骨干172.16.132.0/24 对等体建立专用环回
172.16.132.0 32 AR5
172.16.132.1 32 AR6
172.16.132.2 32 AR7骨干链路划分:
12.0.0.0/30 AR2~AR3
172.16.3.4/30 AR3~AR4172.16.3.0/24
172.16.3.0/30 AR2~AR3
172.16.3.4/30 AR3~AR4172.16.3.8/30 AR2~AR5
172.16.3.12/30 AR4~AR7
172.16.131.0/24
172.16.131.0/30 AR5~AR6
172.16.131.4/30 AR6~AR7
2、AR1~AR8的配置
#AR1
[AR1]bgp 1
[AR1-bgp]router-id 1.1.1.1
[AR1-bgp]peer 12.0.0.2 as-number 2
[AR1-bgp]network 1.1.1.0 24
[AR1]interface Tunnel 0/0/0
[AR1-Tunnel0/0/0]ip address 100.0.0.1 24
[AR1-Tunnel0/0/0]tunnel-protocol gre
[AR1-Tunnel0/0/0]source 1.1.1.1
[AR1-Tunnel0/0/0]description 8.8.8.8
[AR1]ip route-static 192.168.2.0 24 100.0.0.2
#AR2
[AR2]bgp 64512
[AR2-bgp]router-id 2.2.2.2
[AR2-bgp]confederation id 2
[AR2-bgp]confederation peer-as 64513
[AR2-bgp]peer 12.0.0.1 as-number 1
[AR2-bgp]peer 172.16.4.1 as-number 64512
[AR2-bgp]peer 172.16.4.1 connect-interface LoopBack 0
[AR2-bgp]peer 172.16.4.1 next-hop-local
[AR2-bgp]peer 172.16.132.0 as-number 64513
[AR2-bgp]peer 172.16.132.0 connect-interface LoopBack 0
[AR2-bgp]peer 172.16.132.0 ebgp-max-hop 10
[AR2-bgp]peer 172.16.132.0 next-hop-local
[AR2]ospf 1
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
[AR2]bgp 64512
[AR2-bgp]aggregate 172.16.0.0 16 detail-suppressed
[AR2]ip ip-prefix AA permit 172.16.0.0 16 greater-equal 24 less-equal 24
[AR2]route-policy AA permit node 10
[AR2-route-policy]if-match ip-prefix AA
[AR2]bgp 64512
[AR2-bgp]import-route ospf 1 route-policy AA
#AR3
[AR3]bgp 64512
[AR3-bgp]router-id 3.3.3.3
[AR3-bgp]confederation id 2
[AR3-bgp]peer 172.16.4.0 as-number 64512
[AR3-bgp]peer 172.16.4.0 connect-interface LoopBack 0
[AR3-bgp]peer 172.16.4.0 reflect-client
[AR3-bgp]peer 172.16.4.2 as-number 64512
[AR3-bgp]peer 172.16.4.2 connect-interface LoopBack 0
[AR3]ospf 1
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
#AR4
[AR4]bgp 64512
[AR4-bgp]router-id 4.4.4.4
[AR4-bgp]confederation id 2
[AR4-bgp]confederation peer-as 64513
[AR4-bgp]peer 172.16.4.1 as-number 64512
[AR4-bgp]peer 172.16.4.1 connect-interface LoopBack 0
[AR4-bgp]peer 172.16.132.2 as-number 64513
[AR4-bgp]peer 172.16.132.2 connect-interface LoopBack 0
[AR4-bgp]peer 172.16.132.2 ebgp-max-hop 10
[AR4]ospf 1
[AR4-ospf-1]area 0
[AR4-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
#AR5
[AR5]bgp 64513
[AR5-bgp]router-id 5.5.5.5
[AR5-bgp]confederation id 2
[AR5-bgp]confederation peer-as 64512
[AR5-bgp]peer 172.16.132.1 as-number 64513
[AR5-bgp]peer 172.16.132.1 connect-interface LoopBack 0
[AR5-bgp]peer 172.16.4.0 as-number 64512
[AR5-bgp]peer 172.16.4.0 connect-interface LoopBack 0
[AR5-bgp]peer 172.16.4.0 ebgp-max-hop 10
[AR5-bgp]peer 172.16.0.1 as-number 64512
[AR5]ospf 1
[AR5-ospf-1]area 0
[AR5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
#AR6
[AR6]bgp 64513
[AR6-bgp]router-id 6.6.6.6
[AR6-bgp]confederation id 2
[AR6-bgp]peer 172.16.132.0 as-number 64513
[AR6-bgp]peer 172.16.132.0 connect-interface LoopBack 0
[AR6-bgp]peer 172.16.132.0 reflect-client
[AR6-bgp]peer 172.16.132.2 as-number 64513
[AR6-bgp]peer 172.16.132.2 connect-interface LoopBack 0
[AR6]ospf 1
[AR6-ospf-1]area 0
[AR6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
#AR7
[AR7]bgp 64513
[AR7-bgp]router-id 7.7.7.7
[AR7-bgp]confederation id 2
[AR7-bgp]confederation peer-as 64512
[AR7-bgp]peer 23.0.0.1 as-number 3
[AR7-bgp]peer 172.16.132.1 as-number 64513
[AR7-bgp]peer 172.16.132.1 connect-interface LoopBack 0
[AR7-bgp]peer 172.16.132.1 next-hop-local
[AR7-bgp]peer 172.16.4.2 as-number 64512
[AR7-bgp]peer 172.16.4.2 connect-interface LoopBack 0
[AR7-bgp]peer 172.16.4.2 ebgp-max-hop 10
[AR7-bgp]peer 172.16.4.2 next-hop-local
[AR7]ospf 1
[AR7-ospf-1]area 0
[AR7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
[AR7]bgp 64513
[AR7-bgp]aggregate 172.16.0.0 16 detail-suppressed
[AR7]ip ip-prefix AA permit 172.16.0.0 16 greater-equal 24 less-equal 24
[AR7]route-policy AA permit node 10
[AR7-route-policy]if-match ip-prefix AA
[AR7]bgp 64513
[AR7-bgp]import-route ospf 1 route-policy AA
#AR8
[AR8]bgp 3
[AR8-bgp]router-id 8.8.8.8
[AR8-bgp]peer 23.0.0.2 as-number 2
[AR8-bgp]network 8.8.8.0 24
[AR8]interface Tunnel 0/0/0
[AR8-Tunnel0/0/0]ip address 100.0.0.2 24
[AR8-Tunnel0/0/0]tunnel-protocol gre
[AR8-Tunnel0/0/0]source 8.8.8.8
[AR8-Tunnel0/0/0]description 1.1.1.1
[AR8]ip route-static 192.168.1.0 24 100.0.0.1