实验要求:
1.左边三台设备配置OSPF 10,区域0
2.右边为OSPF 1,中间是area 0,下挂area1和area2
3.两个进程之间有ISP设备,需要访问公网
4.OSPF 1,区域0中,中心设备不启动动态路由协议,配置MGRE
实验拓扑
先配置IP
R1
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip ad
[r1-GigabitEthernet0/0/0]ip address 123.1.1.1 24
Mar 20 2023 16:33:23-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]int l 0
[r1-LoopBack0]ip ad
[r1-LoopBack0]ip address 1.1.1.1 32
R2
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip ad
[r2-GigabitEthernet0/0/0]ip address 123.1.1.2 24
[r2-GigabitEthernet0/0/0]
Mar 20 2023 16:34:41-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r2-GigabitEthernet0/0/0]int l 0
[r2-LoopBack0]ip ad
[r2-LoopBack0]ip address 2.2.2.2 32
[r2-LoopBack0]q
R3
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip ad
[r3-GigabitEthernet0/0/0]ip address 123.1.1.3 24
Mar 20 2023 16:35:47-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]int l 0
[r3-LoopBack0]ip ad
[r3-LoopBack0]ip address 3.3.3.3 32
[r3-LoopBack0]q
[r3]int g 0/0/3
^
Error: Wrong parameter found at '^' position.
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip ad
[r3-GigabitEthernet0/0/1]ip address 34.0.0.3 24
Mar 20 2023 16:36:57-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
R4
[isp]int g 0/0/0
[isp-GigabitEthernet0/0/0]ip ad
[isp-GigabitEthernet0/0/0]ip address 34.0.0
^
Error: Wrong parameter found at '^' position.
[isp-GigabitEthernet0/0/0]ip ad
[isp-GigabitEthernet0/0/0]ip address 34.0.0.4 24
Mar 20 2023 16:37:43-08:00 isp %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[isp-GigabitEthernet0/0/0]int g 0/0/1
[isp-GigabitEthernet0/0/1]ip ad
[isp-GigabitEthernet0/0/1]ip address 45.0.0.4 24
Mar 20 2023 16:38:09-08:00 isp %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[isp-GigabitEthernet0/0/1]int l 0
[isp-LoopBack0]ip ad
[isp-LoopBack0]ip address 4.4.4.4 32
R5
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip ad
[r5-GigabitEthernet0/0/0]ip address 45.0.0.5 24
[r5-GigabitEthernet0/0/0]
Mar 20 2023 16:39:23-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r5-GigabitEthernet0/0/0]int g 0/0/1
[r5-GigabitEthernet0/0/1]ip ad
[r5-GigabitEthernet0/0/1]ip address 56.0.0.5 24
Mar 20 2023 16:39:44-08:00 r5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r5-GigabitEthernet0/0/1]int l 0
[r5-LoopBack0]ip ad
[r5-LoopBack0]ip address 5.5.5.5 32
R6
[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]ip ad
[r6-GigabitEthernet0/0/0]ip address 67.0.0.6 24
Mar 20 2023 16:40:28-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r6-GigabitEthernet0/0/0]int g 0/0/1
[r6-GigabitEthernet0/0/1]ip ad
[r6-GigabitEthernet0/0/1]ip address 56.0.0.6 24
Mar 20 2023 16:40:40-08:00 r6 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r6-GigabitEthernet0/0/1]int l 0
[r6-LoopBack0]ip ad
[r6-LoopBack0]ip address 6.6.6.6 32
R7
[r7]int g 0/0/0
[r7-GigabitEthernet0/0/0]ip ad
[r7-GigabitEthernet0/0/0]ip address 67.0.0.7 24
Mar 20 2023 16:42:22-08:00 r7 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r7-GigabitEthernet0/0/0]int g 0/0/1
[r7-GigabitEthernet0/0/1]ip ad
[r7-GigabitEthernet0/0/1]ip address 78.0.0.7 24
[r7-GigabitEthernet0/0/1]
Mar 20 2023 16:42:39-08:00 r7 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r7-GigabitEthernet0/0/1]int g 4/0/0
[r7-GigabitEthernet4/0/0]ip ad
[r7-GigabitEthernet4/0/0]ip address 117.0.0.7 24
[r7-GigabitEthernet4/0/0]
Mar 20 2023 16:43:30-08:00 r7 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet4/0/0 has entered the UP state.
[r7-GigabitEthernet4/0/0]int g 0/0/2
[r7-GigabitEthernet0/0/2]ip ad
[r7-GigabitEthernet0/0/2]ip address 107.0.0.7 24
[r7-GigabitEthernet0/0/2]
Mar 20 2023 16:43:58-08:00 r7 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
R8
[r8]int g 0/0/0
[r8-GigabitEthernet0/0/0]ip ad
[r8-GigabitEthernet0/0/0]ip address 78.0.0.8 24
[r8-GigabitEthernet0/0/0]
Mar 20 2023 16:45:04-08:00 r8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r8-GigabitEthernet0/0/0]int g 0/0/1
[r8-GigabitEthernet0/0/1]ip ad
[r8-GigabitEthernet0/0/1]ip address 89.0.0.8 24
Mar 20 2023 16:45:19-08:00 r8 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r8-GigabitEthernet0/0/1]int l 0
[r8-LoopBack0]ip ad
[r8-LoopBack0]ip address 8.8.8.8 32
R9
[r9]int g 0/0/0
[r9-GigabitEthernet0/0/0]ip ad
[r9-GigabitEthernet0/0/0]ip address 89.0.0.9 24
[r9-GigabitEthernet0/0/0]
Mar 20 2023 16:46:18-08:00 r9 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r9-GigabitEthernet0/0/0]int l 0
[r9-LoopBack0]ip ad
[r9-LoopBack0]ip address 9.9.9.9 32
R10
[r10]int g 0/0/0
[r10-GigabitEthernet0/0/0]ip ad
[r10-GigabitEthernet0/0/0]ip address 107.0.0.10 24
Mar 20 2023 16:47:26-08:00 r10 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r10-GigabitEthernet0/0/0]int g 0/0/1
[r10-GigabitEthernet0/0/1]ip ad
[r10-GigabitEthernet0/0/1]ip address 110.0.0.10 24
Mar 20 2023 16:47:45-08:00 r10 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r10-GigabitEthernet0/0/1]int l 0
[r10-LoopBack0]ip ad
[r10-LoopBack0]ip address 10.10.10.10 32
R11
[r11]int g 0/0/0
[r11-GigabitEthernet0/0/0]ip ad
[r11-GigabitEthernet0/0/0]ip address 110.0.0.11 24
Mar 20 2023 16:48:20-08:00 r11 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r11-GigabitEthernet0/0/0]int g 0/0/1
[r11-GigabitEthernet0/0/1]i pad
[r11-GigabitEthernet0/0/1]ip ad
[r11-GigabitEthernet0/0/1]ip address 114.0.0.11 24
Mar 20 2023 16:48:42-08:00 r11 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r11-GigabitEthernet0/0/1]int l 0
[r11-LoopBack0]ip ad
[r11-LoopBack0]ip address 11.11.11.11 32
R12
[r12]int g 0/0/0
[r12-GigabitEthernet0/0/0]ip ad
[r12-GigabitEthernet0/0/0]ip address 117.0.0.12 24
Mar 20 2023 16:49:43-08:00 r12 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r12-GigabitEthernet0/0/0]int g 0/0/1
[r12-GigabitEthernet0/0/1]ip ad
[r12-GigabitEthernet0/0/1]ip address 112.0.0.12 24
Mar 20 2023 16:49:58-08:00 r12 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r12-GigabitEthernet0/0/1]int l 0
[r12-LoopBack0]ip ad
[r12-LoopBack0]ip address 12.12.12.12 32
R13
[r13]int g 0/0/0
[r13-GigabitEthernet0/0/0]ip ad
[r13-GigabitEthernet0/0/0]ip address 112.0.0.13 24
Mar 20 2023 16:50:52-08:00 r13 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r13-GigabitEthernet0/0/0]int g 0/0/1
[r13-GigabitEthernet0/0/1]ip ad
[r13-GigabitEthernet0/0/1]ip address 136.0.0
^
Error: Wrong parameter found at '^' position.
[r13-GigabitEthernet0/0/1]ip ad
[r13-GigabitEthernet0/0/1]ip address 136.0.0.13 24
Mar 20 2023 16:51:19-08:00 r13 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r13-GigabitEthernet0/0/1]int l 0
[r13-LoopBack0]ip ad
[r13-LoopBack0]ip address 13.13.13.13 32
R14
[r14]int g 0/0/0
[r14-GigabitEthernet0/0/0]ip ad
[r14-GigabitEthernet0/0/0]ip address 114.0.0.14 24
[r14-GigabitEthernet0/0/0]
Mar 20 2023 16:52:10-08:00 r14 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r14-GigabitEthernet0/0/0]int g 0/0/1
[r14-GigabitEthernet0/0/1]ip ad
[r14-GigabitEthernet0/0/1]ip address 145.0.0.14 24
Mar 20 2023 16:52:27-08:00 r14 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r14-GigabitEthernet0/0/1]int l 0
[r14-LoopBack0]ip ad
[r14-LoopBack0]ip address 14.14.14.14 32
R15
[r15]int g 0/0/0
[r15-GigabitEthernet0/0/0]ip ad
[r15-GigabitEthernet0/0/0]ip address 145.0.0.15 24
Mar 20 2023 16:53:24-08:00 r15 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r15-GigabitEthernet0/0/0]int l 0
[r15-LoopBack0]ip ad
[r15-LoopBack0]ip address 15.15.15.15 32
R16
[r16]int g 0/0/0
[r16-GigabitEthernet0/0/0]ip ad
[r16-GigabitEthernet0/0/0]ip address 136.0.0.16 24
[r16-GigabitEthernet0/0/0]
Mar 20 2023 16:54:13-08:00 r16 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r16-GigabitEthernet0/0/0]int l 0
[r16-LoopBack0]ip ad
[r16-LoopBack0]ip address 16.16.16.16 32
测试一下
<r1>ping 123.1.1.2
PING 123.1.1.2: 56 data bytes, press CTRL_C to break
Reply from 123.1.1.2: bytes=56 Sequence=1 ttl=255 time=160 ms
Reply from 123.1.1.2: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 123.1.1.2: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 123.1.1.2: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 123.1.1.2: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 123.1.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/66/160 ms
配置ospf
R1
[r1]ospf 1 ro
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]a 0
[r1-ospf-1-area-0.0.0.0]netw
[r1-ospf-1-area-0.0.0.0]network 123.1.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]
[r1-ospf-1-area-0.0.0.0]
[r1-ospf-1-area-0.0.0.0]net
[r1-ospf-1-area-0.0.0.0]network 0.0.0.0 255.255.255.255
[r1-ospf-1-area-0.0.0.0]q
R2
[r2]ospf 1 rout
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]a 0
[r2-ospf-1-area-0.0.0.0]netw
[r2-ospf-1-area-0.0.0.0]network 0.0.0.0 255.255.255.255
R3
[r3]ospf 1 ro
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]a 0
[r3-ospf-1-area-0.0.0.0]netw
[r3-ospf-1-area-0.0.0.0]network 123.1.1.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]net 3.3.3.3 0.0.0.0
缺省
[r3]ip ro
[r3]ip route-s
[r3]ip route-static 0.0.0.0 0 34.0.0.4
在R3下放缺省
[r3]ospf 1
[r3-ospf-1]def
[r3-ospf-1]default-r
[r3-ospf-1]default-route-advertise
做nat
[r3]acl 2000
[r3-acl-basic-2000]rule p
[r3-acl-basic-2000]rule permit s
[r3-acl-basic-2000]rule permit source a
[r3-acl-basic-2000]rule permit source any
[r3-acl-basic-2000]
[r3-acl-basic-2000]q
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]nat out
[r3-GigabitEthernet0/0/1]nat outbound 2000
测试
<r2>ping 4.4.4.4
PING 4.4.4.4: 56 data bytes, press CTRL_C to break
Request time out
Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=254 time=90 ms
Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=254 time=40 ms
Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=254 time=60 ms
Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 4.4.4.4 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 30/55/90 ms
至此,左边一小部分完成
起MGRE隧道
R6
[r6]int Tunnel 0/0/0
[r6-Tunnel0/0/0]ip ad
[r6-Tunnel0/0/0]ip address 10.0.0.6 24
[r6-Tunnel0/0/0]tun
[r6-Tunnel0/0/0]tunnel-protocol gre p
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]
[r6-Tunnel0/0/0]sou
[r6-Tunnel0/0/0]source 67.0.0.6
Mar 20 2023 17:15:06-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r6-Tunnel0/0/0]
[r6-Tunnel0/0/0]nhr
[r6-Tunnel0/0/0]nhrp e
[r6-Tunnel0/0/0]nhrp entry mul
[r6-Tunnel0/0/0]nhrp entry multicast dy
[r6-Tunnel0/0/0]nhrp entry multicast dynamic
R8
[r8]int Tunnel 0/0/0
[r8-Tunnel0/0/0]ip ad
[r8-Tunnel0/0/0]ip address 10.0.0.8 24
[r8-Tunnel0/0/0]tun
[r8-Tunnel0/0/0]tunnel-protocol gre p
[r8-Tunnel0/0/0]tunnel-protocol gre p2mp
[r8-Tunnel0/0/0]
[r8-Tunnel0/0/0]sou
[r8-Tunnel0/0/0]source g
[r8-Tunnel0/0/0]source GigabitEthernet 0/0/0
Mar 20 2023 17:17:06-08:00 r8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r8-Tunnel0/0/0]
[r8-Tunnel0/0/0]nhr
[r8-Tunnel0/0/0]nhrp en
[r8-Tunnel0/0/0]nhrp entry 10.0.0.6 67.0.0.6 re
[r8-Tunnel0/0/0]nhrp entry 10.0.0.6 67.0.0.6 register
R10
[r10]int Tunnel 0/0/0
[r10-Tunnel0/0/0]ip ad
[r10-Tunnel0/0/0]ip address 10.0.0.10 24
[r10-Tunnel0/0/0]
[r10-Tunnel0/0/0]tun
[r10-Tunnel0/0/0]tunnel-protocol gre
[r10-Tunnel0/0/0]tunnel-protocol gre p2
[r10-Tunnel0/0/0]tunnel-protocol gre p2mp
[r10-Tunnel0/0/0]
[r10-Tunnel0/0/0]sou
[r10-Tunnel0/0/0]source g
[r10-Tunnel0/0/0]source GigabitEthernet 0/0/0
Mar 20 2023 17:19:11-08:00 r10 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r10-Tunnel0/0/0]
[r10-Tunnel0/0/0]nhr
[r10-Tunnel0/0/0]nhrp en
[r10-Tunnel0/0/0]nhrp entry 10.0.0.6 67.0.0.6 reg
[r10-Tunnel0/0/0]nhrp entry 10.0.0.6 67.0.0.6 register
R12
[r12]int Tunnel 0/0/0
[r12-Tunnel0/0/0]ip ad
[r12-Tunnel0/0/0]ip address 10.0.0.12 24
[r12-Tunnel0/0/0]tun
[r12-Tunnel0/0/0]tunnel-protocol gre p
[r12-Tunnel0/0/0]tunnel-protocol gre p2mp
[r12-Tunnel0/0/0]
[r12-Tunnel0/0/0]sou
[r12-Tunnel0/0/0]source g
[r12-Tunnel0/0/0]source GigabitEthernet 0/0/0
Mar 20 2023 17:20:51-08:00 r12 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r12-Tunnel0/0/0]
[r12-Tunnel0/0/0]nhr
[r12-Tunnel0/0/0]nhrp ent
[r12-Tunnel0/0/0]nhrp entry 10.0.0.6 67.0.0.6 re
[r12-Tunnel0/0/0]nhrp entry 10.0.0.6 67.0.0.6 register
写静态路由
R6
[r6]ip route-static 78.0.0.0 24 67.0.0.7
[r6]ip rou
[r6]ip route-s
[r6]ip route-static 107.0.0.0 24 67.0.0.7
[r6]ip rou
[r6]ip route-s
[r6]ip route-static 117.0.0.0 24 67.0.0.7
R8
[r8]ip route-static 67.0.0.0 24 78.0.0.7
[r8]ip rou
[r8]ip route-s
[r8]ip route-static 107.0.0.0 24 78.0.0.7
[r8]ip rou
[r8]ip route-s
[r8]ip route-static 117.0.0.0 24 78.0.0.7
R10
[r10]ip route-static 67.0.0.0 24 107.0.0.7
[r10]ip rou
[r10]ip route-s
[r10]ip route-static 78.0.0.0 24 107.0.0.7
[r10]ip rou
[r10]ip route-s
[r10]ip route-static 117.0.0.0 24 107.0.0.7
R12
[r12]ip route-static 67.0.0.0 24 117.0.0.7
[r12]ip rou
[r12]ip route-s
[r12]ip route-static 78.0.0.0 24 117.0.0.7
[r12]ip rou
[r12]ip route-s
[r12]ip route-static 107.0.0.0 24 117.0.0.7
起ospf
R5
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]a 0
[r5-ospf-1-area-0.0.0.0]net
[r5-ospf-1-area-0.0.0.0]network 56.0.0.5 0.0.0.0
[r5-ospf-1-area-0.0.0.0]net
[r5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
R6
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]a 0
[r6-ospf-1-area-0.0.0.0]net
[r6-ospf-1-area-0.0.0.0]network 56.0.0.6 0.0.0.0
[r6-ospf-1-area-0.0.0.0]net
[r6-ospf-1-area-0.0.0.0]network 6.6.6.6 0.0.0.0
[r6-ospf-1-area-0.0.0.0]net
[r6-ospf-1-area-0.0.0.0]network 10.0.0.6 0.0.0.0
R8
[r8]ospf 1 router-id 8.8.8.8
[r8-ospf-1]a 0
[r8-ospf-1-area-0.0.0.0]netw
[r8-ospf-1-area-0.0.0.0]network 10.0.0.8 0.0.0.0
[r8-ospf-1-area-0.0.0.0]net
[r8-ospf-1-area-0.0.0.0]network 89.0.0.8 0.0.0.0
[r8-ospf-1-area-0.0.0.0]netw
[r8-ospf-1-area-0.0.0.0]network 8.8.8.8 0.0.0.0
R9
[r9]ospf 1 router-id 9.9.9.9
[r9-ospf-1]a 0
[r9-ospf-1-area-0.0.0.0]netw
[r9-ospf-1-area-0.0.0.0]network 0.0.0.0 255.255.255.255
[r9-ospf-1-area-0.0.0.0]
[r9-ospf-1-area-0.0.0.0]q
R10
[r10]ospf 1 router-id 10.10.10.10
[r10-ospf-1]a 0
[r10-ospf-1-area-0.0.0.0]netw
[r10-ospf-1-area-0.0.0.0]network 110.0.0.10 0.0.0.0
[r10-ospf-1-area-0.0.0.0]netw
[r10-ospf-1-area-0.0.0.0]network 10.10.10.10 0.0.0.0
[r10-ospf-1-area-0.0.0.0]net
[r10-ospf-1-area-0.0.0.0]network 10.0.0.10 0.0.0.0
R11
[r11]ospf 1 router-id 11.11.11.11
[r11-ospf-1]a 0
[r11-ospf-1-area-0.0.0.0]net
[r11-ospf-1-area-0.0.0.0]network 110.0.0.11 0.0.0.0
[r11-ospf-1-area-0.0.0.0]network 11.11.11.11 0.0.0.0
[r11-ospf-1-area-0.0.0.0]q
[r11-ospf-1]a 1
[r11-ospf-1-area-0.0.0.1]net
[r11-ospf-1-area-0.0.0.1]network 114.0.0.11 0.0.0.0
R12
[r12-ospf-1]a 0
[r12-ospf-1-area-0.0.0.0]net
[r12-ospf-1-area-0.0.0.0]network 10.0.0.12 0.0.0.0
[r12-ospf-1-area-0.0.0.0]netw
[r12-ospf-1-area-0.0.0.0]network 12.12.12.12 0.0.0.0
[r12-ospf-1-area-0.0.0.0]net
[r12-ospf-1-area-0.0.0.0]network 112.0.0.12 0.0.0.0
R13
[r13]ospf 1 router-id 13.13.13.13
[r13-ospf-1]a 0
[r13-ospf-1-area-0.0.0.0]netw
[r13-ospf-1-area-0.0.0.0]network 112.0.0.13 0.0.0.0
[r13-ospf-1-area-0.0.0.0]network 13.13.13.13 0.0.0.0
[r13-ospf-1-area-0.0.0.0]q
[r13-ospf-1]a 2
[r13-ospf-1-area-0.0.0.2]net
[r13-ospf-1-area-0.0.0.2]network 136.0.0.13 0.0.0.0
R14
[r14]ospf 1 router-id 14.14.14.14
[r14-ospf-1]a 1
[r14-ospf-1-area-0.0.0.1]net
[r14-ospf-1-area-0.0.0.1]network 114.0.0.14 0.0.0.0
[r14-ospf-1-area-0.0.0.1]network 145.0.0.14 0.0.0.0
[r14-ospf-1-area-0.0.0.1]netw
[r14-ospf-1-area-0.0.0.1]network 14.14.14.14 0.0.0.0
R15
[r15]ospf 1 router-id 15.15.15.15
[r15-ospf-1]a 1
[r15-ospf-1-area-0.0.0.1]netw
[r15-ospf-1-area-0.0.0.1]network 0.0.0.0 255.255.255.255
R16
[r16]ospf 1 router-id 16.16.16.16
[r16-ospf-1]a 2
[r16-ospf-1-area-0.0.0.2]netw
[r16-ospf-1-area-0.0.0.2]network 0.0.0.0 255.255.255.255
改接口类型
R6
[r6]interface Tunnel 0/0/0
[r6-Tunnel0/0/0]ospf ne
[r6-Tunnel0/0/0]ospf network-type p2
[r6-Tunnel0/0/0]ospf network-type p2mp
R8
[r8]int Tunnel 0/0/0
[r8-Tunnel0/0/0]ospf ne
[r8-Tunnel0/0/0]ospf network-type p2
[r8-Tunnel0/0/0]ospf network-type p2mp
R10
[r10]int Tunnel 0/0/0
[r10-Tunnel0/0/0]ospf ne
[r10-Tunnel0/0/0]ospf network-type p2
[r10-Tunnel0/0/0]ospf network-type p2mp
R12
[r12]int Tunnel 0/0/0
[r12-Tunnel0/0/0]ospf ne
[r12-Tunnel0/0/0]ospf network-type p2
[r12-Tunnel0/0/0]ospf network-type p2mp
改快hello包时间
R6
[r6]int Tunnel 0/0/0
[r6-Tunnel0/0/0]ospf t
[r6-Tunnel0/0/0]ospf timer he
[r6-Tunnel0/0/0]ospf timer hello 10
R8
[r8]int Tunnel 0/0/0
[r8-Tunnel0/0/0]ospf ti
[r8-Tunnel0/0/0]ospf timer he
[r8-Tunnel0/0/0]ospf timer hello 10
R10
[r10-Tunnel0/0/0]ospf timer hello 10
R12
[r12-Tunnel0/0/0]ospf timer hello 10
给缺省
R5
[r5]ospf 1
[r5-ospf-1]def
[r5-ospf-1]default-r
[r5-ospf-1]default-route-advertise
[r5]ip route-s
[r5]ip route-static 0.0.0.0 0 45.0.0.4
缺nat
R5
[r5]acl 2000
[r5-acl-basic-2000]ru
[r5-acl-basic-2000]rule pe
[r5-acl-basic-2000]rule permit su
[r5-acl-basic-2000]rule permit so
[r5-acl-basic-2000]rule permit source an
[r5-acl-basic-2000]rule permit source any
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]nat out
[r5-GigabitEthernet0/0/0]nat outbound 2000
在R3和R5上做个隧道
R3
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip ad
[r3-Tunnel0/0/0]ip address 10.1.1.3 24
[r3-Tunnel0/0/0]tun
[r3-Tunnel0/0/0]tunnel-protocol gre
[r3-Tunnel0/0/0]so
[r3-Tunnel0/0/0]source 34.0.0.3
[r3-Tunnel0/0/0]des
[r3-Tunnel0/0/0]description
[r3-Tunnel0/0/0]destination 45.0.0.5
R5
[r5]int Tunnel 0/0/0
[r5-Tunnel0/0/0]ip ad
[r5-Tunnel0/0/0]ip address 10.1.1.5 24
[r5-Tunnel0/0/0]tun
[r5-Tunnel0/0/0]tunnel-protocol gre
[r5-Tunnel0/0/0]
[r5-Tunnel0/0/0]sou
[r5-Tunnel0/0/0]source 45.0.0.5
[r5-Tunnel0/0/0]des
[r5-Tunnel0/0/0]description
[r5-Tunnel0/0/0]destination 34.0.0.3