概述
要求:
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.如图运行路由协议
R1 -R2 -R3之间使用MGRE网络,为hub-spoke 网络结构,R1为hub端 ,部署OSPF网络,MGRE修改为BMA网络类型
3.1 R2-R3之间启用PPP的pap单向认证,R3-R4之间启用PPP的chap双向认证
4.area 1 区域不得出现4.5类LSA
5.其他区域优先通过R3访问R1 三个环回接口
6.尽量减少路由条目数量
7.area 1 区域增加安全性
8.全网可达
配置
1.如图连接,合理规划IP地址,所有路由器各自创建一个loopback接口
接口配置
R1
[R1]int l 0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1-LoopBack0]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 18.1.1.1 24
R8
[R8]int l0
[R8-LoopBack0]ip add 8.8.8.8 24
[R8-LoopBack0]int g 0/0/1
[R8-GigabitEthernet0/0/1]ip add 18.1.1.2 24
[R8-GigabitEthernet0/0/1]int g 0/0/0
[R8-GigabitEthernet0/0/0]ip add 28.1.1.1 24
[R8-GigabitEthernet0/0/0]int g 0/0/2
[R8-GigabitEthernet0/0/2]ip add 38.1.1.1 24
R2
[R2]int l0
[R2-LoopBack0]ip add 2.2.2.2 24
[R2-LoopBack0]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 28.1.1.2 24
[R2-GigabitEthernet0/0/1]int s 4/0/0
[R2-Serial4/0/0]ip add 24.1.1.1 24
R3
[R3]int l0
[R3-LoopBack0]ip add 3.3.3.3 24
[R3-LoopBack0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 38.1.1.2 24
[R3-GigabitEthernet0/0/1]int s 4/0/1
[R3-Serial4/0/1]ip add 34.1.1.1 24
R4
[R4]int l0
[R4-LoopBack0]ip add 4.4.4.4 24
[R4-LoopBack0]int s 4/0/0
[R4-Serial4/0/0]ip add 24.1.1.2 24
[R4-Serial4/0/0]int s 4/0/1
[R4-Serial4/0/1]ip add 34.1.1.2 24
[R4-Serial4/0/1]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.1.1.1 24
[R4-GigabitEthernet0/0/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 46.1.1.1 24
R5
[R5]int l0
[R5-LoopBack0]ip add 5.5.5.5 24
[R5-LoopBack0]int g 0/0/1
[R5-GigabitEthernet0/0/1]ip add 45.1.1.2 24
R6
[R6]int l0
[R6-LoopBack0]ip add 6.6.6.6 24
[R6-LoopBack0]int g 0/0/1
[R6-GigabitEthernet0/0/1]ip add 46.1.1.2 24
[R6-GigabitEthernet0/0/1]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip add 67.1.1.1 24
R7
[R7]int l0
[R7-LoopBack0]ip add 7.7.7.7 24
[R7-LoopBack0]int g 0/0/1
[R7-GigabitEthernet0/0/1]ip add 67.1.1.2 24
2.R1-R5-R7创建接口
R1
[R1]int l1
[R1-LoopBack1]ip add 201.1.1.1 24
[R1]int l2
[R1-LoopBack2]ip add 201.1.2.1 24
[R1-LoopBack2]int l3
[R1-LoopBack3]ip add 201.1.3.1 24
R5
[R5]int l1
[R5-LoopBack1]ip add 202.1.1.1 24
[R5-LoopBack1]int l2
[R5-LoopBack2]ip add 202.1.2.1 24
[R5-LoopBack2]int l3
[R5-LoopBack3]ip add 202.1.3.1 24
R7
[R7]int l1
[R7-LoopBack1]ip add 203.1.1.1 24
[R7-LoopBack1]int l2
[R7-LoopBack2]ip add 203.1.2.1 24
[R7-LoopBack2]int l3
[R7-LoopBack3]ip add 203.1.3.1 24
3.如图运行路由协议
OSPF、RIP
R1
[R1]ospf 1 router-id 91.1.1.1
[R1-ospf-1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]net 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]net 18.1.1.1 0.0.0.0
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ospf enable 1 area 0
R8
[R8]ospf 1 router-id 98.8.8.8
[R8-ospf-1]ospf 1
[R8-ospf-1]area 0
[R8-ospf-1-area-0.0.0.0]net 28.1.1.1 0.0.0.0
[R8-ospf-1-area-0.0.0.0]net 18.1.1.2 0.0.0.0
[R8-ospf-1-area-0.0.0.0]net 38.1.1.1 0.0.0.0
[R8-ospf-1-area-0.0.0.0]net 8.8.8.8 0.0.0.0
[R8-ospf-1]int g 0/0/1
[R8-GigabitEthernet0/0/1]ospf enable 1 area 0
[R8-GigabitEthernet0/0/1]int g 0/0/0
[R8-GigabitEthernet0/0/0]ospf enable 1 area 0
[R8-GigabitEthernet0/0/0]int g 0/0/2
[R8-GigabitEthernet0/0/2]ospf enable 1 area 0
R2
[R2]ospf 1 router-id 92.2.2.2
[R2-ospf-1]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]net 28.1.1.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]net 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]q
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]net 24.1.1.1 0.0.0.0
[R2]int g 0/0/1
[R2-GigabitEthernet0/0/1]ospf enable 1 area 0
[R2]int s 4/0/0
[R2-Serial4/0/0]ospf enable 1 area 1
R3
[R3]ospf 1 router-id 93.3.3.3
[R3-ospf-1]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]net 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]net 38.1.1.2 0.0.0.0
[R3-ospf-1-area-0.0.0.0]q
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]net 34.1.1.1 0.0.0.0
[R3-ospf-1]int g 0/0/1
[R3-GigabitEthernet0/0/1]ospf enable 1 area 0
[R3]int s 4/0/1
[R3-Serial4/0/0]ospf enable 1 area 1
R4
[R4]ospf 1 router-id 94.4.4.4
[R4-ospf-1]ospf 1
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]net 24.1.1.2 0.0.0.0
[R4-ospf-1-area-0.0.0.1]net 34.1.1.2 0.0.0.0
[R4-ospf-1-area-0.0.0.1]net 4.4.4.4 0.0.0.0
[R4]ospf 1
[R4-ospf-1]area 2
[R4-ospf-1-area-0.0.0.2]net 46.1.1.1 0.0.0.0
[R4]int s 4/0/0
[R4-Serial4/0/0]ospf enable 1 area 1
[R4-Serial4/0/0]int s 4/0/1
[R4-Serial4/0/1]ospf enable 1 area 1
[R4]int g 0/0/1
[R4-GigabitEthernet0/0/1]ospf enable 1 area 2
R5
[R5]rip 200
[R5-rip-200]version 2
[R5-rip-200]undo sum
[R5-rip-200]undo summary
[R5-rip-200]net 45.0.0.0
[R5-rip-200]net 5.0.0.0
R6
[R6]ospf 1 router-id 96.6.6.6
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]net 46.1.1.2 0.0.0.0
[R6-ospf-1-area-0.0.0.2]net 6.6.6.6 0.0.0.0
[R6-ospf-1]int g 0/0/1
[R6-GigabitEthernet0/0/1]ospf enable 1 area 2
[R6-ospf-1]import-route rip 100
[R6-rip-100]import-route ospf 1
R7
[R7]rip 100
[R7-rip-100]version 2
[R7-rip-100]undo summary
[R7-rip-100]net 67.0.0.0
[R7-rip-100]net 7.0.0.0
网络类型
R1 -R2 -R3之间使用MGRE网络,为hub-spoke 网络结构,R1为hub端 ,部署OSPF网络,MGRE修改为BMA网络类型
R1
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip add 100.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 18.1.1.1
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R1-Tunnel0/0/0]nhrp network-id 100
[R1-Tunnel0/0/0]ospf network-type broadcast
[R1-Tunnel0/0/0]ospf dr-priority 100
R2
[R2]int t 0/0/0
[R2-Tunnel0/0/0]ip add 100.1.1.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]source 28.1.1.2
[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]ospf network-type broadcast
[R2-Tunnel0/0/0]ospf dr-priority 0
R3
[R3]int t 0/0/0
[R3-Tunnel0/0/0]ip add 100.1.1.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 38.1.1.2
[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]ospf network-type broadcast
[R3-Tunnel0/0/0]ospf dr-priority 0
PPP
R2-R3之间启用PPP的pap单向认证,R3-R4之间启用PPP的chap双向认证
pap---R2
[R2]aaa
[R2-aaa]local-user dan password cipher 123456
[R2-aaa]local-user dan service-type ppp
[R2-aaa]int s 4/0/0
[R2-Serial4/0/0]ppp authentication-mode pap
pap---R3
[R3-aaa]int s 4/0/0
[R3-Serial4/0/0]link-protocol ppp
[R3-Serial4/0/0]ppp pap local-user dan password cipher 123456
chap---R3
[R3]aaa
[R3-aaa]local-user chap password cipher 654321
[R3-aaa]local-user chap service-type ppp
[R3]int s 4/0/1
[R3-Serial4/0/1]link-protocol ppp
[R3-Serial4/0/1]ppp authentication-mode chap
[R3]int s 4/0/1
[R3-Serial4/0/1]link-protocol ppp
[R3-Serial4/0/1]ppp chap user chap
[R3-Serial4/0/1]ppp chap password cipher 654321
chap---R4
[R4]int s 4/0/1
[R4-Serial4/0/1]link-protocol ppp
[R4-Serial4/0/1]ppp chap user chap
[R4-Serial4/0/1]ppp chap password cipher 654321
[R4]aaa
[R4-aaa]local-user chap password cipher 654321
[R4-aaa]local-user chap service-type ppp
[R4-aaa]int s 4/0/1
[R4-Serial4/0/1]link-protocol ppp
[R4-Serial4/0/1]ppp authentication-mode chap
4.area 1 区域不得出现4.5类LSA
R2
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]nssa
R3
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]nssa
R4
[R4]ospf 1
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]nssa
5.其他区域优先通过R3访问R1 三个环回接口
[r1]ip route-static 0.0.0.0 0 18.1.1.2
[r2]ip route-static 0.0.0.0 0 82.1.1.1
[r3]ip route-static 0.0.0.0 0 83.1.1.1
[R2]int t 0/0/1
[R2-Tunnel0/0/1]ip add 24.1.2.1 24
[R2-Tunnel0/0/1]tunnel-protocol gre
[R2-Tunnel0/0/1]source 24.1.1.1
[R2-Tunnel0/0/1]description 24.1.1.2
[R4]int t 0/0/1
[R4-Tunnel0/0/1]ip add 24.1.2.2 24
[R4-Tunnel0/0/1]tunnel-protocol gre
[R4-Tunnel0/0/1]source 24.1.1.2
[R4-Tunnel0/0/1]description 24.1.1.1
[R4-ospf-1]import-route rip 200
[R4-rip-100]import-route ospf 1
[R3]int t 0/0/2
[R3-Tunnel0/0/2]ip add 34.1.2.1 24
[R3-Tunnel0/0/2]tunnel-protocol gre
[R3-Tunnel0/0/2]source 34.1.1.1
[R3-Tunnel0/0/2]description 34.1.1.2
[R4]int t 0/0/2
[R4-Tunnel0/0/2]ip add 34.1.2.2 24
[R4-Tunnel0/0/2]tunnel-protocol gre
[R4-Tunnel0/0/2]source 34.1.1.2
[R4-Tunnel0/0/2]description 34.1.1.1
[R1]int t 0/0/0
[R1-Tunnel0/0/0]ospf network-type broadcast
[R2]int t 0/0/0
[R2-Tunnel0/0/0]ospf network-type broadcast
[R3]int t 0/0/0
[R3-Tunnel0/0/0]ospf network-type broadcast
[R2]int t 0/0/1
[R2-Tunnel0/0/1]ospf cost 2000
[R4]int t 0/0/1
[R4-Tunnel0/0/1]ospf cost 2000
6.尽量减少路由条目数量
[R5]int g 0/0/1
[R5-GigabitEthernet0/0/1]rip summary-address 202.1.0.0 255.255.252.0
[R5]ip route-static 202.1.0.0 255.255.252.0 null 0
[R7]int g 0/0/1
[R7-GigabitEthernet0/0/1]rip summary-address 202.1.0.0 255.255.252.0
[R7]ip route-static 202.1.0.0 255.255.252.0 null 0
7.area 1 区域增加安全性
R2
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]authentication-mode simple plain 123456
R3
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]authentication-mode simple plain 123456
R4
[R4]ospf 1
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]authentication-mode simple plain 123456