HCIP--OSPF综合实验

编写实验报告:
1、拓扑信息
2、要求及分析
3、IP规划
4、配置截图
5、测试

1、拓扑信息

2、要求及分析

一、R6为ISP只能配置IP地址,R1-R5的环回为私有网段

1.首先给各个设备分配IP并设置缺省使全网可达

2.配置完成后ping一下其他路由器发现都通

二、R1/2/3为星型的拓扑结构(MGRE),R1为中心站点

R1配置

R2配置

R3配置

在R1中心站点上查询到R2,R3上交的表

三、R1/4/5为全连的MGRE结构

R1为中心

R4为中心

R5为中心

四、所有私有网段可以互相通讯,使用OSPF完成

由于MGRE环境不支持组播,所以需要开启伪广播

在R1-5上开启OSPF

最后查路由表可以看到都在 ,所有私有网段互相通信

3、IP规划

4、配置截图

配置IP和环回
R1配置

<Huawei>sys
[Huawei]sys r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 172.16.16.1 29
[r1-GigabitEthernet0/0/0]int l 0
[r1-LoopBack0]ip add 172.16.17.1 24

R2配置

<Huawei>sys
[Huawei]sys r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 172.16.16.2 29
[r2-GigabitEthernet0/0/0]int l 0
[r2-LoopBack0]ip add 172.16.18.1 24

R3配置

<Huawei>sys
[Huawei]sys r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 172.16.16.3 29
[r3-GigabitEthernet0/0/0]int l 0
[r3-LoopBack0]ip add 172.16.19.1 24

[r3-LoopBack0]int s4/0/0
[r3-Serial4/0/0]ip add 34.0.0.3 24

R4配置

<Huawei>sys
[Huawei]sys r4

[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 47.0.0.4 24
[r4-GigabitEthernet0/0/0]int s4/0/0
[r4-Serial4/0/0]ip add 34.0.0.4 24
[r4-Serial4/0/0]int s4/0/1
[r4-Serial4/0/1]ip add 45.0.0.4 24
[r4-Serial4/0/1]int s3/0/0
[r4-Serial3/0/0]ip add 46.0.0.4 24
[r4-Serial3/0/0]int l 0
[r4-LoopBack0]ip add 4.4.4.4 32

R5配置

<Huawei>sys
[Huawei]sys r5

[r5]int s4/0/0
[r5-Serial4/0/0]ip add 45.0.0.5 24
[r5-Serial4/0/0]int l 0
[r5-LoopBack0]ip add 172.16.1.1 24

R6配置

<Huawei>sys
[Huawei]sys r6
[r6]int s4/0/0
[r6-Serial4/0/0]ip add 46.0.0.6 24
[r6-Serial4/0/0]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 172.16.33.1 30
[r6-GigabitEthernet0/0/0]int l 0
[r6-LoopBack0]ip add 172.16.2.1 24

R7配置

<Huawei>sys
[Huawei]sys r7

[r7]int g0/0/0
[r7-GigabitEthernet0/0/0]ip add 47.0.0.7 24
[r7-GigabitEthernet0/0/0]int l 0
[r7-LoopBack0]ip add 172.16.3.1 24
[r7-LoopBack0]int g0/0/1
[r7-GigabitEthernet0/0/1]ip add 172.16.49.1 30

R8配置

<Huawei>sys
[Huawei]sys r8

[r8]int g0/0/0
[r8-GigabitEthernet0/0/0]ip add 172.16.49.2 30
[r8-GigabitEthernet0/0/0]int g0/0/1
[r8-GigabitEthernet0/0/1]ip add 172.16.49.5 30
[r8-GigabitEthernet0/0/1]int l 0
[r8-LoopBack0]ip add 172.16.48.1 24

R9配置

<Huawei>sys
[Huawei]sys r9

[r9]int g0/0/0
[r9-GigabitEthernet0/0/0]ip add 172.16.49.6 30
[r9-GigabitEthernet0/0/0]int l 0
[r9-LoopBack0]ip add 172.16.64.1 24
[r9-LoopBack0]int g0/0/1
[r9-GigabitEthernet0/0/1]ip add 172.16.66.1 30

R10配置

<Huawei>sys
[Huawei]sys r10

[r10]int g0/0/0
[r10-GigabitEthernet0/0/0]ip add 172.16.66.2 30
[r10-GigabitEthernet0/0/0]int l 0
[r10-LoopBack0]ip add 172.16.65.1 24

R11配置

<Huawei>sys
[Huawei]sys r11

[r11]int g0/0/0
[r11-GigabitEthernet0/0/0]ip add 172.16.33.2 30
[r11-GigabitEthernet0/0/0]int g0/0/1
[r11-GigabitEthernet0/0/1]ip add 172.16.33.5 30
[r11-GigabitEthernet0/0/1]int l 0
[r11-LoopBack0]ip add 172.16.32.1 24

R12配置

<Huawei>sys
[Huawei]sys r12

[r12]int g0/0/0
[r12-GigabitEthernet0/0/0]ip add 172.16.33.6 30
[r12-GigabitEthernet0/0/0]int l 0
[r12-LoopBack0]ip add 172.16.128.1 18
[r12-LoopBack0]int l 1
[r12-LoopBack1]ip add 172.16.192.1 18

测试所有直连网段是否通
用 Ping

搭建非shortcut方式的MGRE环境
R3配置

[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 172.16.0.1 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r3-Tunnel0/0/0]source 34.0.0.3
[r3-Tunnel0/0/0]nhrp entry multicast dynamic 

[r3]ip route-static 0.0.0.0 0 34.0.0.4

R5配置

[r5]int t0/0/0
[r5-Tunnel0/0/0]ip add 172.16.0.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r5-Tunnel0/0/0]source Serial 4/0/0
[r5-Tunnel0/0/0]nhrp entry 172.16.0.1 34.0.0.3 register 

