OSPF实验
要求:
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-R4之间启用PPP pap 单项认证 , R3-R4之间启用PPP的chap双向认证
4.area 1 区域不得出现4.5类LSA
5.其他区域优先通过R3访问R1 三个环回接口
6.尽量减少路由条目数量
7.area 1 区域增加安全性
8.全网可达
1.合理规划IP地址,所有路由器各自创建一个loopback接口(以R1、R4、R8为例其余配置方法一样)
R1:
[r1-ui-console0]int g0/0/0
[r1-GigabitEthernet0/0/0]ip addr 18.1.1.1 24
[r1-GigabitEthernet0/0/0]int l0
[r1-LoopBack0]ip addr 1.1.1.1 24
R4:
[r4-ui-console0]int l0
[r4-LoopBack0]ip addr 4.4.4.4 24
[r4-LoopBack0]int s4/0/1
[r4-Serial4/0/1]ip addr 24.1.1.2 24
[r4-Serial4/0/1]int s4/0/0
[r4-Serial4/0/0]ip addr 34.1.1.2 24
[r4-Serial4/0/0]int g0/0/0
[r4-GigabitEthernet0/0/0]ip addr 45.1.1.1 24
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip addr 46.1.1.1 24
R8:
[r8-ui-console0]int l0
[r8-LoopBack0]ip addr 8.8.8.8 24
[r8-LoopBack0]int g0/0/0
[r8-GigabitEthernet0/0/0]ip addr 18.1.1.2 24
[r8-GigabitEthernet0/0/0]int g0/0/1
[r8-GigabitEthernet0/0/1]ip addr 28.1.1.2 24
[r8-GigabitEthernet0/0/1]int g0/0/2
[r8-GigabitEthernet0/0/2]ip addr 38.1.1.2 24
测试如下:
2.R1再创建三个接口IP地址为201.1.1.1/24、201.1.2.1/24、201.1.3.1/24R,5再创建三个接口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(以R1为例)
[r1-GigabitEthernet0/0/0]int l0
[r1-LoopBack0]ip addr 1.1.1.1 24
[r1-LoopBack0]int L1
[r1-LoopBack1]ip addr 201.1.1.1 24
[r1-LoopBack1]int l2
[r1-LoopBack2]ip addr 201.1.2.1 24
[r1-LoopBack2]int l3
[r1-LoopBack3]ip addr 201.1.3.1 24
3.如图运行路由协议
3.1 R1 -R2 -R3之间使用MGRE网络,为hub-spoke 网络结构,R1为hub端 ,部署OSPF网络,MGRE修改为BMA网络类型
[r1]ip route-static 0.0.0.0 0 18.1.1.2
[r1]int Tunnel 0/0/0
[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 addr 100.1.1.1 24
[r2]ip route-static 0.0.0.0 0 28.1.1.2
[r2]interface Tunnel 0/0/0
[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 register
[r2-Tunnel0/0/0]ip addr 100.1.1.2 24
[r3]ip route-static 0.0.0.0 0 38.1.1.2
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 38.1.1.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 100.1.1.1 18.1.1.1 register
[r3-Tunnel0/0/0]ip addr 100.1.1.3 24
测试:
配置动态路由协议(以R1、R2、R4、R5、R6为例)
R1:
[r1]ospf 100 router-id 91.1.1.1
[r1-ospf-100]area 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 100.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 l0
[r1-LoopBack0]ospf network-type broadcast
[r1-LoopBack0]int l1
[r1-LoopBack1]ospf network-type broadcast
[r1-LoopBack1]int l2
[r1-LoopBack2]ospf network-type broadcast
[r1-LoopBack2]int l3
[r1-LoopBack3]ospf network-type broadcast
R2:
[r2]ospf 100 router-id 92.2.2.2
[r2-ospf-100]area 0
[r2-ospf-100-area-0.0.0.0]net 100.1.1.2 0.0.0.0
[r2-ospf-100-area-0.0.0.0]area 1
[r2-ospf-100-area-0.0.0.1]net 24.1.1.1 0.0.0.0
[r2-ospf-100-area-0.0.0.1]net 2.2.2.2 0.0.0.0
[r2-ospf-100-area-0.0.0.1]int l0
[r2-LoopBack0]ospf network-type broadcast
R4:
[r4]ospf 100 router-id 94.4.4.4
[r4-ospf-100]area 1
[r4-ospf-100-area-0.0.0.1]net 24.1.1.2 0.0.0.0
[r4-ospf-100-area-0.0.0.1]net 34.1.1.2 0.0.0.0
[r4-ospf-100-area-0.0.0.1]net 4.4.4.4 0.0.0.0
[r4-ospf-100-area-0.0.0.1]int l0
[r4-LoopBack0]ospf network-type broadcast
[r4-LoopBack0]ospf 100
[r4-ospf-100]area 2
[r4-ospf-100-area-0.0.0.2]net 46.1.1.1 0.0.0.0
[r4-LoopBack0]rip 200
[r4-rip-200]ver 2
[r4-rip-200]net 45.0.0.0
R5:
[r5]rip 200
[r5-rip-200]ver 2
[r5-rip-200]net 202.1.1.0
[r5-rip-200]net 202.1.2.0
[r5-rip-200]net 202.1.3.0
[r5-rip-200]net 45.0.0.0
[r5-rip-200]net 5.0.0.0
R6:
[r6]ospf 100 router-id 96.6.6.6
[r6-ospf-100]area 2
[r6-ospf-100-area-0.0.0.2]net 46.1.1.2 0.0.0.0
[r6-ospf-100-area-0.0.0.2]net 6.6.6.6 0.0.0.0
[r6-ospf-100-area-0.0.0.2]int l0
[r6-LoopBack0]ospf network-type broadcast
[r6-LoopBack0]rip 100
[r6-rip-100]ver 2
[r6-rip-100]net 67.0.0.0
MGRE修改为BMA网络类型
[r1]int t0/0/0
[r1-Tunnel0/0/0]ospf network-type broadcast
[r2]int t0/0/0
[r2-Tunnel0/0/0]ospf network-type broadcast
[r2-Tunnel0/0/0]ospf dr-priority 0
[r3]int t0/0/0
[r3-Tunnel0/0/0]ospf network-type broadcast
[r3-Tunnel0/0/0]ospf dr-priority 0
3.2 R2-R4之间启用PPP pap 单项认证 , R3-R4之间启用PPP的chap双向认证
· PPP pap单向认证
[r2]aaa
[r2-aaa]local-user hcie password cipher huawei
Info: Add a new user.
[r2-aaa]local-user hcie service-type ppp
[r2-aaa]int s4/0/0
[r2-Serial4/0/0]ppp authentication-mode pap
[r4]interface s4/0/1
[r4-Serial4/0/1]ppp pap local-user hcie password cipher huawei
·PPP的chap双向认证
[r3]aaa
[r3-aaa]local-user r4 password cipher huawei
Info: Add a new user.
[r3-aaa]local-user r4 service-type ppp
[r3-aaa]q
[r3]interface s4/0/0
[r3-Serial4/0/0]ppp authentication-mode chap
[r4-Serial4/0/0]ppp chap password cipher huawei
[r4-Serial4/0/0]ppp chap user r4
[r4]aaa
[r4-aaa]local-user r3 password cipher cisco
Info: Add a new user.
[r4-aaa]local-user r3 service-type ppp
[r4-aaa]q
[r4]int s4/0/0
[r4-Serial4/0/0]ppp authentication-mode chap
[r3-Serial4/0/0]ppp chap password cipher cisco
[r3-Serial4/0/0]ppp chap user r3
4.area 1 区域不得出现4.5类LSA
[r2]ospf 100
[r2-ospf-100]area 1
[r2-ospf-100-area-0.0.0.1]nssa
[r3-Tunnel0/0/0]ospf 100
[r3-ospf-100]area 1
[r3-ospf-100-area-0.0.0.1]nssa
[r4]ospf 100
[r4-ospf-100]area 1
[r4-ospf-100-area-0.0.0.1]nssa