HCIP——OSPF综合实验

OSPF实验

  • 一、实验拓扑
  • 二、实验要求
  • 三、实验思路
  • 四、实验步骤
    • 1、配置接口IP地址以及环回
    • 2、配置缺省路由
    • 3、配置MGRE环境
    • 4、配置OSPF
    • 5、修改网络类型
    • 6、重发布
    • 7、配置汇总空接口防环
    • 8、配置特殊区域:
    • 9、配置NAT环境
    • 10、加快收敛
    • 11、配置接口认证
    • 12、测试

一、实验拓扑

HCIP——OSPF综合实验_第1张图片

二、实验要求

  • 1、R4为ISP,其上只能配置IP地址,R4与其他所有直连设备间均使用公有IP
  • 2、R3-R5/6/7为MGRE环境,R3为中心站点;
  • 3、整个0SPF环境IP基于172.16.0.0/16划分;
  • 4、所有设备均可访问R4的环回;
  • 5、减少LSA的更新量,加快收敛,保障更新安全;
  • 6、全网可达

三、实验思路

首先我们来规划网段

172.16.0.0/16,这里我们首先规划需要配置多少个网段
由拓扑图可知:
共有四个区域以及一个单独使用RIP协议
所以,我们首先划分四个网段给各个区域 --- 所以说这里我们向后借3位
172.16.0.0/19 --- area 0
172.16.32.0/19 --- area 1
172.16.64.0/19 --- area 2
172.16.96.0/19 --- area 3
172.16.128.0/19 --- area 4
172.16.160.0/19 --- rip
172.16.192.0/19 --- 保留地址
172.16.224.0/19

接下来我们在不同区域内再次进行划分

172.16.0.0/19 --- area 0
	172.16.0.0/24 --- p2p骨干
		172.16.0.0/30
		172.16.0.4/30
		172.16.0.8/30
		···
	172.16.1.0/24 --- MA骨干
		172.16.1.0/29
		172.16.1.8/29
		172.16.1.16/29
		···
	172.16.2.0/24
	172.16.3.0/24
	172.16.4.0/24
172.16.32.0/19 --- area 1
	172.16.32.0/24 --- p2p骨干
		172.16.32.0/30
		172.16.32.4/30
		172.16.32.8/30
		···
	172.16.33.0/24 --- MA骨干
		172.16.33.0/29
		172.16.33.8/29
		172.16.33.16/29
		···
	172.16.34/0/24
	172.16.35.0/24
	172.16.36.0/24
172.16.64.0/19 --- area 2
	172.16.64.0/24 --- p2p骨干
		172.16.64.0/30
		172.16.64.4/30
		172.16.64.8/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.68.0/24
172.16.96.0/19 --- area 3
	172.16.96.0/2 --- 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.98.0/24
	172.16.99.0/24
	172.16.100.0/24
	···
172.16.128.0/19 --- area4
	172.16.128.0/24 --- p2p骨干
		172.16.128.0/30
		172.16.128.4/30
		172.16.128.8/30
		···
	172.16.129.0/24 ---MA骨干
		172.16.129.0/29
		172.16.129.8/29
		172.16.129.16/29
		···
	172.16.130.0/24
	172.16.131.0/24
	172.16.132.0/24
	···
172.16.160.0/19 --- rip
	172.16.160.0/20
	172.16.176.0/20
172.16.192.0/19
172.16.224.0/19

HCIP——OSPF综合实验_第2张图片

四、实验步骤

1、配置接口IP地址以及环回

R1:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]user-interface console 0
[R1-ui-console0]idle-timeout 0 0
[R1-ui-console0]quit
[R1]int l0
[R1-LoopBack0]ip add 172.16.34.1 24
[R1-LoopBack0]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 172.16.33.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]

R2:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]user-interface console 0
[R2-ui-console0]idle-timeout 0 0
[R2-ui-console0]quit
[R2]int l0
[R2-LoopBack0]ip add 172.16.35.1 24
[R2-LoopBack0]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 172.16.33.2 24
[R2-GigabitEthernet0/0/0]quit
[R2]

R3:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]user-interface console 0
[R3-ui-console0]idle-timeout 0 0
[R3-ui-console0]quit
[R3]
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 172.16.33.3 24
[R3-GigabitEthernet0/0/0]int l0
[R3-LoopBack0]ip address 172.16.36.1 24
[R3-LoopBack0]int s4/0/0
[R3-Serial4/0/0]ip address 12.1.1.1 24
[R3-Serial4/0/0]quit
[R3]

R4:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]user-interface console 0
[R4-ui-console0]idle-timeout 0 0
[R4-ui-console0]quit
[R4]int s4/0/0
[R4-Serial4/0/0]ip address 12.1.1.2 24
[R4-Serial4/0/0]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 45.1.1.2 24
[R4-GigabitEthernet0/0/0]int s4/0/1
[R4-Serial4/0/1]ip address 23.1.1.2 24
[R4-Serial4/0/1]int s3/0/0
[R4-Serial3/0/0]ip address 34.1.1.2 24
[R4-Serial3/0/0]int l0
[R4-LoopBack0]ip address 4.4.4.4 24
[R4-LoopBack0]quit
[R4]