[r5]ip route-static 0.0.0.0 0 45.0.0.4

R6配置

[r6]int t0/0/0
[r6-Tunnel0/0/0]ip add 172.16.0.3 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r6-Tunnel0/0/0]source Serial 4/0/0
[r6-Tunnel0/0/0]nhrp entry 172.16.0.1 34.0.0.3 register 

[r6]ip route-static 0.0.0.0 0 46.0.0.4

R7配置

[r7]int t0/0/0
[r7-Tunnel0/0/0]ip add 172.16.0.4 24
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r7-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r7-Tunnel0/0/0]nhrp entry 172.16.0.1 34.0.0.3 register 

[r7]ip route-static 0.0.0.0 0 47.0.0.4

检查NHRP表
起Area 0的OSPF
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.1 0.0.0.0

改p2mp类型

[r3-ospf-1-area-0.0.0.0]int t0/0/0

[r3-Tunnel0/0/0]ospf network-type p2mp

减少Hello时间与死亡时间

[r3-Tunnel0/0/0]ospf timer hello 1

将环回类型(主机)改为broadcast (不然OSPF学到的是掩码32的路由)

[r6]int l 0

[r6-LoopBack0]ospf network-type broadcast 

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

改p2mp类型

[r5-ospf-1-area-0.0.0.0]int t0/0/0
[r5-Tunnel0/0/0]ospf network-type p2mp

减少Hello时间与死亡时间

[r5-Tunnel0/0/0]ospf timer hello 1

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.3 0.0.0.0
[r6-ospf-1-area-0.0.0.0]network 172.16.2.1 0.0.0.0

改p2mp类型

[r6-ospf-1-area-0.0.0.0]int t0/0/0
[r6-Tunnel0/0/0]ospf network-type p2mp

减少Hello时间与死亡时间

[r6-Tunnel0/0/0]ospf timer hello 1

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.15.255.255

改p2mp类型

[r7-ospf-1-area-0.0.0.0]int t0/0/0
[r7-Tunnel0/0/0]ospf network-type p2mp

减少Hello时间与死亡时间

[r7-Tunnel0/0/0]ospf timer hello 1

测试OSPF与Hello修改
起Area 1的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 0.0.0.0 255.255.255.255

减少Hello时间与死亡时间

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ospf timer hello 1

R2配置

