OSPF综合实验

 

目录

 

拓扑图如下​

任务要求如下

一,R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有IP,整个OSPF环境Ip基于172.16.0.0/16划分;

1.首先划分IP

2.在设备接口上配置IP 

二,R3-R5/6/7为MGRE环境,R3为中心站点;

r3 

r5

r6

r7

查看邻居表 

 配置完ospf后

​三,所有设备均可访问R4的环回;

1.在所有路由器上配置好ospf

2.在r9和r7上设置虚链路

3.在r10上可以看到未减少更新量时所获取的路由条目 

 4.ABR设备上做nat网络地址转换

 5.在ABR设备上做区域汇总

6.在r12上做双向重发布 

7.所有设备此时均可访问ISP的环回

四,减少LSA的更新量,加快收敛,保障更新安全;

1.减少LSA更新量(特殊区域)

2.加速收敛(修改hello时间)

3.保障更新安全(区域认证) 

五,全网可达


拓扑图如下

任务要求如下

一,R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有IP,整个OSPF环境Ip基于172.16.0.0/16划分;

1.首先划分IP

如图所示

2.在设备接口上配置IP 

二,R3-R5/6/7为MGRE环境,R3为中心站点;

r3 

[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 172.16.4.1 24	
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r3-Tunnel0/0/0]source 34.0.0.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry multicast dynamic #需开启伪广播

r5

[r5]int t0/0/0
[r5-Tunnel0/0/0]ip add 172.16.4.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r5-Tunnel0/0/0]source s4/0/0
[r5-Tunnel0/0/0]nhrp entry 172.16.4.1 34.0.0.1 register
[r5-Tunnel0/0/0]nhrp entry multicast dynamic #需开启伪广播

r6

[r6]int t0/0/0
[r6-Tunnel0/0/0]ip add 172.16.4.3 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r6-Tunnel0/0/0]source s4/0/0
[r6-Tunnel0/0/0]nhrp entry 172.16.4.1 34.0.0.1 register
[r6-Tunnel0/0/0]nhrp entry multicast dynamic #需开启伪广播

r7

[r7]int t0/0/0
[r7-Tunnel0/0/0]ip add 172.16.4.4 24	
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r7-Tunnel0/0/0]source g0/0/0
[r7-Tunnel0/0/0]nhrp entry 172.16.4.1 34.0.0.1 register

查看邻居表 

 配置完ospf后

由于通道p2p为点到点所以改为 broadcast

[r3-Tunnel0/0/0]ospf network-type broadcast
[r5-Tunnel0/0/0]ospf network-type broadcast
[r6-Tunnel0/0/0]ospf network-type broadcast
[r7-Tunnel0/0/0]ospf network-type broadcast

三,所有设备均可访问R4的环回;

1.在所有路由器上配置好ospf

2.在r9和r7上设置虚链路

[r9-ospf-1-area-0.0.0.3]vlink-peer 7.7.7.7
[r7-ospf-1-area-0.0.0.3]vlink-peer 9.9.9.9

3.在r10上可以看到未减少更新量时所获取的路由条目 

 4.ABR设备上做nat网络地址转换

[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.32.0 0.0.31.255
[r3-acl-basic-2000]int s4/0/0
[r3-Serial4/0/0]nat outbound 2000

 5.在ABR设备上做区域汇总

[r3]ospf
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0

6.在r12上做双向重发布 

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

7.所有设备此时均可访问ISP的环回

[r1]ping 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=254 time=60 ms
    Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=254 time=50 ms
    Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=254 time=50 ms
    Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=254 time=40 ms
    Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=254 time=40 ms

  --- 4.4.4.4 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 40/48/60 ms
[r12-ospf-1]ping -a 172.16.160.1 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=253 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=253 time=20 ms
    Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=253 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=253 time=20 ms
    Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=253 time=30 ms

  --- 4.4.4.4 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/26/30 ms

四,减少LSA的更新量,加快收敛,保障更新安全;

1.减少LSA更新量(特殊区域)

a 1区域(末梢区域)

[r1-ospf-1-area-0.0.0.1]stub
[r2-ospf-1-area-0.0.0.1]stub
[r3-ospf-1-area-0.0.0.1]stub no-summary

a 2区域(非完全末梢区域) 

[r6-ospf-1-area-0.0.0.2]nssa no-summary 
[r11-ospf-1-area-0.0.0.2]nssa
[r12-ospf-1-area-0.0.0.2]nssa

2.加速收敛(修改hello时间)

[r1-GigabitEthernet0/0/0]ospf timer hello 5

3.保障更新安全(区域认证) 

[r1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[r5-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[r6-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[r6-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123456
[r7-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[r7-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123456
[r7-ospf-1-area-0.0.0.3]vlink-peer 9.9.9.9 md5 1 cipher 123456
[r8-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123456
[r9-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123456
[r9-ospf-1-area-0.0.0.4]authentication-mode md5 1 cipher 123456
[r9-ospf-1-area-0.0.0.3]vlink-peer 7.7.7.7 md5 1 cipher 123456
[r10-ospf-1-area-0.0.0.4]authentication-mode md5 1 cipher 123456
[r11-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123456
[r12-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123456

五,全网可达

[r12-ospf-1-area-0.0.0.2]ping -a 172.16.160.1 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=253 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=253 time=20 ms
    Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=253 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=253 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=253 time=30 ms

  --- 4.4.4.4 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/28/30 ms

[r12-ospf-1-area-0.0.0.2]ping -a 172.16.176.1 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=253 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=253 time=20 ms
    Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=253 time=20 ms
    Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=253 time=40 ms
    Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=253 time=20 ms

  --- 4.4.4.4 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/26/40 ms
<r10>ping -a 172.16.129.1 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=252 time=50 ms
    Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=252 time=40 ms
    Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=252 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=252 time=30 ms
    Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=252 time=40 ms

  --- 4.4.4.4 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/38/50 ms

  • 1
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
OSPF(开放最短路径优先)是一种用于路由的动态路由协议,它是根据路由器之间的链路状态来计算最短路径的。 在一个OSPF综合实验案例中,可以模拟一个复杂的网络拓扑,包括多个路由器和连接它们的链路。假设有5个路由器A、B、C、D和E,它们之间通过不同的链路相连。 首先,需要配置每个路由器上的OSPF进程,并为它们分配一个路由器ID。然后,在每个链路上配置正确的IP地址和子网掩码。接下来,通过在OSPF进程中启用不同的区域,将路由器分成不同的区域。 然后,需要配置每个路由器之间的OSPF邻居关系。这可以通过指定邻居的路由器ID和链路上的IP地址来完成。路由器之间的邻居关系建立后,它们将开始交换链路状态信息(LSA)。 每个路由器将根据接收到的LSA计算自己的链路状态数据库(LSDB)。然后,通过运行Dijkstra算法,每个路由器将计算出到达其他路由器的最短路径。最后,每个路由器将根据最短路径选择相应的接口进行路由。 在这个实验案例中,还可以模拟链路故障的情况,观察OSPF的快速收敛性。当某个链路出现故障时,路由器将发送通告信息给邻居,通知它们链路状态已经改变。邻居将更新自己的LSDB,并重新计算最短路径。 通过这个综合实验案例,可以深入了解OSPF协议的工作原理和功能。同时,还可以通过观察实验结果,了解OSPF在网络中的优势和效率。这些知识和经验将帮助网络工程师更好地设计、优化和故障排除复杂的网络拓扑。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Gur.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值