一、实验拓扑
二、实验要求
1,AS1存在两个环回,一个地址为192.168.1.0/24该地址不能在任何协议中宣告,AS3中存在俩个环回,一个地址为192.168.2.0/24该地址不能在任何协议中宣告,最终要求这两个环回可以互相通讯。
2,整个AS2的IP地址为172.16.0.0/16,请合理划分。
3,AS间的骨干链路IP地址随意定制。
4,使用BGP协议让整个网络所有设备的环回可以互相访问。
5,减少路由条目数量,避免环路出现。
三、实验步骤
1、配置基础IP
R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[R1-GigabitEthernet0/0/0]int l 0
[R1-LoopBack0]ip add 192.168.1.1 24
[R1-LoopBack0]int l 1
[R1-LoopBack1]ip add 10.0.0.1 24
R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/0]int lo 0
[R2-LoopBack0]ip add 172.16.2.1 24
[R2-LoopBack0]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 172.16.1.1 29
[R2-GigabitEthernet0/0/1]int g 0/0/2
[R2-GigabitEthernet0/0/2]ip add 172.16.1.9 29
R3
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 172.16.1.2 29
[R3-GigabitEthernet0/0/0]
Jul 22 2024 18:13:39-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R3-GigabitEthernet0/0/0]int l 0
[R3-LoopBack0]ip add 172.16.3.1 24
[R3-LoopBack0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 172.16.1.17 29
R4
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 172.16.1.18 29
Jul 22 2024 18:54:14-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R4-GigabitEthernet0/0/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 172.16.1.25 29
Jul 22 2024 18:54:33-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R4-GigabitEthernet0/0/1]int l 0
[R4-LoopBack0]ip add 172.16.4.1 24
R5
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 172.16.1.10 29
[R5-GigabitEthernet0/0/0]
Jul 22 2024 18:17:19-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R5-GigabitEthernet0/0/0]int g 0/0/1
[R5-GigabitEthernet0/0/1]ip add 172.16.1.133 29
Jul 22 2024 18:17:41-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R5-GigabitEthernet0/0/1]int l 0
[R5-LoopBack0]ip add 172.16.5.1 24
R6
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip add 172.16.1.34 29
Jul 22 2024 18:18:51-08:00 R6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R6-GigabitEthernet0/0/0]int g 0/0/1
[R6-GigabitEthernet0/0/1]ip add 172.168.1.41 29
Jul 22 2024 18:19:20-08:00 R6 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R6-GigabitEthernet0/0/1]int l 0
[R6-LoopBack0]ip add 172.16.6.1 24
R7
[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]ip add 172.16.7.1 24
[R7-GigabitEthernet0/0/0]
Jul 22 2024 18:22:21-08:00 R7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R7-GigabitEthernet0/0/0]undo ip add 172.16.7.1 24
Jul 22 2024 18:22:36-08:00 R7 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the DOWN state.
[R7-GigabitEthernet0/0/0]ip add 172.16.1.42 29
Jul 22 2024 18:22:59-08:00 R7 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R7-GigabitEthernet0/0/0]int g 0/0/1
[R7-GigabitEthernet0/0/1]ip add 172.16.1.26 29
Jul 22 2024 18:23:42-08:00 R7 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R7-GigabitEthernet0/0/1]int g 0/0/2
[R7-GigabitEthernet0/0/2]ip add 78.0.0.1 24
Jul 22 2024 18:24:18-08:00 R7 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R7-GigabitEthernet0/0/2]int l 0
[R7-LoopBack0]ip add 172.16.7.1 24
R8
[R8]int g 0/0/0
[R8-GigabitEthernet0/0/0]ip add 78.0.0.2 24
[R8-GigabitEthernet0/0/0]
Jul 22 2024 18:25:26-08:00 R8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R8-GigabitEthernet0/0/0]int l 0
[R8-LoopBack0]ip add 192.168.2.1 24
[R8-LoopBack0]int l 1
[R8-LoopBack1]ip add 11.0.0.1 24
2、AS2配置OSPF协议
R2
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]netw
[R2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
R3
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]ne
[R3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
R4
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]net
[R4-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
R5
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
R6
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
R7
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]ne
[R7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
3、配置BGP对等体
R1
[R1]bgp 1
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.0.0.2 as 2
R2
[R2]bgp 64512
[R2-bgp]router-id 2.2.2.2
[R2-bgp]confederation id 2
[R2-bgp]confederation peer-as 64513[R2-bgp]peer 12.0.0.1 as 1
[R2-bgp]peer 172.16.3.1 as 64512
[R2-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.5.1 as 64513
[R2-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[R2-bgp]peer 172.16.5.1 ebgp-max-hop 2
[R2-bgp]peer 172.16.3.1 next-hop-local
[R2-bgp]peer 172.16.5.1 next-hop-local
R3
[R3]bgp 64512
[R3-bgp]router-id 3.3.3.3
[R3-bgp]confederation id 2
[R3-bgp]peer 172.16.2.1 as 64512
[R3-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R3-bgp]peer 172.16.4.1 as 64512[R3-bgp]peer 172.16.4.1 connect-interface LoopBack 0
R4
[R4]bgp 64512
[R4-bgp]router-id 4.4.4.4
[R4-bgp]confederation id 2
[R4-bgp]confederation peer-as 64513
[R4-bgp]peer 172.16.3.1 as 64512
[R4-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[R4-bgp]peer 172.16.7.1 as 64513
[R4-bgp]peer 172.16.7.1 connect-interface LoopBack 0
[R4-bgp]peer 172.16.7.1 ebgp-max-hop 2
R5
[R5]bgp 64513
[R5-bgp]router-id 5.5.5.5
[R5-bgp]confederation id 2
[R5-bgp]confederation peer-as 64512
[R5-bgp]peer 172.16.2.1 as 64512
[R5-bgp]peer 172.16.2.1 connect-interface LoopBack 0
[R5-bgp]peer 172.16.2.1 ebgp-max-hop 2
[R5-bgp]peer 172.16.6.1 as 64513
[R5-bgp]peer 172.16.6.1 connect-interface LoopBack 0
R6
[R6]bgp 64513
[R6-bgp]router-id 6.6.6.6
[R6-bgp]confederation id 2
[R6-bgp]peer 172.16.5.1 as 64513
[R6-bgp]peer 172.16.5.1 connect-interface LoopBack 0
[R6-bgp]peer 172.16.7.1 as 64513
[R6-bgp]peer 172.16.7.1 connect-interface LoopBack 0
R7
[R7]bgp 64513
[R7-bgp]router-id 7.7.7.7
[R7-bgp]confederation id 2
[R7-bgp]confederation peer-as 64512
[R7-bgp]peer 172.16.6.1 as 64513
[R7-bgp]peer 172.16.6.1 connect-interface LoopBack 0
[R7-bgp]peer 172.16.4.1 as 64512
[R7-bgp]peer 172.16.4.1 connect-interface LoopBack 0
[R7-bgp]peer 172.16.4.1 ebgp-max-hop 2
[R7-bgp]peer 78.0.0.2 as 3
[R7-bgp]peer 172.16.4.1 next-hop-local
[R7-bgp]peer 172.16.6.1 next-hop-local
R8
[R8]bgp 3
[R8-bgp]router-id 8.8.8.8
[R8-bgp]peer 78.0.0.1 as 2
4、发布路由
R1
[R1]bgp 1
[R1-bgp]network 10.0.0.0 24
R8
[R8]bgp 3
[R8-bgp]network 11.0.0.0 24
5、配置路由反射器
R3
[R3]bgp 64512
[R3-bgp]peer 172.16.2.1 reflect-client
R6
[R6]bgp 64513
[R6-bgp]peer 172.16.7.1 reflect-client
6、做空接口,汇总,宣告
R2
[R2]ip route-static 172.16.0.0 21 NULL 0
[R2]bgp 64512
[R2-bgp]network 172.16.0.0 21
R7
[R7]ip route-static 172.16.0.0 22 NULL 0
7、建立GRE隧道
R1
[R1]int t0/0/0
[R1-Tunnel0/0/0]ip a 192.168.10.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre
[R1-Tunnel0/0/0]source 10.0.0.1
[R1-Tunnel0/0/0]destination 11.0.0.1
[R1]ip route-static 192.168.1.0 24 99.0.0.2
R8
[R8]int t0/0/0
[R8-Tunnel0/0/0]ip a 192.168.10.2 24
[R8-Tunnel0/0/0]tunnel-protocol gre
[R8-Tunnel0/0/0]source 11.0.0.1
[R8-Tunnel0/0/0]destination 10.0.0.1
[R8]ip route-static 192.168.2.0 24 99.0.0.1