怎么样查看OSPF的接口优先级?具体是哪条命令了?

2025-03-13 05:47:42
推荐回答(4个)
回答1:

1、动态路由协议ospf支持明文验证和加密验证。我们这里以三台2811路由器配置。

2、拓扑图中,我们配置路由R1和R2明文验证,R2和R3加密验证。查看R1的直接网络。

3、配置R1的ospfR1(config-if)#router ospf 1R1(config-router)#network 192.168.1.1 0.0.0.0 area 0。

4、查看R2的直接网络R2#sh ip int bri。

5、查看R3的直接网络R3#sh ip int bri。

6、配置R3的ospfR3(config-if)#router ospf 1R2(config-router)#network 192.168.2.2 0.0.0.0 area 0。

回答2:

是show ip ospf interface
至于你没有看到priority,确实是因为接口类型为串行口。
接口优先级(priority)是路由器之间选择DR/BDR的时候用的,谁的优先级大,就会优选。
默认情况下,串行口的ospf类型为点到点,这个情况下,是不需要选择DR和BDR的,所以不需要priority,并不是因为它是0。

例子:(注意括号内的部分【】)
r1#show ip ospf interface ethernet 0/1
Ethernet0/1 is up, line protocol is up
Internet Address 192.168.123.1/24, Area 0
Process ID 100, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 100 广播类型
Transmit Delay is 1 sec, 【State DROTHER, Priority 1】优先级在这里
Designated Router (ID) 3.3.3.3, Interface address 192.168.123.3
Backup Designated router (ID) 2.2.2.2, Interface address 192.168.123.2
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:02
Supports Link-local Signaling (LLS)
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 2, Adjacent neighbor count is 2
Adjacent with neighbor 2.2.2.2 (Backup Designated Router)
Adjacent with neighbor 3.3.3.3 (Designated Router)
Suppress hello for 0 neighbor(s)
r1#
------------------------------------------------------------------------
 ROUTER1#show ip ospf interface serial 1
  
  Serial1 is up, line protocol is up
  
   Internet Address 0.0.0.0/24, Area 0
  
   Process ID 20, Router ID 10.1.2.1, Network Type POINT_TO_POINT, Cost: 64
  
   Transmit Delay is 1 sec, 【State POINT_TO_POINT,】点到点类型 没有优先级
  
   Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
  
  Hello due in 00:00:02
  
   Neighbor Count is 1, Adjacent neighbor count is 1
  
  Adjacent with neighbor 10.1.1.2
  
   Suppress hello for 0 neighbor(s)

回答3:

华为设备 命令:display ospf interface all
[Huawei]display ospf interface all
OSPF 进程 1 路由器标识 1.1.1.1
接口信息
区域: 0.0.0.0
接口: 20.20.20.1 (Vlanif12)
花费: 1 状态: BDR 类型: Broadcast MTU值: 1500
优先级: 200
选举路由器: 20.20.20.2
备份选举路由器: 20.20.20.1
定时器: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
接口: 10.10.10.1 (Vlanif13)
花费: 1 状态: DR 类型: Broadcast MTU值: 1500
优先级: 1
选举路由器: 10.10.10.1
备份选举路由器: 0.0.0.0
定时器: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1

[Huawei]

回答4:

R1(config)#int e0 (修改特定接口的优先级)
R1(config-if)#ip ospf priority 10 (0~255)

show ip ospf interface查看