OSPF综合实验

拓扑:

需求:

1.R5为ISP,其上只能配置IP地址;
R5与其他所有直连设备间均使用公有IP;环回地址为100.1.1.1/32
2.R4设备为企业出口路由器
3.整个OSPF环境IP基于172.16.0.0/16划分;
4.所有设备均可访问R5的环回;
5.减少LSA的更新量,加快收敛,保障更新安全;
6.全网可达

需求分析:

1.R5 仅配置 IP 地址,与直连设备的接口使用公有 IP 地址,确保与外部网络的连接。
2.R4 需配置与 R5 连接的公有 IP 接口,以及面向企业内部 OSPF 网络的接口,承担企业内外网络通信的桥梁角色。
3.整个 OSPF 网络的设备接口及环回地址均从 172.16.0.0/16 划分,确保企业内部 IP 地址的统一性与规划性。
4.需将 R5 的环回地址引入 OSPF 网络,使所有 OSPF 设备能学习到该路由,实现对 R5 环回的访问。
5.减少 LSA 更新量:在区域边界路由器(ABR)上进行路由汇总,将多个子网汇总为一个网络,减少 LSA 泛洪数量。
加快收敛速度:调整 OSPF 的 Hello 间隔和 Dead 间隔,使设备更快检测到邻居状态变化,加速网络拓扑收敛。
保障更新安全:启用 MD5 认证,对 OSPF 报文进行加密验证,防止非法设备注入错误路由信息,确保路由更新的安全性。
6.确保 OSPF 内部路由正确传递,同时通过合理配置,使企业内部 OSPF 设备、R5 及其他直连设备之间路由互通,最终达成全网所有设备相互可达。

配置命令:

R5:
sys r5
int s 4/0/0
ip address 45.0.0.5 24
int l 0 
ip address 100.1.1.1 32



R4:
sys r4
int l 0
ip address 172.16.1.1 24
ospf network-type broadcast
q
int s 4/0/0
ip address 1782.16.0.2 30
int s 3/0/0
ip address 172.16.0.5 30
int g 0/0/0
ip address 172.16.0.9 30
int s 4/0/1
ip address 45.0.0.4 24
q
ospf 1 router-id 4.4.4.4
a 0
network 172.16.0.2 0.0.0.0
network 172.16.0.5 0.0.0.0
network 172.16.0.9 0.0.0.0
network 172.16.1.1 0.0.0.0
q
ip route-static 0.0.0.0 0 45.0.0.5
acl 2000
rule permit source 172.16.0.0 0.0.255.255
q
int s 4/0/1
nat outbound 2000
q
ospf 1
default-route-advertise
q



R3:
sys r3
int g 0/0/0
ip address 172.16.19.3 29
int l 0
ip address 172.16.18.1 24
ospf network-type broadcast
int s 4/0/0
ip address 172.16.0.1 30
ospf 1 router-id 3.3.3.3
a 1
net 172.16.18.1 0.0.0.0
net 172.16.19.3 0.0.0.0
q
a 0
network 172.16.0.1 0.0.0.0
q
ospf 1
stub n0-summary 
q
ospf 1
area 1
abr-summary 172.16.16.0 255.255.240.0
q
int g 0/0/0
ospf timer hello 1
int g 0/0/0
ospf network-type p2mp



R1:
sys r1
int l 0
ip address 172.168.16.1/24
ospf network-type broadcast
q
interface GigabitEthernet 0/0/0
ip address 172.16.19.1 29
q
ospf 1 router-id 1.1.1.1
a 1
network 172.16.16.1 0.0.0.0
network 172.16.19.1 0.0.0.0
q
ospf 1
a 1
stub
q
int g 0/0/0
ospf timer hello 1
int g 0/0/0
ospf network-type p2mp



R2:
sys r2
int g 0/0/0
ip address 172.16.19.2 29
int l 0
ip address 172.16.17.1 24
ospf network-type broadcast
q
ospf 1 router-id 2.2.2.2
a 1
network 172.16.17.1 0.0.0.0
network 172.16.19.2 0.0.0.0
q
ospf 1
a 1
stub
q
int g 0/0/0
ospf timer hello 1
int g 0/0/0
ospf network-type p2mp




R6:
sys r6
int s 4/0/0
ip address 172.16.0.6 30
int g 0/0/0
ip address 172.16.33.1 30
int l 0
ip address 172.16.2.1 24
ospf network-type broadcast
q
ospf 1 router-id 6.6.6.6
a 0
net 172.16.0.6 0.0.0.0
net 172.16.2.1 0.0.0.0
q
a 2
network 172.16.33.1 0.0.0.0
q
ospf 1
a 2
nssa no-summary
q
ospf 1
area 2
abr-summary 172.16.32.0 255.255.240.0
q