R5:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r5
[r5]sys R5
[R5]user-interface console 0
[R5-ui-console0]idle-timeout 0 0
[R5-ui-console0]quit
[R5]int l0
[R5-LoopBack0]ip address 172.16.2.1 24
[R5-LoopBack0]int s4/0/0
[R5-Serial4/0/0]ip address 23.1.1.1 24
[R5-Serial4/0/0]quit
[R5]

R6:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R6
[R6]user-interface console 0
[R6-ui-console0]idle-timeout 0 0
[R6-ui-console0]quit
[R6]
[R6]int s4/0/0
[R6-Serial4/0/0]ip address 34.1.1.1 24
[R6-Serial4/0/0]int l0
[R6-LoopBack0]ip address 172.16.3.1 24
[R6-LoopBack0]int g0/0/0
[R6-GigabitEthernet0/0/0]ip address 172.16.65.1 29
[R6-GigabitEthernet0/0/0]quit
[R6]

R7:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R7
[R7]user-interface console 0
[R7-ui-console0]idle-timeout 0 0
[R7-ui-console0]quit
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip address 45.1.1.1 24
[R7-GigabitEthernet0/0/0]int l0
[R7-LoopBack0]ip address 172.16.4.1 24
[R7-LoopBack0]int g0/0/1
[R7-GigabitEthernet0/0/1]ip address 172.16.97.1 29
[R7]

R8:

<Huawei>SYS
Enter system view, return user view with Ctrl+Z.
[Huawei]SYS R8
[R8]user-interface console 0
[R8-ui-console0]idle-timeout 0 0
[R8-ui-console0]quit
[R8-GigabitEthernet0/0/0]int g0/0/1
[R8-GigabitEthernet0/0/1]ip address 172.16.97.9 29
[R8-GigabitEthernet0/0/1]int g0/0/0
[R8-GigabitEthernet0/0/0]ip address 172.16.97.2 29
[R8]int l0
[R8-LoopBack0]ip address 172.16.98.1 24
[R8-LoopBack0]quit
[R8]

R9:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R9
[R9]user-interface console 0
[R9-ui-console0]idle-timeout 0 0
[R9-ui-console0]quit
[R9]int g0/0/0
[R9-GigabitEthernet0/0/0]ip address 172.16.97.10 29
[R9-GigabitEthernet0/0/0]int l0
[R9-LoopBack0]ip address 172.16.130.1 24
[R9-LoopBack0]int g0/0/1
[R9-GigabitEthernet0/0/1]ip address 172.16.129.1 29
[R9-GigabitEthernet0/0/1]quit
[R9]

R10:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R10
[R10]user-interface console 0
[R10-ui-console0]idle-timeout 0 0
[R10-ui-console0]quit
[R10]int g0/0/0
[R10-GigabitEthernet0/0/0]ip address 172.16.129.2 29
[R10-GigabitEthernet0/0/0]int l0
[R10-LoopBack0]ip address 172.16.131.1 24
[R10-LoopBack0]quit
[R10]

R11:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R11
[R11]user-interface console 0
[R11-ui-console0]idle-timeout 0 0
[R11-ui-console0]quit
[R11]int g0/0/0
[R11-GigabitEthernet0/0/0]ip address 172.16.65.2 29
[R11-GigabitEthernet0/0/0]int l0
[R11-LoopBack0]ip address 172.16.66.1 24
[R11-LoopBack0]int g0/0/1
[R11-GigabitEthernet0/0/1]ip address 172.16.65.9 29
[R11-GigabitEthernet0/0/1]quit
[R11]

R12:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R12
[R12]user-interface console 0
[R12-ui-console0]idle-timeout 0 0
[R12-ui-console0]quit
[R12]int g0/0/0
[R12-GigabitEthernet0/0/0]ip address 172.16.65.10 29
[R12-GigabitEthernet0/0/0]int l0
[R12-LoopBack0]ip address 172.16.160.1 20
[R12-LoopBack0]int l1
[R12-LoopBack1]ip address 172.16.176.1 20
[R12-LoopBack1]quit
[R12]

查看接口配置以及其状态:
R1:

[R1]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.33.1/24       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.34.1/24       up         up(s)     
NULL0                             unassigned           up         up(s)     
[R1]

R2:

[R2]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.33.2/24       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.35.1/24       up         up(s)     
NULL0                             unassigned           up         up(s)     
[R2]

R3:

[R3]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 3

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.33.3/24       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.36.1/24       up         up(s)     
NULL0                             unassigned           up         up(s)     
Serial4/0/0                       12.1.1.1/24          up         up        
Serial4/0/1                       unassigned           down       down      
[R3]

R4:

[R4]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 6
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 6
The number of interface that is DOWN in Protocol is 3

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              45.1.1.2/24          up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         4.4.4.4/24           up         up(s)     
NULL0                             unassigned           up         up(s)     
Serial3/0/0                       34.1.1.2/24          up         up        
Serial3/0/1                       unassigned           down       down      
Serial4/0/0                       12.1.1.2/24          up         up        
Serial4/0/1                       23.1.1.2/24          up         up        
[R4]

