auto-cost reference-bandwidth命令的使用

本文探讨了OSPF中auto-cost reference-bandwidth命令的作用及度量值计算方法,并通过实验验证了不同带宽下的计算结果。

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

在远程实验中,router ospf 1
                  auto-cost reference-bandwidth 10000

show ip ospf interface s1/s0

发现它的值是6476,好像不符合10∧8/bandwidth.

WHY?

3月11日:

我又在RACK10中做了一些实验,发现auto-cost reference-bandwidth 10000大概
是这个意思:(10000×(10∧6))/bandwidth,这个bandwidth即是sh inter e0/s0所查到的带宽。因此,show ip ospf interface s1
即(10000×(10∧6))/1544K=6476;
show ip ospf interface e0  即(10000×(10∧6))/(10∧7)=1000。

不知这个理解是否正确?

LKP:auto-cost reference-bandwidth 这个命令是改变OSPF的metric计算方式,缺省的值是100,代表100M/BW,因为s0接口缺省的带宽是1.544M,所以,正常计算结果是64.76,METRIC只能取整,所以是64。
但是你已经调了 auto-cost reference-bandwidth 为10000M,那么就是10000M/BW=6476。你的理解是对的,但是配置的时候注意必须在OSPF整个AS里面的每台路由器上都要配置,保持一致性。  

                                                                                                                                            ——从ccs的博客转过来的

我自己的:

在路由进程下修改会提示

R4(config-router)#auto-cost reference-bandwidth 10000
% OSPF: Reference bandwidth is changed.
        Please ensure reference bandwidth is consistent across all routers.

show ip ospf interface s1/0 的结果

R4#show ip ospf interface s1/0
Serial1/0 is up, line protocol is up
  Internet Address 14.1.1.4/24, Area 0
  Process ID 1, Router ID 192.168.1.1, Network Type POINT_TO_POINT, Cost: 6476
  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:07
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 172.16.1.1
  Suppress hello for 0 neighbor(s)

只修改一台路由器并不影响连通性,我还用clear ip ospf process清了进程。

只是两边的度量值不一样而已。

R4#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/32 is subnetted, 1 subnets
O       172.16.1.1 [110/6477] via 14.1.1.1, 00:00:03, Serial1/0
C    192.168.1.0/24 is directly connected, Loopback0
     14.0.0.0/24 is subnetted, 1 subnets
C       14.1.1.0 is directly connected, Serial1/0
R4#ping 172.16.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/91/120 ms

R1(config-router)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.1.0 is directly connected, Loopback0
     192.168.1.0/32 is subnetted, 1 subnets
O       192.168.1.1 [110/65] via 14.1.1.4, 00:00:23, Serial1/0
     14.0.0.0/24 is subnetted, 1 subnets
C       14.1.1.0 is directly connected, Serial1/0
R1(config-router)#do ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/66/112 ms

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值