R11:
sys r11
int l 0
ip address 172.16.32.1 24
ospf network-type broadcast
int g 0/0/0
ip address 172.16.33.2 30
int g 0/0/1
ip address 172.16.33.5 30
q
ospf 1 router-id 11.11.11.11
a 2
network 172.16.32.1 0.0.0.0
network 172.16.33.2 0.0.0.0
network 172.16.33.5 0.0.0.0
q
ospf 1
a 2
nssa 
q



R12:
sys r12
int g 0/0/0
ip address 172.16.33.6 30
int l 0
ip address 172.16.128.1 18
int l 1
ip address 172.16.192.1 18
ospf 1 router-id 12.12.12.12
a 2
network 172.16.33.6 0.0.0.0
q
rip 1
ver 2
network 172.16.0.0
q
ospf 1
import-route rip 1
q
rip 1
import-route ospf 1
q
ospf 1
a 2
nssa
q
ospf 1
abr-summary 172.16.128.0 255.255.128.0
q



R7:
sys r7
int g 0/0/1
ip address  172.16.49.1 30
int l 0
ip address 172.16.3.1 24
ospf network-type broadcast
q
int g 0/0/0
ip address 172.16.0.10 30
ospf 1 router-id 7.7.7.7
a 0
network 172.16.0.10 0.0.0.0
network 172.16.3.1 0.0.0.0
q
a 3
network 172.16.49.1 0.0.0.0
q
ospf 1
a 3
nssa no-summary
q
ospf 1
area 3
abr-summary 172.16.48.0 255.255.240.0
q



R8:
sys r8
int g 0/0/0
ip address 172.16.49.2 30
int g 0/0/1
ip address 172.16.49.5 30
q
int l 0
ip address 172.16.48.1 24
ospf network-type broadcast
q
ospf 1 router-id 8.8.8.8
a 3
net 172.16.49.2 0.0.0.0
net 172.16.49.5 0.0.0.0
net 172.16.49.1 0.0.0.0
q
ospf 1
a 3
nssa
q



R9:
sys r9
int g 0/0/0
ip address 172.16.19.6 30
int g 0/0/1
ip address 172.16.66.1 30
int l 0
ip address 172.16.64.1 24
ospf network-type broadcast
q
ospf 1 router-id 9.9.9.9
a 3
network 172.16.49.6 0.0.0.0
q
ospf 2 router-id 9.9.9.9
area 4
network 172.16.64.1 0.0.0.0
network 172.16.66.1 0.0.0.0
q
ospf 1
import-route ospf 2
q
import-route ospf 1
q
ospf 2
default-route-advertise
q
undo import-route ospf 1
ospf 1
area 4
abr-summary 172.16.64.0 255.255.240.0
q



R10:
sys r10
int g 0/0/0
ip address 172.16.66.2 30
int l 0
ip address 172.16.65.1 24
ospf network-type broadcast
q
ospf 2 router-id 10.10.10.10
a 4
network 172.16.66.2 0.0.0.0
network 172.16.65.1 0.0.0.0
q

测试结果:
1.全网通:
R1:
ping -a 172.16.16.1 172.16.128.1

ping -a 172.16.16.1 172.16.49.5

ping -a 172.16.16.1 172.16.65.1

ping -a 172.16.16.1 100.1.1.1

R7:
ping 100.1.1.1

R12:
ping 100.1.1.1

R10:
ping 100.1.1.1

2.优化:
R1:
display ospf lsdb


R12:
display ospf lsdb


R6:
display ospf lsdb


R8:
display ospf lsdb


R10:
display ospf lsdb


R4:
display ospf lsdb


display ip routing-table protocol

实验感悟:

本次实验通过搭建 OSPF 网络并实现多需求配置,深刻体会到网络设计需兼顾规划、优化与安全。从 IP 地址的合理划分到路由汇总减少 LSA 泛洪,每一步配置都需精准对接需求;调整 Hello/Dead 间隔与启用 MD5 认证,让我直观理解协议参数对网络性能和安全性的影响。最关键的是,通过全网可达性测试验证配置有效性,认识到理论落地需反复调试与验证。实验不仅强化了 OSPF 协议应用能力,更培养了从需求出发、系统性解决问题的思维。
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值