实验名称
BGP综合实验
实验拓扑图如下
实验要求
1.AS1中存在两个环回,一个地址为192.168.1.0/24,该地址不能在任何协议中宣告;AS3中存在两个环回,一个地址为192.168.2.0/24,该地址不能在任何协议中宣告,最终要求这两个环回可以ping通;
2.整个AS2的IP地址为172.16.0.0/16,请合理划分,并且其内部配置OSPF协议;
3.R1-R8的建邻环回用x.x.x.x/32表示;R2-R7上再划分一个业务网断;
4.AS间的骨干链路IP地址随意定制;
5.使用BGP协议让整个网络所有设备的环回可以互相访问。
实验思路
1.配置IP地址以及环回。
2.配置OSPF协议。
3.配置BGP。
4.宣告网段。
5.配置GRE。
6.检查。
实验步骤
一
AR1
[AR 2220 NO.1]int g0/0/0
[AR 2220 NO.1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[AR 2220 NO.1-GigabitEthernet0/0/0]int l0
[AR 2220 NO.1-LoopBack0]ip add 172.16.0.1 32
[AR 2220 NO.1-LoopBack0]int l1
[AR 2220 NO.1-LoopBack1]ip add 192.168.1.1 24
AR2
[AR 2220 NO.2]int g0/0/0
[AR 2220 NO.2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[AR 2220 NO.2]int g0/0/0
[AR 2220 NO.2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[AR 2220 NO.2-GigabitEthernet0/0/1]int g0/0/2
[AR 2220 NO.2-GigabitEthernet0/0/2]ip add 172.16.1.21 30
[AR 2220 NO.2-GigabitEthernet0/0/2]int l0
[AR 2220 NO.2-LoopBack0]ip add 172.16.0.2 32
[AR 2220 NO.2-LoopBack0]int l1
[AR 2220 NO.2-LoopBack1]ip add 172.16.2.2 24
AR3
[AR 2220 NO.3]int g0/0/0
[AR 2220 NO.3-GigabitEthernet0/0/0]ip add 172.16.1.2 30
[AR 2220 NO.3-GigabitEthernet0/0/0]int g0/0/1
[AR 2220 NO.3-GigabitEthernet0/0/1]ip add 172.16.1.5 30
[AR 2220 NO.3-GigabitEthernet0/0/1]int l0
[AR 2220 NO.3-LoopBack0]ip add 172.16.0.3 32
[AR 2220 NO.3-LoopBack0]int l1
[AR 2220 NO.3-LoopBack1]ip add 172.16.3.3 24
AR4
[AR 2220 NO.4]int g0/0/0
[AR 2220 NO.4-GigabitEthernet0/0/0]ip add 172.16.1.6 30
[AR 2220 NO.4-GigabitEthernet0/0/0]int g0/0/1
[AR 2220 NO.4-GigabitEthernet0/0/1]ip add 172.16.1.9 30
[AR 2220 NO.4-GigabitEthernet0/0/1]int l0
[AR 2220 NO.4-LoopBack0]ip add 172.16.0.4 32
[AR 2220 NO.4-LoopBack0]int l1
[AR 2220 NO.4-LoopBack1]ip add 172.16.4.4 24
AR5
[AR 2220 NO.5]int g0/0/0
[AR 2220 NO.5-GigabitEthernet0/0/0]ip add 172.16.1.22 30
[AR 2220 NO.5-GigabitEthernet0/0/0]int g0/0/1
[AR 2220 NO.5-GigabitEthernet0/0/1]ip add 172.16.1.17 30
[AR 2220 NO.5-GigabitEthernet0/0/1]int l0
[AR 2220 NO.5-LoopBack0]ip add 172.16.0.5 32
[AR 2220 NO.5-LoopBack0]int l1
[AR 2220 NO.5-LoopBack1]ip add 172.16.5.5 24
AR6
[AR 2220 NO.6]int g0/0/0
[AR 2220 NO.6-GigabitEthernet0/0/0]ip add 172.16.1.18 30
[AR 2220 NO.6-GigabitEthernet0/0/0]int g0/0/1
[AR 2220 NO.6-GigabitEthernet0/0/1]ip add 172.16.1.13 30
[AR 2220 NO.6-GigabitEthernet0/0/1]int l0
[AR 2220 NO.6-LoopBack0]ip add 172.16.0.6 32
[AR 2220 NO.6-LoopBack0]int l1
[AR 2220 NO.6-LoopBack1]ip add 172.16.6.6 24
AR7
[AR 2220 NO.7]int g0/0/0
[AR 2220 NO.7-GigabitEthernet0/0/0]ip add 172.16.1.14 30
[AR 2220 NO.7-GigabitEthernet0/0/0]int g0/0/1
[AR 2220 NO.7-GigabitEthernet0/0/1]ip add 172.16.1.10 30
[AR 2220 NO.7-GigabitEthernet0/0/1]int g0/0/2
[AR 2220 NO.7-GigabitEthernet0/0/2]ip add 34.1.1.7 24
[AR 2220 NO.7-GigabitEthernet0/0/2]int l0
[AR 2220 NO.7-LoopBack0]ip add 172.16.0.7 32
[AR 2220 NO.7-LoopBack0]int l1
[AR 2220 NO.7-LoopBack1]ip add 172.16.7.7 24
AR8
[AR 2220 NO.8]int g0/0/0
[AR 2220 NO.8-GigabitEthernet0/0/0]ip add 34.1.1.8 24
[AR 2220 NO.8-GigabitEthernet0/0/0]int l0
[AR 2220 NO.8-LoopBack0]ip add 172.16.0.8 32
[AR 2220 NO.8-LoopBack0]int l1
[AR 2220 NO.8-LoopBack1]ip add 192.168.2.8 24
二
AR2
[AR 2220 NO.2]ospf 1 router-id 2.2.2.2
[AR 2220 NO.2-ospf-1]a 0
[AR 2220 NO.2-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
AR3
[AR 2220 NO.3]ospf 1 router-id 3.3.3.3
[AR 2220 NO.3-ospf-1]a 0
[AR 2220 NO.3-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
AR4
[AR 2220 NO.4]ospf 1 router-id 4.4.4.4
[AR 2220 NO.4-ospf-1]a 0
[AR 2220 NO.4-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
AR5
[AR 2220 NO.5]ospf 1 router-id 5.5.5.5
[AR 2220 NO.5-ospf-1]a 0
[AR 2220 NO.5-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
AR6
[AR 2220 NO.6]ospf 1 router-id 6.6.6.6
[AR 2220 NO.6-ospf-1]a 0
[AR 2220 NO.6-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
AR7
[AR 2220 NO.7]ospf 1 router-id 7.7.7.7
[AR 2220 NO.7-ospf-1]a 0
[AR 2220 NO.7-ospf-1-area-0.0.0.0]net 172.16.0.0 0.0.255.255
三
AR1
[AR 2220 NO.1]bgp 1
[AR 2220 NO.1-bgp]peer 12.1.1.2 as 2
AR2
[AR 2220 NO.2]bgp 64512
[AR 2220 NO.2-bgp]confederation id 2
[AR 2220 NO.2-bgp]confederation peer-as 64513
[AR 2220 NO.2-bgp]peer 12.1.1.1 as 1
[AR 2220 NO.2-bgp]peer 172.16.0.3 as 64512
[AR 2220 NO.2-bgp]peer 172.16.0.3 connect-interface l0
[AR 2220 NO.2-bgp]peer 172.16.0.3 next-hop-invariable
[AR 2220 NO.2-bgp]peer 172.16.0.3 next-hop-local
[AR 2220 NO.2-bgp]peer 172.16.0.5 as 64513
[AR 2220 NO.2-bgp]peer 172.16.0.5 connect-interface l0
[AR 2220 NO.2-bgp]peer 172.16.0.5 next-hop-invariable
[AR 2220 NO.2-bgp]peer 172.16.0.5 next-hop-local
[AR 2220 NO.2-bgp]peer 172.16.0.5 ebgp-max-hop
AR3
[AR 2220 NO.3]bgp 64512
[AR 2220 NO.3-bgp]confederation id 2
[AR 2220 NO.3-bgp]peer 172.16.0.2 as 64512
[AR 2220 NO.3-bgp]peer 172.16.0.2 connect-interface l0
[AR 2220 NO.3-bgp]peer 172.16.0.4 as 64512
[AR 2220 NO.3-bgp]peer 172.16.0.4 connect-interface l0
[AR 2220 NO.3]bgp 64512
[AR 2220 NO.3-bgp]peer 172.16.0.2 reflect-client
[AR 2220 NO.3-bgp]peer 172.16.0.4 reflect-client
AR4
[AR 2220 NO.4]bgp 64512
[AR 2220 NO.4-bgp]confederation id 2
[AR 2220 NO.4-bgp]peer 172.16.0.3 as 64512
[AR 2220 NO.4-bgp]peer 172.16.0.3 connect-interface l0
AR5
[AR 2220 NO.5]bgp 64513
[AR 2220 NO.5-bgp]confederation id 2
[AR 2220 NO.5-bgp]confederation peer-as 64512
[AR 2220 NO.5-bgp]peer 172.16.0.6 as 64513
[AR 2220 NO.5-bgp]peer 172.16.0.6 connect-interface l0
[AR 2220 NO.5-bgp]peer 172.16.0.6 next-hop-invariable
[AR 2220 NO.5-bgp]peer 172.16.0.6 next-hop-local
[AR 2220 NO.5-bgp]peer 172.16.0.2 as 64512
[AR 2220 NO.5-bgp]peer 172.16.0.2 connect-interface l0
[AR 2220 NO.5-bgp]peer 172.16.0.2 next-hop-invariable
[AR 2220 NO.5-bgp]peer 172.16.0.2 next-hop-local
[AR 2220 NO.5-bgp]peer 172.16.0.2 ebgp-max-hop
AR6
[AR 2220 NO.6]bgp 64513
[AR 2220 NO.6-bgp]confederation id 2
[AR 2220 NO.6-bgp]peer 172.16.0.5 as 64513
[AR 2220 NO.6-bgp]peer 172.16.0.5 connect-interface l0
[AR 2220 NO.6-bgp]peer 172.16.0.7 as 64513
[AR 2220 NO.6-bgp]peer 172.16.0.7 connect-interface l0
[AR 2220 NO.6-bgp]peer 172.16.0.5 reflect-client
[AR 2220 NO.6-bgp]peer 172.16.0.7 reflect-client
AR7
[AR 2220 NO.7]bgp 64513
[AR 2220 NO.7-bgp]confederation id 2
[AR 2220 NO.7-bgp]peer 172.16.0.6 as 64513
[AR 2220 NO.7-bgp]peer 172.16.0.6 connect-interface l0
[AR 2220 NO.7-bgp]peer 172.16.0.6 next-hop-invariable
[AR 2220 NO.7-bgp]peer 172.16.0.6 next-hop-local
[AR 2220 NO.7-bgp]peer 34.1.1.8 as 3
AR8
[AR 2220 NO.8]bgp 3
[AR 2220 NO.8-bgp]peer 34.1.1.7 as 2
四
AR2
[AR 2220 NO.2]bgp 64512
[AR 2220 NO.2-bgp]net 172.16.2.0 24
[AR 2220 NO.2-bgp]net 172.16.0.2 32
AR3
[AR 2220 NO.3]bgp 64512
[AR 2220 NO.3-bgp]net 172.16.0.3 32
[AR 2220 NO.3-bgp]net 172.16.3.0 24
AR4
[AR 2220 NO.4]bgp 64512
[AR 2220 NO.4-bgp]net 172.16.0.4 32
[AR 2220 NO.4-bgp]net 172.16.4.0 24
AR5
[AR 2220 NO.5]bgp 64513
[AR 2220 NO.5-bgp]net 172.16.0.5 32
[AR 2220 NO.5-bgp]net 172.16.5.0 24
AR6
[AR 2220 NO.6]bgp 64513
[AR 2220 NO.6-bgp]net 172.16.0.6 32
[AR 2220 NO.6-bgp]net 172.16.6.0 24
AR7
[AR 2220 NO.7]bgp 64513
[AR 2220 NO.7-bgp]net 172.16.0.7 32
[AR 2220 NO.7-bgp]net 172.16.7.0 24
五
AR1
[AR 2220 NO.1]int t0/0/0
[AR 2220 NO.1-Tunnel0/0/0]ip add 10.1.1.1 24
[AR 2220 NO.1-Tunnel0/0/0]tunnel-protocol gre
[AR 2220 NO.1-Tunnel0/0/0]source 12.1.1.1
[AR 2220 NO.1-Tunnel0/0/0]destination 34.1.1.8
[AR 2220 NO.1-Tunnel0/0/0]source 172.16.0.1
[AR 2220 NO.1-Tunnel0/0/0]destination 172.16.0.8
[AR 2220 NO.1-Tunnel0/0/0]quit
[AR 2220 NO.1]bgp 1
[AR 2220 NO.1-bgp]net 172.16.0.1 32
[AR 2220 NO.1]ip route-static 192.168.2.0 24 10.1.1.8
AR8
[AR 2220 NO.8]bgp 3
[AR 2220 NO.8-bgp]net 172.16.0.8 32
[AR 2220 NO.8]int t0/0/0
[AR 2220 NO.8-Tunnel0/0/0]ip add 10.1.1.8 24
[AR 2220 NO.8-Tunnel0/0/0]tunnel-protocol gre
[AR 2220 NO.8-Tunnel0/0/0]source 172.16.0.8
[AR 2220 NO.8-Tunnel0/0/0]destination 172.16.0.1
[AR 2220 NO.8-Tunnel0/0/0]quit
[AR 2220 NO.8]ip route-static 192.168.1.0 24 10.1.1.1
六
通过AR与AR之间的互ping来检查,全部ping通,实现目标 实验结束