R5:

[R5]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 4
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 4

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           down       down      
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.2.1/24        up         up(s)     
NULL0                             unassigned           up         up(s)     
Serial4/0/0                       23.1.1.1/24          up         up        
Serial4/0/1                       unassigned           down       down      
[R5]

R6:

[R6]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 3

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.65.1/29       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.3.1/24        up         up(s)     
NULL0                             unassigned           up         up(s)     
Serial4/0/0                       34.1.1.1/24          up         up        
Serial4/0/1                       unassigned           down       down      
[R6]

R7:

[R7]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              45.1.1.1/24          up         up        
GigabitEthernet0/0/1              172.16.97.1/29       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.4.1/24        up         up(s)     
NULL0                             unassigned           up         up(s)     
[R7]

R8:

[R8]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.97.2/29       up         up        
GigabitEthernet0/0/1              172.16.97.9/29       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.98.1/24       up         up(s)     
NULL0                             unassigned           up         up(s)     
[R8]

R9:

[R9]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.97.10/29      up         up        
GigabitEthernet0/0/1              172.16.129.1/29      up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.130.1/24      up         up(s)     
NULL0                             unassigned           up         up(s)     
[R9]

R10:

[R10]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.129.2/29      up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.131.1/24      up         up(s)     
NULL0                             unassigned           up         up(s)     
[R10]

R11:

[R11]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.65.2/29       up         up        
GigabitEthernet0/0/1              172.16.65.9/29       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.66.1/24       up         up(s)     
NULL0                             unassigned           up         up(s)     
[R11]

R12:

[R12]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              172.16.65.10/29      up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         172.16.160.1/20      up         up(s)     
LoopBack1                         172.16.176.1/20      up         up(s)     
NULL0                             unassigned           up         up(s)     
[R12]

2、配置缺省路由

R3:

[R3]ip route-static 0.0.0.0 0 12.1.1.2

R5:

[R5]ip route-static 0.0.0.0 0 23.1.1.2

R6:

[R6]ip route-static 0.0.0.0 0 34.1.1.2

R7:

[R7]ip route-static 0.0.0.0 0 45.1.1.2

3、配置MGRE环境

R3:

[R3]int t0/0/0
[R3-Tunnel0/0/0]ip address 172.16.1.1 29
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R3-Tunnel0/0/0]source 12.1.1.1	
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry multicast dynamic 
[R3-Tunnel0/0/0]quit
[R3]

R5:

[R5]int t0/0/0
[R5-Tunnel0/0/0]ip address 172.16.1.2 29	
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R5-Tunnel0/0/0]source 23.1.1.1
[R5-Tunnel0/0/0]nhrp network-id 100
[R5-Tunnel0/0/0]nhrp entry 172.16.1.1 12.1.1.1 register 
[R5-Tunnel0/0/0]quit
[R5]

R6:

[R6]int t0/0/0
[R6-Tunnel0/0/0]ip address 172.16.1.3 29	
[R6-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R6-Tunnel0/0/0]source 34.1.1.1	
[R6-Tunnel0/0/0]nhrp network-id 100
[R6-Tunnel0/0/0]nhrp entry 172.16.1.1 12.1.1.1 register 
[R6-Tunnel0/0/0]quit
[R6]

R7:

[R7]int t0/0/0
[R7-Tunnel0/0/0]ip address 172.16.1.4 29
[R7-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R7-Tunnel0/0/0]source 45.1.1.1
[R7-Tunnel0/0/0]nhrp network-id 100	
[R7-Tunnel0/0/0]nhrp entry 172.16.1.1 12.1.1.1 register 
[R7-Tunnel0/0/0]quit
[R7]

查看注册信息:

[R3]display nhrp peer all 
------------------------------------------------------------------------------- 
Protocol-addr   Mask  NBMA-addr       NextHop-addr    Type         Flag         
------------------------------------------------------------------------------- 
172.16.1.2      32    23.1.1.1        172.16.1.2      dynamic      route tunnel 
------------------------------------------------------------------------------- 
Tunnel interface: Tunnel0/0/0
Created time    : 00:07:00
Expire time     : 01:53:00
------------------------------------------------------------------------------- 
Protocol-addr   Mask  NBMA-addr       NextHop-addr    Type         Flag         
------------------------------------------------------------------------------- 
172.16.1.3      32    34.1.1.1        172.16.1.3      dynamic      route tunnel 
------------------------------------------------------------------------------- 
Tunnel interface: Tunnel0/0/0
Created time    : 00:05:18
Expire time     : 01:54:42
------------------------------------------------------------------------------- 
Protocol-addr   Mask  NBMA-addr       NextHop-addr    Type         Flag         
------------------------------------------------------------------------------- 
172.16.1.4      32    45.1.1.1        172.16.1.4      dynamic      route tunnel 
------------------------------------------------------------------------------- 
Tunnel interface: Tunnel0/0/0
Created time    : 00:04:01
Expire time     : 01:55:59

Number of nhrp peers: 3
[R3]

4、配置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.0.0 0.0.255.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.0.0 0.0.255.255

