关于OSPF实验题

文章详细描述了一个OSPF网络环境的配置过程,涉及区域划分、DR/BDR选举策略,以及如何确保全网可达性和安全性,包括设置默认路由和MD5认证。通过实例展示了如何配置路由器以实现网络通信和验证连接效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

题目:

题目分析:

由题可知:有两个广播域,三个回环,一条骨干链路,区域0需要一个网段,需要划分5个网段

骨干链路(由于上面只需要两个主机,所以使网络号为30):

192.168.1.0/30

区域0(只需要三个地址):

192.168.1.0101  0001    192.168.1.81/28

192.168.1.0101  0010     192.168.1.82/28

192.168.1.0101  0011     192.168.1.83/28

环回

192.168.1.0001 0001  192.168.1.17/28

192.168.1.0010 0001  192.168.1.33/28

192.168.1.0011 0001   192.168.1.49/28

如图:

第一步:基础配置

此处省略

第二步:启用ospf

笔记参考:

[R1]ospf 1 router-id 1.1.1.1  创建ospf 进程为1 RID为 1.1.1.1

[R1-ospf-1]area 0  定义进入0区域

[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0

[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255

反掩码

<R1>display ospf peer   查看详细邻居关系

<R1>display ospf peer brief  查看邻居表

<R1>display  ospf lsdb  查看数据库目录

<R1>display ospf lsdb router 2.2.2.2  打开数据库表中的具体路由信息

[R1-ospf-1]bandwidth-reference 1000  修改参考带宽为1000M

注意:一旦修改带宽,全网设备均需修改

对R1,R2:

[r1]ospf 1 router-id 1.1.1.1 
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.81 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.17 0.0.0.0 

[r2]ospf 1 router-id 2.2.2.2 
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.1.49 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 192.168.1.83 0.0.0.0

对R3:

[r3]ospf 1 ro 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.1.82 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 192.168.1.33 0.0.0.0      //宣告区域0内的接口

[r3-ospf-1-area-0.0.0.0]q
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 192.168.1.1 0.0.0.0        //宣告区域1内的接口

对R4:

[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 1
[r4-ospf-1-area-0.0.0.1]network 192.168.1.2 0.0.0.0

第三步:设置DR

要求R1-R3中,R3为DR设备,且R1-R3中没有BDR设备。

选举DR/BDR的规则为:

        1.先比较该网段所有参选设备接口的优先级,越大越优;

           默认优先级为1;取值范围0-255,0标识不参选

        2.若所有参选者优先级相同,比较参选设备的RID,数值大优

所以在区域0中R3是DR(Master),R2是BDR(Master)

选举DR/BDR默认优先级为1,所以将R1、R2的优先级设置为0,将R3的优先级设置为2;

ospf的选举是非抢占性的;故在修改完优先级后,需要所有路由器重启OSPF进程。

下列为R3的配置:

[r3]display ospf peer
 
         OSPF Process 1 with Router ID 3.3.3.3
                 Neighbors 
 
 Area 0.0.0.0 interface 192.168.1.82(GigabitEthernet0/0/0)'s neighbors
 Router ID: 1.1.1.1          Address: 192.168.1.81    
   State: Full  Mode:Nbr is  Slave  Priority: 0
   DR: 192.168.1.82  BDR: None   MTU: 0    
   Dead timer due in 33  sec 
   Retrans timer interval: 5 
   Neighbor is up for 00:02:18     
   Authentication Sequence: [ 0 ] 
 Router ID: 2.2.2.2          Address: 192.168.1.83    
   State: Full  Mode:Nbr is  Slave  Priority: 0
   DR: 192.168.1.82  BDR: None   MTU: 0    
   Dead timer due in 33  sec 
   Retrans timer interval: 5 
   Neighbor is up for 00:02:28     
   Authentication Sequence: [ 0 ] 
                 Neighbors 
 Area 0.0.0.1 interface 192.168.1.1(GigabitEthernet0/0/1)'s neighbors
 Router ID: 4.4.4.4         Address: 192.168.1.2     
   State: Full  Mode:Nbr is  Master  Priority: 1
   DR: 192.168.1.2  BDR: 192.168.1.1  MTU: 0    
   Dead timer due in 35  sec 
   Retrans timer interval: 5 
   Neighbor is up for 00:03:04     
   Authentication Sequence: [ 0 ] 

第四步:汇总

ospf协议不支持接口汇总;只能在ABR上将a区域拓扑计算所得路由,共享给B区域时进行汇总

分析拓扑图,得知R3是区域0到区域1的ABR(区域边界路由器),则在R3中进行配置

第五步:配置缺省路由

第六步:

要求:全网可达的同时,路由器之间更新安全。

在直连邻居或邻接的接口上配置,保障更新的安全。

而区域0中R1-R3都是直连邻居或邻接的接口,所以认证码要一致,而区域1中只要求R3和R4之间认证码相同

区域0:

[r2-GigabitEthernet0/0/0]ospf authentication-mode md5  1 cipher 123
[r3-GigabitEthernet0/0/0]ospf authentication-mode md5  1 cipher 123

区域1:

[r3-GigabitEthernet0/0/1]ospf authentication-mode md5  1 cipher 124
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5  1 cipher 124

测试:

[r1]ping 4.4.4.1
  PING 4.4.4.1: 56  data bytes, press CTRL_C to break
    Reply from 4.4.4.1: bytes=56 Sequence=1 ttl=254 time=50 ms
    Reply from 4.4.4.1: bytes=56 Sequence=2 ttl=254 time=70 ms
    Reply from 4.4.4.1: bytes=56 Sequence=3 ttl=254 time=40 ms
    Reply from 4.4.4.1: bytes=56 Sequence=4 ttl=254 time=40 ms
    Reply from 4.4.4.1: bytes=56 Sequence=5 ttl=254 time=50 ms
 
  --- 4.4.4.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 40/50/70 ms
 
 
[r1]ping 192.168.1.49
  PING 192.168.1.49: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.49: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 192.168.1.49: bytes=56 Sequence=2 ttl=255 time=60 ms
    Reply from 192.168.1.49: bytes=56 Sequence=3 ttl=255 time=60 ms
    Reply from 192.168.1.49: bytes=56 Sequence=4 ttl=255 time=40 ms
    Reply from 192.168.1.49: bytes=56 Sequence=5 ttl=255 time=40 ms
 
  --- 192.168.1.49 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 40/48/60 ms
 
 
 
[r1]ping 192.168.1.82
  PING 192.168.1.82: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.82: bytes=56 Sequence=1 ttl=255 time=50 ms
    Reply from 192.168.1.82: bytes=56 Sequence=2 ttl=255 time=40 ms
    Reply from 192.168.1.82: bytes=56 Sequence=3 ttl=255 time=70 ms
    Reply from 192.168.1.82: bytes=56 Sequence=4 ttl=255 time=40 ms
    Reply from 192.168.1.82: bytes=56 Sequence=5 ttl=255 time=60 ms
 
  --- 192.168.1.82 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 40/52/70 ms

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值