show interface counters 查看的是从上一次清除计数器之后到当前时间统计的一个数值,是不断累计的,Octets反应的也是累计的字节数(单位byte),如果要转换为KB那么只需除以1024即可,转换为MB再次除以1024,以此类推
show interface t1/1 中的 xxxx packets input/ packets output 是上面 对应的ucast+mcast+Bcast 的和
TEST-C3560x#sh int t1/1 counters Port InOctets InUcastPkts InMcastPkts InBcastPkts Te1/1 57433969236673 179954154943 901404033 109337015 Port OutOctets OutUcastPkts OutMcastPkts OutBcastPkts Te1/1 273766597900976 272644695974 17117261 17551603 TEST-C3560x#sh int t1/1 | in bytes MTU 1500 bytes, BW 10000000 Kbit, DLY 10 usec, 180965408293 packets input, 57434203680985 bytes, 0 no buffer 272680110725 packets output, 273767313380298 bytes, 0 underruns TEST-C3560x#
如果需要查看端口实时的流量,可以通过show interface InterfaceName | in rate 查看,这个反应的是该接口的实时流量情况(默认是5分钟的平均值,可以通过接口命令:load-interval 60 进行修改1分钟,单位为秒,也可修改为30-300之间的其他值),数据的单位是bit/sec即bps,如果需要转换为Kb(Kpbs), Mb(Mbps),则需要分别除以一个1000和两个1000来进行转换。
我想你要查看流量,应该是看这一种吧
TEST-C3560x#sh int t1/1 | in rate Queueing strategy: fifo 5 minute input rate 114545000 bits/sec, 44927 packets/sec ---> 114545 Kbps, 114.545 Mbps 5 minute output rate 563952000 bits/sec, 69844 packets/sec ---> 563952 Kbps, 563.952 Mbps TEST-C3560x#
附:修改load-interval的 示例
TEST-PoE#sh run int g1/0/1 Building configuration... Current configuration : 114 bytes ! interface GigabitEthernet1/0/1 switchport access vlan 10 switchport mode access spanning-tree portfast end TEST-PoE#conf t Enter configuration commands, one per line. End with CNTL/Z. TEST-PoE(config)#int g1/0/1 TEST-PoE(config-if)#load-interval ? <30-600> Load interval delay in seconds TEST-PoE(config-if)#load-interval 60 TEST-PoE(config-if)#do sh run int g1/0/1 Building configuration... Current configuration : 132 bytes ! interface GigabitEthernet1/0/1 switchport access vlan 10 switchport mode access load-interval 60 spanning-tree portfast end TEST-PoE(config-if)#do sh int g1/0/1 | in rate Queueing strategy: fifo 1 minute input rate 0 bits/sec, 0 packets/sec 1 minute output rate 0 bits/sec, 0 packets/sec TEST-PoE(config-if)#
ilay
show interface counters 查看的是从上一次清除计数器之后到当前时间统计的一个数值,是不断累计的,Octets反应的也是累计的字节数(单位byte),如果要转换为KB那么只需除以1024即可,转换为MB再次除以1024,以此类推
show interface t1/1 中的 xxxx packets input/ packets output 是上面 对应的ucast+mcast+Bcast 的和
TEST-C3560x#sh int t1/1 counters Port InOctets InUcastPkts InMcastPkts InBcastPkts Te1/1 57433969236673 179954154943 901404033 109337015 Port OutOctets OutUcastPkts OutMcastPkts OutBcastPkts Te1/1 273766597900976 272644695974 17117261 17551603 TEST-C3560x#sh int t1/1 | in bytes MTU 1500 bytes, BW 10000000 Kbit, DLY 10 usec, 180965408293 packets input, 57434203680985 bytes, 0 no buffer 272680110725 packets output, 273767313380298 bytes, 0 underruns TEST-C3560x#
如果需要查看端口实时的流量,可以通过show interface InterfaceName | in rate 查看,这个反应的是该接口的实时流量情况(默认是5分钟的平均值,可以通过接口命令:load-interval 60 进行修改1分钟,单位为秒,也可修改为30-300之间的其他值),数据的单位是bit/sec即bps,如果需要转换为Kb(Kpbs), Mb(Mbps),则需要分别除以一个1000和两个1000来进行转换。
我想你要查看流量,应该是看这一种吧
TEST-C3560x#sh int t1/1 | in rate Queueing strategy: fifo 5 minute input rate 114545000 bits/sec, 44927 packets/sec ---> 114545 Kbps, 114.545 Mbps 5 minute output rate 563952000 bits/sec, 69844 packets/sec ---> 563952 Kbps, 563.952 Mbps TEST-C3560x#
附:修改load-interval的 示例
TEST-PoE#sh run int g1/0/1 Building configuration... Current configuration : 114 bytes ! interface GigabitEthernet1/0/1 switchport access vlan 10 switchport mode access spanning-tree portfast end TEST-PoE#conf t Enter configuration commands, one per line. End with CNTL/Z. TEST-PoE(config)#int g1/0/1 TEST-PoE(config-if)#load-interval ? <30-600> Load interval delay in seconds TEST-PoE(config-if)#load-interval 60 TEST-PoE(config-if)#do sh run int g1/0/1 Building configuration... Current configuration : 132 bytes ! interface GigabitEthernet1/0/1 switchport access vlan 10 switchport mode access load-interval 60 spanning-tree portfast end TEST-PoE(config-if)#do sh int g1/0/1 | in rate Queueing strategy: fifo 1 minute input rate 0 bits/sec, 0 packets/sec 1 minute output rate 0 bits/sec, 0 packets/sec TEST-PoE(config-if)#
ilay