R3:

[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
[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]ospf 1 router-id 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.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.3.255
[R6-ospf-1-area-0.0.0.0]q
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]network 172.16.65.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.7.255
[R7-ospf-1-area-0.0.0.0]q
[R7-ospf-1]area 3
[R7-ospf-1-area-0.0.0.3]network 172.16.97.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.0.0 0.0.255.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.97.10 0.0.0.0
[R9-ospf-1-area-0.0.0.3]q
[R9-ospf-1]q
[R9]ospf 2 router-id 9.9.9.9
[R9-ospf-2]area 4
[R9-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.3.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.0.0 0.0.255.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.0.0 0.0.255.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.65.10 0.0.0.0
[R12]rip 1
[R12-rip-1]version 2
[R12-rip-1]network 172.16.0.0 

查看此时的各区域邻居信息:
R1:

[R1]display ospf peer brief 

	 OSPF Process 1 with Router ID 1.1.1.1
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.1          GigabitEthernet0/0/0             2.2.2.2          Full        
 0.0.0.1          GigabitEthernet0/0/0             3.3.3.3          Full        
 ----------------------------------------------------------------------------
[R1]

R2:

[R2]display ospf peer brief 

	 OSPF Process 1 with Router ID 2.2.2.2
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.1          GigabitEthernet0/0/0             1.1.1.1          Full        
 0.0.0.1          GigabitEthernet0/0/0             3.3.3.3          Full        
 ----------------------------------------------------------------------------
[R2]

R3:

[R3]display ospf peer brief 

	 OSPF Process 1 with Router ID 3.3.3.3
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          Tunnel0/0/0                      5.5.5.5          Full        
 0.0.0.1          GigabitEthernet0/0/0             1.1.1.1          Full        
 0.0.0.1          GigabitEthernet0/0/0             2.2.2.2          Full        
 ----------------------------------------------------------------------------
[R3]

R5:

[R5]display ospf peer brief 

	 OSPF Process 1 with Router ID 5.5.5.5
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          Tunnel0/0/0                      3.3.3.3          Full        
 ----------------------------------------------------------------------------
[R5]

R6:

[R6]display ospf peer brief 

	 OSPF Process 1 with Router ID 6.6.6.6
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          Tunnel0/0/0                      3.3.3.3          Init        
 0.0.0.2          GigabitEthernet0/0/0             11.11.11.11      Full        
 ----------------------------------------------------------------------------
[R6]

R7:

[R7]display ospf peer brief 

	 OSPF Process 1 with Router ID 7.7.7.7
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          Tunnel0/0/0                      3.3.3.3          Init        
 0.0.0.3          GigabitEthernet0/0/1             8.8.8.8          Full        
 ----------------------------------------------------------------------------
[R7]

R8:

[R8]display ospf peer brief 

	 OSPF Process 1 with Router ID 8.8.8.8
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.3          GigabitEthernet0/0/1             9.9.9.9          Full        
 0.0.0.3          GigabitEthernet0/0/0             7.7.7.7          Full        
 ----------------------------------------------------------------------------
[R8]

R9:

[R9]display ospf peer brief 

	 OSPF Process 1 with Router ID 9.9.9.9
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.3          GigabitEthernet0/0/0             8.8.8.8          Full        
 ----------------------------------------------------------------------------

	 OSPF Process 2 with Router ID 9.9.9.9
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.4          GigabitEthernet0/0/1             10.10.10.10      Full        
 ----------------------------------------------------------------------------
[R9]

R10:

[R10]display ospf peer brief 

	 OSPF Process 1 with Router ID 10.10.10.10
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.4          GigabitEthernet0/0/0             9.9.9.9          Full        
 ----------------------------------------------------------------------------
[R10]

R11:

[R11]display ospf peer brief 

	 OSPF Process 1 with Router ID 11.11.11.11
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.2          GigabitEthernet0/0/0             6.6.6.6          Full        
 0.0.0.2          GigabitEthernet0/0/1             12.12.12.12      Full        
 ----------------------------------------------------------------------------
[R11]

R12:

[R12]display ospf peer brief 

	 OSPF Process 1 with Router ID 12.12.12.12
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.2          GigabitEthernet0/0/0             11.11.11.11      Full        
 ----------------------------------------------------------------------------
[R12]

5、修改网络类型

由于创建的MGRE环境是一个P2P类型,所以无法和其他路由器建立邻居关系,我们需要修改它的网络类型
R3:

[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ospf network-type p2mp

R5:

[R5]int Tunnel 0/0/0
[R5-Tunnel0/0/0]ospf network-type p2mp

R6:

[R6]int Tunnel 0/0/0
[R6-Tunnel0/0/0]ospf network-type p2mp

R7:

[R7]int Tunnel 0/0/0
[R7-Tunnel0/0/0]ospf network-type p2mp

查看此时R3的邻居信息:

[R3]display ospf peer brief 

	 OSPF Process 1 with Router ID 3.3.3.3
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          Tunnel0/0/0                      5.5.5.5          Full        
 0.0.0.0          Tunnel0/0/0                      6.6.6.6          Full        
 0.0.0.0          Tunnel0/0/0                      7.7.7.7          Full        
 0.0.0.1          GigabitEthernet0/0/0             1.1.1.1          Full        
 0.0.0.1          GigabitEthernet0/0/0             2.2.2.2          Full        
 ----------------------------------------------------------------------------
[R3]

此时的路由表信息:
R1:

[R1]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 15       Routes : 15       

OSPF routing table status : <Active>
         Destinations : 15       Routes : 15

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1           D   172.16.33.3     GigabitEthernet0/0/0
     172.16.1.2/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
     172.16.1.3/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
     172.16.1.4/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
     172.16.2.1/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
     172.16.3.1/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
     172.16.4.1/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.35.1/32  OSPF    10   1           D   172.16.33.2     GigabitEthernet0/0/0
    172.16.36.1/32  OSPF    10   1           D   172.16.33.3     GigabitEthernet0/0/0
    172.16.65.0/29  OSPF    10   1564        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.65.8/29  OSPF    10   1565        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.66.1/32  OSPF    10   1564        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.97.0/29  OSPF    10   1564        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.97.8/29  OSPF    10   1565        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.98.1/32  OSPF    10   1564        D   172.16.33.3     GigabitEthernet0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R1]

R2:

[R2]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 15       Routes : 15       

OSPF routing table status : <Active>
         Destinations : 15       Routes : 15

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1           D   172.16.33.3     GigabitEthernet
0/0/0
     172.16.1.2/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
     172.16.1.3/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
     172.16.1.4/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
     172.16.2.1/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
     172.16.3.1/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
     172.16.4.1/32  OSPF    10   1563        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.34.1/32  OSPF    10   1           D   172.16.33.1     GigabitEthernet0/0/0
    172.16.36.1/32  OSPF    10   1           D   172.16.33.3     GigabitEthernet0/0/0
    172.16.65.0/29  OSPF    10   1564        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.65.8/29  OSPF    10   1565        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.66.1/32  OSPF    10   1564        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.97.0/29  OSPF    10   1564        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.97.8/29  OSPF    10   1565        D   172.16.33.3     GigabitEthernet0/0/0
    172.16.98.1/32  OSPF    10   1564        D   172.16.33.3     GigabitEthernet0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R2]

