实验要求:
1,R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有;
2,IP R3-R5/6/7为MGRE环境,R3为中心站点;
3,整个OSPF环境IP基于172.16.0.0/16划分;
4,所有设备均可访问r4的环回;
5,减少LSA的更新量,加快收敛,保障更新安全;
6,全网可达
步骤一:整个OSPF环境IP基于172.16.0.0/16划分;
172.16.0.0 /16
172.16.0.0 /19 ----a0
172.16.0.0/24----P2P骨干
172.16.0.0 /30
172.16.0.4/30
172.16.0.8/30
172.16.0.12/30
......
172.16.1.0/24----MA骨干
172.16.1.0/29
172.16.1.8/29
172.16.1.16/29
172.16.1.24/29
.....
172.16.2.0/24
172.16.3.0/24
172.16.4.0/24
172.16.5.0/24
172.16.32.0/19 ----a1
172.16.32.0/24 ----P2P的骨干
172.16.32.0/30
172.16.32.4/30
......
172.16.33.0/24 ----MA的骨干
172.16.33.0/29
172.16.33.8/29
172.16.33.16/29
172.16.33.24/29
.....
172.16.34.0/24
172.16.35.0/24
.......
172.16.64.0/19 ----a2
172.16.64.0/24 ----P2P的骨干
172.16.64.0/30
172.16.64.4/30
172.16.64.8/30
172.16.64.12/30
.....
172.16.65.0/24 ----MA的骨干
172.16.65.0/29
172.16.65.8/29
172.16.65.16/29
......
172.16.66.0/24
172.16.67.0/24
.......
172.16.96.0/19 ----a3
172.16.96.0/24 ---- P2P的骨干
172.16.96.0/30
172.16.96.4/30
172.16.96.8/30
......
172.16.97.0/24 ----MA的骨干
172.16.97.0/29
172.16.97.8/29
172.16.97.16/29
172.16.97.24/29
.....
172.16.98.0/24
172.16.99.0/24
.......
172.16.128.0/19 ----a4
172.16.128.0/24 ---- P2P的骨干
172.16.128.0/30
172.16.128.4/30
172.16.128.8/30
172.16.128.12/30
.....
172.16.129.0/24 ---- MA的骨干
172.16.129.0/29
172.16.129.8/29
172.16.129.16/29
172.16.129.24/29
.......
172.16.130.0/24
172.16.131.0/24
.....
172.16.160.0/19 ----rip
172.16.160.0/24 ---- P2P的骨干
172.16.160.0/30
172.16.160.4/30
172.16.160.8/30
172.16.160.12/30
.......
172.16.161.0/24 ----MA的骨干
172.16.161.0/29
172.16.161.8/29
172.16.161.16/29
172.16.161.24/29
......
172.16.162.0/24
172.16.163.0/24
.......
172.16.192.0/19
172.16.224.0/19
步骤二:按照区域进行相应的配置
Area 0区域
R3:
R7:
R5:
R6:
R4:
R3-R5/6/7为MGRE环境,R3为中心站点;
R3:
<r3>sys
[r3]int t0/0/0 ————创建虚拟隧道
[r3-Tunnel0/0/0]ip ad 172.16.1.1 29 ————配置IP地址
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp ————配置网络类型
[r3-Tunnel0/0/0]source 34.0.0.1 ————中心设备IP地址的固定
[r3-Tunnel0/0/0]nhrp network-id 100 ————建立nhrp域让建邻可以通过nhrp自动获取
[r3-Tunnel0/0/0]nhrp entry multicast dynamic ————开启为广播
R5:
<r5>sys
[r5]int t 0/0/0
[r5-Tunnel0/0/0]ip ad 172.16.1.2 29
[r5-Tunnel0/0/0]tunnel-protocol gre p2
[r5-Tunnel0/0/0]source Serial 4/0/0
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register ————找中心站点进行注册
R6:
<r6>sys
[r6]int t 0/0/0
[r6-Tunnel0/0/0]ip ad 172.16.1.3 29
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source Serial 4/0/0
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
R7:
<r7>sys
[r7]int t0/0/0
[r7-Tunnel0/0/0]ip ad 172.16.1.4 29
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp
[r7-Tunnel0/0/0]source g0/0/0
[r7-Tunnel0/0/0]nhrp network-id 100
[r7-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register
在R3检验:
[r3]display nhrp peer all ————检验命令
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
172.16.1.2 32 54.0.0.1 172.16.1.2 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:14:13
Expire time : 01:45:47
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
172.16.1.3 32 64.0.0.1 172.16.1.3 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:12:39
Expire time : 01:47:21
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
172.16.1.4 32 74.0.0.1 172.16.1.4 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:11:12
Expire time : 01:48:48
[r3]ping 172.16.1.2 ————R5
PING 172.16.1.2: 56 data bytes, press CTRL_C to break
Reply from 172.16.1.2: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 172.16.1.2: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 172.16.1.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 172.16.1.2: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 172.16.1.2: bytes=56 Sequence=5 ttl=255 time=20 ms
--- 172.16.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/26/30 ms
[r3]
[r3]ping 172.16.1.3 ————R6
PING 172.16.1.3: 56 data bytes, press CTRL_C to break
Reply from 172.16.1.3: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 172.16.1.3: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 172.16.1.3: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 172.16.1.3: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 172.16.1.3: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 172.16.1.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/34/50 ms
[r3]ping 172.16.1.4 ————R7
PING 172.16.1.4: 56 data bytes, press CTRL_C to break
Reply from 172.16.1.4: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 172.16.1.4: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 172.16.1.4: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 172.16.1.4: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 172.16.1.4: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 172.16.1.4 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/30/40 ms
area 1区域:
R1:
<r1>sys
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip ad 172.16.33.1 29
[r1-GigabitEthernet0/0/0]int l0
[r1-LoopBack0]ip ad 172.16.34.1 24
R2:
<r2>sys
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip ad 172.16.33.2 29
[r2-GigabitEthernet0/0/0]int l0
[r2-LoopBack0]ip ad 172.16.35.1 24
R3:
<r3>sys
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip ad 172.16.33.3 29
[r3-GigabitEthernet0/0/0]int l0
[r3-LoopBack0]ip ad 172.16.36.1 24
检测:
area 2区域:
R6:
<r6>sys
[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]ip ad 172.16.65.1 29
R11:
<r11>sys
[r11]int g 0/0/0
[r11-GigabitEthernet0/0/0]ip ad 172.16.65.2 29
[r11-GigabitEthernet0/0/0]int g 0/0/1
[r11-GigabitEthernet0/0/1]ip ad 172.16.65.9 29
[r11-GigabitEthernet0/0/1]int l0
[r11-LoopBack0]ip ad 172.16.66.1 24
R12:
<r12>sys
[r12]int g0/0/0
[r12-GigabitEthernet0/0/0]ip ad 172.16.65.10 29
Area3区域:
R7:
<r7>sys
[r7]int g0/0/1
[r7-GigabitEthernet0/0/1]ip ad 172.16.97.1 29
R8:
<r8>sys
[r8]int g0/0/0
[r8-GigabitEthernet0/0/0]ip ad 172.16.97.2 29
[r8-GigabitEthernet0/0/0]int g 0/0/1
[r8-GigabitEthernet0/0/1]ip ad 172.16.97.9 29
[r8-GigabitEthernet0/0/1]int l0
[r8-LoopBack0]ip ad 172.16.98.1 24
R9:
<r9>sys
[r9]int g 0/0/0
[r9-GigabitEthernet0/0/0]ip ad 172.16.97.10 29
Area4区域:
R9:
[r9]int g 0/0/1
[r9-GigabitEthernet0/0/1]ip ad 172.16.129.1 29
[r9]int LoopBack 0
[r9-LoopBack0]ip ad 172.16.130.1 24
R10:
[r10]int g0/0/0
[r10-GigabitEthernet0/0/0]ip ad 172.16.129.2 29
[r10]int LoopBack 0
[r10-LoopBack0]ip ad 172.16.131.1 24
RIP区域:
<r12>sys
[r12]int LoopBack 0
[r12-LoopBack0]ip ad 172.16.160.1 20
[r12]int LoopBack 1
[r12-LoopBack1]ip ad 172.16.176.1 20
步骤二:整个OSPF环境
Area1:
R1:
<r1>sys
[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.0.0 0.0.255.255
R2:
<r2>SYS
[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.0.0 0.0.255.255
R3:
<r3>sys
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255
Area0:
R3:
[r3-ospf-1-area-0.0.0.1]q
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0
R5:
<r5>SYS
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]a 0
[r5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
R6:
<r6>sys
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]a 0
[r6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.3.255
R7:
<r7>SYS
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]a 0
[r7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.7.255
Area2:
R6:
[r6-ospf-1]a 2
[r6-ospf-1-area-0.0.0.2]network 172.16.65.1 0.0.0.0
R11:
<r11>SYS
[r11]ospf 1 router-id 11.11.11.11
[r11-ospf-1]a 2
[r11-ospf-1-area-0.0.0.2]network 172.16.0.0 0.0.255.255
R12:
<r12>sys
[r12]ospf 1 router-id 12.12.12.12
[r12-ospf-1]a 2
[r12-ospf-1-area-0.0.0.2]network 172.16.65.10 0.0.0.0
Area3:
R7:
[r7-ospf-1-area-0.0.0.0]q
[r7-ospf-1]a 3
[r7-ospf-1-area-0.0.0.3]network 172.16.97.1 0.0.0.0
R8:
<r8>sys
[r8]ospf 1 router-id 8.8.8.8
[r8-ospf-1]a 3
[r8-ospf-1-area-0.0.0.3]network 172.16.0.0 0.0.255.255
R9:
<r9>sys
[r9]ospf 1 router-id 9.9.9.9
[r9-ospf-1]a 3
[r9-ospf-1-area-0.0.0.3]network 172.16.97.10 0.0.0.0
Area4:
R9:
[r9-ospf-1]a 4
[r9-ospf-1-area-0.0.0.4]network 172.16.128.0 0.0.3.255
R10:
<r10>sys
[r10]ospf 1 router-id 10.10.10.10
[r10-ospf-1]a 4
[r10-ospf-1-area-0.0.0.4]network 172.16.0.0 0.0.255.255
RIP区域:
R12:
[r12]rip 1
[r12-rip-1]version 2
[r12-rip-1]network 172.16.0.0
步骤三:所有设备均可访问r4的环回
Area0:
R3:
<r3>sys
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ospf network-type p2mp
R5:
<r5>sys
[r5]int t 0/0/0
[r5-Tunnel0/0/0]ospf network-type p2mp
R6:
<r6>sys
[r6]int t 0/0/0
[r6-Tunnel0/0/0]ospf network-type p2mp
R7:
<r7>sys
[r7]int t 0/0/0
[r7-Tunnel0/0/0]ospf network-type p2mp
查看:
[r3]display ospf peer brief ——查看命令
<r6>display ip routing-table protocol ospf ——查看命令
重发布:
(1)让R11能够获取RIP路由的信息
[r12]ospf ——进入OSPF进程
[r12-ospf-1]import-route rip 1 ——将RIP的信息导入OSPF中
查看:<r5>display ip routing-table protocol ospf ——查看命令
(2)将R9运行双进程
<r9>sys
[r9]ospf
[r9-ospf-1]a 4
[r9-ospf-1-area-0.0.0.4]undo net
[r9-ospf-1-area-0.0.0.4]undo network 172.16.128.0 0.0.3.255
[r9-ospf-1-area-0.0.0.4]q
[r9-ospf-1]undo a 4
[r9-ospf-1]q
[r9]ospf 2 router-id 9.9.9.9
[r9-ospf-2]a 4
[r9-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.3.255
重发布:
[r9-ospf-2-area-0.0.0.4]q
[r9-ospf-2]q
[r9]ospf 1
[r9-ospf-1]import-route os
[r9-ospf-1]import-route ospf 2
查看:[r5]display ip routing-table protocol ospf
步骤四:减少LSA的更新量,加快收敛,保障更新安全
域内汇总
R3:
<r3>sys
[r3]ospf 1
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
R6:
<r6>SYS
[r6]ospf
[r6-ospf-1]a 2
[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
R7:
<r7>sys
[r7]ospf
[r7-ospf-1]a 3
[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
域外汇总:
R9:
<r9>sys
[r9]ospf
[r9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
R12:
<r12>SYS
[r12]ospf
[r12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
检查:<r5>display ip routing-table protocol ospf
特殊区域的设置:
Area1:
R1:
<r1>sys
[r1]ospf
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]stub
R2:
<r2>sys
[r2]ospf
[r2-ospf-1]a 1
[r2-ospf-1-area-0.0.0.1]stub
R3:
<r3>sys
[r3]ospf
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]stub
[r3-ospf-1-area-0.0.0.1]stub no-summary
Area2:
R6:
<r6>sys
[r6]ospf
[r6-ospf-1]a 2
[r6-ospf-1-area-0.0.0.2]nssa no-summary
R11:
<r11>SYS
[r11]ospf
[r11-ospf-1]a 2
[r11-ospf-1-area-0.0.0.2]nssa no-summary
R12:
<r12>sys
[r12]ospf
[r12-ospf-1]a 2
[r12-ospf-1-area-0.0.0.2]nssa
Area3:
R7:
<r7>SYS
[r7]ospf
[r7-ospf-1]a 3
[r7-ospf-1-area-0.0.0.3]nssa no-summary
R8:
<r8>sys
[r8]ospf
[r8-ospf-1]a 3
[r8-ospf-1-area-0.0.0.3]nssa
R9:
<r9>sys
[r9]ospf
[r9-ospf-1]a 3
[r9-ospf-1-area-0.0.0.3]nssa
R10:获得缺省
<r9>sys
[r9]ospf 2
[r9-ospf-2]default-route-advertise
步骤五:所有设备均可访问r4的环回
R3:
<r3>sys
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r3-acl-basic-2000]q
[r3]int s 4/0/0
[r3-Serial4/0/0]nat outbound 2000
R6:
<r6>SYS
[r6]acl 2000
[r6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r6-acl-basic-2000]q
[r6]int s 4/0/0
[r6-Serial4/0/0]nat outbound 2000
R7:
<r7>sys
[r7]acl 2000
[r7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r7-acl-basic-2000]q
[r7]int g 0/0/0
[r7-GigabitEthernet0/0/0]nat outbound 2000