ospf综合实验

华子目录

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

一、实验拓扑

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

ospf综合实验_第2张图片

四、实验步骤

1、配置接口IP地址以及环回(以此类推)

<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]

2、配置缺省路由(依次类推r3,r5,r6,r7)

[R3]ip route-static 0.0.0.0 0 12.1.1.2

3、配置MGRE环境(以此类推r3,r5,r6,r7)

[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]

4、配置OSPF

[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]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

[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

[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]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]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]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]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]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]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]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 

5、修改网络类型

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

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

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

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

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

6、重发布

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

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

7、配置汇总空接口防环

[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]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]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]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]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]ospf 1
[R1-ospf-1]area 1
[R1-ospf-1-area-0.0.0.1]stub 

[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]stub 

[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]stub no-summary 

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

[R7]ospf 1
[R7-ospf-1]area 3
[R7-ospf-1-area-0.0.0.3]nssa no-summary

[R8]ospf 1
[R8-ospf-1]area 3
[R8-ospf-1-area-0.0.0.3]nssa 

[R9]ospf 1
[R9-ospf-1]area 3
[R9-ospf-1-area-0.0.0.3]nssa

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

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

9、配置NAT环境

[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]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]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]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,r5,r6,r7)

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

11、配置接口认证

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

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

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

你可能感兴趣的:(网络)