R3:

[R3]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 14       Routes : 14       

OSPF routing table status : <Active>
         Destinations : 14       Routes : 14

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.2/32  OSPF    10   1562        D   172.16.1.2      Tunnel0/0/0
     172.16.1.3/32  OSPF    10   1562        D   172.16.1.3      Tunnel0/0/0
     172.16.1.4/32  OSPF    10   1562        D   172.16.1.4      Tunnel0/0/0
     172.16.2.1/32  OSPF    10   1562        D   172.16.1.2      Tunnel0/0/0
     172.16.3.1/32  OSPF    10   1562        D   172.16.1.3      Tunnel0/0/0
     172.16.4.1/32  OSPF    10   1562        D   172.16.1.4      Tunnel0/0/0
    172.16.34.1/32  OSPF    10   1           D   172.16.33.1     GigabitEthernet0/0/0
    172.16.35.1/32  OSPF    10   1           D   172.16.33.2     GigabitEthernet0/0/0
    172.16.65.0/29  OSPF    10   1563        D   172.16.1.3      Tunnel0/0/0
    172.16.65.8/29  OSPF    10   1564        D   172.16.1.3      Tunnel0/0/0
    172.16.66.1/32  OSPF    10   1563        D   172.16.1.3      Tunnel0/0/0
    172.16.97.0/29  OSPF    10   1563        D   172.16.1.4      Tunnel0/0/0
    172.16.97.8/29  OSPF    10   1564        D   172.16.1.4      Tunnel0/0/0
    172.16.98.1/32  OSPF    10   1563        D   172.16.1.4      Tunnel0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R3]

R5:

[R5]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 15       Routes : 15       

OSPF routing table status : <Active>
         Destinations : 15       Routes : 15

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1562        D   172.16.1.1      Tunnel0/0/0
     172.16.1.3/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
     172.16.1.4/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
     172.16.3.1/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
     172.16.4.1/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
    172.16.33.0/24  OSPF    10   1563        D   172.16.1.1      Tunnel0/0/0
    172.16.34.1/32  OSPF    10   1563        D   172.16.1.1      Tunnel0/0/0
    172.16.35.1/32  OSPF    10   1563        D   172.16.1.1      Tunnel0/0/0
    172.16.36.1/32  OSPF    10   1562        D   172.16.1.1      Tunnel0/0/0
    172.16.65.0/29  OSPF    10   3125        D   172.16.1.1      Tunnel0/0/0
    172.16.65.8/29  OSPF    10   3126        D   172.16.1.1      Tunnel0/0/0
    172.16.66.1/32  OSPF    10   3125        D   172.16.1.1      Tunnel0/0/0
    172.16.97.0/29  OSPF    10   3125        D   172.16.1.1      Tunnel0/0/0
    172.16.97.8/29  OSPF    10   3126        D   172.16.1.1      Tunnel0/0/0
    172.16.98.1/32  OSPF    10   3125        D   172.16.1.1      Tunnel0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R5]

