OSPF综合实验

文章目录

    • 拓扑图
    • 实验要求
    • 实验思路
    • 实验步骤
    • 实验结果

拓扑图

实验要求

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

实验思路

  1. 先划分172.16.0.0/16IP地址
  2. 再配置IP地址
  3. 公网通(缺省路由)
  4. 配置OSPF,RIP,路由引入RIP
  5. 配置MGRE,R3为中心站点,ospf宣告隧道
  6. 修改接口类型,取消选举
  7. 多进程重发布area4
  8. 配置easyIP
  9. 路由聚合(优化骨干),R3,5,6,7传入区域聚合,R9(进程1),12(ospf协议视图)ASBR聚合
  10. 设置特殊区域(优化非骨干区域),area1完全末梢,area3,area2完全非纯末梢,会自动下发缺省(能够访问R4环回)
  11. 加快收敛,修改Hello时间ospf timer hello 5
  12. 保证更新安全,区域认证

实验步骤

1.划分地址:
先划分区域,再从单个区域细分

area0

总地址:172.16.0.0/19

用户地址:

172.16.0.0/24---P2P

172.16.1.0/24---MA

172.16.2.0/24---R4(环回)

172.16.3.0/24---R5(环回)

172.16.4.0/24---R6(环回)

172.16.5.0/24---R7(环回)

172.16.6.0/24---隧道

area1

总地址:172.16.32.0/19

用户地址:

172.16.32.0/24---P2P

172.16.33.0/24---MA

172.16.34.0/24---R1(环回)

172.16.35.0/24---R2(环回)

172.16.36.0/24---R3(环回)

area2

总地址:172.16.64.0/19

用户地址:

172.16.64.0/24---P2P

172.16.65.0/24---MA

172.16.65.0/30

172.16.65.4/30

172.16.66.0/24---R11(环回)

area3

总地址:172.16.96.0/19

用户地址:

172.16.96.0/24---P2P

172.16.97.0/24---MA

172.16.97.0/30

172.16.97.0/30

172.16.98.0/24---R8(环回)

area4

总地址:172.16.128.0/19

用户地址:

172.16.128.0/24---P2P

172.16.129.0/24---MA

172.16.129.0/30

172.16.130.0/24---R9(环回)

172.16.131.0/24---R10(环回)

RIP:

地址:172.16.160.0/19

L0:172.16.160.0/24

L1:172.16.161.0/24

2.配置IP地址:
R1:

[Huawei]sy R1

[R1]int g 0/0/0

[R1-GigabitEthernet0/0/0]ip address 172.16.33.1 24

[R1-GigabitEthernet0/0/0]int l0

[R1-LoopBack0]ip address 172.16.34.1 24

R2:

[Huawei]sy R2

[R2]int g 0/0/0

[R2-GigabitEthernet0/0/0]ip address 172.16.33.2 24

[R2-GigabitEthernet0/0/0]int l0

[R2-LoopBack0]ip address 172.16.35.2 24

R3:

[Huawei]sy R3

[R3]int g 0/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.3 24

[R3-LoopBack0]int s 4/0/0

[R3-Serial4/0/0]ip address 34.0.0.3 24

R4:

<Huawei>sy

[Huawei]sy R4

[R4]int s 4/0/0

[R4-Serial4/0/0]ip address 34.0.0.4 24

[R4-Serial4/0/0]int s 3/0/1

[R4-Serial3/0/1]ip address 45.0.0.4 24

[R4-Serial3/0/1]int s 3/0/0

[R4-Serial3/0/0]ip address 46.0.0.4 24

[R4-Serial3/0/0]int g 0/0/0

[R4-GigabitEthernet0/0/0]ip address 47.0.0.4 24

[R4-GigabitEthernet0/0/0]int l0

[R4-LoopBack0]ip address 172.16.2.4 24

R5:

<Huawei>sy

[Huawei]sy R5

[R5]int s 4/0/0

[R5-Serial4/0/0]ip address 45.0.0.5 24

[R5-Serial4/0/0]int l0

[R5-LoopBack0]ip ad 172.16.3.5 24

R6:

<Huawei>sy

[Huawei]sy R6

[R6]int s 4/0/0

[R6-Serial4/0/0]ip address 46.0.0.6 24

[R6-Serial4/0/0]int l0

[R6-LoopBack0]ip address 172.16.4.6 24

[R6-LoopBack0]int g 0/0/0

[R6]int g 0/0/0

[R6-GigabitEthernet0/0/0]ip address 172.16.65.1 30

R7:

<Huawei>sy

[Huawei]sy R7

[R7]int g 0/0/0

