实验使用软件:ensp
实验拓扑图:
实验要求·:
1.如图连接,合理规划IP地址,所有路由器各自创建一个loopback接口
2.R1再创建三个接口IP地址为201.1.1.1/24、201.1.2.1/24、201.1.3.1/24
R5再创建三个接口IP地址为202.1.1.1/24、202.1.2.1/24、202.1.3.1/24
R7再创建三个接口IP地址为203.1.1.1/24、203.1.2.1/24、203.1.3.1/24
3.如图运行路由协议
3.1 R1 -R2 -R3之间使用MGRE网络,为hub-spoke 网络结构,R1为hub端 ,
部署OSPF网络,MGRE修改为BMA网络类型
3.2 R2-R3之间启用PPP pap 单项认证 , R3-R4之间启用PPP的chap双向认证
4.area 1 区域不得出现4.5类LSA
5.其他区域优先通过R3访问R1 三个环回接口
6.尽量减少路由条目数量
7.area 1 区域增加安全性
8.全网可达
实验步骤:
1、根据实验要求规划好拓扑图
2、按要求对设备配置IP地址
R1接口配置:
R5接口配置:
R7接口配置:
R1 -R2 -R3
使用MGRE网络,为hub-spoke 网络结构,R1为hub端 ,部署OSPF网络,MGRE修改为BMA网络类型,先配置三条缺省 让路由器先通
[r1]ip route-static 0.0.0.0 0 18.1.1.2
[r2]ip route-static 0.0.0.0 0 28.1.1.2
[r3]ip route-static 0.0.0.0 0 38.1.1.2
进行hub-spoke配置
[r1-Tunnel0/0/0]tunnel-protocol gre ?
p2mp Point to multi-point GRE mode
<cr> Please press ENTER to execute command
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 18.1.1.1
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]ip address 100.1.1.1 24
[r2-Tunnel0/0/0]tunnel-protocol gre
[r2-Tunnel0/0/0]tunnel-protocol gre ?
p2mp Point to multi-point GRE mode
<cr> Please press ENTER to execute command
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source 28.1.1.1
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 100.1.1.1 18.1.1.1
[r2-Tunnel0/0/0]nhrp entry 100.1.1.1 18.1.1.1
Info: This peer exists already.
[r2-Tunnel0/0/0]ip add 100.1.1.2 24
Aug 11 2024 20:34:23-08:00 r2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r2-Tunnel0/0/0]nhrp entry 100.1.1.1 18.1.1.1 register
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]shutdown
[r3-Tunnel0/0/0]source 38.1.1.1
[r3-Tunnel0/0/0]nhrp entry 100.1.1.1 18.1.1.1 register
[r3-Tunnel0/0/0]ip add 100.1.1.3 24
R2-R3
启用PPP pap 单项认证 , R3-R4之间启用PPP的chap双向认证
1.单向认证
[r2]aaa
[r2-aaa]l
[r2-aaa]local-user ljl password cipher huawei
Info: Add a new user.
[r2-aaa]local-user ljl service-type ppp
[r2-aaa]int s 4/0/1
[r2-Serial4/0/1]ppp authentication-mode pap
[r4-Serial4/0/1]ppp pap local-user ljl password cipher huawei
2.双向认证
[r3-aaa]local-user r4 password cipher huawei
Info: Add a new user.
[r3-aaa]local-user r4 service-type ppp
[r3]interface s 4/0/0
[r3-Serial4/0/0]ppp authentication-mode ?
chap Enable CHAP authentication
pap Enable PAP authentication
[r3-Serial4/0/0]ppp authentication-mode chap
[r3-Serial4/0/0]ppp authentication-mode chap
r4-Serial4/0/0]ppp chap user r4 ?
[r4-Serial4/0/0]ppp chap password cipher huawei
运行协议
[r1-ospf-100]area 0
[r1-ospf-100-area-0.0.0.0]network 100.1.1.1 0.0.0.0
[r1-ospf-100-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[r1-ospf-100-area-0.0.0.0]network 201.1.0.0 0.0.255.255
[r1-ospf-100-area-0.0.0.0]int l 0
[r1-LoopBack0]ospf network-type broadcast
[r1-LoopBack0]int l 1
[r1-LoopBack1]ospf network-type broadcast
[r1-LoopBack1]int l 2
[r1-LoopBack2]ospf network-type broadcast
[r1-LoopBack2]int l 3
[r1-LoopBack3]ospf network-type broadcast
[r2]ospf 100 router-id 92.2.2.2
[r2-ospf-100]area 0
[r2-ospf-100-area-0.0.0.0]network 100.1.1.2 0.0.0.0
[r2-ospf-100-area-0.0.0.0]network 100.1.1.2 0.0.0.0
[r2-ospf-100-area-0.0.0.0]network 100.1.1.2 0.0.0.0
[r2-ospf-100]area 1
[r2-ospf-100-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[r2-ospf-100-area-0.0.0.1]network 24.1.1.1 0.0.0.0
[r2-ospf-100-area-0.0.0.1]int l 0
[r2-LoopBack0]ospfv3
[r2-LoopBack0]ospf network-type broadcast
[r4]ospf 100 router-id 94.4.4.4
[r4-ospf-100]area 1
[r4-ospf-100-area-0.0.0.1]network 24.1.1.2 0.0.0.0
[r4-ospf-100-area-0.0.0.1]network 24.1.1.2 0.0.0.
[r4-ospf-100]area 2
[r4-ospf-100-area-0.0.0.2]network 46.1.1.1 0.0.0.0
[r4-ospf-100-area-0.0.0.2]int l 0
[r4-LoopBack0]ospf network-type broadcast
[r4-LoopBack0]q
[r4]ospf 100
[r4-ospf-100]area 0
[r4-ospf-100-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r4-ospf-100-area-0.0.0.0]q
[r4-ospf-100]q
[r4]rip 200
[r4-rip-200]verify-source
[r4-rip-200]version 2
[r4-rip-200]network 45.0.0.0
[r5-rip-200]verify-source
[r5-rip-200]version 2
[r5-rip-200]network 45.0.0.0
[r5-rip-200]q
[r5]rip 200
[r5-rip-200]network 202.1.1.0
[r5-rip-200]network 202.1.2.0
[r5-rip-200]network 202.1.3.0
[r5-rip-200]network 5.0.0.0
[r7]rip 100
[r7-rip-100]verify-source
[r7-rip-100]version 2
[r7-rip-100]network 67.0.0.0
[r7-rip-100]network 7.0.0.0
[r7-rip-100]network 203.1.1.0
[r7-rip-100]network 203.1.2.0
[r7-rip-100]network 203.1.3.0
[r7-rip-100]dis ip rou pro rip
[r7-rip-100]q
[r7]dis ip ro pro rip
[r7]dis ip rou pro rip
[r7]dis ip rou pro rip
[r1-Tunnel0/0/0]ospf network-type broadcast
[r2-Tunnel0/0/0]ospf network-type broadcast
[r2-Tunnel0/0/0]ospf dr-priority 0
[r3-Tunnel0/0/0]ospf network-type broadcast
[r3-Tunnel0/0/0]ospf dr-priority 0
area 1 区域不得出现4.5类LSA
[r4-ospf-100-area-0.0.0.1]nssa
[r2-ospf-100-area-0.0.0.1]nssa
[r3-ospf-100-area-0.0.0.1]nssa
做通道使不规则的ospf区域协议通讯
[r2]int t 0/0/1
[r2-Tunnel0/0/1]ip address 42.1.1.1 24
[r2-Tunnel0/0/1]tunnel-protocol gre
[r2-Tunnel0/0/1]source 2.2.2.2
[r2-Tunnel0/0/1]description 4.4.4.4
[r4-Tunnel0/0/1]ip add 42.1.1.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 4.4.4.4
[r4-Tunnel0/0/1]description 2.2.2.2
[r4-Tunnel0/0/1]int t0/0/2
[r4-Tunnel0/0/2]ip address 43.1.1.2 24
[r4-Tunnel0/0/2]tunnel-protocol gre
[r4-Tunnel0/0/2]source 4.4.4.4
[r4-Tunne10/0/2]destination 3.3.3.3
[r3-Tunnel0/0/2]tunnel-protocol gre
[r3-Tunnel0/0/2]ip address 43.1.1.1 24
[r3-Tunnel0/0/2]source 3.3.3.3
[r3-Tunnel0/0/2]destination 4.4.4.4
将通道宣告到area2区域
[r2-ospf-100-area-0.0.0.2]network 42.1.1.1 0.0.0.0
[r4-ospf-100-area-0.0.0.2]network 42.1.1.2 0.0.0.8
[r4-ospf-100-area-0.0.0.2]network 43.1.1.2 0.0.0.0
[r3-ospf-100-area-0.0.0.2]network 43.1.1.1 0.0.0.0
汇总:
[r2-ospf-100-area-0.0.0.0]abr-summary 201.1.0.0 255.255.252.0
[r2-ospf-100-area-0.0.0.0]abr-summary 201.1.0.0 255.255.252.0 cost 100
[r3-ospf-100-area-0.0.0.0]abr-summary 201.1.0.0 255.255.252.0
[r3-ospf-100-area-0.0.0.0]abr-summary 201.1.0.0 255.255.252.0 cost 50
做area 1 区域增加安全性
[r2-ospf-100-area-0.0.0.1]authentication-mode
Please press ENTER to execute command<Cr>
[r2-ospf-100-area-0.0.0.1]authentication-modesimple huawei simple huawei
[r3-ospf-100-area-0.0.0.1]authentication-mode simple huawei
[r4-ospf-100-area-0.0.0.1]authentication-mode simple huawei
将rip协议重发布到ospf中或者补一条缺省
[r4-ospf-100]import-route rip 200
[r4-rip-200]default-route originate
[r6-rip-100]import-route ospf 100
全网可达
[r7]ping 201.1.1.1
PING 201.1.1.1:56 data bytes, press cTRL_c to break
Reply from 201.1.1.1: bytes=56 Sequence=1 tt1=252 time=170 ms
Reply from 201.1.1.1: bytes=56Sequence=2 ttl=252 time=40 ms
Reply from201.1.1.1: bytes=56Sequence=3 ttl=252 time=60 msmS
Reply from201.1.1.1:bytes=56Sequence=4 ttl=252 time=60
Reply from 201.1.1.1: bytes=56Sequence=5ttl=252 time=50 ms