R6:

[R6]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 14       Routes : 14       

OSPF routing table status : <Active>
         Destinations : 14       Routes : 14

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1562        D   172.16.1.1      Tunnel0/0/0
     172.16.1.2/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
     172.16.1.4/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
     172.16.2.1/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
     172.16.4.1/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
    172.16.33.0/24  OSPF    10   1563        D   172.16.1.1      Tunnel0/0/0
    172.16.34.1/32  OSPF    10   1563        D   172.16.1.1      Tunnel0/0/0
    172.16.35.1/32  OSPF    10   1563        D   172.16.1.1      Tunnel0/0/0
    172.16.36.1/32  OSPF    10   1562        D   172.16.1.1      Tunnel0/0/0
    172.16.65.8/29  OSPF    10   2           D   172.16.65.2     GigabitEthernet0/0/0
    172.16.66.1/32  OSPF    10   1           D   172.16.65.2     GigabitEthernet0/0/0
    172.16.97.0/29  OSPF    10   3125        D   172.16.1.1      Tunnel0/0/0
    172.16.97.8/29  OSPF    10   3126        D   172.16.1.1      Tunnel0/0/0
    172.16.98.1/32  OSPF    10   3125        D   172.16.1.1      Tunnel0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R6]

R7:

[R7]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 14       Routes : 14       

OSPF routing table status : <Active>
         Destinations : 14       Routes : 14

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1562        D   172.16.1.1      Tunnel0/0/0
     172.16.1.2/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
     172.16.1.3/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
     172.16.2.1/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
     172.16.3.1/32  OSPF    10   3124        D   172.16.1.1      Tunnel0/0/0
    172.16.33.0/24  OSPF    10   1563        D   172.16.1.1      Tunnel0/0/0
    172.16.34.1/32  OSPF    10   1563        D   172.16.1.1      Tunnel0/0/0
    172.16.35.1/32  OSPF    10   1563        D   172.16.1.1      Tunnel0/0/0
    172.16.36.1/32  OSPF    10   1562        D   172.16.1.1      Tunnel0/0/0
    172.16.65.0/29  OSPF    10   3125        D   172.16.1.1      Tunnel0/0/0
    172.16.65.8/29  OSPF    10   3126        D   172.16.1.1      Tunnel0/0/0
    172.16.66.1/32  OSPF    10   3125        D   172.16.1.1      Tunnel0/0/0
    172.16.97.8/29  OSPF    10   2           D   172.16.97.2     GigabitEthernet0/0/1
    172.16.98.1/32  OSPF    10   1           D   172.16.97.2     GigabitEthernet0/0/1

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R7]

R8:

[R8]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 14       Routes : 14       

OSPF routing table status : <Active>
         Destinations : 14       Routes : 14

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1563        D   172.16.97.1     GigabitEthernet0/0/0
     172.16.1.2/32  OSPF    10   3125        D   172.16.97.1     GigabitEthernet0/0/0
     172.16.1.3/32  OSPF    10   3125        D   172.16.97.1     GigabitEthernet0/0/0
     172.16.1.4/32  OSPF    10   1           D   172.16.97.1     GigabitEthernet0/0/0
     172.16.2.1/32  OSPF    10   3125        D   172.16.97.1     GigabitEthernet0/0/0
     172.16.3.1/32  OSPF    10   3125        D   172.16.97.1     GigabitEthernet0/0/0
     172.16.4.1/32  OSPF    10   1           D   172.16.97.1     GigabitEthernet0/0/0
    172.16.33.0/24  OSPF    10   1564        D   172.16.97.1     GigabitEthernet0/0/0
    172.16.34.1/32  OSPF    10   1564        D   172.16.97.1     GigabitEthernet0/0/0
    172.16.35.1/32  OSPF    10   1564        D   172.16.97.1     GigabitEthernet0/0/0
    172.16.36.1/32  OSPF    10   1563        D   172.16.97.1     GigabitEthernet0/0/0
    172.16.65.0/29  OSPF    10   3126        D   172.16.97.1     GigabitEthernet0/0/0
    172.16.65.8/29  OSPF    10   3127        D   172.16.97.1     GigabitEthernet0/0/0
    172.16.66.1/32  OSPF    10   3126        D   172.16.97.1     GigabitEthernet0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R8]

R9:

[R9]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 17       Routes : 17       

