OSPF综合实验
题目及IP地址划分
按照上图划分的ip地址完成基础配置后
各个路由器的环回
区域1
R1
[R1]int loop0
[R1-LoopBack0]ip add 172.16.33.1 25
R2
[R2]int loop0
[R2-LoopBack0]ip add 172.16.33.129 25
R3
[R3]int loop0
[R3-LoopBack0]ip add 172.16.34.1 25
区域0
R5
[R5]int loop0
[R5-LoopBack0]ip add 172.16.1.1 25
区域2
R6
[R6]int loop0
[R6-LoopBack0]ip add 172.16.1.129 25
R11
[R11]int loop0
[R11-LoopBack0]ip add 172.16.97.1 25
区域3
R7
[R7]int loop0
[R7-LoopBack0]ip add 172.16.2.1 25
R8
[R8]int loop0
[R8-LoopBack0]ip add 172.16.65.1 25
区域4
R9
[R9]int loop0
[R9-LoopBack0]ip add 172.16.129.1 25
R10
[R10]int loop0
[R10-LoopBack0]ip add 172.16.129.129 25
RIP
R12
[R12]int loop0
[R12-LoopBack0]ip add 172.16.160.1 20
[R12-LoopBack0]int loop1
[R12-LoopBack1]ip add 173.16.176.1 20
R4的环回及ip地址
[R4]int loop0
[R4-LoopBack0]ip add 4.4.4.4 24
[R4-GigabitEthernet0/0/0]ip add 34.1.1.2 24
[R4-GigabitEthernet0/0/0]int G0/0/1
[R4-GigabitEthernet0/0/1]ip add 45.1.1.2 24
[R4-GigabitEthernet0/0/1]int G0/0/2
[R4-GigabitEthernet0/0/2]ip add 46.1.1.2 24
[R4-GigabitEthernet0/0/2]int G4/0/0
[R4-GigabitEthernet4/0/0]ip add 47.1.1.2 24
边界路由的缺省路由
R3
[R3]ip route-static 0.0.0.0 0 34.1.1.2
R5
[R5]ip rout 0.0.0.0 0 45.1.1.2
R6
[R6]ip rout 0.0.0.0 0 46.1.1.2
R7
[R7]ip rout 0.0.0.0 0 47.1.1.2
配置MA骨干
R3(中心站点)
[R3]int T0/0/0
[R3-Tunnel0/0/0]ip add 172.16.0.129 29
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 34.1.1.1
R5
[R5]int T0/0/0
[R5-Tunnel0/0/0]ip add 172.16.0.130 29
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]so
[R5-Tunnel0/0/0]source G0/0/0
[R5-Tunnel0/0/0]nhrp entry 172.16.0.129 34.1.1.1 register
R6
[R6]int T0/0/0
[R6-Tunnel0/0/0]tu
[R6-Tunnel0/0/0]ip add 172.16.0.131 29
[R6-Tunnel0/0/0]tunnel-protocol gre p2mp
[R6-Tunnel0/0/0]source G0/0/0
[R6-Tunnel0/0/0]nhrp entry 172.16.0.129 34.1.1.1 register
R7
[R7]int T0/0/0
[R7-Tunnel0/0/0]ip add 172.16.0.132 29
[R7-Tunnel0/0/0]tunnel-protocol gre p2mp
[R7-Tunnel0/0/0]source G0/0/0
[R7-Tunnel0/0/0]nhrp entry 172.16.0.129 34.1.1.1 register
查看R3的动态map
打开R3的伪广播
[R3-Tunnel0/0/0]nhrp entry multicast dynamic
OSPF协议
R1
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.1.255
R2
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.1.255
R3
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 172.16.0.129 0.0.0.0
[R3-ospf-1-area-0.0.0.0]area 1
[R3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.3.255
R5
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]net
[R5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.1.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.1.255
[R6-ospf-1-area-0.0.0.0]area 2
[R6-ospf-1-area-0.0.0.2]network 172.16.96.1 0.0.0.0
R7
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.3.255
[R7-ospf-1-area-0.0.0.0]area 3
[R7-ospf-1-area-0.0.0.3]network 172.16.64.1 0.0.0.0
R8
[R8]ospf 1 router-id 8.8.8.8
[R8-ospf-1]area 3
[R8-ospf-1-area-0.0.0.3]network 172.16.64.0 0.0.1.255
R9
[R9]ospf 1 router-id 9.9.9.9
[R9-ospf-1]area 3
[R9-ospf-1-area-0.0.0.3]network 172.16.64.6 0.0.0.0
[R9-ospf-1-area-0.0.0.3]area 4
[R9-ospf-1-area-0.0.0.4]network 172.16.128.0 0.0.1.255
R10
[R10]ospf 1 router-id 10.10.10.10
[R10-ospf-1]area 4
[R10-ospf-1-area-0.0.0.4]network 172.16.128.0 0.0.1.255
R11
[R11]ospf 1 router-id 11.11.11.11
[R11-ospf-1]area 2
[R11-ospf-1-area-0.0.0.2]network 172.16.96.0 0.0.1.255
R12
[R12]ospf 1 router-id 12.12.12.12
[R12-ospf-1]area 2
[R12-ospf-1-area-0.0.0.2]network 172.16.96.6 0.0.0.0
RIP协议
R12
[R12]rip 1
[R12-rip-1]ver 2
[R12-rip-1]network 172.16.0.0
查看OSPF邻居关系
R3
R6
R11
R8
R9
更改公网路由器的工作方式及确定DR
R3
[R3]int T0/0/0
[R3-Tunnel0/0/0]ospf network-type broadcast
R5
[R5]int T0/0/0
[R5-Tunnel0/0/0]ospf network-type broadcast
[R5-Tunnel0/0/0]ospf dr-priority 0
R6
[R6]int T0/0/0
[R6-Tunnel0/0/0]ospf network-type broadcast
[R6-Tunnel0/0/0]ospf dr-priority 0
R7
[R7]int t0/0/0
[R7-Tunnel0/0/0]ospf network-type broadcast
[R7-Tunnel0/0/0]ospf dr-priority 0
查看R3邻居关系
将RIP区域的路由引入区域2(将RIP路由重发布进区域2)
R12
[R12]ospf 1
[R12-ospf-1]import-route rip
区域2与区域3做双向重发布
R9
[R9]ospf 1
[R9-ospf-1]dis th
[V200R003C00]
#
ospf 1 router-id 9.9.9.9
area 0.0.0.3
network 172.16.64.6 0.0.0.0
area 0.0.0.4
network 172.16.128.0 0.0.1.255
#
return
[R9-ospf-1]area 4
[R9-ospf-1-area-0.0.0.4]undo network 172.16.128.0 0.0.1.255
[R9-ospf-1-area-0.0.0.4]q
[R9-ospf-1]q
[R9]ospf 2
[R9-ospf-2]area 4
[R9-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.1.255
现在将区域4当成一个运行的RIP协议
R9
[R9]ospf 1
[R9-ospf-1]import-route ospf 2
R9
[R9-ospf-1]q
[R9]ospf 2
[R9-ospf-2]import-route ospf 1
汇总(优化)
优化区域0
R3
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
R6
[R6]ospf 1
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.96.0 255.255.224.0
R7
[R7]ospf 1
[R7-ospf-1]area 3
[R7-ospf-1-area-0.0.0.3]abr-summary 172.16.64.0 255.255.224.0
R12
[R12]ospf 1
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
R9
[R9]ospf 1
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.254.0
优化区域1
R1
[R1]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]stub
R2
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]stub
R3
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]stub no-summary
优化区域2
R12
[R12]ospf 1
[R12-ospf-1]area 2
[R12-ospf-1-area-0.0.0.2]nssa
R11
[R11]ospf 1
[R11-ospf-1]area 2
[R11-ospf-1-area-0.0.0.2]nssa
R6
[R6]ospf 1
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]nssa no-summary
优化区域3
R7
[R7]ospf 1
[R7-ospf-1]area 3
[R7-ospf-1-area-0.0.0.3]nssa no-summary
R8
[R8]ospf 1
[R8-ospf-1]area 3
[R8-ospf-1-area-0.0.0.3]nssa
R9
[R9]ospf 1
[R9-ospf-1]area 3
[R9-ospf-1-area-0.0.0.3]nssa
优化区域4
将R9双向重发布改为单向
R9
[R9]ospf 2
[R9-ospf-2]undo import-route ospf 1
[R9-ospf-2]default-route-advertise
防环
R3
[R3]ip route-static 172.16.32.0 19 NULL 0
R6
[R6]ip route-static 172.16.96.0 19 NULL 0
R7
[R7]ip route-static 172.16.64.0 19 NULL 0
R9
[R9]ip route-static 172.16.128.0 19 NULL 0
R12
[R12]ip route-static 172.16.160.0 19 NULL 0
配置NAT
R3
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3-acl-basic-2000]int G0/0/1
[R3-GigabitEthernet0/0/1]nat outbound 2000
R6
[R6]acl 2000
[R6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R6-acl-basic-2000]int G0/0/0
[R6-GigabitEthernet0/0/0]nat outbound 2000
R7
[R7]acl 2000
[R7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R7-acl-basic-2000]int G0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000
测试