目录
文章目录
一、题目
二、题目分析
题目需求
IP地址的划分
三、实验配置
IP地址配置
OSPF配置
检查OSPF配置:
BGP配置
配置反射器
宣告1.1.1.1/8.8.8.8
查看结果
减少路由条目数量
配置GRE环境
提示:以下是本篇文章正文内容,下面案例可供参考
一、题目
题目要求和拓扑图
二、题目分析
题目需求
1、AS1中存在两个环回,一个地址为192.168.1.0/24,该地址不能在任何协议中宣告;
AS3中存在两个环回一个地址为192.168.2.0/24,该地址不能在任何协议中宣告,最终要求这两个环回可以ping通;
2、R1-R8的建邻环回用X.X.X.X/32表示
3、整个AS2的IP地址为172.16.0.0/16,R3-R7上各有一个业务网段,请合理划分; 并且其内部配置OSPF协议
4、As间的骨干链路IP地址随意定制;
5、使用Bgp协议让整个网络所有设备的环回可以互相访问;
6、减少路由条目数量,避免环路出现;
IP地址的划分
由于题目需要IP地址划分,划分如下:
三、实验配置
IP地址配置
AR1
[Huawei]sysname AR1
[AR1]int g 0/0/0
[AR1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[AR1-GigabitEthernet0/0/0]int l 0
[AR1-LoopBack0]ip add 1.1.1.1 32
[AR1-LoopBack0]q
[AR1]int l 1
[AR1-LoopBack1]ip add 192.168.1.1 24
AR2
[Huawei]sys AR@
[AR@]sys AR2
[AR2]int g 0/0/0
[AR2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[AR2-GigabitEthernet0/0/0]int g 0/0/1
[AR2-GigabitEthernet0/0/1]ip add 172.16.1.1 30
[AR2-GigabitEthernet0/0/1]int g 0/0/2
[AR2-GigabitEthernet0/0/2]ip add 172.16.1.21 30
[AR2-GigabitEthernet0/0/2]int l 0
[AR2-LoopBack0]ip add 2.2.2.2 32
AR3
[Huawei]sys AR3
[AR3]int g 0/0/0
[AR3-GigabitEthernet0/0/0]ip add 172.16.1.2 30
[AR3-GigabitEthernet0/0/0]int g 0/0/1
[AR3-GigabitEthernet0/0/1]ip add 172.16.1.5 30
[AR3-GigabitEthernet0/0/1]int l 0
[AR3-LoopBack0]ip add 3.3.3.3 32
[AR3-LoopBack0]int l 1
[AR3-LoopBack1]ip add 172.16.3.1 24
AR4
[Huawei]sysname AR4
[AR4]int g 0/0/0
[AR4-GigabitEthernet0/0/0]ip add 172.16.1.6 30
[AR4-GigabitEthernet0/0/0]int g 0/0/1
[AR4-GigabitEthernet0/0/1]ip add 172.16.1.9 30
[AR4-GigabitEthernet0/0/1]int l 0
[AR4-LoopBack0]ip add 4.4.4.4 32
[AR4-LoopBack0]int l1
[AR4-LoopBack1]ip add 172.16.4.1 24
AR5
[Huawei]sys AR5
[AR5]int g 0/0/0
[AR5-GigabitEthernet0/0/0]ip add 172.16.1.22 30
[AR5-GigabitEthernet0/0/0]int g 0/0/0
[AR5-GigabitEthernet0/0/0]int g 0/0/1
[AR5-GigabitEthernet0/0/1]ip add 172.16.1.17 30
[AR5-GigabitEthernet0/0/1]int l 0
[AR5-LoopBack0]ip add 5.5.5.5 32
[AR5-LoopBack0]int l1
[AR5-LoopBack1]ip add 172.16.5.1 24
[AR5-LoopBack1]
AR6
[Huawei]sysname AR6
[AR6]int g 0/0/0
[AR6-GigabitEthernet0/0/0]ip add 172.16.1.18 30
[AR6-GigabitEthernet0/0/0]int g0/0/1
[AR6-GigabitEthernet0/0/1]ip add 172.16.1.13 30
[AR6-GigabitEthernet0/0/1]int l0
[AR6-LoopBack0]ip add 6.6.6.6 32
[AR6-LoopBack0]int l1
[AR6-LoopBack1]ip add 172.16.6.1 24
[AR6-LoopBack1]
AR7
[Huawei]sysname AR7
[AR7]int g0/0/0
[AR7-GigabitEthernet0/0/0]ip add 172.16.1.14 30
[AR7-GigabitEthernet0/0/0]int g 0/0/2
[AR7-GigabitEthernet0/0/2]ip add 172.16.1.10 32
Error: The specified IP address is invalid.
[AR7-GigabitEthernet0/0/2]ip add 172.16.1.10 30
[AR7-GigabitEthernet0/0/2]int g 0/0/1
[AR7-GigabitEthernet0/0/1]ip add 78.1.1.1 24
[AR7-GigabitEthernet0/0/1]int l 0
[AR7-LoopBack0]ip add 7.7.7.7 32
[AR7-LoopBack0]int l1
[AR7-LoopBack1]ip add 172.16.7.1 24
[AR7-LoopBack1]
AR8
[Huawei]sysname AR8
[AR8]int g 0/0/0
[AR8-GigabitEthernet0/0/0]ip add 78.1.1.2 24
Jul 22 2024 09:27:42-08:00 AR8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IPon the interface GigabitEthernet0/0/0 has entered the UP state.
[AR8-GigabitEthernet0/0/0]int l 0
[AR8-LoopBack0] ip add 8.8.8.8 32
[AR8-LoopBack0]int l 1
[AR8-LoopBack1]ip add 192.168.2.1 24
[AR8-LoopBack1]
OSPF配置
AS2内部配置OSPF协议
AR2
[AR2]ospf 1 router-id 2.2.2.2
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]net 172.16.1.1 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]net 172.16.1.21 0.0.0.0
[AR2-ospf-1-area-0.0.0.0]net 2.2.2.2 0.0.0.0
AR3
[AR3]ospf 1 router-id 3.3.3.3
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]net 172.16.1.2 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]net 172.16.1.5 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]net 3.3.3.3 0.0.0.0
[AR3-ospf-1-area-0.0.0.0]net 172.16.3.0 0.0.0.255
AR4
[AR4]ospf 1 router-id 4.4.4.4
[AR4-ospf-1]area 0
[AR4-ospf-1-area-0.0.0.0]net 4.4.4.4 0.0.0.0
[AR4-ospf-1-area-0.0.0.0]net 172.16.1.6 0.0.0.0
[AR4-ospf-1-area-0.0.0.0]net 172.16.1.9 0.0.0.0
[AR4-ospf-1-area-0.0.0.0]net 172.16.4.0 0.0.0.255
AR5
[AR5]ospf 1 router-id 5.5.5.5
[AR5-ospf-1]area 0
[AR5-ospf-1-area-0.0.0.0]net 172.16.1.22 0.0.0.0
[AR5-ospf-1-area-0.0.0.0]net 5.5.5.5 0.0.0.0
[AR5-ospf-1-area-0.0.0.0]net 172.16.5.0 0.0.0.255
[AR5-ospf-1-area-0.0.0.0]net 172.16.1.17 0.0.0.0
AR6
[AR6]ospf 1 router-id 6.6.6.6
[AR6-ospf-1]area 0
[AR6-ospf-1-area-0.0.0.0]net 6.6.6.6 0.0.0.0
[AR6-ospf-1-area-0.0.0.0]net 172.16.1.18 0.0.0.0
[AR6-ospf-1-area-0.0.0.0]net 172.16.1.13 0.0.0.0
[AR6-ospf-1-area-0.0.0.0]net 172.16.6.0 0.0.0.255
AR7
[AR7]ospf 1 router-id 7.7.7.7
[AR7-ospf-1]area 0
[AR7-ospf-1-area-0.0.0.0]net 7.7.7.7 0.0.0.0
[AR7-ospf-1-area-0.0.0.0]net 172.16.1.14 0.0.0.0
[AR7-ospf-1-area-0.0.0.0]net 172.16.1.10 0.0.0.0
[AR7-ospf-1-area-0.0.0.0]net 172.16.7.0 0.0.0.255
检查OSPF配置:
查看AR2的路由表
查看AR3的路由表
查看AR3的路由表
BGP配置
AR1
[AR1]bgp 1
[AR1-bgp]dis
[AR1-bgp]display this
[V200R003C00]
#
bgp 1peer 12.1.1.2 as-number 2 #ipv4-family unicastundo synchronizationnetwork 1.1.1.1 255.255.255.255 peer 12.1.1.2 enable
#
return
[AR1-bgp]
AR2
[AR2]bgp 64512
[AR2-bgp]dis
[AR2-bgp]display this
[AR2-bgp]display this
[V200R003C00]
#
bgp 64512confederation id 2confederation peer-as 64513peer 12.1.1.1 as-number 1 peer 172.16.1.2 as-number 64512 peer 172.16.1.22 as-number 64513 #ipv4-family unicastundo synchronizationpeer 12.1.1.1 enablepeer 172.16.1.2 enablepeer 172.16.1.2 next-hop-local peer 172.16.1.22 enablepeer 172.16.1.22 next-hop-local
#
return
[AR2-bgp]
AR3
[AR3]bgp 64512
[AR3-bgp]dis
[AR3-bgp]display this
[V200R003C00]
#
bgp 64512confederation id 2peer 172.16.1.1 as-number 64512 peer 172.16.1.6 as-number 64512 #ipv4-family unicastundo synchronizationpeer 172.16.1.1 enablepeer 172.16.1.1 next-hop-local peer 172.16.1.6 enablepeer 172.16.1.6 reflect-clientpeer 172.16.1.6 next-hop-local
#
return
[AR3-bgp]
AR4
[AR4]bgp 64512
[AR4-bgp]dis
[AR4-bgp]display this
[V200R003C00]
#
bgp 64512confederation id 2peer 172.16.1.5 as-number 64512 #ipv4-family unicastundo synchronizationpeer 172.16.1.5 enablepeer 172.16.1.5 next-hop-local
#
return
[AR4-bgp]
AR5
[AR5]bgp 64513
[AR5-bgp]dis
[AR5-bgp]display this
[V200R003C00]
#
bgp 64513confederation id 2confederation peer-as 64512peer 172.16.1.18 as-number 64513 peer 172.16.1.21 as-number 64512 #ipv4-family unicastundo synchronizationpeer 172.16.1.18 enablepeer 172.16.1.18 next-hop-local peer 172.16.1.21 enablepeer 172.16.1.21 next-hop-local
#
return
[AR5-bgp]
AR6
[AR6]bgp 64513
[AR6-bgp]dis
[AR6-bgp]display this
[V200R003C00]
#
bgp 64513confederation id 2peer 172.16.1.14 as-number 64513 peer 172.16.1.17 as-number 64513 #ipv4-family unicastundo synchronizationpeer 172.16.1.14 enablepeer 172.16.1.14 next-hop-local peer 172.16.1.17 enablepeer 172.16.1.17 reflect-clientpeer 172.16.1.17 next-hop-local
#
return
[AR6-bgp]
AR7
[AR7]bgp 64513
[AR7-bgp]dis
[AR7-bgp]display this
[V200R003C00]
#
bgp 64513confederation id 2peer 78.1.1.2 as-number 3 peer 172.16.1.9 as-number 64512 peer 172.16.1.13 as-number 64513 #ipv4-family unicastundo synchronizationpeer 78.1.1.2 enablepeer 78.1.1.2 next-hop-local peer 172.16.1.9 enablepeer 172.16.1.9 next-hop-local peer 172.16.1.13 enablepeer 172.16.1.13 next-hop-local
#
return
[AR7-bgp]
AR8
[AR8]bgp 3
[AR8-bgp]dis
[AR8-bgp]display this
[V200R003C00]
#
bgp 3peer 78.1.1.1 as-number 2 #ipv4-family unicastundo synchronizationnetwork 8.8.8.8 255.255.255.255 peer 78.1.1.1 enable
#
return
[AR8-bgp]
配置反射器
AR3
[AR3]bgp 64512
[AR3-bgp]peer 172.16.1.6 reflect-client
AR6
[AR6]bgp 64513
[AR6-bgp]peer 172.16.1.17 reflect-client
宣告1.1.1.1/8.8.8.8
[AR1-bgp]network 1.1.1.1 32
[AR8-bgp]net 8.8.8.8 32
查看结果
AR1和AR8的环回可以ping通
减少路由条目数量
AR2
[AR2]ip route-static 172.16.0.0 16 NULL 0
[AR2]bgp 64512
[AR2-bgp]net 172.16.0.0 16
AR7
[AR7]ip route-static 172.16.0.0 16 NULL 0
[AR7]bgp 64513
[AR7-bgp]net 172.16.0.0 16
配置GRE环境
因为AS1中存在两个环回,一个地址为192.168.1.0/24,该地址不能在任何协议中宣告;AS3中存在两个环回一个地址为192.168.2.0/24,该地址不能在任何协议中宣告,最终要求这两个环回可以ping通,使用GRE
AR1
[AR1]int t 0/0/0
[AR1-Tunnel0/0/0]ip add 11.1.1.1 24
[AR1-Tunnel0/0/0]tun
[AR1-Tunnel0/0/0]tunnel-protocol gre
[AR1-Tunnel0/0/0]ou
[AR1-Tunnel0/0/0]sou
[AR1-Tunnel0/0/0]source 1.1.1.1
[AR1-Tunnel0/0/0]de
[AR1-Tunnel0/0/0]destination 8.8.8.8
[AR1-Tunnel0/0/0]q
[AR1]ip route-s
[AR1]ip route-static 192.168.2.0 24 11.1.1.2
AR8
[AR8]int t 0/0/0
[AR8-Tunnel0/0/0]ip add 11.1.1.2 24
[AR8-Tunnel0/0/0]tun
[AR8-Tunnel0/0/0]tunnel-protocol gre
[AR8-Tunnel0/0/0]sou
[AR8-Tunnel0/0/0]source 8.8.8.8
[AR8-Tunnel0/0/0]de
[AR8-Tunnel0/0/0]description
[AR8-Tunnel0/0/0]destination 1.1.1.1
Jul 22 2024 13:27:18-08:00 AR8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IPon the interface Tunnel0/0/0 has entered the UP state.
[AR8-Tunnel0/0/0]
[AR8-Tunnel0/0/0]q
[AR8]ip route-static 192.168.1.0 24 11.1.1.1
ping通