[R7-GigabitEthernet0/0/0]ip address 47.0.0.7 24

[R7-GigabitEthernet0/0/0]int l0

[R7-LoopBack0]ip address 172.16.5.7 24

[R7-LoopBack0]int g 0/0/1

[R7-GigabitEthernet0/0/1]ip address 172.16.97.1 30

R8:

<Huawei>sy

[Huawei]sy R8

[R8]int g 0/0/0

[R8-GigabitEthernet0/0/0]ip address 172.16.97.2 30

[R8-GigabitEthernet0/0/0]int g 0/0/1

[R8-GigabitEthernet0/0/1]ip address 172.16.97.5 30

[R8-GigabitEthernet0/0/1]int l0

[R8-LoopBack0]ip address 172.16.98.8 24

R9:

<Huawei>sy

[Huawei]sy R9

[R9]int g 0/0/0

[R9-GigabitEthernet0/0/0]ip address 172.16.97.6 30

[R9-GigabitEthernet0/0/0]int g 0/0/1

[R9-GigabitEthernet0/0/1]ip address 172.16.129.1 30

[R9-GigabitEthernet0/0/1]int l0

[R9-LoopBack0]ip address 172.16.130.9 24

R10:

<Huawei>sy

[Huawei]sy R10

[R10]int g 0/0/0

[R10-GigabitEthernet0/0/0]ip address 172.16.129.2 30

[R10-GigabitEthernet0/0/0]int l0

[R10-LoopBack0]ip address 172.16.131.10 24

R11:

[R11]sy R11

[R11]int g 0/0/0

[R11-GigabitEthernet0/0/0]ip address 172.16.65.2 30

[R11-GigabitEthernet0/0/0]int g 0/0/1

[R11-GigabitEthernet0/0/1]ip address 172.16.65.5 30

[R11-GigabitEthernet0/0/1]int l0

[R11-LoopBack0]ip address 172.16.66.11 24

R12:

<Huawei>sy

[Huawei]sy R12

[R12]int g 0/0/0

[R12-GigabitEthernet0/0/0]ip address 172.16.65.6 30

[R12-GigabitEthernet0/0/0]int l 0

[R12-LoopBack0]ip address 172.16.160.12 24

[R12-LoopBack0]int l 1

[R12-LoopBack1]ip address 172.16.161.12 24

(3)公网通(缺省路由)

R3:

[R3]ip route-static 0.0.0.0 0 34.0.0.4

R5:

[R5]ip route-static 0.0.0.0 0 45.0.0.4

R6:

[R6]ip route-static 0.0.0.0 0 46.0.0.4

R7:

[R7]ip route-static 0.0.0.0 0 47.0.0.4

配置OSPF,RIP,路由引入RIP
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.33.1 0.0.0.0

[R1-ospf-1-area-0.0.0.1]network 172.16.34.1 0.0.0.0

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

[R2-ospf-1-area-0.0.0.1]network 172.16.35.2 0.0.0.0

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

[R3-ospf-1-area-0.0.0.1]network 172.168.36.3 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]net 172.16.3.5 0.0.0.0

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