[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 0.0.0.0 255.255.255.255

减少Hello时间与死亡时间

[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ospf timer hello 1

R3配置

[r3]ospf 1 
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 172.16.16.0 0.15.255.255

减少Hello时间与死亡时间

[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ospf timer hello 1

起Area 2的OSPF与RIP
R6配置

[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]network 172.16.33.1 0.0.0.0

减少Hello时间与死亡时间

[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ospf timer hello 1

R11配置

[r11]ospf 1 router-id 11.11.11.11
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.2]network 0.0.0.0 255.255.255.255

减少Hello时间与死亡时间

[r11]int g0/0/0
[r11-GigabitEthernet0/0/0]ospf timer hello 1

[r11-GigabitEthernet0/0/0]int g0/0/1
[r11-GigabitEthernet0/0/1]ospf timer hello 1

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.33.6 0.0.0.0

减少Hello时间与死亡时间

[r12]int g0/0/0
[r12-GigabitEthernet0/0/0]ospf timer hello 1

起RIP

[r12-ospf-1-area-0.0.0.2]q
[r12-ospf-1]q
[r12]rip 1
[r12-rip-1]ver 2
[r12-rip-1]undo summary 
[r12-rip-1]network 172.16.0.0

起Area 3的OSPF
R7配置

[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]network 172.16.49.1 0.0.0.0

减少Hello时间与死亡时间

[r7]int g0/0/1
[r7-GigabitEthernet0/0/1]ospf timer hello 1

R8配置

[r8]ospf 1 router-id 8.8.8.8 
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]network 0.0.0.0 255.255.255.255

减少Hello时间与死亡时间

[r8]int g0/0/0
[r8-GigabitEthernet0/0/0]ospf timer hello 1

[r8]int g0/0/1
[r8-GigabitEthernet0/0/1]ospf timer hello 1

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.49.6 0.0.0.0

减少Hello时间与死亡时间

[r9]int g0/0/0
[r9-GigabitEthernet0/0/0]ospf timer hello 1

起Area 4的OSPF(不同进程)
R9配置

[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.64.0 0.15.255.255

减少Hello时间与死亡时间

[r9-GigabitEthernet0/0/0]int g0/0/1
[r9-GigabitEthernet0/0/1]ospf timer hello 1

R10配置

[r10]ospf 1 router-id 10.10.10.10
[r10-ospf-1]area 4
[r10-ospf-1-area-0.0.0.4]network 0.0.0.0 255.255.255.255

减少Hello时间与死亡时间

[r10]int g0/0/0
[r10-GigabitEthernet0/0/0]ospf timer hello 1

R12与R9上做重发布
R12配置

[r12]ospf 1
[r12-ospf-1]import-route rip 1
[r12-ospf-1]q
[r12]rip 1
[r12-rip-1]import-route ospf 1

R9配置

[r9]ospf 1
[r9-ospf-1]import-route ospf 2
[r9-ospf-1]q
[r9]ospf 2
[r9-ospf-2]import-route ospf 1

做OSPF路由汇总
R3配置

[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.16.0 255.255.240.0

R6配置

[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.32.0 255.255.240.0

R7配置

[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.48.0 255.255.240.0

R9配置(域外路由汇总)

[r9]ospf 1
[r9-ospf-1]asbr-summary 172.16.64.0 255.255.240.0

R12配置(域外路由汇总)

[r12]ospf 1
[r12-ospf-1]asbr-summary 172.16.128.0 255.255.128.0

做特殊区域
Area 1做成Totally Stub Area
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 

Area 2做成Totally 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 

Area 3做成Totally NSSA
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 

下发一个缺省,不然R10中既没有缺省,也没有其他路由

[r9]ospf 2
[r9-ospf-2]default-route-advertise

做认证保障更新安全
R9配置(接口认证)

[r9]int g0/0/1
[r9-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456

R10配置(接口认证)

[r10]int g0/0/0
[r10-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456

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

空接口防环(优化)
R3配置

[r3]ip route-static 172.16.16.0 20 NULL 0

R6配置

[r6]ip route-static 172.16.32.0 20 NULL 0

R7配置

[r7]ip route-static 172.16.48.0 20 NULL 0
[r7]ip route-static 172.16.64.0 20 NULL 0

静默接口(优化)
配在连接用户上(即环回接口)

R1配置

[r1]ospf 1
[r1-ospf-1]silent-interface LoopBack 0

R2配置

[r2]ospf 1
[r2-ospf-1]silent-interface LoopBack 0

R3配置

[r3]ospf 1
[r3-ospf-1]silent-interface LoopBack 0

R4配置

[r4]ospf 1
[r4-ospf-1]silent-interface LoopBack 0

R5配置

[r5]ospf 1
[r5-ospf-1]silent-interface LoopBack 0

R6配置

[r6]ospf 1

[r6-ospf-1]silent-interface LoopBack 0

R7配置

[r7]ospf 1
[r7-ospf-1]silent-interface LoopBack 0

R8配置

[r8]ospf 1
[r8-ospf-1]silent-interface LoopBack 0

R9配置

[r9]ospf 1
[r9-ospf-1]silent-interface LoopBack 0

R10配置

[r10]ospf 1
[r10-ospf-1]silent-interface LoopBack 0

R11配置

[r11]ospf 1
[r11-ospf-1]silent-interface LoopBack 0

R12配置

做NAT
R3配置

[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.16.0 0.0.15.255

[r3-acl-basic-2000]q
[r3]int s4/0/0
[r3-Serial4/0/0]nat outbound 2000

R6配置

[r6]acl 2000
[r6-acl-basic-2000]rule permit source 172.16.32.0 0.0.15.255

[r6-acl-basic-2000]rule permit source 172.16.128.0 0.0.254.255
[r6-acl-basic-2000]q
[r6]int s4/0/0
[r6-Serial4/0/0]nat outbound 2000

R7配置

[r7]acl 2000
[r7-acl-basic-2000]rule permit source 172.16.48.0 0.0.15.255
[r7-acl-basic-2000]rule permit source 172.16.64.0 0.0.15.255
[r7-acl-basic-2000]q
[r7]int g0/0/0
[r7-GigabitEthernet0/0/0]nat outbound 2000

5、测试

测试所有设备均可访问R4的环回

  • 22
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值