OSPF routing table status : <Active>
         Destinations : 17       Routes : 17

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1564        D   172.16.97.9     GigabitEthernet0/0/0
     172.16.1.2/32  OSPF    10   3126        D   172.16.97.9     GigabitEthernet0/0/0
     172.16.1.3/32  OSPF    10   3126        D   172.16.97.9     GigabitEthernet0/0/0
     172.16.1.4/32  OSPF    10   2           D   172.16.97.9     GigabitEthernet0/0/0
     172.16.2.1/32  OSPF    10   3126        D   172.16.97.9     GigabitEthernet0/0/0
     172.16.3.1/32  OSPF    10   3126        D   172.16.97.9     GigabitEthernet0/0/0
     172.16.4.1/32  OSPF    10   2           D   172.16.97.9     GigabitEthernet0/0/0
    172.16.33.0/24  OSPF    10   1565        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.34.1/32  OSPF    10   1565        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.35.1/32  OSPF    10   1565        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.36.1/32  OSPF    10   1564        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.65.0/29  OSPF    10   3127        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.65.8/29  OSPF    10   3128        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.66.1/32  OSPF    10   3127        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.97.0/29  OSPF    10   2           D   172.16.97.9     GigabitEthernet0/0/0
    172.16.98.1/32  OSPF    10   1           D   172.16.97.9     GigabitEthernet0/0/0
   172.16.131.1/32  OSPF    10   1           D   172.16.129.2    GigabitEthernet0/0/1

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R9]

R10:

[R10]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 1        Routes : 1        

OSPF routing table status : <Active>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

   172.16.130.1/32  OSPF    10   1           D   172.16.129.1    GigabitEthernet0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R10]

R11:

[R11]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 14       Routes : 14       

OSPF routing table status : <Active>
         Destinations : 14       Routes : 14

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1563        D   172.16.65.1     GigabitEthernet0/0/0
     172.16.1.2/32  OSPF    10   3125        D   172.16.65.1     GigabitEthernet0/0/0
     172.16.1.3/32  OSPF    10   1           D   172.16.65.1     GigabitEthernet0/0/0
     172.16.1.4/32  OSPF    10   3125        D   172.16.65.1     GigabitEthernet0/0/0
     172.16.2.1/32  OSPF    10   3125        D   172.16.65.1     GigabitEthernet0/0/0
     172.16.3.1/32  OSPF    10   1           D   172.16.65.1     GigabitEthernet0/0/0
     172.16.4.1/32  OSPF    10   3125        D   172.16.65.1     GigabitEthernet0/0/0
    172.16.33.0/24  OSPF    10   1564        D   172.16.65.1     GigabitEthernet0/0/0
    172.16.34.1/32  OSPF    10   1564        D   172.16.65.1     GigabitEthernet0/0/0
    172.16.35.1/32  OSPF    10   1564        D   172.16.65.1     GigabitEthernet0/0/0
    172.16.36.1/32  OSPF    10   1563        D   172.16.65.1     GigabitEthernet0/0/0
    172.16.97.0/29  OSPF    10   3126        D   172.16.65.1     GigabitEthernet0/0/0
    172.16.97.8/29  OSPF    10   3127        D   172.16.65.1     GigabitEthernet0/0/0
    172.16.98.1/32  OSPF    10   3126        D   172.16.65.1     GigabitEthernet0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R11]

R12:

[R12]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 16       Routes : 16       

OSPF routing table status : <Active>
         Destinations : 16       Routes : 16

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1564        D   172.16.65.9     GigabitEthernet0/0/0
     172.16.1.2/32  OSPF    10   3126        D   172.16.65.9     GigabitEthernet0/0/0
     172.16.1.3/32  OSPF    10   2           D   172.16.65.9     GigabitEthernet0/0/0
     172.16.1.4/32  OSPF    10   3126        D   172.16.65.9     GigabitEthernet0/0/0
     172.16.2.1/32  OSPF    10   3126        D   172.16.65.9     GigabitEthernet0/0/0
     172.16.3.1/32  OSPF    10   2           D   172.16.65.9     GigabitEthernet0/0/0
     172.16.4.1/32  OSPF    10   3126        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.33.0/24  OSPF    10   1565        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.34.1/32  OSPF    10   1565        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.35.1/32  OSPF    10   1565        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.36.1/32  OSPF    10   1564        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.65.0/29  OSPF    10   2           D   172.16.65.9     GigabitEthernet0/0/0
    172.16.66.1/32  OSPF    10   1           D   172.16.65.9     GigabitEthernet0/0/0
    172.16.97.0/29  OSPF    10   3127        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.97.8/29  OSPF    10   3128        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.98.1/32  OSPF    10   3127        D   172.16.65.9     GigabitEthernet0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R12]

6、重发布

R12:

[R12]ospf 1
[R12-ospf-1]import-route rip 1

R9:

[R9]ospf 1
[R9-ospf-1]import-route ospf 2

查看路由表:
R12:

[R12]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 19       Routes : 19       

