一、前言
本文为本人自我学习中的一个小笔记,基于思科C2960S交换机的CiscoOS进行说明,
我们通过show int <InterfaceID> ?
可以看到思科CiscoOS下关于show int相关的分支指令参数,如下:
show int Te1/0/1 ?
accounting Show interface accounting
capabilities Show interface capabilities information
controller Show interface status, configuration and controller status
counters Show interface counters
crb Show interface routing/bridging info
dampening Show interface dampening info
debounce Show interface debounce time info
description Show interface description
etherchannel Show interface etherchannel information
fair-queue Show interface Weighted Fair Queueing (WFQ) info
flowcontrol Show interface flowcontrol information
history Show interface history
human-readable show interfaces output with larger numbers separated by comma(s)
irb Show interface routing/bridging info
mac-accounting Show interface MAC accounting info
mpls-exp Show interface MPLS experimental accounting info
mtu Show interface mtu
precedence Show interface precedence accounting info
pruning Show interface trunk VTP pruning information
random-detect Show interface Weighted Random Early Detection (WRED) info
rate-limit Show interface rate-limit info
stats Show interface packets & octets, in & out, by switching path
status Show interface line status
summary Show interface summary
switchport Show interface switchport information
transceiver Show interface transceiver
trunk Show interface trunk information
users Show interface users
vlan Show interface vlan information
本文会对相关的指令进行详细的说明,也作为自己学习之用。
二、指令详细说明
1、accounting参数
该参数的字面意思就是关于端口的统计信息的,执行可以看到详细的端口发包统计等信息:
#show int Te1/0/1 accounting
TenGigabitEthernet1/0/1 to-1m001.38.a1-Ten2/0/6
Protocol Pkts In Chars In Pkts Out Chars Out
Other 0 0 337537 20252220
IP 0 0 423 25380
Spanning Tree 409526230 26189471208 3307 210476
CDP 187660 86135760 187602 95676192
VTP 0 0 1694001 317056348
DTP 337634 20258040 0 0
2、capabilities参数
该参数的字面意思就是关于端口的基础功能信息,执行可以看到如下内容:
#show int Te1/0/1 capabilities
TenGigabitEthernet1/0/1
Model: WS-C2960X-48TD-L
Type: SFP-10GBase-SR
Speed: 10000
Duplex: full
Trunk encap. type: 802.1Q
Trunk mode: on,off,desirable,nonegotiate
Channel: yes
Broadcast suppression: percentage(0-100)
Flowcontrol: rx-(off,on,desired),tx-(none)
Fast Start: yes
QoS scheduling: rx-(not configurable on per port basis),
tx-(4q3t) (3t: Two configurable values and one fixed.)
CoS rewrite: yes
ToS rewrite: yes
UDLD: yes
Inline power: no
SPAN: source/destination
PortSecure: yes
Dot1x: yes
3、controller参数
查看该参数的简单说明可知该参数用于查看端口的状态、配置信息、控制器状态信息等等,执行后可以看到如下信息:
#show int Te1/0/1 controller
========第一部分为基础的端口支持信息与吞吐状态===============
TenGigabitEthernet1/0/1 is up, line protocol is up (connected)
Hardware is Ten Gigabit Ethernet, address is 00b1.e396.80b3 (bia 00b1.e396.80b3)
Description: to-1m001.38.a1-Ten2/0/6
MTU 1500 bytes, BW 10000000 Kbit/sec, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive not set
Full-duplex, 10Gb/s, link type is auto, media type is SFP-10GBase-SR
input flow-control is off, output flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:03, output hang never
Last clearing of "show interface" counters never
Input queue: 1/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 3914000 bits/sec, 702 packets/sec
5 minute output rate 428000 bits/sec, 425 packets/sec
4611038765 packets input, 3771532100116 bytes, 0 no buffer
Received 1468343724 broadcasts (1141826783 multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 1141826783 multicast, 0 pause input
0 input packets with dribble condition detected
2928664842 packets output, 551035900656 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 pause output
0 output buffer failures, 0 output buffers swapped out
=============第二部分可以看到各种frame information================
Transmit TenGigabitEthernet1/0/1 Receive
551035907320 Bytes 472997283569 Bytes
2832094542 Unicast frames 3142695075 Unicast frames
63022573 Multicast frames 1141826934 Multicast frames
33547798 Broadcast frames 326517004 Broadcast frames
0 Too old frames 133393091097 Unicast bytes
0 Deferred frames 283422550049 Multicast bytes
0 MTU exceeded frames 38340170718 Broadcast bytes
0 1 collision frames 0 Alignment errors
0 2 collision frames 0 FCS errors
0 3 collision frames 0 Oversize frames
0 4 collision frames 0 Undersize frames
0 5 collision frames 0 Collision fragments
0 6 collision frames
0 7 collision frames 143731049 Minimum size frames
0 8 collision frames 1358236658 65 to 127 byte frames
0 9 collision frames 296155758 128 to 255 byte frames
0 10 collision frames 409108096 256 to 511 byte frames
0 11 collision frames 104149904 512 to 1023 byte frames
0 12 collision frames 1610527067 1024 to 1518 byte frames
0 13 collision frames 0 Overrun frames
0 14 collision frames 0 Pause frames
0 15 collision frames
0 Excessive collisions 0 Symbol error frames
0 Late collisions 0 Invalid frames, too large
0 VLAN discard frames 689130481 Valid frames, too large
0 Excess defer frames 0 Invalid frames, too small
337624 64 byte frames 0 Valid frames, too small
2546538345 127 byte frames
86358050 255 byte frames 0 Too old frames
46879734 511 byte frames 0 Valid oversize frames
41025942 1023 byte frames 0 System FCS error frames
112730236 1518 byte frames 0 RxPortFifoFull drop frame
94794982 Too large frames
0 Good (1 coll) frames
0 Good (>1 coll) frames
4、counters参数
该参数用于查看端口的Octets/cast等计数信息,执行后输出如下:
#show int Te1/0/1 counters
Port InOctets InUcastPkts InMcastPkts InBcastPkts
Te1/0/1 3771619770692 3142771842 1141867922 326526848
Port OutOctets OutUcastPkts OutMcastPkts OutBcastPkts
Te1/0/1 551045411140 2832170002 63024035 33549199
5、crb参数
这个参数就很简单了,就是查看这个端口的对端连接的主机/交换机名和端口名,执行后输出如下:
#show int Te1/0/1 crb
TenGigabitEthernet1/0/1 to-1m001.38.a1-Ten2/0/6
6、dampening参数
用于查看端口的IP事件抑制信息,由于手头的交换机暂时没有配置相关设置,所以没有输出信息。该功能一般用于运营商网络优化策略或者超大型IDC的网络优化策略中,相关运行模式介绍如下:
当端口被人为关闭或开启,或者受外在因素影响端口状态会发生转变。当端口状态发生翻动(持续up,down)时,路由协议会被告知有哪些路由受到影响。
在一个网络中所有受到影响的设备需要重新计算最优路径,在路由表中添加或者删除路由,最后向邻居通告有效路由。
过多的接口状态变化会导致网络设备消耗巨大的系统资源用于重新计算路径,而且会造成路由协议与端口状态不同步。
IP事件抑制机制引进可控的指数衰减机制来抑制端口过度翻动多所带来的影响。
利用这个机制,网络运维人员可以配置路由器使之自动识别并且有针对性的抑制翻动的端口。
抑制一个翻动端口意味着将其移除网络,路由协议在计算最优路径时不会考虑该端口,也不会在该端口上建立邻居。
当被抑制端口不在翻动,稳定时,该机制会取消惩罚,恢复这个端口在网络中的地位。
使用 IP Event Dampening 的好处
1. 减少系统运行负担
2. 更快的收敛速度
3. 网络稳定性更高
使用 IP Event Dampening 的局限性
1. 不追踪子端口状态(换而言之,只能在主端口上应用)
2. 不支持虚拟接入接口
3. 不支持IPX路由协议
以上内容参考自https://blog.csdn.net/ziyuanzhao/article/details/17757683
7、debounce参数
debounce参数主要也是用于网络环境的稳定,简单来说就是多个信号合并成一个稳定的型号,减少波动的影响。
8、description参数
用于查看端口的综合描述信息,输出类似于:
#show int Te1/0/1 description
Interface Status Protocol Description
Te1/0/1 up up to-1m001.38.a1-Ten2/0/6
9、etherchannel参数
用于查看端口的etherchannel参数。
10、fair-queue参数
用于查看端口的WFQ信息。
11、flowcontrol参数
用于查看端口的流控信息,输出内容如下:
#show int Te1/0/1 flowcontrol
Port Send FlowControl Receive FlowControl RxPause TxPause
admin oper admin oper
--------- -------- -------- -------- -------- ------- -------
Te1/0/1 Unsupp. Unsupp. off off 0 0
12、history参数
查看端口的history信息,包含如下的子参数:
#show int Te1/0/1 history ?
60min Display 60 minute histograms only
60sec Display 60 second histograms only
72hour Display 72 hour histograms only
all Display all three histogram intervals
both Display both input and output histograms
input Display input histograms only
output Display output histograms only
| Output modifiers
<cr>
13、human-readable参数
使用易于人类阅读的方式呈现端口状态与计数,输出内容如下:
#show int Te1/0/1 human-readable
TenGigabitEthernet1/0/1 is up, line protocol is up (connected)
Hardware is Ten Gigabit Ethernet, address is 00b1.e396.80b3 (bia 00b1.e396.80b3)
Description: to-1m001.38.a1-Ten2/0/6
MTU 1500 bytes, BW 10000000 Kbit/sec, DLY 10 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive not set
Full-duplex, 10Gb/s, link type is auto, media type is SFP-10GBase-SR
input flow-control is off, output flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 3.97 mega-bits/sec , 677 pps
5 minute output rate 418.0 kilobits , 457 pps
4,618,294,969 packets input, 3,776,515,245,249 bytes, 0 no buffer
Received 1,471,134,116 broadcasts (1,143,876,593 multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 1,143,876,593 multicast, 0 pause input
0 input packets with dribble condition detected
2,933,697,259 packets output, 552,450,663,378 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 pause output
0 output buffer failures, 0 output buffers swapped out
14、irb参数
用于查看端口的链路和桥接信息,输入信息如下:
#show int Te1/0/1 irb
TenGigabitEthernet1/0/1 to-1m001.38.a1-Ten2/0/6
15、mac-accounting参数
查看端口的MAC统计信息。
16、mpls-exp参数
查看端口的MPLS实验统计信息。
17、mtu参数
查看端口的MTU(最大传输单元)设置信息,输出内容如下:
#show int Te1/0/1 mtu
Port Name MTU
Te1/0/1 to-1m001.38.a1-Ten 1500
18、precedence参数
查看端口的precedence统计参数。
19、pruning参数
其实主要用于查看端口的vlan修饰请求和通信请求信息。输出大致如下,显示可以看到该端口被其他端口所请求的vlan段信息。
#show int Te1/0/1 pruning
Port Vlans pruned for lack of request by neighbor
Te1/0/1 none
Port Vlan traffic requested of neighbor
Te1/0/1 1,101,201-202,670,702,705,801,888
20、random-detect参数
用于显示端口的界面加权随机早期检测(WRED)信息
21、rate-limit参数
显示端口的速率限制信息
22、stats参数
根据交换机路径查看端口的各种发包数信息。
#show int Te1/0/1 stats
TenGigabitEthernet1/0/1
Switching path Pkts In Chars In Pkts Out Chars Out
Processor 0 0 2225842 442703098
Route cache 0 0 0 0
Total 0 0 2225842 442703098
23、status参数
查看端口的连接线材信息
#show int Te1/0/1 status
Port Name Status Vlan Duplex Speed Type
Te1/0/1 to-1m001.38.a1-Ten connected trunk full 10G SFP-10GBase-SR
#show int Te1/0/1 status err-disabled
Port Name Status Reason Err-disabled Vlans
Te1/0/1 to-1m001.38.a1-Ten connected none
#show int Te1/0/1 status inactive
Port Name Status Reason
Te1/0/1 to-1m001.38.a1-Ten connected none
24、summary参数
用于查看端口的概况
#show int Te1/0/1 summary
*: interface is up
IHQ: pkts in input hold queue IQD: pkts dropped from input queue
OHQ: pkts in output hold queue OQD: pkts dropped from output queue
RXBS: rx rate (bits/sec) RXPS: rx rate (pkts/sec)
TXBS: tx rate (bits/sec) TXPS: tx rate (pkts/sec)
TRTL: throttle count
Interface IHQ IQD OHQ OQD RXBS RXPS TXBS TXPS TRTL
-----------------------------------------------------------------------------------------------------------------
* Te1/0/1 0 0 0 0 3361000 625 373000 372 0
25、switchport参数
查看接口的交换机端口信息。输出内容如下:
#show int Te1/0/1 switchport
Name: Te1/0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
26、transceiver信息
重要参数!用于查看端口的光衰信息等模块状态信息,用于判断链路的连接状态和光模块运作状态,在现在交换机端口检测中很重要。
detail用于查看光衰减dBm信息,properties用于查看整体简要配置信息。
#show int Te1/0/1 transceiver detail
ITU Channel not available (Wavelength not available),
Transceiver is internally calibrated.
mA: milliamperes, dBm: decibels (milliwatts), NA or N/A: not applicable.
++ : high alarm, + : high warning, - : low warning, -- : low alarm.
A2D readouts (if they differ), are reported in parentheses.
The threshold values are calibrated.
High Alarm High Warn Low Warn Low Alarm
Temperature Threshold Threshold Threshold Threshold
Port (Celsius) (Celsius) (Celsius) (Celsius) (Celsius)
--------- ------------------ ---------- --------- --------- ---------
Te1/0/1 29.4 75.0 70.0 0.0 -5.0
High Alarm High Warn Low Warn Low Alarm
Voltage Threshold Threshold Threshold Threshold
Port (Volts) (Volts) (Volts) (Volts) (Volts)
--------- --------------- ---------- --------- --------- ---------
Te1/0/1 3.33 3.63 3.46 3.13 2.97
Optical High Alarm High Warn Low Warn Low Alarm
Transmit Power Threshold Threshold Threshold Threshold
Port (dBm) (dBm) (dBm) (dBm) (dBm)
--------- ----------------- ---------- --------- --------- ---------
Te1/0/1 -2.2 1.7 -1.3 -7.3 -11.3
Optical High Alarm High Warn Low Warn Low Alarm
Receive Power Threshold Threshold Threshold Threshold
Port (dBm) (dBm) (dBm) (dBm) (dBm)
------- ----------------- ---------- --------- --------- ---------
Te1/0/1 -3.4 2.0 -1.0 -9.9 -13.9
#show int Te1/0/1 transceiver properties
ITU Channel not available (Wavelength not available),
Transceiver is internally calibrated.
Name : Te1/0/1
Administrative Speed: 10000
Administrative Duplex: full
Administrative Auto-MDIX: on
Administrative Power Inline: N/A
Operational Speed: 10000
Operational Duplex: full
Operational Auto-MDIX: off
Media Type: SFP-10GBase-SR
27、trunk参数
用于查看端口的trunk配置信息和相关的multi-vlan信息。
#show int Te1/0/1 trunk
Port Mode Encapsulation Status Native vlan
Te1/0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Te1/0/1 1-4094
Port Vlans allowed and active in management domain
Te1/0/1 1-5,101-105,111-113,201-205,300,411-414,420,430,440,450,460,601-606,610,620,630,640,650,660,670-672,680,701-707,710-711,720,730,740,750,760,770-778,801-802,810,888,901-910,1001
Port Vlans in spanning tree forwarding state and not pruned
Te1/0/1 1-5,101-105,111-113,201-205,300,411-414,420,430,440,450,460,601-606,610,620,630,640,650,660,670-672,680,701-707,710-711,720,730,740,750,760,770-778,801-802,810,888,901-910,1001
28、user参数
用于查看当前接口的user信息。
29、vlan参数
使用vlan mapping
指令查看接口的vlan mapping信息。