OSPF综合实验

 如有错误,敬请谅解!

此文章仅为本人学习笔记,仅供参考,如有冒犯,请联系作者删除!!!

实验拓扑图:

1.根据题意可知,需要基于172.16.0.0/16划分六个网段

172.16.0.0/19---a0
       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.8.0/29
                 172.16.16.0/29
                  ......
       172.16.2.0/24
       172.16.3.0/24
        .......

172.16.32.0/19---a1

......

172.16.64.0/19---a2

.....

172.16.96.0/19---a3

......

172.16.128.0/19---a4

......

172.16.160.0/19---rip
       172.16.160.0/20
       172.16.176.0/20
        ......

2.R1上配置

# 配置接口IP
interface GigabitEthernet0/0/0
 ip address 172.16.1.65 255.255.255.192 
#
interface LoopBack0
 ip address 172.16.1.1 255.255.255.192 
# 启动OSPF宣告所有接口
ospf 1 router-id 1.1.1.1 
 area 0.0.0.1 
  network 172.16.1.0 0.0.0.255

3.R2上配置

# 配置接口IP
interface GigabitEthernet0/0/0
 ip address 172.16.1.66 255.255.255.192 
#
interface LoopBack0
 ip address 172.16.128.1 255.255.252.0 
# 启动OSPF进程宣告所有接口
ospf 1 router-id 2.2.2.2 
 area 0.0.0.1 
  network 172.16.1.0 0.0.0.255

4.R3上配置

# 配置接口IP
interface Serial4/0/0
 link-protocol ppp
 ip address 34.1.1.1 255.255.255.0 
 nat outbound 2000 
#
interface GigabitEthernet0/0/0
 ip address 172.16.1.67 255.255.255.192 
#
interface LoopBack0
 ip address 172.16.1.193 255.255.255.192 
# 创建tunnel口,搭建MGRE环境
interface Tunnel0/0/0
 ip address 172.16.0.1 255.255.255.192 
 tunnel-protocol gre p2mp
 source 34.1.1.1
 ospf network-type p2mp 
 nhrp entry multicast dynamic
 nhrp network-id 100
# 启动OSPF进程
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 172.16.0.0 0.0.0.255 
 area 0.0.0.1 
  abr-summary 172.16.1.0 255.255.255.0 
  network 172.16.1.0 0.0.0.255 
  stub no-summary
# 缺省路由指向ISP
ip route-static 0.0.0.0 0.0.0.0 34.1.1.2
ip route-static 172.16.1.0 255.255.255.0 null0

5.R4上配置

# R4上只配置接口IP
interface Serial2/0/0
 link-protocol ppp
 ip address 34.1.1.2 255.255.255.0 
#
interface Serial2/0/1
 link-protocol ppp
 ip address 54.1.1.2 255.255.255.0 
#
interface Serial3/0/0
 link-protocol ppp
 ip address 64.1.1.2 255.255.255.0 
#
interface GigabitEthernet0/0/0
 ip address 74.1.1.2 255.255.255.0 
#
interface LoopBack0
 ip address 8.8.8.8 255.255.255.0 

6.R5上配置

# 配置接口IP
interface Serial4/0/0
 link-protocol ppp
 ip address 54.1.1.1 255.255.255.0 
#
interface LoopBack0
 ip address 172.16.0.65 255.255.255.192 
# 创建tunne口,搭建MGRE环境
interface Tunnel0/0/0
 ip address 172.16.0.2 255.255.255.192 
 tunnel-protocol gre p2mp
 source Serial4/0/0
 ospf network-type p2mp 
 nhrp network-id 100
 nhrp entry 172.16.0.1 34.1.1.1 register
# 启动ospf进程
ospf 1 router-id 5.5.5.5 
 area 0.0.0.0 
  network 172.16.0.0 0.0.0.255 
# 缺省路由和空接口路由
ip route-static 0.0.0.0 0.0.0.0 54.1.1.2

7.R6上配置

# 使用acl抓取私网流量
acl number 2000  
 rule 5 permit source 172.16.0.0 0.0.255.255 
# 配置接口IP
interface Serial4/0/0
 link-protocol ppp
 ip address 64.1.1.1 255.255.255.0 
 nat outbound 2000 
#
interface GigabitEthernet0/0/0
 ip address 172.16.2.1 255.255.255.192 
#
interface LoopBack0
 ip address 172.16.0.129 255.255.255.192 
# 创建tunne口,搭建MGRE环境
interface Tunnel0/0/0
 ip address 172.16.0.3 255.255.255.192 
 tunnel-protocol gre p2mp
 source Serial4/0/0
 ospf network-type p2mp
 nhrp network-id 100
 nhrp entry 172.16.0.1 34.1.1.1 register