[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.97.1 0.0.0.0

[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.97.2 0.0.0.0

[R8-ospf-1-area-0.0.0.3]network 172.16.97.5 0.0.0.0

[R8-ospf-1-area-0.0.0.3]network 172.16.98.8 0.0.0.0

R9:(区域四在进程2)

[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.6 0.0.0.0

[R9]ospf 2 router-id 9.9.9.9

[R9-ospf-2]area 4

[R9-ospf-2-area-0.0.0.4]net 172.16.129.1 0.0.0.0

[R9-ospf-2-area-0.0.0.4]net 172.16.130.9 0.0.0.0

R10:(进程2)

[R10]ospf 2 router-id 10.10.10.10

[R10-ospf-2]area 4

[R10-ospf-2-area-0.0.0.4]net 172.16.129.2 0.0.0.0

[R10-ospf-2-area-0.0.0.4]net 172.16.131.10 0.0.0.0

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

[R11-ospf-1-area-0.0.0.2]network 172.16.65.5 0.0.0.0

[R11-ospf-1-area-0.0.0.2]network 172.16.66.11 0.0.0.0

R12:

[OSPF]:

[R12]ospf 1 router-id 12.12.12.12

[R12-ospf-1]

[R12-ospf-1]area 2

[R12-ospf-1-area-0.0.0.2]network 172.16.65.6 0.0.0.0

[RIP]:

[R12]rip 1

[R12-rip-1]version 2

[R12-rip-1]undo summary

[R12-rip-1]network 172.16.0.0

路由引入(ospf协议视图引入RIP进程1):

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

  1. 配置MGRE,R3为中心站点,ospf宣告隧道

R3:

R3int Tunnel 0/0/0

R3-Tunnel0/0/0ip address 172.16.6.3 24

R3-Tunnel0/0/0tunnel-protocol gre p2mp

R3-Tunnel0/0/0source Serial 4/0/0

R3-Tunnel0/0/0nhrp network-id 100

R3-Tunnel0/0/0nhrp entry multicast dynamic

R3-ospf-1-area-0.0.0.0net 172.16.6.3 0.0.0.0

R5:

R5int t 0/0/0

R5-Tunnel0/0/0ip address 172.16.6.5 24

R5-Tunnel0/0/0tunnel-protocol gre p2mp

R5-Tunnel0/0/0source Serial 4/0/0

R5-Tunnel0/0/0nhrp network-id 100

R5-Tunnel0/0/0nhrp entry 172.16.6.3 34.0.0.3 register

R5-ospf-1-area-0.0.0.0net 172.16.6.5 0.0.0.0

R6:

R6int t 0/0/0

R6-Tunnel0/0/0ip address 172.16.6.6 24

R6-Tunnel0/0/0tunnel-protocol gre p2mp

R6-Tunnel0/0/0source Serial 4/0/0

R6-Tunnel0/0/0nhrp network-id 100

R6-Tunnel0/0/0nhrp entry 172.16.6.3 34.0.0.3 register

R6-ospf-1-area-0.0.0.0net 172.16.6.6 0.0.0.0

R7:

R7int t 0/0/0

R7-Tunnel0/0/0ip address 172.16.6.7 24

R7-Tunnel0/0/0tunnel-protocol gre p2mp

R7-Tunnel0/0/0source g 0/0/0

R7-Tunnel0/0/0nhrp network-id 100

R7-Tunnel0/0/0nhrp entry 172.16.6.3 34.0.0.3 register

R7-ospf-1-area-0.0.0.0net 172.16.6.7 0.0.0.0

  1. 修改接口类型,取消选举

R3:

R3-Tunnel0/0/0ospf network-type broadcast

R5:

R5-Tunnel0/0/0ospf network-type broadcast

R5-Tunnel0/0/0ospf dr

R5-Tunnel0/0/0ospf dr-priority 0

R6:

R6-Tunnel0/0/0ospf network-type broadcast

R6-Tunnel0/0/0ospf dr-priority 0

R7:

R7-Tunnel0/0/0ospf network-type broadcast

R7-Tunnel0/0/0ospf dr-priority 0

  1. 多进程重发布area4

R9:

R9-ospf-2import-route ospf 1

R9-ospf-1import-route ospf 2

  1. 配置easyIP

R3:

R3acl 2000

R3-acl-basic-2000rule permit source 172.16.0.0 0.0.255.255

R3int s 4/0/0

R3-Serial4/0/0nat outbound 2000

R5:

R5acl 2000

R5-acl-basic-2000rule 5 permit source 172.16.0.0 0.0.255.255

R5-acl-basic-2000q

R5int s 4/0/0

R5-Serial4/0/0nat outbound 2000

R6:

R6acl 2000

R6-acl-basic-2000rule 5 permit source 172.16.0.0 0.0.255.255

R6int s 4/0/0

R6-Serial4/0/0nat out 2000

R7:

R7acl 2000

R7-acl-basic-2000rule 5 permit source 172.16.0.0 0.0.255.255

R7-acl-basic-2000int g 0/0/0

R7-GigabitEthernet0/0/0nat outbound 2000

  1. 路由聚合(优化骨干),R3,5,6,7传入区域聚合,R9(进程1),12(ospf协议视图)ASBR聚合

(1)ABR聚合:

R3:

R3ospf 1 router-id 3.3.3.3

R3-ospf-1area 1

R3-ospf-1-area-0.0.0.1abr-summary 172.16.32.0 255.255.224.0

R6:

R6ospf 1 router-id 6.6.6.6

R6-ospf-1area 2

R6-ospf-1-area-0.0.0.2abr-summary 172.16.64.0 255.255.224.0

R7:

R7ospf 1 router-id 7.7.7.7

R7-ospf-1area 3

R7-ospf-1-area-0.0.0.3abr-summary 172.16.96.0 255.255.224.0

(2)ASBR聚合

R9:

R9ospf 1 router-id 9.9.9.9

R9-ospf-1asbr-summary 172.16.128.0 255.255.224.0

R12:

R12ospf 1 router-id 12.12.12.12

R12-ospf-1asbr-summary 172.16.160.0 255.255.224.0

  1. 设置特殊区域(优化非骨干区域),area1完全末梢,area3,area2完全非纯末梢,会自动下发缺省(就能够访问R4环回)

Area 1:

R1:

R1-ospf-1-area-0.0.0.1stub no-summary

R2:

R2-ospf-1-area-0.0.0.1stub no-summary

R3:

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

Area 2:

R6:

R6-ospf-1-area-0.0.0.2nssa no-summary

R11:

R11-ospf-1-area-0.0.0.2nssa no-summary

R12:

R12-ospf-1-area-0.0.0.2nss no-summary

Area 3:

R7:

R7-ospf-1-area-0.0.0.3nssa no-summary

R8:

R7-ospf-1-area-0.0.0.3nssa no-summary

R9:

R9-ospf-1-area-0.0.0.3nssa no-summary

  1. 加快收敛,修改Hello时间

接口模式下ospf timer hello 5

R1:

R1-GigabitEthernet0/0/0ospf timer hello 5

R2:

R2-GigabitEthernet0/0/0ospf timer hello 5

R3:

R3-Tunnel0/0/0ospf timer hello 5

R5:

R5-Tunnel0/0/0ospf timer hello 5

R6:

R6-Tunnel0/0/0ospf timer hello 5

R7:

R7-GigabitEthernet0/0/1ospf timer hello 5

R7-Tunnel0/0/0ospf timer hello 5

R8:

R8-GigabitEthernet0/0/1ospf timer hello 5

R9:

R9-GigabitEthernet0/0/0ospf timer hello 5

R9-GigabitEthernet0/0/1ospf timer hello 5

R10:

R10-GigabitEthernet0/0/0ospf timer hello 5

R11:

R11-GigabitEthernet0/0/0ospf timer hello 5

R11-GigabitEthernet0/0/1ospf timer hello 5

R12:

R12-GigabitEthernet0/0/0ospf timer hello 5

  1. 保证更新安全,采用区域认证

R1:

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

R2:

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

R3:

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

R3-ospf-1-area-0.0.0.0authentication-mode md5 1 cipher 123456

R5:

R5-ospf-1-area-0.0.0.0 authentication-mode md5 1 cipher 123456

R6:

R6-ospf-1-area-0.0.0.0authentication-mode md5 1 cipher 123456

R6-ospf-1-area-0.0.0.2authentication-mode md5 1 cipher 123456

R7:

R7-ospf-1-area-0.0.0.0authentication-mode md5 1 cipher 123456

R7-ospf-1-area-0.0.0.3authentication-mode md5 1 cipher 123456

R8:

R8-ospf-1-area-0.0.0.3authentication-mode md5 1 cipher 123456

R9:

R9-ospf-1-area-0.0.0.3authentication-mode md5 1 cipher 123456

R9-ospf-2-area-0.0.0.4authentication-mode md5 1 cipher 123456

R10:

R10-ospf-2-area-0.0.0.4authentication-mode md5 1 cipher 123456

R11:

R11-ospf-1-area-0.0.0.2authentication-mode md5 1 cipher 123456

R12:

R12-ospf-1-area-0.0.0.2authentication-mode md5 1 cipher 123456

实验结果

查看R2路由表:

查看R3的邻居表:

查看R3,R6,R7,R9路由表:

相关推荐
李子琪。9 分钟前
网络空间安全深度实战:CSRF 漏洞原理剖析与基于 Token 的纵深防御体系构建(全栈实验报告)
前端·安全·csrf
志栋智能14 分钟前
小步快跑:从单一场景开启超自动化巡检之旅
运维·网络·人工智能·自动化
XINERTEL23 分钟前
视频卡顿花屏?专业视频质量评估测试让画质从“凭感觉”到“数据说话”
网络·测试工具·音视频·丢包
AugustRed29 分钟前
Linux 运维常用命令大全(超全速查表)
运维·网络·php
正在走向自律38 分钟前
远程控制软件安全对比2026:ToDesk vs 向日葵 vs TeamViewer,你的电脑钥匙交给谁更放心
网络·远程办公·远程服务
胡楚昊1 小时前
Vulnhub靶场 Tr0ll打靶(上)
网络
gs801402 小时前
网络隐形杀手:从 Could not connect to SMTP host 报错深度剖析 Docker MTU 黑洞理论与实战
网络·docker·容器
wanhengidc2 小时前
云手机搬砖 像僵尸开炮
运维·网络·智能手机·云计算
黎阳之光2 小时前
数智透明·安全兜底|黎阳之光透明矿山,AI+数字孪生守护矿山生命线
人工智能·物联网·算法·安全·数字孪生