OSPF routing table status : <Active>
         Destinations : 19       Routes : 19

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1564        D   172.16.65.9     GigabitEthernet0/0/0
     172.16.1.2/32  OSPF    10   3126        D   172.16.65.9     GigabitEthernet0/0/0
     172.16.1.3/32  OSPF    10   2           D   172.16.65.9     GigabitEthernet0/0/0
     172.16.1.4/32  OSPF    10   3126        D   172.16.65.9     GigabitEthernet0/0/0
     172.16.2.1/32  OSPF    10   3126        D   172.16.65.9     GigabitEthernet0/0/0
     172.16.3.1/32  OSPF    10   2           D   172.16.65.9     GigabitEthernet0/0/0
     172.16.4.1/32  OSPF    10   3126        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.33.0/24  OSPF    10   1565        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.34.1/32  OSPF    10   1565        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.35.1/32  OSPF    10   1565        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.36.1/32  OSPF    10   1564        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.65.0/29  OSPF    10   2           D   172.16.65.9     GigabitEthernet0/0/0
    172.16.66.1/32  OSPF    10   1           D   172.16.65.9     GigabitEthernet0/0/0
    172.16.97.0/29  OSPF    10   3127        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.97.8/29  OSPF    10   3128        D   172.16.65.9     GigabitEthernet0/0/0
    172.16.98.1/32  OSPF    10   3127        D   172.16.65.9     GigabitEthernet0/0/0
   172.16.129.0/29  O_ASE   150  1           D   172.16.65.9     GigabitEthernet0/0/0
   172.16.130.0/24  O_ASE   150  1           D   172.16.65.9     GigabitEthernet0/0/0
   172.16.131.1/32  O_ASE   150  1           D   172.16.65.9     GigabitEthernet0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R12]

R9:

[R9]display ip routing-table protocol ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 19       Routes : 19       

OSPF routing table status : <Active>
         Destinations : 19       Routes : 19

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

     172.16.1.1/32  OSPF    10   1564        D   172.16.97.9     GigabitEthernet0/0/0
     172.16.1.2/32  OSPF    10   3126        D   172.16.97.9     GigabitEthernet0/0/0
     172.16.1.3/32  OSPF    10   3126        D   172.16.97.9     GigabitEthernet0/0/0
     172.16.1.4/32  OSPF    10   2           D   172.16.97.9     GigabitEthernet0/0/0
     172.16.2.1/32  OSPF    10   3126        D   172.16.97.9     GigabitEthernet0/0/0
     172.16.3.1/32  OSPF    10   3126        D   172.16.97.9     GigabitEthernet0/0/0
     172.16.4.1/32  OSPF    10   2           D   172.16.97.9     GigabitEthernet0/0/0
    172.16.33.0/24  OSPF    10   1565        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.34.1/32  OSPF    10   1565        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.35.1/32  OSPF    10   1565        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.36.1/32  OSPF    10   1564        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.65.0/29  OSPF    10   3127        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.65.8/29  OSPF    10   3128        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.66.1/32  OSPF    10   3127        D   172.16.97.9     GigabitEthernet0/0/0
    172.16.97.0/29  OSPF    10   2           D   172.16.97.9     GigabitEthernet0/0/0
    172.16.98.1/32  OSPF    10   1           D   172.16.97.9     GigabitEthernet0/0/0
   172.16.131.1/32  OSPF    10   1           D   172.16.129.2    GigabitEthernet0/0/1
   172.16.160.0/20  O_ASE   150  1           D   172.16.97.9     GigabitEthernet0/0/0
   172.16.176.0/20  O_ASE   150  1           D   172.16.97.9     GigabitEthernet0/0/0

OSPF routing table status : <Inactive>
         Destinations : 0        Routes : 0

[R9]

7、配置汇总空接口防环

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
[R3]ip route-static 172.16.32.0 19 NULL 0

R6:

[R6]ospf 1
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[R6]ip route-static 172.16.64.0 19 NULL 0

R7:

[R7]ospf 1
[R7-ospf-1]area 3
[R7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
[R7]ip route-static 172.16.96.0 19 NULL 0

R9:

[R9]ospf 1
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
[R9]ip route-static 172.16.128.0 19 NULL 0

R12:

[R12]ospf 1
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
[R12]ip route-static 172.16.160.0 19 NULL 0

8、配置特殊区域:

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 

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

R6:

[R6]ospf 1
[R6-ospf-1]area 2
[R6-ospf-1-area-0.0.0.2]nssa no-summary

R11:

[R11]ospf 1
[R11-ospf-1]area 2
[R11-ospf-1-area-0.0.0.2]nssa 

R12:

[R12]ospf 1
[R12-ospf-1]area 2
[R12-ospf-1-area-0.0.0.2]nssa 

9、配置NAT环境

R3:

[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 Serial 4/0/0
[R3-Serial4/0/0]nat outbound 2000

R5:

[R5]acl 2000
[R5-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R5-acl-basic-2000]q
[R5]int Serial 4/0/0
[R5-Serial4/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]q
[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]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]q
[R6]int s 4/0/0
[R6-Serial4/0/0]nat outbound 2000

10、加快收敛

减少计时器时间
R3:

[R3]int t 0/0/0
[R3-Tunnel0/0/0]ospf timer hello 5

R5:

[R5]int t 0/0/0
[R5-Tunnel0/0/0]ospf timer hello 5

R6:

[R6]int t 0/0/0
[R6-Tunnel0/0/0]ospf timer hello 5

R7:

[R7]int t 0/0/0
[R7-Tunnel0/0/0]ospf timer hello 5

11、配置接口认证

R1:

[R1]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456

R2:

[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456

R3:

[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456

12、测试

HCIP——OSPF综合实验_第3张图片
HCIP——OSPF综合实验_第4张图片

你可能感兴趣的:(计算机网络,HCIP,网络安全,网络协议,网络,HCIP,计算机网络,运维,华为)