# 启动OSPF进程
ospf 1 router-id 6.6.6.6 
 area 0.0.0.0 
  network 172.16.0.0 0.0.0.255 
 area 0.0.0.2 
  abr-summary 172.16.2.0 255.255.255.0 
  network 172.16.2.0 0.0.0.255 
  nssa no-summary 
# 缺省路由和空接口路由
ip route-static 0.0.0.0 0.0.0.0 64.1.1.2
ip route-static 172.16.2.0 255.255.255.0 null0

8.R7上配置

# 使用acl抓取私网流量
acl number 2000  
 rule 5 permit source 172.16.0.0 0.0.255.255 
# 配置接口IP
interface GigabitEthernet0/0/0
 ip address 74.1.1.1 255.255.255.0 
 nat outbound 2000
#
interface GigabitEthernet0/0/1
 ip address 172.16.3.1 255.255.255.192 
#
interface LoopBack0
 ip address 172.16.0.193 255.255.255.192 
#配置接口IP
interface Tunnel0/0/0
 ip address 172.16.0.4 255.255.255.192 
 tunnel-protocol gre p2mp
 source GigabitEthernet0/0/0
 ospf network-type p2mp
 nhrp network-id 100
 nhrp entry 172.16.0.1 34.1.1.1 register
# 启动OSPF进程
ospf 1 router-id 7.7.7.7 
 area 0.0.0.0 
  network 172.16.0.0 0.0.0.255 
 area 0.0.0.3 
  abr-summary 172.16.3.0 255.255.255.0
  network 172.16.3.0 0.0.0.255 
  nssa no-summary 
# 缺省路由和空接口路由
ip route-static 0.0.0.0 0.0.0.0 74.1.1.2
ip route-static 172.16.3.0 255.255.255.0 null0  

9.R8上配置

# 配置接口IP
interface GigabitEthernet0/0/0
 ip address 172.16.3.2 255.255.255.192 
#
interface GigabitEthernet0/0/1
 ip address 172.16.3.129 255.255.255.192 
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 172.16.3.65 255.255.255.192 
# 启动OSPF进程
ospf 1 router-id 8.8.8.8 
 area 0.0.0.3 
  network 172.16.3.0 0.0.0.255 

10.R9上配置

# 配置接口IP
interface GigabitEthernet0/0/0
 ip address 172.16.3.130 255.255.255.192 
#
interface GigabitEthernet0/0/1
 ip address 172.16.4.65 255.255.255.192 
#
interface LoopBack0
 ip address 172.16.4.1 255.255.255.192 
# 启动OSPF进程1
ospf 1 router-id 9.9.9.9 
 asbr-summary 172.16.4.0 255.255.255.0 
 import-route ospf 2
 area 0.0.0.3 
  network 172.16.3.0 0.0.0.255 
  nssa --- 配置该区域为NSSA
# 启动OSPF进程2
ospf 2 router-id 9.9.9.9 
 asbr-summary 0.0.0.0 0.0.0.0 
 import-route ospf 1
 area 0.0.0.4 
  network 172.16.4.0 0.0.0.255 

11.R10上配置

# 配置接口IP
interface GigabitEthernet0/0/0
 ip address 172.16.4.66 255.255.255.192 
#
interface LoopBack0
 ip address 172.16.4.129 255.255.255.192 
# 启动OSPF进程
ospf 1 router-id 10.10.10.10 
 area 0.0.0.4 
  network 172.16.4.0 0.0.0.255 

12.R11上配置

# 配置接口IP
interface GigabitEthernet0/0/0
 ip address 172.16.2.2 255.255.255.192 
#
interface GigabitEthernet0/0/1
 ip address 172.16.2.129 255.255.255.192 
#
interface LoopBack0
 ip address 172.16.2.65 255.255.255.192 
# 启动OSPF进程
ospf 1 router-id 11.11.11.11 
 area 0.0.0.2 
  network 172.16.2.0 0.0.0.255 

13.R12上配置

# 配置接口IP
interface GigabitEthernet0/0/0
 ip address 172.16.2.130 255.255.255.192 
# 
interface LoopBack1
 ip address 172.16.128.1 255.255.255.0 
#
interface LoopBack2
 ip address 172.16.129.1 255.255.255.0 
# 启动OSPF进程
ospf 1 router-id 12.12.12.12 
 asbr-summary 172.16.128.0 255.255.192.0 
 import-route rip 1 
 area 0.0.0.2 
  network 172.16.2.0 0.0.0.255 
  nssa 
# 启动RIP
rip 1
 undo summary
 version 2
 network 172.16.0.0 
 import-route ospf 1

14.测试

R10pingR1

 

 以上过程即为所求,欢迎同行朋友予以斧正!万分感谢! 

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
发出的红包

打赏作者

春光犹上人间

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

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

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

打赏作者

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

抵扣说明:

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

余额充值