16.1网络诊断命令
16.1.1ping
命令功能
使用该命令来检测到一个网络内的某个主机的可达性以及统计信息。一般会有几种结果,如:目标不可达;网段不可达;主机不可达;端口不可达;超时。该命令可以在公网内或VRF内使用。
命令语法
ping ( ip | mgmt-if ) WORD
ping ( vrf WORD | ) [ -a WORD | -si IFNAME | -m INTERVAL | -c COUNT | -s DATASIZE | -f | -tos TOS | -h TTL | -t TIMEOUT ] WORD
ping ( mgmt-if | vrf WORD | ) ipv6 [ -a WORD | -m INTERVAL | -c COUNT | -s DATASIZE | -tc TC | -h HL | -t TIMEOUT ] WORD ( interface IFNAME | )
参数 |
参数说明 |
参数取值 |
-a WORD |
指定源IP地址,默认为出端口的IP地址 |
- |
-si IFNAME |
指定ping报文的源端口 |
支持 physical/aggregation/loopback/tunnel/vlan 端口 |
ip |
普通IPv4网络 |
- |
vrf WORD |
VRF网络名称 |
不超过31个字符的字符串 |
mgmt-if |
管理口 |
- |
WORD |
要检测的主机地址,支持IPv4和IPv6地址 |
- |
ipv6 |
普通IPv6网络 |
- |
interface |
指定出接口LinkLocal地址 |
- |
IFNAME |
接口名 |
支持 physical/aggregation/loopback/tunnel/vlan 端口 |
-m INTERVAL |
指定报文发送间隔,单位是毫秒 |
10-10000 毫秒 |
-c COUNT |
指定发送报文数量 |
1-4294967295 |
-s DATASIZE |
指定发送报文的数据部分长度,单位是字节 |
20-9600 字节 |
-f |
指定发送的报文不分片 |
- |
-tos TOS |
指定报文中tos值,范围是0~255 |
0-255 |
-h TTL |
指定报文中ttl值,范围是1~255 |
1-255 |
-tc TC |
指定报文中Traffic Class的值,范围是0~255 |
0-255 |
-h HL |
指定报文中Hop Limit的值,范围是1~255 |
1-255 |
-t TIMEOUT |
指定请求报文的超时时间,单位是毫秒 |
0-100 秒(0 表示一直等待) |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面的例子显示了如何在管理口上检测一个主机的可达性
Switch# ping mgmt-if 10.10.29.247
PING 10.10.29.247 (10.10.29.247) 56(84) bytes of data.
64 bytes from 10.10.29.247: icmp_seq=1 ttl=64 time=0.194 ms
64 bytes from 10.10.29.247: icmp_seq=2 ttl=64 time=0.131 ms
64 bytes from 10.10.29.247: icmp_seq=3 ttl=64 time=0.134 ms
64 bytes from 10.10.29.247: icmp_seq=4 ttl=64 time=0.121 ms
64 bytes from 10.10.29.247: icmp_seq=5 ttl=64 time=0.135 ms
--- 10.10.29.247 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3996ms
rtt min/avg/max/mdev = 0.121/0.143/0.194/0.025 ms
相关命令
traceroute
16.1.2traceroute
命令功能
该命令用来查看IPv4 报文从当前设备传到目的设备所经过的路径。
当用户使用ping命令测试发现网络出现故障后,可以用traceroute 命令分析出现故障的网络节点。
命令语法
traceroute ( ip | vrf WORD | mgmt-if | ) WORD
traceroute ( vrf WORD | ) ipv6 WORD
参数 |
参数说明 |
参数取值 |
-a |
指定源IP地址,默认为出端口的IP地址 |
- |
-si |
指定traceroute报文的源端口 |
- |
ip |
普通IPv4网络 |
- |
ipv6 |
普通IPv6网络 |
- |
vrf WORD |
VRF网络 |
- |
mgmt-if |
管理口 |
- |
WORD |
要检测的主机地址,支持IPv4和IPv6地址 |
- |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面的例子显示了如何查看到1.1.1.2这个主机所经过的路径
Switch# traceroute 1.1.1.2
traceroute to 1.1.1.2 (1.1.1.2), 30 hops max, 38 byte packets
1 1.1.1.2 (1.1.1.2) 108.129 ms 99.313 ms 94.720 ms
相关命令
ping
16.1.3show network connections
命令功能
使用此命令查看系统的网络连接状态。
命令语法
show network connections ( ipv4 | ipv6 | all ) ( tcp | udp | raw | all ) ( numeric | )
参数 |
参数说明 |
参数取值 |
ipv4 |
显示 IPv4信息 |
- |
ipv6 |
显示 IPv6信息 |
- |
all |
显示IPv4和IPv6信息 |
- |
tcp |
显示TCP信息 |
- |
udp |
显示UDP信息 |
- |
raw |
显示raw信息 |
- |
all |
显示TCP/UDP/raw信息 |
- |
numeric |
以数值形式显示主机地址和端口号 |
- |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面的例子显示了当前设备的所有连接信息:
Switch# show network connections all all
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost:36602 localhost:705 ESTABLISHED
tcp 0 0 localhost:36620 localhost:705 ESTABLISHED
tcp 0 0 172.16.0.2:6162 172.16.0.3:33806 ESTABLISHED
tcp 0 0 localhost:36592 localhost:705 ESTABLISHED
tcp 0 0 localhost:705 localhost:36644 ESTABLISHED
tcp 0 0 localhost:36644 localhost:705 ESTABLISHED
tcp 0 0 localhost:705 localhost:36602 ESTABLISHED
tcp 0 0 localhost:705 localhost:36672 ESTABLISHED
tcp 0 0 localhost:36640 localhost:705 ESTABLISHED
tcp 0 0 localhost:705 localhost:36652 ESTABLISHED
tcp 0 0 localhost:36648 localhost:705 ESTABLISHED
tcp 0 0 172.16.0.2:6142 172.16.0.3:54560 ESTABLISHED
tcp 0 0 localhost:705 localhost:36588 ESTABLISHED
tcp 0 0 172.16.0.2:6141 172.16.0.3:47144 ESTABLISHED
tcp 0 0 localhost:705 localhost:36624 ESTABLISHED
tcp 0 0 172.16.0.2:33086 172.16.0.3:61002 ESTABLISHED
tcp 0 0 localhost:36660 localhost:705 ESTABLISHED
tcp 0 0 172.16.0.2:6163 172.16.0.3:50578 ESTABLISHED
tcp 0 0 localhost:36596 localhost:705 ESTABLISHED
tcp 0 0 localhost:705 localhost:36664 ESTABLISHED
tcp 0 0 localhost:705 localhost:36632 ESTABLISHED
tcp 0 0 localhost:36632 localhost:705 ESTABLISHED
tcp 0 0 172.16.0.2:6207 172.16.0.3:44778 ESTABLISHED
tcp 0 0 localhost:705 localhost:36592 ESTABLISHED
tcp 0 0 localhost:705 localhost:36636 ESTABLISHED
tcp 0 0 localhost:36616 localhost:705 ESTABLISHED
tcp 0 0 localhost:705 localhost:36608 ESTABLISHED
tcp 0 0 localhost:705 localhost:36668 ESTABLISHED
tcp 0 0 localhost:36668 localhost:705 ESTABLISHED
tcp 0 0 172.16.0.2:6206 172.16.0.3:34718 ESTABLISHED
tcp 0 0 localhost:36604 localhost:705 ESTABLISHED
tcp 0 0 localhost:705 localhost:36620 ESTABLISHED
tcp 0 0 localhost:705 localhost:36612 ESTABLISHED
tcp 0 0 localhost:705 localhost:36604 ESTABLISHED
tcp 0 0 localhost:705 localhost:36640 ESTABLISHED
tcp 0 0 localhost:705 localhost:36596 ESTABLISHED
tcp 0 0 localhost:705 localhost:36660 ESTABLISHED
tcp 0 0 172.16.0.2:6143 172.16.0.3:43080 ESTABLISHED
tcp 0 0 localhost:36636 localhost:705 ESTABLISHED
tcp 0 0 172.16.0.2:6140 172.16.0.3:57812 ESTABLISHED
tcp 0 0 localhost:36652 localhost:705 ESTABLISHED
tcp 0 0 172.16.0.2:6161 172.16.0.3:54938 ESTABLISHED
tcp 0 0 localhost:36588 localhost:705 ESTABLISHED
tcp 0 0 localhost:36624 localhost:705 ESTABLISHED
tcp 0 0 localhost:36628 localhost:705 ESTABLISHED
tcp 0 0 localhost:36672 localhost:705 ESTABLISHED
tcp 0 0 172.16.0.2:6160 172.16.0.3:58726 ESTABLISHED
tcp 0 0 localhost:705 localhost:36616 ESTABLISHED
tcp 0 0 localhost:705 localhost:36648 ESTABLISHED
tcp 0 0 localhost:36656 localhost:705 ESTABLISHED
tcp 0 0 localhost:36608 localhost:705 ESTABLISHED
tcp 0 0 localhost:705 localhost:36628 ESTABLISHED
tcp 0 0 localhost:36612 localhost:705 ESTABLISHED
tcp 0 0 172.16.0.2:6205 172.16.0.3:52156 ESTABLISHED
tcp 0 0 localhost:36664 localhost:705 ESTABLISHED
tcp 0 0 localhost:705 localhost:36656 ESTABLISHED
tcp 0 0 172.16.0.2:6208 172.16.0.3:60470 ESTABLISHED
相关命令
无
16.1.4show network services
命令功能
使用此命令查看系统开启的服务。
命令语法
show network services ( ipv4 | ipv6 | all ) ( tcp | udp | raw | all ) ( numeric | )
参数 |
参数说明 |
参数取值 |
ipv4 |
显示 IPv4信息 |
- |
ipv6 |
显示 IPv6信息 |
- |
all |
显示IPv4和IPv6信息 |
- |
tcp |
显示TCP信息 |
- |
udp |
显示UDP信息 |
- |
raw |
显示raw信息 |
- |
all |
显示TCP/UDP/raw信息 |
- |
numeric |
以数值形式显示主机地址和端口号 |
- |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面例子显示了系统开启的所有服务:
Switch# show network services all all
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:6160 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6161 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6162 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6163 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6140 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6141 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6205 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6142 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6206 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6143 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6207 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6208 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:705 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8100 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 :::23 :::* LISTEN
tcp 0 0 :::23 :::* LISTEN
tcp 0 0 :::23 :::* LISTEN
tcp 0 0 :::61002 :::* LISTEN
udp 0 0 10.13.13.107:123 0.0.0.0:*
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*
udp 0 0 0.0.0.0:3503 0.0.0.0:*
udp 0 0 0.0.0.0:514 0.0.0.0:*
udp 0 0 0.0.0.0:3785 0.0.0.0:*
udp 0 0 0.0.0.0:67 0.0.0.0:*
udp 0 0 0.0.0.0:68 0.0.0.0:*
udp 0 0 fe80::21e:8ff:fe27::123 :::*
udp 0 0 ::1:123 :::*
udp 0 0 :::123 :::*
raw 0 0 0.0.0.0:1 0.0.0.0:* 7
raw 0 0 0.0.0.0:2 0.0.0.0:* 7
raw 1000000 0 255.255.255.255:17 0.0.0.0:* 7
raw 1000000 0 255.255.255.255:17 0.0.0.0:* 7
raw 1000000 0 255.255.255.255:17 0.0.0.0:* 7
raw 0 0 0.0.0.0:103 0.0.0.0:* 7
raw 0 0 0.0.0.0:103 0.0.0.0:* 7
raw 0 0 0.0.0.0:255 0.0.0.0:* 7
raw 0 0 :::58 :::* 7
raw 0 0 :::89 :::* 7
raw 0 0 :::103 :::* 7
raw 0 0 :::103 :::* 7
相关命令
无
16.1.5show network statistics
命令功能
使用此命令查看系统统计结果。
命令语法
show network statistics ( tcp | udp | raw | all )
参数 |
参数说明 |
参数取值 |
tcp |
显示TCP信息 |
- |
udp |
显示UDP信息 |
- |
raw |
显示raw信息 |
- |
all |
显示TCP/UDP/raw信息 |
- |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面例子显示了系统的统计结果:
Switch# show network statistics all
Ip:
2308686 total packets received
0 forwarded
0 incoming packets discarded
2269596 incoming packets delivered
3978161 requests sent out
Icmp:
8 ICMP messages received
0 input ICMP message failed.
InCsumErrors: 0
ICMP input histogram:
destination unreachable: 8
8 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:
destination unreachable: 8
IcmpMsg:
InType3: 8
OutType3: 8
Tcp:
47 active connections openings
46 passive connection openings
22 failed connection attempts
12 connection resets received
57 connections established
2259727 segments received
2341577 segments send out
62 segments retransmited
0 bad segments received.
35 resets sent
InCsumErrors: 0
Udp:
6049 packets received
8 packets to unknown port received.
0 packet receive errors
8 packets sent
RcvbufErrors: 0
SndbufErrors: 0
InCsumErrors: 0
IgnoredMulti: 3848
相关命令
无
16.2NTP命令
16.2.1ntp ace
命令功能
使用此命令创建对NTP服务器/对端设备的访问控制规则(ACE)。使用关键字no删除访问控制规则。
命令语法
ntp ace ( IP_ADDR | HOSTNAME ) ( mask MASK_LENGTH | ) ( version | kod | ignore | noquery | nomodify | notrap | noserve | nopeer | notrust | limited | none )
no ntp ace ( IP_ADDR | HOSTNAME ) ( mask MASK | ) ( version | kod | ignore | noquery | nomodify | notrap | noserve | nopeer | notrust | limited | none )
参数 |
参数说明 |
参数取值 |
IP_ADDR |
NTP服务器/对端设备的IP地址 |
IPv4 地址, 不支持127.0.0.1 和0.0.0.0 |
HOSTNAME |
NTP服务器/对端设备的名称 |
不超过256字符的字符串 |
MASK_LENGTH |
地址掩码长度 |
1-32 |
MASK |
地址掩码 |
IPv4地址格式的掩码 |
version |
忽略不匹配版本号的服务器 |
- |
kod |
如果拒绝访问,发送kiss-of-death报文 |
- |
ignore |
忽略所有报文 |
- |
noquery |
忽略NTP 6和7模式的报文 |
- |
nomodify |
忽略NTP 6和7模式中试图改变服务器状态的报文 |
- |
notrap |
忽略trap报文 |
- |
noserve |
忽略NTP 6和7以外的报文 |
- |
nopeer |
不作为NTP对端使用 |
- |
notrust |
不信任的服务器,不作为同步源 |
- |
limited |
限制同一网络中client的数量 |
- |
none |
无限制 |
- |
命令模式
全局配置模式
默认配置
无
使用说明
使用此命令创建对NTP服务器/对端设备的访问控制规则(ACE)。
举例说明
下面是创建一个1.1.1.1的访问控制规则的例子
Switch# configure terminal
Switch(config)# ntp ace 1.1.1.1 version
相关命令
show ntp
16.2.2ntp authentication
命令功能
通过使用ntp authentication enable命令,使能NTP鉴权功能。
通过使用ntp authentication disable命令,去使能NTP鉴权功能。
命令语法
ntp authentication ( enable | disable )
参数 |
参数说明 |
参数取值 |
enable |
使能NTP鉴权 |
- |
disable |
去使能NTP鉴权 |
- |
命令模式
全局配置模式
默认配置
无
使用说明
当NTP鉴权功能使能时,设备会使用信任的key加密与NTP server同步时间。更多的信息可参考ntp trustedkey 命令行。
举例说明
下面举例使能NTP鉴权功能
Switch# configure terminal
Switch(config)# ntp authentication enable
相关命令
show ntp
16.2.3ntp disable
命令功能
使用ntp disable 命令,在特定的端口上禁止接受NTP报文。
命令语法
ntp disable
no ntp disable
命令模式
端口配置模式
默认配置
缺省所有接口都接受NTP报文
使用说明
该命令支持配置在物理口、vlan interface和loopback interface上面。
举例说明
下面举例,在端口eth-0-1上禁止NTP报文接受
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ntp disable
相关命令
无
16.2.4ntp key
命令功能
使用ntp key 配置NTP鉴权key。
命令语法
ntp key KEYID ( 8 | ) VALUE
no ntp key KEYID
参数 |
参数说明 |
参数取值 |
KEYID |
鉴权key序号 |
1-64000 |
8 |
指定加密key |
- |
VALUE |
鉴权key值 |
不超过128字符的字符串 |
命令模式
全局配置模式
默认配置
无
使用说明
使用此命令配置一个NTP 可以有效值。
举例说明
下面举例,在NTP key 123中配置key值321
Switch# configure terminal
Switch(config)# ntp key 123 321
相关命令
show ntp
16.2.5ntp interface reload
命令功能
使用ntp interface reload命令,在端口下重新加载NTP配置。
命令语法
ntp interface reload
命令模式
全局配置模式
默认配置
无
使用说明
使用此命令在所有端口下重新加载NTP配置。
举例说明
下面举例重新加载所有端口下的NTP配置
Switch# configure terminal
Switch(config)# ntp interface reload
相关命令
show ntp
16.2.6ntp max-distance
命令功能
使用ntp max-distance,配置NTP最大同步距离的阈值。ntp max-distance命令主要应用于NTP客户端,在客户端,NTP会计算到各个NTP服务器的同步距离并且会和使用ntp max-distance命令配置的距离阈值相比较,如果同步距离超过了配置的阈值,客户端将不会同步该服务器的时钟。
命令语法
ntp max-distance DISTANCE
no ntp max-distance DISTANCE
参数 |
参数说明 |
参数取值 |
DISTANCE |
指定NTP最大同步距离的阈值。缺省情况下,NTP的最大同步距离阈值是10秒。 |
1-16 |
命令模式
全局配置模式
默认配置
10
使用说明
无
举例说明
下面举例,配置最大同步距离16
Switch# configure terminal
DUT1# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
DUT1(config)# ntp max-distance 16
相关命令
无
16.2.7ntp peer
命令功能
使用ntp peer 命令,配置设备同步NTP的对端。使用关键字no关闭该功能。
命令语法
ntp peer ( mgmt-if | vrf NAME | ) ( HOSTNAME | IP_ADDR ) { key KEY_ID | prefer | version VER } { source-interface IFNAME | source-ip SRC_ADDR }
no ntp peer ( mgmt-if | vrf NAME | ) ( HOSTNAME | IP_ADDR )
参数 |
参数说明 |
参数取值 |
mgmt-if |
使用管理口连接 |
- |
vrf NAME |
指定VPN实例名称 |
不超过 32 字符的字符串 |
HOSTNAME |
对端名字 |
不超过256字符的字符串 |
IP_ADDR |
对端IP地址 |
IPv4 地址 |
KEY_ID |
(可选)定义鉴权key值 |
1-64000 |
prefer |
(可选)该NTP对端作为首选同步对端 |
- |
VER |
(可选)NTP版本 |
1-3 |
IFNAME |
指定源接口名称 |
支持 physical/aggregation/loopback/tunnel/vlan 端口 |
SRC_ADDR |
指定源IP 地址 |
IPv4 地址 |
命令模式
全局配置模式
默认配置
无
使用说明
使用此命令,配置NTP对端,并且可以指定版本号等信息。如果指定源接口或者源IP地址,将会使用对应的IP地作为发出报文的源IP地址。
举例说明
下面举例,配置NTP对端为192.168.22.33,版本号为2
Switch# configure terminal
Switch(config)# ntp peer 192.168.22.33 version 2
相关命令
show ntp
16.2.8ntp refclock
命令功能
使用ntp refclock 命令,为NTP配置外部时钟源。使用关键字no关闭该功能。
命令语法
ntp refclock stratum NUMBER
no ntp refclock
参数 |
参数说明 |
参数取值 |
NUMBER |
(可选) 配置NTP层次 |
1-15 |
命令模式
全局配置模式
默认配置
关闭
使用说明
无
举例说明
下面举例配置NTP外部时钟源,NTP层次为1层
Switch# configure terminal
Switch(config)# ntp refclock stratum 1
相关命令
show ntp
16.2.9ntp server
命令功能
使用ntp server 命令,配置设备同步NTP服务器。使用关键字no关闭该功能。
命令语法
ntp server ( mgmt-if | vrf NAME | ) ( HOSTNAME | IP_ADDR ) { key KEY_ID | prefer | version VER } { source-interface IFNAME | source-ip SRC_ADDR }
no ntp server ( mgmt-if | vrf NAME | ) ( HOSTNAME | SRC_ADDR )
参数 |
参数说明 |
参数取值 |
mgmt-if |
使用管理口连接 |
- |
vrf NAME |
指定VPN实例名称 |
不超过 32 字符的字符串 |
HOSTNAME |
对端名字 |
不超过256字符的字符串 |
IP_ADDR |
对端IP地址。 |
IPv4 地址 |
KEY_ID |
(可选) 定义鉴权key值 |
1-64000 |
prefer |
(可选) 该NTP对端作为首选同步对端 |
- |
VER |
(可选) NTP版本 |
1-3 |
IFNAME |
指定源接口名称 |
支持 physical/aggregation/loopback/tunnel/vlan 端口 |
SRC_ADDR |
指定源IP 地址 |
IPv4 地址 |
命令模式
全局配置模式
默认配置
关闭
使用说明
使用该命令,配置设备同步NTP服务器。如果指定源接口或者源IP地址,将会使用对应的IP地作为发出报文的源IP地址。
举例说明
下面举例,配置NTP服务器172.16.22.44,版本号2
Switch# configure terminal
Switch(config)# ntp server 172.16.22.44 version 2
相关命令
show ntp
16.2.10ntp trustedkey
命令功能
使用ntp trustedkey ,配置NTP信任的鉴权key。使用关键字no关闭该功能。
命令语法
ntp trustedkey KEY_ID
no ntp trustedkey KEY_ID
参数 |
参数说明 |
参数取值 |
KEY_ID |
KEY ID。 |
1-64000 |
命令模式
全局配置模式
默认配置
无
使用说明
使用ntp trustedkey ,配置NTP信任的鉴权key。
举例说明
下面举例,配置鉴权key 42,并设置成信任key
Switch# configure terminal
Switch(config)# ntp authentication enable
Switch(config)# ntp key 42 aNiceKey
Switch(config)# ntp trustedkey 42
相关命令
show ntp
ntp key
16.2.11show ntp
命令功能
通过show ntp命令,显示NTP配置。
命令语法
show ntp
命令模式
特权模式
默认配置
无
使用说明
通过show ntp命令,显示NTP配置。
举例说明
下面是显示NTP配置的例子
Switch# show ntp
Current NTP configuration:
============================================================
NTP access control list:
Unicast peer:
1.1.1.1
Unicast server:
2.2.2.2
Authentication: enabled
Local reference clock:
enabled, stratum 10
相关命令
ntp server
ntp peer
16.2.12show ntp ace
命令功能
通过show ntp ace命令,显示NTP的ace配置信息。
命令语法
show ntp ace
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面的例子是通过show命令显示当前的访问控制规则配置
Switch# show ntp ace
address mask count flags
=====================================================================
0.0.0.0 0.0.0.0 55188 noquery, nomodify, notrap
6.6.6.6 255.255.255.255 73 none
127.0.0.1 255.255.255.255 1259 none
相关命令
ntp ace
16.2.13show ntp associations
命令功能
通过show ntp associations命令,显示NTP邻居的状态。
命令语法
show ntp associations
命令模式
特权模式
默认配置
无
使用说明
详细的显示信息说明,可参见NTP定义(RFC1305)。
举例说明
下面举例显示NTP邻居状态
Switch# show ntp associations
Current NTP associations:
remote refid st when poll reach delay offset disp
==============================================================================
*6.6.6.6 127.127.1.0 6 161 256 377 0.778 -0.087 119.400
* synchronized, + candidate, # selected, x falsetick, . excess, - outlyer
相关命令
show ntp status
16.2.14show ntp key
命令功能
通过show ntp key 命令,显示NTP key。
命令语法
show ntp key
命令模式
特权模式
默认配置
无
使用说明
使用此命令显示NTP key。
举例说明
下面举例,显示配置的NTP key
Switch# show ntp key
Current NTP key configuration:
Flags: * - Trusted
ID Value
============================================================
* 1 trusted_key
5 test_key
相关命令
ntp key
16.2.15show ntp status
命令功能
使用show ntp status 命令,显示NTP状态。
命令语法
show ntp status
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面举例,显示当前NTP状态
Switch# show ntp status
Current NTP status:
============================================================
clock is synchronized
stratum: 11
reference clock: 127.127.1.0
frequency: 0.000 ppm
precision: 2^15
reference time: d116c946.4dc2f6a7 ( 1:24:22.303 UTC Tue Mar 1 2011)
root delay: 0.000 ms
root dispersion: 449.207 ms
peer dispersion: 662.059 ms
clock offset: 0.000 ms
stability: 0.000 ppm
相关命令
show ntp associations
16.2.16show ntp statistics
命令功能
使用show ntp statistics命令,显示NTP统计值。
命令语法
show ntp statistics
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面是使用show ntp statistics命令获取统计值的例子
Switch# show ntp statistics
Current NTP I/O statistics:
============================================================
time since reset: 175834
receive buffers: 10
free receive buffers: 9
used receive buffers: 0
low water refills: 1
dropped packets: 0
ignored packets: 0
received packets: 32
packets sent: 31
packets not sent: 0
interrupts handled: 32
received by int: 32
相关命令
show ntp associations
16.2.17clear ntp statistics
命令功能
使用clear ntp statistics命令,清除NTP统计值。
命令语法
clear ntp statistics
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面是使用clear ntp statistics命令清除统计值的例子
Switch# clear ntp statistics
相关命令
show ntp statistics
16.3PTP命令
16.3.1show ptp
命令功能
使用此命令显示PTP的全局信息。
命令语法
show ptp ( second | )
参数 |
参数说明 |
参数取值 |
second |
时间信息 |
- |
命令模式
特权模式
默认配置
无
使用说明
命令用于显示PTP全局信息。
举例说明
下面的例子用来演示如何显示PTP全局信息
Switch# show ptp
-------------------------- Global Configure --------------------------
PTP State : enable
Port Number : 1
Domain : 0
Slave Only : false
Clock Type : ordinary clock
Priority1 : 128
Priority2 : 128
Clock Accuracy : 0xfe
Clock Class : 248
Time Source : internal-oscillator(160)
UTC Offset : 34
Leap59 : false
Leap61 : false
Local Clock Identity : 14:6D:8F:FF:FE:0A:6F:00
Set systime via PTP: : false
--------------------------- BMC Properties ---------------------------
Receive Member : (null)
Parent Clock Identity : 14:6D:8F:FF:FE:0A:6F:00
Parent Port Number : 0
Mean Path Delay : 0
Offset From Master : 0
Step Removed : 0
GM Clock Identity : 14:6D:8F:FF:FE:0A:6F:00
GM Priority1 : 128
GM Priority2 : 128
GM Clock Accuracy : 0xfe
GM Clock Class : 248
GM Time Source : internal-oscillator(160)
GM UTC Offset : 34
GM UTC Offset Valid : false
GM Time Scale : PTP
GM Time Traceable : false
GM Leap59 : false
GM Leap61 : false
GM Frequency Traceable : false
相关命令
无
16.3.2show ptp interface
命令功能
使用此命令显示PTP接口信息。
命令语法
show ptp interface ( IFPHYSICAL | IFAGG | brief | )
参数 |
参数说明 |
参数取值 |
IFPHYSICAL |
以太网接口名 |
以太网接口名 |
IFAGG |
聚合接口名 |
聚合接口名 |
brief |
摘要信息 |
- |
命令模式
特权模式
默认配置
无
使用说明
该命令用于显示PTP接口信息。
举例说明
下面的例子演示了如何显示PTP接口信息
Switch# show ptp interface eth-0-9 brief
Name State Delay-mechanism Enable Step
------------------------------------------------------------------------
eth-0-9 master normal enable two
相关命令
无
16.3.3show ptp foreign-master
命令功能
使用此命令显示PTP外部主时钟信息。
命令语法
show ptp foreign-master
命令模式
特权模式
默认配置
无
使用说明
该命令用于显示PTP外部主时钟信息。
举例说明
下面的例子演示了如何显示PTP外部主时钟信息
Switch# show ptp foreign-master
Foreign_master_port_identity Qualification Interface
------------------------------------------------------------------------
*EE:D3:E0:FF:FE:4A:06:00@9 true eth-0-9
相关命令
无
16.3.4clear ptp statistics
命令功能
使用此命令清除接口上的PTP统计信息。
命令语法
clear ptp statistics ( IFPHYSICAL | IFAGG | )
参数 |
参数说明 |
参数取值 |
IFPHYSICAL |
以太网接口名 |
以太网接口名 |
IFAGG |
聚合接口名 |
聚合接口名 |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面的例子演示了如何清除接口上的PTP统计信息
Switch# clear ptp statistics
相关命令
无
16.3.5ptp device-type
命令功能
使用此命令设置时钟类型。
命令语法
ptp device-type ( bc | oc | e2etc | p2ptc )
no ptp device-type
参数 |
参数说明 |
参数取值 |
bc |
边界时钟 |
- |
oc |
普通时钟 |
- |
e2etc |
端到端延时测量机制透传时钟 |
- |
p2ptc |
点到点延时测量机制透传时钟 |
- |
命令模式
全局配置模式
默认配置
默认情况下,设备的时钟类型为普通时钟.
使用说明
该命令可以配置你所需要的时钟类型。
举例说明
下面的例子演示了如何将设备的时钟类型修改为边界时钟
Switch# configure terminal
Switch(config)# ptp device-type bc
相关命令
无
16.3.6ptp global-enable
命令功能
使用此命令设置PTP全局使能开关。
命令语法
ptp global-enable
no ptp global-enable
命令模式
全局配置模式
默认配置
默认情况下,PTP是未使能的
使用说明
无
举例说明
下面的例子演示了如何在设备上启用PTP
Switch# configure terminal
Switch(config)# ptp global-enable
相关命令
无
16.3.7ptp domain
命令功能
使用此命令设置普通时钟或者边界时钟的时钟域。
命令语法
ptp domain DOMAIN
no ptp domain
参数 |
参数说明 |
参数取值 |
DOMAIN |
时钟域编号 |
0-255 |
命令模式
全局配置模式
默认配置
默认情况下,时钟域编号为0
使用说明
无
举例说明
下面的例子演示了如何将时钟域修改为1
Switch# configure terminal
Switch(config)# ptp domain 1
相关命令
ptp device-type
16.3.8ptp tc-primary-domain
命令功能
使用此命令设置透传时钟的主同步时钟域。
命令语法
ptp tc-primary-domain DOMAIN
no ptp tc-primary-domain
参数 |
参数说明 |
参数取值 |
DOMAIN |
时钟域编号 |
0-255 |
命令模式
全局配置模式
默认配置
默认情况下,主同步时钟域编号为0
使用说明
无
举例说明
下面的例子演示了如何将主同步时钟域修改为1
Switch# configure terminal
Switch(config)# ptp tc-primary-domain 1
相关命令
ptp device-type
16.3.9ptp slave-only
命令功能
使用此命令设置普通时钟为只从时钟。
命令语法
ptp slave-only
no ptp slave-only
命令模式
全局配置模式
默认配置
默认情况下,时钟类型不是只从时钟。
使用说明
该命令只能在普通时钟模式下使用。
举例说明
下面的例子演示了如何将时钟修改为只从时钟
Switch# configure terminal
Switch(config)# ptp slave-only
相关命令
ptp device-type
16.3.10ptp priority1
命令功能
使用此命令设置普通时钟和边界时钟的优先级一属性。
命令语法
ptp priority1 PRIORITY
no ptp priority1
参数 |
参数说明 |
参数取值 |
PRIORITY |
优先级一属性的值 |
0-255 |
命令模式
全局配置模式
默认配置
默认情况下,优先级一的属性值为128。
使用说明
无
举例说明
下面的例子演示了如何将优先级一修改为0
Switch# configure terminal
Switch(config)# ptp priority1 0
相关命令
ptp device-type
16.3.11ptp priority2
命令功能
使用此命令设置普通时钟和边界时钟的优先级二属性。
命令语法
ptp priority2 PRIORITY
no ptp priority2
参数 |
参数说明 |
参数取值 |
PRIORITY |
优先级一属性的值 |
0-255 |
命令模式
全局配置模式
默认配置
默认情况下,优先级二的属性值为128
使用说明
无
举例说明
下面的例子演示了如何将优先级二修改为0
Switch# configure terminal
Switch(config)# ptp priority2 0
相关命令
ptp device-type
16.3.12ptp clock-accuracy
命令功能
使用此命令设置普通时钟和边界时钟的时钟精度。
命令语法
ptp clock-accuracy ( 0x20 | 0x21 | 0x22 | 0x23 | 0x24 | 0x25 | 0x26 | 0x27 | 0x28 | 0x29 | 0x2a | 0x2b | 0x2c | 0x2d | 0x2e | 0x2f | 0x30 | 0x31 | 0xfe )
no ptp clock-accuracy
参数 |
参数说明 |
参数取值 |
0x20 |
时钟精度为25 ns |
- |
0x21 |
时钟精度为100 ns |
- |
0x22 |
时钟精度为250 ns |
- |
0x23 |
时钟精度为1 us |
- |
0x24 |
时钟精度为2.5 us |
- |
0x25 |
时钟精度为10 us |
- |
0x26 |
时钟精度为25 us |
- |
0x27 |
时钟精度为100 us |
- |
0x28 |
时钟精度为250 us |
- |
0x29 |
时钟精度为1 ms |
- |
0x2a |
时钟精度为2.5 ms |
- |
0x2b |
时钟精度为10 ms |
- |
0x2c |
时钟精度为25 ms |
- |
0x2d |
时钟精度为100 ms |
- |
0x2e |
时钟精度为250 ms |
- |
0x2f |
时钟精度为1 s |
- |
0x30 |
时钟精度为10 s |
- |
0x31 |
时钟精度大于10 s |
- |
0xfe |
时钟精度未知 |
- |
命令模式
全局配置模式
默认配置
默认情况下,时钟精度值为0xfe
使用说明
无
举例说明
下面的例子演示了如何将时钟精度设置为0x21
Switch# configure terminal
Switch(config)# ptp clock-accuracy 0x21
相关命令
ptp device-type
16.3.13ptp clock-class
命令功能
使用此命令设置普通时钟或边界时钟的时钟级别。
命令语法
ptp clock-class ( 6 | 7 | 13 | 14 | 52 | 58 | 187 | 193 | 248 )
no ptp clock-class
参数 |
参数说明 |
参数取值 |
13 |
表示时钟同步到一个根据应用制定的时间源,这个时间源的分发刻度为ARB |
- |
14 |
表示时钟在先前的时间里同步到了一个根据应用制定的时间源并且成为13的时钟级别,但是现在已经失去了继续同步的能力并且在制定的保持模式标准下进入了保持模式,这个时间源的分发刻度为ARB |
- |
187 |
时钟级别为7的时钟在非保持模式下降级到备选时钟B的级别 |
- |
193 |
时钟级别为14的时钟在保持模式下降级到备选时钟B的级别 |
- |
248 |
默认值。这样的时钟级别不用于其它定义 |
- |
52 |
时钟级别为7的时钟在非保持模式下降级到备选时钟A的级别 |
- |
58 |
时钟级别为14的时钟在保持模式下降级到备选时钟A的级别 |
- |
6 |
表示时钟同步到一个主时钟源,这个时间源的分发刻度必须为PTP |
- |
7 |
表示时钟在先前的时间里同步到了一个主时钟源并且成为6的时钟级别,但是现在已经失去了继续同步的能力并且在制定的保持模式标准下进入了保持模式,这个时间源的分发刻度必须为PTP |
- |
命令模式
全局配置模式
默认配置
默认情况下,时钟等级的值为248
使用说明
无
举例说明
下面的例子演示了如何将时钟等级设置为6
Switch# configure terminal
Switch(config)# ptp clock-class 6
相关命令
ptp device-type
16.3.14ptp time-source
命令功能
使用此命令设置普通时钟或边界时钟的时钟源信息。
命令语法
ptp time-source ( atomic-clock | gps | hand-set | internal-oscillator | ntp | other | ptp | terrestrial-radio )
no ptp time-source
参数 |
参数说明 |
参数取值 |
atomic-clock |
表示直接向原子钟同步 |
- |
gps |
表示向GPS时钟同步 |
- |
hand-set |
表示通过人工接口设置 |
- |
internal-oscillator |
表示通过内部自由晶振计时 |
- |
ntp |
表示向NTP时钟源同步 |
- |
other |
表示向其他暂时没有列出的设备同步 |
- |
ptp |
表示向PTP外时钟源同步 |
- |
terrestrial-radio |
表示通过地面无线电通信方式同步 |
- |
命令模式
全局配置模式
默认配置
默认情况下,时钟源信息被设置为内部自由晶振计时
使用说明
无
举例说明
下面的例子演示了如何将时钟源信息修改为GPS
Switch# configure terminal
Switch(config)# ptp time-source gps
相关命令
ptp device-type
16.3.15ptp announce-interval
命令功能
使用此命令设置普通时钟和边界时钟上Announce报文在接口上的发送间隔。
命令语法
ptp announce-interval INTERVAL
no ptp announce-interval
参数 |
参数说明 |
参数取值 |
INTERVAL |
Announce报文的发送周期,其值为2的interval次方秒 |
-5-10 |
命令模式
端口配置模式
默认配置
默认情况下,Announce报文的发送间隔为1,即发送周期为2秒
使用说明
无
举例说明
下面的例子演示了如何将Announce报文的发送周期设置为1024秒
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp announce-interval 10
相关命令
无
16.3.16ptp sync-interval
命令功能
使用此命令设置普通时钟和边界时钟上Sync报文在接口上的发送间隔。
命令语法
ptp sync-interval INTERVAL
no ptp sync-interval
参数 |
参数说明 |
参数取值 |
INTERVAL |
Sync报文的发送周期,其值为2的interval次方秒 |
-5-10 |
命令模式
端口配置模式
默认配置
默认情况下,Sync报文的发送间隔为0,即发送周期为1秒。
使用说明
无
举例说明
下面的例子演示了如何将Sync报文的发送周期设置为1024秒
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp sync-interval 10
相关命令
无
16.3.17ptp min-delayreq-interval
命令功能
使用此命令设置普通时钟和边界时钟上Delay_Req报文在接口上的最小发送间隔。
命令语法
ptp min-delayreq-interval INTERVAL
no ptp min-delayreq-interval
参数 |
参数说明 |
参数取值 |
INTERVAL |
Delay_Req报文的最小发送周期,其值为2的interval次方秒 |
-5-10 |
命令模式
端口配置模式
默认配置
默认情况下,Delay_Req报文的最小发送间隔为0,即最小发送周期为1秒。
使用说明
无
举例说明
下面的例子演示了如何将Delay_Req报文的最小发送周期设置为1024秒
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp min-delayreq-interval 10
相关命令
无
16.3.18ptp min-pdelayreq-interval
命令功能
使用此命令设置普通时钟和边界时钟上Pdelay_Req报文在接口上的最小发送间隔。
命令语法
ptp min-pdelayreq-interval INTERVAL
no ptp min-pdelayreq-interval
参数 |
参数说明 |
参数取值 |
INTERVAL |
Pdelay_Req报文的最小发送周期,其值为2的interval次方秒 |
-5-10 |
命令模式
端口配置模式
默认配置
默认情况下,Pdelay_Req报文的最小发送间隔为0,即最小发送周期为1秒。
使用说明
无
举例说明
下面的例子演示了如何将Pdelay_Req报文的最小发送周期设置为1024秒
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp min-pdelayreq-interval 10
相关命令
无
16.3.19ptp announce-receipt-timeout
命令功能
使用此命令设置普通时钟和边界时钟上Announce报文在接口上的超时周期数。
命令语法
ptp announce-receipt-timeout TIMES
no announce-receipt-timeout
参数 |
参数说明 |
参数取值 |
TIMES |
Announce报文接受超时周期数 |
3-255 |
命令模式
端口配置模式
默认配置
默认情况下,Announce报文的接收超时周期数为4。
使用说明
无
举例说明
下面的例子演示了如何设置报文的接收超时周期数为3
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp announce-receipt-timeout 3
相关命令
无
16.3.20ptp delay-mechanism
命令功能
使用此命令设置接口上的延时测量机制。
命令语法
ptp delay-mechanism ( disable | normal | peer )
no ptp delay-mechanism
参数 |
参数说明 |
参数取值 |
disable |
不使用任何延时测量机制 |
- |
normal |
使用请求-响应延时测量机制 |
- |
peer |
使用节点延时测量机制 |
- |
命令模式
端口配置模式
默认配置
默认情况下,接口上的延时测量机制为请求-响应延时测量机制
使用说明
无
举例说明
下面的例子演示了如何将延时测量机制修改为节点延时测量机制
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp delay-mechanism peer
相关命令
无
16.3.21ptp enable
命令功能
使用此命令在接口上使能PTP功能。
命令语法
ptp enable
no ptp enable
命令模式
端口配置模式
默认配置
默认情况下,接口上的PTP功能不使能
使用说明
无
举例说明
下面的例子演示了如何在接口上使能PTP功能
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp enable
相关命令
无
16.3.22ptp protocol
命令功能
使用此命令设置接口上的PTP承载协议类型。
命令语法
ptp protocol ( mac | udp ( source-ip A.B.C.D ( unicast ( dest-ip A.B.C.D | ) | ) | source-ipv6 X:X::X:X ( unicast dest-ipv6 X:X::X:X | ) ) )
no ptp protocol ( udp source-ip A.B.C.D unicast ( dest-ip A.B.C.D | ) | )
参数 |
参数说明 |
参数取值 |
A.B.C.D |
UDP封装格式中,IPv4层的源地址 |
A.B.C.D格式的IPv4地址 |
X:X::X:X |
UDP封装格式中,IPv6层的源地址 |
X:X::X:X格式的IPv6地址 |
命令模式
端口配置模式
默认配置
默认情况下,每一个接口都是用了IEEE Std 1588-2008所定义的二层组播地址并按以太网封装格式承载
使用说明
无
举例说明
下面的例子演示了如何在接口上设置UDP封装格式承载PTP报文并且按照1.10.10.10的源地址封装IPv4层
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp protocol udp source-ip 1.10.10.10
相关命令
无
16.3.23ptp tagging vlan
命令功能
使用此命令设置接口上的VLAN封装格式。
命令语法
ptp tagging vlan VLANID ( cos COS | )
no ptp tagging ( vlan | cos )
参数 |
参数说明 |
参数取值 |
VLANID |
VLANID |
1-4094 |
COS |
服务类型 |
0-7 |
命令模式
端口配置模式
默认配置
默认情况下,PTP报文不会使用VLAN封装。
使用说明
如果配置VLAN封装时省略了服务类型参数,则服务类型值为0。
举例说明
下面的例子演示了如何设置接口上使用vlan2并且使用服务质量3来分发PTP报文
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp tagging vlan 2 cos 3
相关命令
无
16.3.24ptp asymmetry-correction
命令功能
使用此命令设置接口上的异步校准值。
命令语法
ptp asymmetry-correction ASYMMETRY
no ptp asymmetry-correction
参数 |
参数说明 |
参数取值 |
ASYMMETRY |
路径异步校准 |
-2000000 - 2000000 |
命令模式
端口配置模式
默认配置
默认情况下,路径上的异步校准值为0ns。
使用说明
无
举例说明
下面的例子演示了如何设置接口上的路径异步校准值为200ns
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp asymmetry-correction 200
相关命令
无
16.3.25ptp ingress-latency (egress-latency)
命令功能
使用此命令行设置ingerss 和egress的latency
命令语法
ptp ( ingress-latency | egress-latency ) LATENCY
no ptp ( ingress-latency | egress-latency )
参数 |
参数说明 |
参数取值 |
LATENCY |
延时,单位纳秒 |
0-65535 |
命令模式
端口配置模式
默认配置
默认情况下,latency值为0。
使用说明
无
举例说明
下面的例子演示了如何设置接口上的ingress-latency为200ns
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ptp ingress-latency 200
相关命令
无
16.3.26ptp utc-offset
命令功能
使用此命令行设置utc offset
命令语法
ptp utc-offset OFFSET
no ptp utc-offset
参数 |
参数说明 |
参数取值 |
OFFSET |
差值,单位秒 |
0-100 |
命令模式
全局配置模式
默认配置
默认情况下,utc offset值为37。
使用说明
无
举例说明
下面的例子演示了如何设置utc offset为38
Switch# configure terminal
Switch(config)# ptp utc-offset 38
相关命令
无
16.3.27ptp clock-step
命令功能
使用此命令行设置设备的时钟模式是one-step还是two-step
命令语法
ptp clock-step ( one-step | two-step )
no ptp clock-step
命令模式
全局配置模式
默认配置
默认情况下,时钟模式是two-step
使用说明
无
举例说明
下面的例子演示了如何设置设备的时钟模式为one-step
Switch# configure terminal
Switch(config)# ptp clock-step one-step
相关命令
无
16.4Loopback命令
16.4.1loopback internal
命令功能
使用此命令设置接口的loopback internal模式。
命令语法
loopback internal
命令模式
端口配置模式
默认配置
无
使用说明
一个接口只能配置一种loopback模式,新的配置会覆盖掉原有配置。
此模式下从某端口发出的报文会转发回某端口。
举例说明
下面例子中,接口被设置为loopback internal模式
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# loopback internal
相关命令
no loopback
16.4.2loopback external
命令功能
使用此命令设置接口的loopback external模式。
命令语法
loopback external ( mac-address swap | )
参数 |
参数说明 |
参数取值 |
mac-address swap |
源MAC和目的MAC互换,并更新FCS |
- |
命令模式
端口配置模式
默认配置
无
使用说明
一个接口只能配置一种loopback模式,新的配置会覆盖掉原有配置。
此模式下从网络上收到的报文会转发回网络,swap字段指定是否进行源MAC和目的MAC互换。
举例说明
下面例子中,接口被设置为loopback external模式
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# loopback external
相关命令
no loopback
16.4.3no loopback
命令功能
使用此命令取消接口的loopback internal或loopback external模式。
命令语法
no loopback
命令模式
端口配置模式
默认配置
无
使用说明
该命令用于取消接口的loopback配置。
举例说明
下面例子中,取消接口的port level loopback配置
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# loopback internal
Switch(config-if)# no loopback
相关命令
loopback internal
loopback external
16.4.4show loopback
命令功能
使用此命令显示loopback的配置信息。
命令语法
show loopback
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面例子中,显示loopback的配置信息
Switch# show loopback
Interface Type DestIntf SwapMac
- $$-----------------------------------------------------------
eth-0-1 internal - -
eth-0-2 external - yes
- $$-----------------------------------------------------------
相关命令
loopback internal
loopback external
16.4.5l2 ping
命令功能
使用此命令允许用户使用指定包从指定接口ping指定的目的MAC地址。
命令语法
l2 ping HHHH.HHHH.HHHH interface IFPHYSICAL ( { vlan VLAN_ID | interval INTERVAL | timeout TIMEOUT | count COUNT | size SIZE } | )
参数 |
参数说明 |
参数取值 |
HHHH.HHHH.HHHH |
目的MAC |
以HHHH.HHHH.HHHH格式表示的MAC地址 |
interface IFPHYSICAL |
发送ping包的源接口 |
支持物理接口 |
VLAN_ID |
ping包中的vlan id |
1-4094 |
INTERVAL |
两次ping包之间的时间间隔,单位:秒 |
1-65535 |
TIMEOUT |
等待ping包的时间间隔.单位:秒 |
1-65535 |
COUNT |
ping的总报文数 |
1-65535 |
SIZE |
ping包大小 |
64-1518 |
命令模式
特权模式
默认配置
缺省情况下,ping协议包不带vlan tag;
缺省的ping间隔1秒;
缺省的ping次数为5次;
缺省的ping包大小为64。
使用说明
“Ctrl + C”组合键取消ping操作。
举例说明
下面例子中,显示了如何ping一个指定的目的MAC地址。
Switch# l2 ping 0000.0000.0001 interface eth-0-1 vlan 101 interval 1 timeout 1 count 10 size 1500
相关命令
l2 ping response
16.4.6l2 ping enable
命令功能
使用此命令全局使能l2 ping 功能。使用关键字no关闭该功能。
命令语法
l2 ping enable
no l2 ping enable
命令模式
全局配置模式
默认配置
缺省情况下,不使能l2 ping。
使用说明
该命令全局控制l2 ping功能使能状态。
举例说明
下面例子中,显示了如何全局使能l2 ping功能。
Switch(config)# l2 ping enable
下面例子中,显示了如何全局去使能l2 ping功能。
Switch(config)# no l2 ping enable
相关命令
none
16.4.7l2 ping response
命令功能
使用此命令使能l2 ping response功能。使用关键字no关闭该功能。
命令语法
l2 ping response enable
no l2 ping response enable
命令模式
端口配置模式
默认配置
无
使用说明
如果该功能未启用,l2 ping request包会被丢掉。
举例说明
下面例子中,在接口上使能l2 ping response功能
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# l2 ping response enable
相关命令
l2 ping
show l2ping response
16.4.8show l2ping response
命令功能
使用此命令显示l2 ping的配置信息。
命令语法
show l2ping response
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面例子中,显示l2 ping的配置信息
Switch# show l2 ping response
Interface L2pingResp
- $$-----------------------------------
eth-0-7 Enable
eth-0-8 Enable
- $$-----------------------------------
相关命令
l2 ping response
16.4.9show l2ping state
命令功能
使用此命令显示l2 ping当前的状态。
命令语法
show l2ping state
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面例子中,显示l2 ping当前状态信息
Switch# show l2ping response
L2 ping state.
- $$-----------------------------------------------------------
Total count Interval Timeout VlanId Packet size Sequence
100 1515010
10 packet(s) transmitted, 0 received, 100 % packet loss
相关命令
无
16.4.10l2 ping stop
命令功能
使用此命令停止L2ping处理。
命令语法
l2 ping stop
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面例子中,停止当前L2 ping处理
Switch# l2 ping stop
相关命令
无
16.4.11l2 ping forward enable
命令功能
使用此命令使能端口L2ping报文转发功能,否则不转发L2ping报文。
命令语法
l2 ping forward enable
no l2 ping forward enable
命令模式
端口配置模式
默认配置
使能
使用说明
无
举例说明
下面例子中,使能端口L2ping报文转发功能
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# l2 ping forward enable
相关命令
无
16.4.12debug l2ping
命令功能
使用此命令使能l2 ping的debugging功能。
命令语法
debug l2ping ( all | packet | send | receive | response )
no debug l2ping ( all | packet | send | receive | response )
参数 |
参数说明 |
参数取值 |
all |
全部l2ping调试功能 |
- |
packet |
调试报文信息 |
- |
send |
调试发送报文信息 |
- |
receive |
调试接收报文信息 |
- |
response |
调试应答信息 |
- |
命令模式
特权模式
默认配置
关闭
使用说明
如果debugging开关打开,系统会打印相关信息。
举例说明
下面例子中,使能l2 ping的debugging功能
Switch# debug l2ping all
相关命令
l2 ping response
16.4.13show debugging l2ping
命令功能
使用此命令显示l2 ping的debugging状态。
命令语法
show debugging l2ping
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
下面例子中,显示l2 ping的debugging状态
Switch# show debugging l2ping
L2ping debugging status:
l2ping packet debugging is on
l2ping receive debugging is on
l2ping send debugging is on
l2ping response debugging is on
相关命令
l2 ping response
16.5RMON命令
16.5.1rmon collection stats
命令功能
此命令用于为端口创建或删除一条统计。
命令语法
rmon collection stats ID ( owner OWNER | )
no rmon collection stats ID
参数 |
参数说明 |
参数取值 |
ID |
RMON 统计的ID |
1-65535 |
owner OWNER |
指定统计的归属者(可选) |
不超过15个字符的字符串 |
命令模式
端口配置模式
默认配置
无
使用说明
每个端口只能创建一条统计。
举例说明
下面例子显示如何在端口上创建一条统计
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# rmon collection stats 1 owner test
相关命令
show rmon statistics
16.5.2rmon collection history
命令功能
此命令用于为端口创建或删除一条历史统计记录。
命令语法
rmon collection history INDEX ( buckets NUMBER | ) ( interval INTERVAL | ) ( owner OWNER | )
no rmon collection history INDEX
参数 |
参数说明 |
参数取值 |
INDEX |
RMON 历史统计的ID |
1-65535 |
buckets NUMBER |
设置保留历史记录数量 |
1-65535 |
interval INTERVAL |
统计的频率,单位是秒 |
1-3600 |
owner OWNER |
统计的归属者信息 |
不超过15个字符的字符串 |
命令模式
端口配置模式
默认配置
无
使用说明
该命令用于收集端口在指定时间内收到的各类报文。Buckets用于指定保留的统计量,interval用于指定收集报文的周期。
举例说明
下面例子显示如何在端口上创建一条历史统计
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# rmon collection history 1 buckets 1000 interval 100 owner test
相关命令
show rmon history
16.5.3rmon event
命令功能
此命令用于为RMON创建或删除一条事件。
命令语法
rmon event INDEX ( log | ) ( trap TRAP | ) ( description DESCRIPTION | ) ( owner OWNER | )
no rmon event Index
参数 |
参数说明 |
参数取值 |
INDEX |
事件ID |
1-65535 |
log |
该事件被触发时记录一条log |
- |
trap TRAP |
trap的community参数 |
不超过127个字符的字符串 |
description DESCRIPTION |
对事件的描述或注释 |
不超过127个字符的字符串 |
owner OWNER |
事件的归属人信息 |
不超过15个字符的字符串 |
命令模式
全局配置模式
默认配置
无
使用说明
可以指定该事件被触发时进行的操作,记录log也可以发送trap
举例说明
下面例子显示如何创建一条事件
Switch# configure terminal
Switch(config)# rmon event 1 log trap public description reach_max owner test
相关命令
show rmon event
16.5.4rmon alarm
命令功能
此命令用于为RMON创建或删除一条警告。
命令语法
rmon alarm INDEX OID interval INTERVAL ( delta | absolute ) rising-threshold RTHRE ( event numbs | ) falling-threshold FTHRE ( event NUMBER | ) ( owner OWNER | )
no rmon alarm Index
参数 |
参数说明 |
参数取值 |
INDEX |
警告ID |
1-65535 |
OID |
警告监控的mib节点(etherStatsEntry.m.n) |
MIB OID |
INTERVAL |
指定警告监控mib节点的周期,单位是秒 |
1-65535 |
delta |
警告取样值为与上周期的差值。 |
- |
absolute |
警告取样值为本周期的绝对值。 |
- |
rising-threshold RTHRE |
设置上限阀值 |
-2147483648 - 2147483646 |
event numbs |
指定警告上限阀值触发的RMON事件 |
1-65535 |
falling-threshold FTHRE |
设置下限阀值 |
-2147483648 - 2147483646 |
event NUMBER |
指定警告下限阀值触发的RMON事件 |
1-65535 |
owner OWNER |
指定警告归属人 |
不超过15个字符的字符串 |
命令模式
全局配置模式
默认配置
无
使用说明
我们创建mib的alarm之前,需要先创建一个事件来响应统计超过最大和最小阀值。
使用alaram前需要先在端口启用statistics
举例说明
下面例子显示如何创建一条警告。
Switch# configure terminal
Switch(config)# rmon alarm 1 etherStatsEntry.3.1 interval 10 delta rising-threshold 1000 event 1 falling-threshold 5 event 1 owner test
相关命令
无
16.5.5show rmon statistics
命令功能
此命令用于显示RMON所有或指定的的统计信息。
命令语法
show rmon statistics ( ID | )
参数 |
参数说明 |
参数取值 |
ID |
统计ID |
1-65535 |
命令模式
特权模式
默认配置
无
使用说明
显示RMON的统计信息。
举例说明
特权模式下,显示RMON统计信息
Switch# show rmon statistics
Rmon collection index 1
Statistics ifindex = 1, Owner: RMON_SNMP
Input packets 0, octets 0, dropped 0
Broadcast packets 0, multicast packets 0, CRC alignment errors 0, collisions 0
Undersized packets 0, oversized packets 0, fragments 0, jabbers 0
# of packets received of length (in octets):
64: 0, 65-127: 0, 128-255: 0
256-511: 0, 512-1023: 0, 1024-max: 0
相关命令
无
16.5.6show rmon history
命令功能
此命令用于显示RMON所有或指定的历史信息。
命令语法
show rmon history ( ID | )
参数 |
参数说明 |
参数取值 |
ID |
历史记录ID |
1-65535 |
命令模式
特权模式
默认配置
无
使用说明
显示RMON创建的历史信息。
举例说明
特权模式下,显示RMON的历史信息
Switch# show rmon history
History index = 1
Data source ifindex = 1
Buckets requested = 1000
Buckets granted = 1000
Interval = 100
Owner: test
Sample # 1 Begin at 00:30:07
Received 00 octets, 00 packets
00 broadcast and 00 multicast packets
00 undersized and 00 oversized packets
00 fragments and 00 jabbers
00 CRC alignment errors and 00 collisions.
# of dropped packet events is 00
Network utilization is estimated at 0
Sample # 2 Begin at 00:31:47
Received 00 octets, 00 packets
00 broadcast and 00 multicast packets
00 undersized and 00 oversized packets
00 fragments and 00 jabbers
00 CRC alignment errors and 00 collisions.
# of dropped packet events is 00
Network utilization is estimated at 0
Sample # 3 Begin at 00:33:27
Received 00 octets, 00 packets
00 broadcast and 00 multicast packets
00 undersized and 00 oversized packets
00 fragments and 00 jabbers
00 CRC alignment errors and 00 collisions.
# of dropped packet events is 00
Network utilization is estimated at 0
相关命令
无
16.5.7show rmon event
命令功能
此命令用于显示RMON创建所有或指定的事件。
命令语法
show rmon event ( ID | )
参数 |
参数说明 |
参数取值 |
ID |
事件ID |
1-65535 |
命令模式
特权模式
默认配置
无
使用说明
显示RMON创建的事件信息及其状态。
举例说明
特权模式下,显示RMON创建的事件
Switch# show rmon event
event Index = 1
Description: RMON_SNMP
Event type Log & Trap
Event community name public
Last Time Sent = 00:00:00
Owner test
相关命令
无
16.5.8show rmon alarm
命令功能
此命令用于显示RMON创建所有或指定的警告。
命令语法
show rmon alarm ( ID | )
参数 |
参数说明 |
参数取值 |
ID |
警告ID |
1-65535 |
命令模式
特权模式
默认配置
无
使用说明
显示RMON创建的警告信息。
举例说明
特权模式下,显示RMON创建的警告
Switch# show rmon alarm
alarm Index = 1
alarm status = VALID
alarm Interval = 3600
alarm Type is Delta
alarm Value = 00
alarm Rising Threshold = 100
alarm Rising Event = 1
alarm Falling Threshold = 10
alarm Falling Event = 1
alarm Owner is test
相关命令
无
16.5.9rmon clear counters
命令功能
此命令用于清除指定端口中RMON的统计。
命令语法
rmon clear counters
命令模式
端口配置模式
默认配置
无
使用说明
清除RMON中的统计信息
举例说明
下面例子显示如何清除RMON在端口1上的统计。
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# rmon clear counters
相关命令
无
16.5.10debug rmon
命令功能
此命令用于打开或关闭RMON的debug开关。
命令语法
debug rmon
no rmon debug
命令模式
特权模式
默认配置
无
使用说明
调试时用于打开或关闭RMON的debug开关
举例说明
下面例子显示如何打开RMON的debug开关
Switch# debug rmon
相关命令
无
16.6SNMP命令
16.6.1snmp-server access
命令功能
全局配置模式下,使用snmp-server access命令配置MIB视图的访问控制属性。该命令的no格式删除访问控制属性。
命令语法
snmp-server access GROUP_NAME security-model usm ( noauth | auth | priv ) ( { read READ | write WRITE | notify NOTIFY | context CONTEXT ( prefix | exact | ) } | )
no snmp-server access GROUP_NAME security-model usm ( noauth | auth | priv ) ( context CONTEXT | )
参数 |
参数说明 |
参数取值 |
GROUP_NAME |
组名 |
不超过31字符的字符串 |
security-model |
组的安全模式 |
- |
usm |
SNMPv3 usm安全模式 |
- |
auth |
指明对报文进行认证但不加密 |
- |
noauth |
指明对报文既不认证也不加密 |
- |
priv |
指明对报文进行认证和加密 |
- |
context CONTEXT |
(可选项)组内视图的context |
不超过31字符的字符串 |
prefix |
context只匹配前缀 |
- |
exact |
全部匹配context |
- |
READ |
(可选项)配置组的只读视图。该视图允许用户对代理进行读操作 |
不超过31字符的字符串 |
WRITE |
(可选项)配置组的写视图。该视图允许用户对代理进行写操作 |
不超过31字符的字符串 |
NOTIFY |
(可选项)配置组的通告视图。该视图允许代理发送通告给网管工作站 |
不超过31字符的字符串 |
命令模式
全局配置模式
默认配置
无访问控制设置
使用说明
该命令配置MIB视图的访问安全控制属性。
举例说明
下例演示如何配置访问安全控制属性
Switch# configure terminal
Switch(config)# snmp-server access manage security-model usm auth write _all_ read _all_
相关命令
show snmp-server access
16.6.2snmp-server community
命令功能
全局配置模式下,使用snmp-server community命令配置一个新的SNMP团体。该命令的no格式删除SNMP团体。
命令语法
snmp-server community ( 8 | ) STRING ( read-only | read-write ) ( view NAME | )
no snmp-server community string
参数 |
参数说明 |
参数取值 |
STRING |
团体名,为1~127个字符的字符串,作用类型密码。空格表示不允许访问,支持数字、大写字母、小写字母、特殊字符如~!@#$%^&*()_+`-= ,./;[]<:{} |
不超过127个字符的字符串 |
read-only |
表明对MIB对象进行只读的访问。网管工作站只能执行读操作 |
- |
read-write |
表明对MIB对象进行读写的访问。网管工作站可以执行读写操作 |
- |
view NAME |
用来指定网管工作站可以访问的MIB对象的范围 |
不超过31字符的字符串 |
8 |
(可选项)是否隐藏团体名 |
- |
命令模式
全局配置模式
默认配置
无SNMP团体名
使用说明
无
举例说明
下例演示如何创建一个名为newstring的团体,该团体对mib有读写权限
Switch# configure terminal
Switch(config)# snmp-server community newstring read-write
相关命令
snmp-server enable
16.6.3snmp-server context
命令功能
全局配置模式下,使用snmp-server context命令配置SNMP context信息。该命令的no格式删除该配置。
命令语法
snmp-server context CONTEXT
no snmp-server context CONTEXT
参数 |
参数说明 |
参数取值 |
CONTEXT |
SNMP context |
不超过31字符的字符串 |
命令模式
全局配置模式
默认配置
无SNMP context配置
使用说明
无
举例说明
下例演示如何创建一个context
Switch# configure terminal
Switch(config)# snmp-server context contextA
相关命令
show snmp-server context
16.6.4snmp-server enable
命令功能
全局配置模式下,使用snmp-server enable命令使能SNMP代理功能。该命令的no格式关闭SNMP功能。
命令语法
snmp-server enable
no snmp-server enable
命令模式
全局配置模式
默认配置
SNMP默认为关闭
使用说明
该命令用来使能或关闭SNMP代理功能。
举例说明
下例演示如何启用SNMP功能
Switch# configure terminal
Switch(config)# snmp-server enable
相关命令
show snmp
16.6.5snmp-server engineID
命令功能
全局配置模式下,使用snmp-server engineID命令设置本地设备的SNMP的引擎ID。该命令的no格式删除引擎ID。
命令语法
snmp-server engineID STRING
no snmp-server engineID
参数 |
参数说明 |
参数取值 |
STRING |
引擎ID字符串 |
引擎ID字符串必须偶数个十六进制数,最小为10个字符,最大64个字符 |
命令模式
全局配置模式
默认配置
可通过show snmp-server engineID命令显示默认引擎ID
使用说明
SNMP的引擎ID唯一标识了设备。它是一个可选配置。关于SNMP引擎的更多信息,请参考RFC2571。
举例说明
下例演示如何配置engineID
Switch# configure terminal
Switch(config)# snmp-server engineID 30383038303830383038
相关命令
show snmp-server engineID
16.6.6snmp-server group
命令功能
全局配置模式下,使用snmp-server group命令配置一个新的SNMP组。该命令的no格式用来删除组。
命令语法
snmp-server group GROUP_NAME user USER_NAME security-model usm
no snmp-server group GROUP_NAME user user-name security-model usm
参数 |
参数说明 |
参数取值 |
GROUP_NAME |
组名 |
不超过31字符的字符串 |
USER_NAME |
组中用户名 |
不超过31字符的字符串 |
security-model |
配置组的安全模型 |
- |
usm |
配置基于用户安全模型(USM)的SNMPv3安全模型 |
- |
命令模式
全局配置模式
默认配置
无SNMP组
使用说明
该命令用于创建一个新的SNMP组。
举例说明
下例演示如何创建一个新的SNMP组
Switch# configure terminal
Switch(config)# snmp-server group SampleA user User1 security-model usm
相关命令
show snmp-server group
16.6.7snmp-server notify
命令功能
全局配置模式下,使用snmp-server notify命令配置SNMP的通告。该命令的no格式用来将通告值恢复成默认。
命令语法
snmp-server notify notify-name tag tag-name ( inform | trap | )
no snmp-server notify notify-name
参数 |
参数说明 |
参数取值 |
NOTIFY_NAME |
通告名称 |
不超过31字符的字符串 |
TAG_NAME |
标记名字 |
不超过32字符的字符串 |
inform |
设置通告类型为inform |
- |
trap |
设置通告类型为trap |
- |
命令模式
全局配置模式
默认配置
无SNMP通告
使用说明
无
举例说明
下例演示如何设置通告
Switch# configure terminal
Switch(config)# snmp-server notify note tag tt
相关命令
show snmp-server notify
16.6.8snmp-server system-contact
命令功能
全局配置模式下,使用snmp-server system-contact命令配置设备管理者联系方式。该命令的no格式用来删除联系方式。
命令语法
snmp-server system-contact TEXT
no snmp-server system-contact
参数 |
参数说明 |
参数取值 |
TEXT |
设备管理者联系方式 |
不超过255字符的字符串 |
命令模式
全局配置模式
默认配置
无联系方式
使用说明
该命令配置设备管理者联系方式。可通过configure配置文件查看到该联系方式。
举例说明
下例演示将联系方式设置为admin@exampledomain.com
Switch# configure terminal
Switch(config)# snmp-server system-contact admin@exampledomain.com
相关命令
snmp-server system-location
16.6.9snmp-server system-location
命令功能
全局配置模式下,使用snmp-server system-location命令配置设备放置位置的描述符。该命令的no格式用来删除该描述符。
命令语法
snmp-server system-location TEXT
no snmp-server system-location
参数 |
参数说明 |
参数取值 |
TEXT |
设备放置位置的描述符 |
不超过255字符的字符串 |
命令模式
全局配置模式
默认配置
无位置描述符
使用说明
该命令配置放置位置的描述符。可通过configure配置文件查看到该描述符。
举例说明
下例演示将位置描述符设置为Sample Place
Switch# configure terminal
Switch(config)# snmp-server system-location Sample Place
相关命令
snmp-server system-contact
16.6.10snmp-server target-address
命令功能
全局配置模式下,使用snmp-server target-address命令指定允许接收SNMP请求报文的目的主机。该命令的no格式用来删除该配置。
命令语法
snmp-server target-address NAME param PARAM ( IPV4_ADDR | IPV6_ADDR ) ( { udpport UDP_PORT | timeout TIMEOUT | retries RETRY } | ) ( taglist LINE | )
snmp-server target-address WORD param WORD mgmt-if IPV4_ADDR ( { udpport UDP_PORT | timeout TIMEOUT | retries RETRY } | ) ( taglist LINE | )
no snmp-server target-address WORD ( mgmt-if | )
参数 |
参数说明 |
参数取值 |
NAME |
远程目的主机名称 |
不超过31字符的字符串 |
PARAM |
地址参数表 |
不超过31字符的字符串 |
mgmt-if |
使用管理口 |
- |
IPV4_ADDR |
IPv4格式的目的地址 |
IPv4 地址 |
IPV6_ADDR |
IPv6格式的目的地址 |
IPv6 地址 |
udpport port |
(可选项)UDP端口号,默认值162 |
0-65535 |
timeout number |
(可选项)超时时间 |
1-1800000毫秒 |
retries number |
(可选项)重传次数,默认为3 |
0-10 |
taglist LINE |
标记列表,用于标识发送通告和转发消息到其上的目的地址,可以配置多个值,中间使用空格隔开(最多支持128个),最大长度255个字符 |
不超过255字符的字符串 |
命令模式
全局配置模式
默认配置
无目的主机IP配置
使用说明
只用于SNMPv3。
举例说明
下例演示将主机10.0.0.2设置为信任,允许响应该主机的SNMP请求
Switch# configure terminal
Switch(config)# snmp-server target-address targ1 param parm1 10.0.0.2 taglist tmptag
相关命令
show snmp-server target-address
16.6.11snmp-server target-params
命令功能
全局配置模式下,使用此命令配置允许接受SNMP请求报文的目的主机的参数。使用该命令的no形式删除该主机的参数
命令语法
snmp-server target-params PARAM user USER_NAME security-model v3 message-processing v3 ( noauth | auth | priv )
no snmp-server target-params USER_NAME
参数 |
参数说明 |
参数取值 |
PARAM |
地址参数表 |
不超过31字符的字符串 |
USER_NAME |
用户名 |
不超过31字符的字符串 |
noauth |
指明对报文既不认证也不加密 |
- |
auth |
指明对报文进行认证但不加密 |
- |
priv |
指明对报文既认证又加密 |
- |
命令模式
全局配置模式
默认配置
无参数配置
使用说明
只用于SNMPv3。
举例说明
下列演示设置p1的参数内容
Switch# configure terminal
Switch(config)# snmp-server target-params p1 user u1 security-model v3 message-processing v3 auth
相关命令
show snmp-server target-params
16.6.12snmp-server trap enable
命令功能
全局配置模式下,使用snmp-server trap enable命令使能相关的SNMP通告类型。该命令的no格式用来关闭此功能。
命令语法
snmp-server trap enable NOTIFICATION-TYPE
no snmp-server trap enable NOTIFICATION-TYPE
参数 |
参数说明 |
参数取值 |
NOTIFICATION-TYPE |
使能或关闭的通告类型。如果使用“all”参数。系统将使能或者关闭使用该命令的所有通告类型 |
all/bgp/coldstart/ipsla/linkdown/linkup/priv-linkdown/priv-linkup/loopback-detect/system/warmstart/bfd/cpu-traffic-limit |
命令模式
全局配置模式
默认配置
关闭此功能
使用说明
snmp-server trap enable和snmp-server trap target-address命令是一起使用的。使用该命令允许设备发送指定类型的trap。
举例说明
下例演示如何启用设备的所有trap功能
Switch# configure terminal
Switch(config)# snmp-server trap enable all
相关命令
snmp-server trap target-address
16.6.13snmp-server trap delay
命令功能
全局配置模式下,使用snmp-server trap delay命令延迟snmp trap发送。该命令的no格式用来关闭此功能。
命令语法
snmp-server trap delay ( linkup | linkdown ) TIMER
no snmp-server trap delay ( linkup | linkdown )
参数 |
参数说明 |
参数取值 |
TIMER |
延迟snmp trap的时间,单位为100毫秒 |
1-100 |
命令模式
全局配置模式
默认配置
关闭此功能
使用说明
默认配置下端口up/down时会马上出发相关trap,配置改命令后端口状态改变后会等待一个延迟后才产生trap。比如在环网中链路切换后,由于三层网络不能马上切换,如果马上发送trap的话可能会丢失。该命令的单位是100ms。
举例说明
下例演示如何设置设备链路up时的delay功能
Switch# configure terminal
Switch(config)# snmp-server trap delay linkup 10
相关命令
snmp-server trap target-address
16.6.14snmp-server trap target-address
命令功能
全局配置模式下,使用该命令配置系统产生的trap发送到指定的服务器。该命令的no格式用来删除。
命令语法
snmp-server trap target-address ( mgmt-if | vrf VRF_NAME | ) ( IPV4_ADDR | IPV6_ADDR ) community COMMUINTY ( udpport UDP_PORT | )
no snmp-server trap target-address ( mgmt-if | vrf VRF_NAME | ) ( IPV4_ADDR | IPV6_ADDR ) community COMMUINTY ( udpport UDP_PORT | )
参数 |
参数说明 |
参数取值 |
mgmt-if |
通过管理口发送 |
- |
vrf VRF_NAME |
Trap接收服务器地址的VRF |
不超过31个字符的字符串 |
IPV4_ADDR |
Trap接收服务器的IPv4地址 |
IPv4 地址 |
IPV6_ADDR |
Trap接收服务器的IPv6地址 |
IPv6 地址 |
COMMUINTY |
团体名称 |
不超过127字符的字符串 |
UDP_PORT |
Trap发送的端口号。 默认端口号为162 |
1-65535 |
命令模式
全局配置模式
默认配置
无相关配置
使用说明
该命令用于指定系统产生的trap发送目的地。
举例说明
下例演示如何将系统产生的trap通过管理口发送到IP为192.168.1.100的设备
Switch# configure terminal
Switch(config)# snmp-server trap target-address mgmt-if 192.168.1.100 community test udpport 6000
相关命令
snmp-server trap enable
snmp-server trap source-address
16.6.15snmp-server trap source-address
命令功能
全局配置模式下,使用该命令配置系统产生的trap的源地址。该命令的no格式用来删除。
命令语法
snmp-server trap source-address ( vrf WORD | ) ( IPV4_ADDR | IPV6_ADDR )
no snmp-server trap source-address ( vrf WORD | ) ( IPV4_ADDR | IPV6_ADDR )
参数 |
参数说明 |
参数取值 |
vrf WORD |
Trap发送端地址的VRF |
不超过31个字符的字符串 |
IPV4_ADDR |
Trap发送端的IPv4地址 |
IPv4 地址 |
IPV6_ADDR |
Trap发送端的IPv6地址 |
IPv6 地址 |
命令模式
全局配置模式
默认配置
无相关配置
使用说明
该命令用于指定系统产生的trap发送源IP地址。若指定的source IP不存在,需在UP的接口上配置好源IP地址才能发包。
举例说明
下例演示如何将系统产生的trap通过指定source 192.168.1.100
Switch# configure terminal
Switch(config)# snmp-server trap source-address 192.168.1.100
相关命令
snmp-server trap target-address
16.6.16snmp-server inform target-address
命令功能
全局配置模式下,使用该命令配置系统产生的inform发送到指定的服务器。该命令的no格式用来删除。
命令语法
snmp-server inform target-address ( mgmt-if | vrf VRF_NAME | ) ( IPV4_ADDR | IPV6_ADDR ) community COMMUINTY ( udpport UDP_PORT | )
no snmp-server inform target-address ( mgmt-if | vrf VRF_NAME | ) ( IPV4_ADDR | IPV6_ADDR ) community COMMUINTY ( udpport UDP_PORT | )
参数 |
参数说明 |
参数取值 |
mgmt-if |
通过管理口发送 |
- |
vrf VRF_NAME |
Inform接收服务器的地址所在vrf |
不超过31个字符的字符串 |
IPV4_ADDR |
Inform接收服务器的IPv4地址 |
IPv4 地址 |
IPV6_ADDR |
Inform接收服务器的IPv6地址 |
IPv6 地址 |
COMMUINTY |
团体名称 |
不超过127字符的字符串 |
UDP_PORT |
Trap发送的端口号。 默认端口号为162 |
1-65535 |
命令模式
全局配置模式
默认配置
无相关配置
使用说明
该命令用于指定系统产生的Inform发送目的地。
举例说明
下例演示如何将系统产生的inform通过管理口发送到IP为192.168.1.100的设备
Switch# configure terminal
Switch(config)# snmp-server inform target-address mgmt-if 192.168.1.100 community test udpport 6000
相关命令
无
16.6.17snmp-server inform
命令功能
全局配置下,使用这条命令配置SNMP inform报文的超时时间和超时重传次数。使用该命令的no形式来删除inform报文的这些参数
命令语法
snmp-server inform ( { retries RETRY | timeout TIMEOUT } )
no snmp-server inform ( retries | timeout | )
参数 |
参数说明 |
参数取值 |
RETRY |
重传次数,默认为3 |
0-10 |
TIMEOUT |
超时重传时间,默认为15秒 |
1-1800s |
命令模式
全局配置模式
默认配置
无此配置
使用说明
该命令只用于SNMPv2
举例说明
下面的例子展示了如何配置inform报文的参数
Switch(config)# snmp-server inform timeout 10 retries 5
相关命令
无
16.6.18snmp-server version
命令功能
全局配置模式下,使用snmp-server version命令配置系统支持的SNMP的版本号。该命令的no格式用来恢复版本号为默认值。
命令语法
snmp-server version ( all | v1 | v2c | v3 )
no snmp-server version
参数 |
参数说明 |
参数取值 |
all |
支持所有版本号(v1,v2c和v3) |
- |
v1 |
只支持v1 |
- |
v2c |
只支持v2c |
- |
v3 |
只支持v3 |
- |
命令模式
全局配置模式
默认配置
支持所有版本号
使用说明
该命令设置交换机支持的SNMP版本号。
举例说明
下例演示如何使系统支持所有SNMP版本
Switch# configure terminal
Switch(config)# snmp-server version all
相关命令
show snmp-server version
16.6.19snmp-server view
命令功能
全局配置模式下,使用snmp-server view命令创建或更新SNMP视图。该命令的no格式用来删除SNMP视图。
命令语法
snmp-server view NAME ( included | excluded ) sub-tree
no snmp-server view NAME ( included | excluded ) sub-tree
参数 |
参数说明 |
参数取值 |
NAME |
创建或更新的视图名称 |
不超过31字符的字符串 |
included |
视图包含的MIB树节点,即允许访问MIB子树的所有节点 |
- |
excluded |
视图不包含的MIB树节点,,即禁止访问MIB子树的所有节点 |
- |
sub-tree |
MIB对象子树 |
- |
命令模式
全局配置模式
默认配置
无视图
使用说明
该命令创建的SNMP视图将作为其他SNMP命令的参数被使用。
举例说明
下例演示如何创建一个SNMP视图
Switch# configure terminal
Switch(config)# snmp-server view abc excluded 1.3.6.2
相关命令
show snmp-server view
16.6.20snmp-server access-group NAME in
命令功能
全局配置模式下,使用该命令配置ACL过滤访问控制。该命令的no格式用来删除改配置。
命令语法
snmp-server access-group NAME in
参数 |
参数说明 |
参数取值 |
NAME |
访问控制列表名称 |
不超过40字符的字符串 |
in |
过滤方向 |
- |
命令模式
全局配置模式
默认配置
无访问控制组
使用说明
该命令在SNMP模块中应用ACL功能。
举例说明
下例演示如何应用一条ACL到SNMP
Switch# configure terminal
Switch(config)# snmp-server access-group abc in
相关命令
无
16.6.21show snmp
命令功能
特权模式下,使用show snmp命令显示SNMP的服务信息。
命令语法
show snmp
命令模式
特权模式
默认配置
无
使用说明
该命令显示SNMP的服务信息(使能或关闭)。
举例说明
下例演示如何显示SNMP服务
Switch# show snmp
SNMP services: enable
相关命令
snmp-server enable
16.6.22show snmp-server access
命令功能
特权模式下,使用show snmp-server access命令显示SNMP的访问控制信息。
命令语法
show snmp-server access ( GROUP_NAME | )
参数 |
参数说明 |
参数取值 |
GROUP_NAME |
指定组名 |
不超过31字符的字符串 |
命令模式
特权模式
默认配置
无
使用说明
该命令用来显示snmp-server access命令配置的访问控制信息。
举例说明
下例演示如何显示访问控制信息
Switch# show snmp-server access gp1
Group name: gp1
Context: test
Security model: usm
Security level: auth
Context Match: exact
Read view: _all_
Write view: none
Notify view: none
Storage Type: permanent
Row status: active
相关命令
snmp-server access
16.6.23show snmp-server community
命令功能
特权模式下,使用show snmp-server community命令显示SNMP团体信息。
命令语法
show snmp-server community
命令模式
特权模式
默认配置
无
使用说明
该命令用来显示snmp-server community命令配置的团体信息。
举例说明
下例演示如何显示系统当前的团体信息
Switch# show snmp-server community
Community-Access Community-String Security-name
==================================================================
read-only public comm1
read-write private comm3
read-only public comm2
read-write private comm4
相关命令
snmp-server community
16.6.24show snmp-server context
命令功能
特权模式下,使用show snmp-server context命令显示SNMP context信息。
命令语法
show snmp-server context
命令模式
特权模式
默认配置
无
使用说明
该命令用来显示snmp-server context命令配置的SNMP context信息。
举例说明
下例演示如何显示context信息
Switch# show snmp-server context
samplecontext
相关命令
snmp-server context
16.6.25show snmp-server engineID
命令功能
特权模式下,使用show snmp-server engineID命令显示engineID信息。
命令语法
show snmp-server engineID
命令模式
特权模式
默认配置
无
使用说明
SNMP引擎ID是SNMP实体的唯一标识。
举例说明
下例演示如何显示engineID
Switch# show snmp-server engineID
Engine ID : 00000009020000000c025808
相关命令
snmp-server engineID
16.6.26show snmp-server group
命令功能
特权模式下,使用show snmp-server group命令显示组信息。包括组名,安全模式,视图,存储类型的等。
命令语法
show snmp-server group ( GROUP_NAME | )
参数 |
参数说明 |
参数取值 |
GROUP_NAME |
指定组名 |
不超过31字符的字符串 |
命令模式
特权模式
默认配置
无
使用说明
使用snmp-server group命令配置SNMP组。
举例说明
下例演示如何显示SNMP组
Switch# show snmp-server group
Group-name model Security-name
===========================================================
a11 usm a
a11 usm ab
相关命令
snmp-server group
16.6.27show snmp-server notify
命令功能
特权模式下,使用show snmp-server notify命令显示SNMP通告信息。
命令语法
show snmp-server notify ( GROUP_NAME | )
参数 |
参数说明 |
参数取值 |
GROUP_NAME |
指定组名 |
不超过31字符的字符串 |
命令模式
特权模式
默认配置
无
使用说明
该命令用来显示snmp-server notify命令配置的SNMP通告信息。
举例说明
下例演示如何显示SNMP通告信息
Switch# show snmp-server notify
Notify-name Notify-type
===========================================================
sample trap
相关命令
snmp-server notify
16.6.28show snmp-server sys-info
命令功能
特权模式下,使用show snmp-server sys-info命令显示当前SNMP设备的系统信息。
命令语法
show snmp-server sys-info
命令模式
特权模式
默认配置
无
使用说明
该命令用于显示snmp-server system-contact和snmp-server system-location命令设置的信息。
举例说明
下例演示如何显示系统信息
Switch# show snmp-server sys-info
Contact: admin@sampledomain.com
Location: Denvor
相关命令
snmp-server system-contact
snmp-server system-location
16.6.29show snmp-server trap-receiver
命令功能
特权模式下,使用show snmp-server trap-receiver命令显示SNMP的traps接收主机。
命令语法
show snmp-server trap-receiver
命令模式
特权模式
默认配置
无
使用说明
该命令用来显示snmp-server trap target-addres命令配置的trap接收信息。
举例说明
下例演示如何显示SNMP的traps接收主机
Switch# show snmp-server trap-receiver
Target-ipaddress udpport version pdu-type community
===========================================================
1.1.1.1 234 v2c inform public
1.1.1.1 234 v2c trap public
1.1.1.1 234 v1 trap public
相关命令
snmp-server trap target-addres
16.6.30show snmp-server usm-user
命令功能
特权模式下,使用show snmp-server usm-user命令显示SNMP的用户信息。
命令语法
show snmp-server usm-user ( USERNAME | )
参数 |
参数说明 |
参数取值 |
USERNAME |
(可选项) 显示指定名字的用户信息 |
不超过31字符的字符串 |
命令模式
特权模式
默认配置
无
使用说明
SNMP用户必须属于一个组。通过snmp-server usm-user命令配置用户名。
举例说明
下例演示如何显示SNMP的用户信息
Switch# show snmp-server usm-user user1
EnginedID: 01234567890123456789
User Name: user1
Auth Protocol: md5
priv Protocol: des
Storage Type: nonvolatile
Row status: active
相关命令
snmp-server usm-user
16.6.31show snmp-server version
命令功能
特权模式下,使用show snmp-server version命令显示支持的SNMP版本。
命令语法
show snmp-server version
命令模式
特权模式
默认配置
无
使用说明
该命令用来显示系统当前支持的SNMP版本信息。
举例说明
下例演示如何显示当前支持的SNMP版本信息
Switch# show snmp-server version
SNMPv1/SNMPv2c/SNMPv3
相关命令
snmp-server version
16.6.32show snmp-server view
命令功能
特权模式下,使用show snmp-server view命令显示SNMP视图信息。
命令语法
show snmp-server view ( NAME | )
参数 |
参数说明 |
参数取值 |
NAME |
指定视图名称 |
不超过31字符的字符串 |
命令模式
特权模式
默认配置
无
使用说明
该命令显示SNMP视图配置信息。
举例说明
下例演示如何显示SNMP所有配置的视图
Switch# show snmp-server view
View-name View-type Subtree
===========================================================
abc excluded .1.3.6.2
_all_ included .0
_all_ included .1
_all_ included .2
_none_ excluded .0
_none_ excluded .1
_none_ excluded .2
相关命令
snmp-server view
16.6.33snmp-server udp-port
命令功能
全局配置模式下,使用snmp-server udp-port命令配置用于监听NMS报文的udp端口。该命令的no格式用来将端口恢复为默认配置161端口。
命令语法
snmp-server udp-port PORT
参数 |
参数说明 |
参数取值 |
PORT |
指定监听的udp端口 |
<1025-65535> |
命令模式
全局配置模式
默认配置
默认监听端口为161
使用说明
该命令用于配置监听NMS消息的udp端口
举例说明
下面演示如何配置监听NMS消息的udp端口
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# snmp-server udp-port 60001
This operation will cause all NMS connection to be closed.
Are you sure to change SNMP udp port? [Y/N]y
相关命令
无
16.6.34snmp-server trap source-port
命令功能
全局配置模式下,使用snmp-server trap source-port命令配置trap/inform报文所使用的的udp源端口。该命令的no格式用来将端口恢复为默认配置即随机端口
命令语法
snmp-server trap source-port PORT
参数 |
参数说明 |
参数取值 |
PORT |
|
<1025-65535> |
命令模式
全局配置模式
默认配置
默认使用随机可用端口作为trap/inform源端口
使用说明
该命令用于指定trap/inform报文所使用的的udp源端口
举例说明
下面演示如何配置trap/inform所使用的的udp源端口
Switch# configure terminal
Switch(config)# snmp-server trap source-port 60002
This operation will change all source port of trap/inform messages.
Are you sure to change SNMP trap source port? [Y/N]y
相关命令
snmp-server trap target
16.7SFLOW命令
16.7.1sflow enable
命令功能
使用此命令全局使能sFlow,使用此命令的no形式关闭sflow功能。
命令语法
sflow enable
no sflow enable
命令模式
全局配置模式
默认配置
Sflow默认全局不使能
使用说明
在进行sflow其他配置前必须先使用此命令全局使能sflow服务。使用此命令的no形式,所有sflow的配置将会被清空。
举例说明
如下例子显示了如何全局使能sflow
Switch# configure terminal
Switch(config)# sflow enable
相关命令
show sflow
16.7.2sflow agent
命令功能
使用此命令设置sflow 代理地址。
命令语法
sflow agent ( ip IPV4_ADDR | ipv6 ipv6-addres )
no sflow agent ( ip | ipv6 )
参数 |
参数说明 |
参数取值 |
IPV4_ADDR |
代理的IPv4地址 |
IPv4地址 |
IPV6_ADDR |
代理的IPv6地址 |
IPv6地址 |
命令模式
全局配置模式
默认配置
无
使用说明
使用此命令配置sflow代理地址。如果没有配置,系统将会使用端口状态为UP的最大的router-id作为代理地址,并且不会再自动改变
举例说明
如下例子显示如何配置代理地址
Switch# configure terminal
Switch(config)# sflow agent ip 10.0.0.254
相关命令
show sflow
16.7.3sflow collector
命令功能
使用此命令设置sflow采样报文的收集、分析服务器的IP地址,使用此命令的no命令清空配置。
命令语法
sflow collector ( mgmt-if | vrf WORD | ) ( IPV4_ADDR | ipv6-addres ) ( UDP_PORT | )
no sflow collector ( mgmt-if | vrf WORD | ) ( IPV4_ADDR | ipv6-addres ) ( UDP_PORT | )
参数 |
参数说明 |
参数取值 |
mgmt-if |
通过管理口发送 |
- |
vrf WORD |
Sflow收集服务器地址的VRF |
不超过31个字符的字符串 |
IPV4_ADDR |
收集服务器的IPv4地址 |
IPv4地址 |
IPV6_ADDR |
收集服务器的IPv6地址 |
IPv6地址 |
UDP_PORT |
收集服务器的接收UDP端口号,如果不指定,使用默认值6343 |
1-65535 |
命令模式
全局配置模式
默认配置
默认UDP目的端口号6343
使用说明
使用此命令添加一个收集服务器的IP地址以及UDP端口号,系统最多支持两个收集服务器。使用此命令的no形式可以删除一个收集服务器。
举例说明
如下例子显示如何添加一个收集服务器
Switch# configure terminal
Switch(config)# sflow collector mgmt-if 10.0.0.254 3000
相关命令
show sflow
16.7.4sflow counter interval
命令功能
使用此命令配置基于统计的采样间隔。使用此命令的no形式恢复默认值。
命令语法
sflow counter interval INTERVAL
no sflow counter interval
参数 |
参数说明 |
参数取值 |
INTERVAL |
采样间隔,单位为秒 |
1-2000 |
命令模式
全局配置模式
默认配置
20秒
使用说明
采样间隔越短对系统的影响越大。
举例说明
如下例子显示如何配置基于统计的采样的间隔
Switch# configure terminal
Switch(config)# sflow counter interval 10
相关命令
show sflow
16.7.5sflow counter-sampling enable
命令功能
使用此命令在指定端口上使能基于统计的采样功能。使用此命令的no形式关闭采样功能。
命令语法
sflow counter-sampling enable
no sflow counter-sampling enable
命令模式
端口配置模式
默认配置
所有的端口基于统计的采样功能默认不使能
使用说明
基于统计的采样是指每个采样间隔内,系统会将端口上的统计信息通过sflow协议报文送往采样收集服务器。
此命令可以配置在非linkagg成员的物理口上,也可以配置的linkagg端口上。
举例说明
如下例子显示了如何在端口上使能基于统计的采样功能
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# sflow counter-sampling enable
相关命令
show sflow
16.7.6sflow flow-sampling rate
命令功能
使用此命令配置基于报文的采样的速率。使用此命令的no形式恢复默认值。
命令语法
sflow flow-sampling rate RATE
no sflow flow-sampling rate
参数 |
参数说明 |
参数取值 |
RATE |
基于报文采样的速率 |
必须是2的整数幂,可配范围为32-1048576 |
命令模式
端口配置模式
默认配置
基于报文的采样速率的默认值是8192
使用说明
这个数值可以简单的理解成多少个报文进入芯片采样一次。但由于芯片实现上是通过计算概率的方式实现,所以并不一定严格按照这个数字进行采样。系统对报文进行采样时会将报文的前256字节封装到sflow协议报文中。系统对基于统计和基于报文的采样都是软件实现的,如果采样速率配置的很低,CPU利用率就会非常高。另外cpu流量控制模块将sflow采样报文上cpu的速率限制为400kbps,如果用户要求高的采样速率可以修改这个值。
此命令可以配置在非linkagg成员的物理口上,也可以配置的linkagg端口上。
举例说明
如下的例子显示了如何配置基于报文的采样速率
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# sflow flow-sampling rate 2048
% Warning: sFlow sampling requires high CPU usage, especially with a low rate.
It is suggested not configure a rate less than default value 8192.
相关命令
show sflow
16.7.7sflow flow-sampling enable
命令功能
使用此命令在端口上使能基于报文的采样功能。使用此命令的no形式关闭采样功能。
命令语法
sflow flow-sampling enable ( input | output | both )
no sflow flow-sampling enable ( input | output | both )
命令模式
端口配置模式
默认配置
基于报文的采样功能在所有的端口上默认都是不使能
使用说明
使用此命令使能对进入指定端口的报文进行采样的功能。
此命令可以配置在非linkagg成员的物理口上,也可以配置的linkagg端口上。
举例说明
使用此命令在端口上使能基于报文的采样功能
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# sflow flow-sampling enable input
相关命令
show sflow
16.7.8show sflow
命令功能
使用此命令查看sflow的配置信息。
命令语法
show sflow
命令模式
特权模式
默认配置
此命令无默认值
使用说明
此命令可以查看sflow详细的配置信息。
举例说明
如下例子显示了sflow的配置信息
Switch# show sflow
sFlow Version: 5
sFlow Global Information:
Agent IP address : 0.0.0.0
Counter Sampling Interval : 20 seconds
Collector IP : Not configured
sFlow Port Information:
Flow-Sample Flow-Sample
Port Counter Flow Direction Rate
- $$------------------------------------------------------
eth-0-1 Disable Enable Input 8192
相关命令
sflow enable
sflow collector
16.7.9sflow source
命令功能
使用此命令设置sflow 源地址。
命令语法
sflow source ip IPV4_ADDR
no sflow source ip
参数 |
参数说明 |
参数取值 |
IPV4_ADDR |
源的IPv4地址 |
IPv4地址 |
命令模式
全局配置模式
默认配置
无
使用说明
使用此命令配置sflow源地址。
举例说明
如下例子显示如何配置源地址
Switch# configure terminal
Switch(config)# sflow source ip 10.0.0.254
相关命令
show sflow
16.8LLDP命令
16.8.1lldp enable(global)
命令功能
在全局配置模式下,使用lldp enable命令来启用LLDP功能。使用命令相应的no形式关闭该项功能。
命令语法
lldp enable
lldp disable
命令模式
全局配置模式
默认配置
默认情况下此功能未打开。
使用说明
在启用LLDP功能前,必需同时在全局和接口上使能LLDP。
举例说明
全局启用LLDP功能
Switch# configure terminal
Switch(config)# lldp enable
相关命令
lldp enable(interface)
16.8.2lldp mgmt-if enable
命令功能
在全局配置模式下使用lldp mgmt-if enable命令使能LLDP功能。使用命令相应的no形式,在管理口上关闭LLDP功能。
命令语法
lldp mgmt-if enable ( txonly | txrx | rxonly )
lldp mgmt-if disable
参数 |
参数说明 |
参数取值 |
txonly |
使能管理口LLDP报文传输 |
- |
txrx |
使能管理口LLDP报文传输和发送 |
- |
rxonly |
使能管理口LLDP报文发送 |
- |
命令模式
全局配置模式
默认配置
默认情况下此功能打开。
使用说明
在启用LLDP功能前,必需同时在全局和管理口上使能LLDP。
举例说明
管理口上启用LLDP功能
Switch# configure terminal
Switch(config)# lldp mgmt-if enable txrx
管理口上关闭LLDP功能
Switch# configure terminal
Switch(config)# lldp mgmt-if disable
相关命令
lldp enable(global)
16.8.3lldp enable(interface)
命令功能
在接口模式下使用lldp enable命令使能LLDP功能。使用命令相应的no形式,在接口上关闭LLDP功能。
命令语法
lldp enable ( txonly | txrx | rxonly )
lldp disable
参数 |
参数说明 |
参数取值 |
txonly |
使能LLDP报文传输 |
- |
txrx |
使能LLDP报文传输和发送 |
- |
rxonly |
使能LLDP报文发送 |
- |
命令模式
端口配置模式
默认配置
默认情况下此功能打开。
使用说明
在启用LLDP功能前,必需同时在全局和接口上使能LLDP。
举例说明
接口上启用LLDP功能
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# lldp enable txrx
相关命令
lldp enable(global)
16.8.4lldp system-name
命令功能
在全局配置模式下,使用lldp system-name命令配置系统名称TLV的值。使用命令相应的no形式,恢复默认配置。
命令语法
lldp system-name NAME
no lldp system-name
参数 |
参数说明 |
参数取值 |
NAME |
系统名称 |
不超过64个字符的字符串 |
命令模式
全局配置模式
默认配置
默认情况下,使用系统名称。
使用说明
如果该命令没有配置,使用系统名称作为该TLV的值。
举例说明
配置系统名称TLV的值为switch
Switch# configure terminal
Switch(config)# lldp system-name switch
相关命令
lldp enable(global)
lldp enable(interface)
16.8.5lldp system-description
命令功能
在全局模式下,使用lldp system- description命令配置系统描述TLV的值。使用命令相应的no形式,恢复默认配置。
命令语法
lldp system-description LINE
no lldp system-description
参数 |
参数说明 |
参数取值 |
LINE |
系统描述,长度范围为1到255,允许空格 |
不超过255个字符的字符串 |
命令模式
全局配置模式
默认配置
默认情况下,使用系统描述。
使用说明
如果该命令没有配置,使用系统描述作为该TLV的值。
举例说明
配置系统描述TLV的值为switch
Switch# configure terminal
Switch(config)# lldp system-description switch
相关命令
lldp enable(global)
lldp enable(interface)
16.8.6lldp management
命令功能
在全局模式下,使用lldp management命令,配置管理地址TLV的值。使用命令相应的no形式,恢复默认配置。
命令语法
lldp management ( ip ADDRESS | interface IFNAME )
no lldp management ( ip | interface )
参数 |
参数说明 |
参数取值 |
ADDRESS |
IPv4 地址, 例如 1.1.1.1 |
IPv4 地址 |
IFNAME |
端口名称,需要是三层端口 |
支持物理端口,聚合端口,环回端口,VLAN端口,隧道端口,带内管理端口 |
命令模式
全局配置模式
默认配置
使用默认管理地址。
使用说明
配置的管理地址优先于配置的接口,如果两者都没有配置,系统将会按照环回接口,管理口,其他三层接口, 系统MAC地址的顺序,使用默认管理地址。同类接口中将使用IP地址较小的接口。
举例说明
配置管理地址TLV的值
Switch# configure terminal
Switch(config)# lldp management ip 192.168.1.2
相关命令
lldp enable(global)
lldp enable(interface)
16.8.7lldp msg-tx-hold
命令功能
在全局模式下,使用lldp msg-tx-hold配置msg-tx-hold值。使用命令相应的no形式,恢复默认配置。
命令语法
lldp msg-tx-hold NUMBER
no lldp msg-tx-hold
参数 |
参数说明 |
参数取值 |
NUMBER |
msg-tx-hold值 |
2-10 |
命令模式
全局配置模式
默认配置
默认msg-tx-hold值为4。
使用说明
无
举例说明
配置msg-tx-hold的值
Switch# configure terminal
Switch(config)# lldp msg-tx-hold 3
相关命令
lldp enable(global)
lldp enable(interface)
16.8.8lldp timer msg-tx-interval
命令功能
在全局模式下,使用lldp timer msg-tx-interval命令配置消息传输间隔msg-tx-interval。使用命令相应的no形式,恢复默认配置。
命令语法
lldp timer msg-tx-interval NUMBER
no lldp timer msg-tx-interval
参数 |
参数说明 |
参数取值 |
NUMBER |
msg-tx-interval值 |
msg-tx-hold |
命令模式
全局配置模式
默认配置
默认msg-tx-interval值为30s。
使用说明
无
举例说明
配置msg-tx-interval的值
Switch# configure terminal
Switch(config)# lldp timer msg-tx-interval 20
相关命令
lldp enable(global)
lldp enable(interface)
16.8.9lldp timer reinit-delay
命令功能
在全局模式下,使用lldp timer reinitDelay命令配置reinitDelay。使用命令相应的no形式,恢复默认配置。
命令语法
lldp timer reinit-delay NUMBER
no lldp timer reinit-delay
参数 |
参数说明 |
参数取值 |
NUMBER |
reinit-delay值 |
1-10 |
命令模式
全局配置模式
默认配置
默认reinitDelay值为2s。
使用说明
无
举例说明
配置reinitDelay的值
Switch# configure terminal
Switch(config)# lldp timer reinit-delay 1
相关命令
lldp enable(global)
lldp enable(interface)
16.8.10lldp timer tx-delay
命令功能
在全局模式下,使用lldp timer tx-delay命令配置传输延迟tx-delay。使用命令相应的no形式,恢复默认配置。
命令语法
lldp timer tx-delay NUMBER
no lldp timer tx-delay
参数 |
参数说明 |
参数取值 |
NUMBER |
tx-delay 值 |
1-8192 |
命令模式
全局配置模式
默认配置
默认tx-delay的值为2s。
使用说明
tx-delay的值需要遵守公式:1 <= tx-delay <= ((0.25)* msg-tx-interval。
举例说明
配置tx-delay的值。
Switch# configure terminal
Switch(config)# lldp timer tx-delay 3
相关命令
lldp enable(global)
lldp enable(interface)
16.8.11lldp tlv basic
命令功能
在接口模式下,使用lldp tlv basic命令选择基础TLV。使用命令相应的no形式,取消选择。
命令语法
lldp tlv basic { port-description | system-name | system-description | system-capabilities | management-address | all }
no lldp tlv basic { port-description | system-name | system-description | system-capabilities | management-address | all }
参数 |
参数说明 |
参数取值 |
port-description |
选择端口描述 Tlv |
- |
system-name |
选择系统名称Tlv |
- |
system-description |
选择系统描述Tlv |
- |
system-capabilities |
选择系统能力 Tlv |
- |
management-address |
选择管理地址Tlv |
- |
all |
选择所有基础tlv |
- |
命令模式
端口配置模式
默认配置
所有基础tlv都已使能。
使用说明
无
举例说明
在端口配置模式下使用选择系统名称tlv
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# lldp tlv basic system-name
相关命令
lldp enable(global)
lldp enable(interface)
16.8.12lldp tlv 8021-org-specific
命令功能
在接口模式下,使用lldp tlv 8021-org-specific命令选择IEEE 802.1TLV。使用命令相应的no形式,取消选择。
命令语法
lldp tlv 8021-org-specific { port-vlan | protocol-vlan | vlan-name | protocol-id | link-aggregation | dcbx | all }
no lldp tlv 8021-org-specific { port-vlan | protocol-vlan | vlan-name | protocol-id | link-aggregation | dcbx | all }
参数 |
参数说明 |
参数取值 |
port-vlan |
选择 Port Vlan ID Tlv |
- |
protocol-vlan |
选择 Port and Protocol Vlan ID Tlv |
- |
vlan-name |
选择 Vlan Name Tlv |
- |
protocol-id |
选择 Protocol Identity Tlv |
- |
link-aggregation |
选择 Link Aggregation Tlv |
- |
dcbx |
选择DCBX Tlv |
- |
all |
选择除Link Aggregation Tlv的所有IEEE 802.1 tlv |
- |
命令模式
端口配置模式
默认配置
除Link Aggregation Tlv的所有IEEE 802.1 tlv都已使能。
使用说明
Link Aggregation Tlv 默认在 IEEE 802.3 tlv 中使能
举例说明
在端口配置模式下选择IEEE802.1 tlv
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# lldp tlv 8021-org-specific vlan-name
相关命令
lldp enable(global)
lldp enable(interface)
16.8.13lldp tlv 8021-org-specific vlan-name-value
命令功能
在接口模式下,使用lldp tlv 8021-org-specific vlan-name-value命令配置VLAN NAME TLV。使用命令相应的no形式,取消配置。
命令语法
lldp tlv 8021-org-specific vlan-name-value VLAN_ID
no lldp tlv 8021-org-specific vlan-name-value
参数 |
参数说明 |
参数取值 |
VLAN_ID |
VLAN NAME TLV中包含的vlan的id |
1-4094 |
命令模式
端口配置模式
默认配置
VLAN NAME TLV携带端口所属的默认VLAN。
使用说明
无
举例说明
在端口配置模式下配置VLAN NAME TLV中携带的Vlan id
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# lldp tlv 8021-org-specific vlan-name-value 2000
相关命令
lldp enable(global)
lldp enable(interface)
16.8.14lldp tlv 8023-org-specific
命令功能
在接口模式下,使用lldp tlv 8023-org-specific命令选择IEEE 802.3TLV。使用命令相应的no形式,取消选择。
命令语法
lldp tlv 8023-org-specific { mac-phy-cfg | power | link-aggregation | max-frame-size | all }
no lldp tlv 8023-org-specific { mac-phy-cfg | power | link-aggregation | max-frame-size | all }
参数 |
参数说明 |
参数取值 |
mac-phy-cfg |
选择 MAC/PHY Configuration/Status TLV |
- |
power |
选择Power Via MDI Tlv |
- |
link-aggregation |
选择 Link Aggregation Tlv |
- |
max-frame-size |
选择 Maximum Frame Size Tlv |
- |
all |
选择所有 IEEE 802.3 tlvs |
- |
命令模式
端口配置模式
默认配置
所有IEEE 802.3 tlv都已使能。
使用说明
Link Aggregation Tlv 默认在 IEEE 802.3 tlv 中使能
举例说明
在端口配置模式下选择IEEE802.3 tlv
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# lldp tlv 8023-org-specific power
相关命令
lldp enable(global)
lldp enable(interface)
16.8.15lldp tlv med
命令功能
在接口模式下,使用lldp tlv med命令选择MED TLV。使用命令相应的no形式,取消选择。
命令语法
lldp tlv med { network-policy | ext-power | inventory | all }
no lldp tlv med { network-policy | ext-power | inventory | all }
参数 |
参数说明 |
参数取值 |
network-policy |
选择 Network Policy TLV |
- |
ext-power |
选择 Extend Power-Via-MDI Tlv |
- |
inventory |
选择 Inventory Tlv |
- |
all |
选择除Location Identification Tlv 的所有MED tlv |
- |
命令模式
端口配置模式
默认配置
除Location Identification Tlv的所有MED tlv都已使能。
使用说明
当有MED的某一个tlv被选择的时候,LLDP-MED Capabilities TLV 会自动被选择;而当没有MED的其他tlv被选择时, LLDP-MED Capabilities TLV 会自动被取消。
举例说明
在端口配置模式下选择MED tlv
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# lldp tlv med inventory
相关命令
lldp enable(global)
lldp enable(interface)
16.8.16lldp tlv med location-id
命令功能
在接口模式下,使用lldp tlv med location-id命令选择并配置MED Location-id TLV。使用命令相应的no形式,取消选择。
命令语法
lldp tlv med location-id ( ecs-elin VALUE | civic DEV-TYPE CODE CA1-TYPE CA1-VALUE ( CA2-TYPE CA2-VALUE ( CA3-TYPE CA3-VALUE ( CA4-TYPE CA4-VALUE ( CA5-TYPE CA5-VALUE ( CA6-TYPE CA6-VALUE ( CA7-TYPE CA7-VALUE ( CA8-TYPE CA8-VALUE ( CA9-TYPE CA9-VALUE ( CA10-TYPE CA10-VALUE | ) | ) | ) | ) | ) | ) | ) | ) | ) )
no lldp tlv med location-id
参数 |
参数说明 |
参数取值 |
ecs-elin VALUE |
ECS ELIN 的地址,类型为电话号码 |
ECS ELIN 的地址,类型为电话号码,有效长度为[10-25] |
civic DEV-TYPE |
DEV-TYPE,设备类型,有效值为0-2, 0表示配置设备类型为DHCP server,1表示配置设备类型为Switch,2表示配置设备类型为LLDP-MED Endpoint |
0-2 |
CODE |
国家编码 |
CODE, 国家编码,取值范围请参考ISO 3166。 |
CA(n)-TYPE CA(n)-VALUE |
n的范围1-10 |
CA-TYPE CA-VALUE 地址信息,最多可以有10组, CA-TYPE的范围是0-255, CA-VALUE的长度范围是[1-232] |
命令模式
端口配置模式
默认配置
无
使用说明
无。
举例说明
在端口配置模式下配置MED Location-id tlv
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# lldp tlv med location-id ecs-elin 1234567890
相关命令
lldp enable(global)
lldp enable(interface)
16.8.17debug lldp
命令功能
在特权模式下,使用debug lldp命令打开LLDP的调试显示。使用该命令的no形式,恢复默认值。
命令语法
debug lldp ( events | packet | all | tlv-info )
no debug lldp ( events | packet | all | tlv-info )
参数 |
参数说明 |
参数取值 |
events |
LLDP 事件 |
- |
packet |
LLDP 报文信息 |
- |
all |
打开所有LLDP调试 |
- |
tlv-info |
打开TLV信息调试 |
- |
命令模式
特权模式
默认配置
无
使用说明
该命令用于显示属于DHCPv6中继的接口信息。
使用“terminal monitor ”使调试信息打印在VTY终端,使用“show logging buffer”查看log缓存中的信息。
举例说明
在特权模式下打开LLDP调试
Switch# debug lldp all
相关命令
terminal monitor
show logging buffer
16.8.18show lldp local
命令功能
在特权模式下,使用show lldp local命令显示LLDP的本地信息。
命令语法
show lldp local ( config | tlv-info ) ( interface ( IFNAME | mgmt-if ) | )
参数 |
参数说明 |
参数取值 |
config |
配置信息 |
- |
tlv-info |
本地LLDP TLV内容 |
- |
interface |
指定端口 |
- |
IFNAME |
物理端口名称 |
支持物理端口 |
mgmt-if |
管理口 |
- |
命令模式
特权模式
默认配置
无
使用说明
如果没有指定端口名称,将会显示全局的LLDP 本地信息。
举例说明
在特权模式下显示LLDP本地信息
Switch# show lldp local config
LLDP global configuration:
============================================================
LLDP function global enabled : NO
LLDP msgTxHold : 4
LLDP msgTxInterval : 30
LLDP reinitDelay : 2
LLDP txDelay : 2
Switch# show lldp local config interface eth-0-4
LLDP configuration on interface eth-0-4 :
============================================================
LLDP admin status : Disabled
Basic optional TLV Enabled:
Port Description TLV
System Name TLV
System Description TLV
System Capabilities TLV
Management Address TLV
IEEE 802.1 TLV Enabled:
Port Vlan ID TLV
Port and Protocol Vlan ID TLV
Vlan Name TLV
Protocol Identity TLV
IEEE 802.3 TLV Enabled:
MAC/PHY Configuration/Status TLV
Power Via MDI TLV
Link Aggregation TLV
Maximum Frame Size TLV
LLDP-MED TLV Enabled:
Med Capabilities TLV
Network Policy TLV
Extended Power-via-MDI TLV
Inventory TLV
相关命令
lldp enable(global)
lldp enable(interface)
lldp tlv basic
lldp tlv med
lldp tlv 8023-org-specific
lldp tlv 8021-org-specific
lldp msg-tx-hold
lldp timer msg-tx-interval
lldp timer reinitDelay
lldp timer tx-delay
16.8.19show lldp neighbor
命令功能
在特权模式下,使用show lldp neighbor命令显示LLDP 邻居信息。
命令语法
show lldp neighbor ( interface ( IFNAME | mgmt-if ) | ) ( brief | )
参数 |
参数说明 |
参数取值 |
interface |
指定端口 |
- |
IFNAME |
物理端口名称 |
支持物理端口 |
mgmt-if |
管理口 |
- |
brief |
显示简要信息 |
- |
命令模式
特权模式
默认配置
无
使用说明
该命令用于显示LLDP邻居信息。
举例说明
在特权模式下显示LLDP邻居简要信息
Switch# show lldp neighbor interface eth-0-4 brief
Local Port : eth-0-4
Remote Port : eth-0-6
Hold Time : 120
Expire Time : 116
System Name : switch
------------------------------------------------------------
相关命令
lldp enable(global)
lldp enable(interface)
16.8.20show lldp statistics
命令功能
在特权模式下,使用show lldp statistics命令显示LLDP统计信息。
命令语法
show lldp statistics ( interface ( IFNAME | mgmt-if ) | )
参数 |
参数说明 |
参数取值 |
interface |
指定端口 |
- |
IFNAME |
物理端口名称 |
支持物理端口 |
mgmt-if |
管理口 |
- |
命令模式
特权模式
默认配置
无
使用说明
该命令用于显示LLDP统计的详情。
举例说明
在特权模式下显示LLDP统计
Switch# show lldp statistics interface eth-0-4
LLDP statistics information:
============================================================
LLDP Port statistics for eth-0-4
Frames transmitted: 568
Frames Aged out: 0
Frames Discarded: 0
Frames with Error: 0
Frames Recieved: 364
TLVs discarded: 0
TLVs unrecognized: 0
相关命令
clear lldp statistics
16.8.21clear lldp statistics
命令功能
在特权模式下,使用clear lldp statistics命令清除LLDP统计信息。
命令语法
clear lldp statistics ( interface ( IFNAME | mgmt-if ) | )
参数 |
参数说明 |
参数取值 |
interface |
指定端口 |
- |
IFNAME |
物理端口名称 |
支持物理端口 |
mgmt-if |
管理口 |
- |
命令模式
特权模式
默认配置
无
使用说明
该命令清除LLDP 统计信息。
举例说明
在特权模式下清除LLDP统计信息
Switch# clear lldp statistics
相关命令
show lldp statistics
16.9IPFIX命令
16.9.1ipfix recorder
命令功能
此命令创建ipfix recorder并进入recorder配置模式。
使用关键字no删除指定的ipfix recorder。
命令语法
ipfix recorder NAME
no ipfix recorder NAME
参数 |
参数说明 |
参数取值 |
NAME |
ipfix recorder的名字 |
不超过32字符的字符串 |
命令模式
全局配置模式
默认配置
无
使用说明
如果ipfix recorder名称为一个已经存在的名称,则此命令表示进入IPFIX recorder配置模式;如果ipfix recorder名称为新名称,则此命令表示创建此recorder并进入IPFIX recorder配置模式;此处创建的ipfix recorder配合match和collect命令使用,具体见相关章节。
举例说明
在全局配置模式下创建一个名为recorder1的ipfix recorder并进入配置模式
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)#
Delete ipfix recorder recorder1:
Switch(config)# no ipfix recorder recorder1
删除名称为recorder1的ipfix recorder
Switch# configure terminal
Switch(config)# no ipfix recorder recorder1
相关命令
decription
match ipv4
match ipv6
match mpls
match transport
collect ttl
collect flow
collect counter
16.9.2description
命令功能
此命令用于描述ipfix recorder,使用关键字no删除指定的描述。
命令语法
description DESCRIPTION
参数 |
参数说明 |
参数取值 |
DESCRIPTION |
对ipfix recorder的描述 |
字符串长度不应超过64个字符 |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下对recorder进行描述
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# descrption this is a ipfix recorder
删除recorder的description
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# no description
相关命令
无
16.9.3match ipv4
命令功能
此命令配置ipfix recorder的ipv4字段,使用关键字no删除指定的ipv4字段。
命令语法
match ipv4 ( source | destination ) address ( mask IP_MASK_LEN | )
match ipv4 (dscp | ecn | ttl)
no match ipv4 (source | destination)address
no match ipv4 (dscp | ecn | ttl)
参数 |
参数说明 |
参数取值 |
source |
ipv4源ip地址 |
- |
destination |
ipv4目地ip地址 |
- |
dscp |
ipv4 dscp字段值 |
- |
ecn |
ipv4 ecn字段值 |
- |
ttl |
ipv4 ttl字段值 |
- |
IP_MASK_LEN |
ipv4地址子网掩码 |
1-32 |
命令模式
IPFIX recorder配置模式
默认配置
ipv4地址子网默认是32
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用ipv4的源ip地址和目地ip地址
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match ipv4 source address
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match ipv4 destination address
相关命令
无
16.9.4match ipv6
命令功能
此命令配置ipfix recorder的ipv6字段,使用关键字no删除指定的ipv6字段。
命令语法
match ipv6 ( source | destination ) address ( mask IPV6_MASK_LEN | )
no match ipv6(source | destination)address
match ipv6(flowlabel | dscp)
no match ipv6(flowlabel | dscp)
参数 |
参数说明 |
参数取值 |
source |
ipv6源ip地址 |
- |
destination |
ipv6目地ip地址 |
- |
dscp |
ipv6 dscp字段值 |
- |
flowlabel |
ipv6 flowlabel字段值 |
- |
IPV6_MASK_LEN |
ipv6地址子网掩码, |
范围是1-128,且必须是4的整数倍 |
命令模式
IPFIX recorder配置模式
默认配置
ipv6地址子网默认是128
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用ipv6的源ip地址和目地ip地址
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match ipv6 source address
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match ipv6 destination address
相关命令
无
16.9.5match mac
命令功能
此命令配置ipfix recorder的mac字段,使用关键字no删除指定的mac字段。
命令语法
match mac (destination | source) address
no match mac (destination | source)address
参数 |
参数说明 |
参数取值 |
source |
源mac地址 |
- |
destination |
目地mac地址 |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用mac的源mac地址
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match mac source address
相关命令
无
16.9.6match transport
命令功能
此命令配置ipfix recorder的transport字段,使用关键字no删除指定的transport字段。
命令语法
match transport(destination-port | source-port | type)
no match transport(destination-port | source-port | type)
match transport icmp(opcode | type)
no match transport icmp(opcode | type)
参数 |
参数说明 |
参数取值 |
destination-port |
目地端口号 |
- |
source-port |
源端口号 |
- |
type |
传输层类型 |
- |
opcode |
icmp操作码 |
- |
type |
icmp类型 |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用transport的源端口和目的端口
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match transport source-port
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match transport destination-port
相关命令
无
16.9.7match vlan
命令功能
此命令配置ipfix recorder的vlan字段,使用关键字no删除指定的vlan字段。
命令语法
match vlan(inner | )
no match vlan(inner | )
参数 |
参数说明 |
参数取值 |
inner |
内层vlan |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用内层vlan
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match vlan inner
相关命令
无
16.9.8match cos
命令功能
此命令配置ipfix recorder的cos字段,使用关键字no删除指定的cos字段。
命令语法
match cos(inner | )
no match cos(inner | )
参数 |
参数说明 |
参数取值 |
inner |
内层COS |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用内层cos
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match cos inner
相关命令
无
16.9.9match interface (input | output)
命令功能
此命令配置ipfix recorder的interface字段,使用关键字no删除指定的interface字段。
命令语法
match interface ( input | output )
no match interface ( input | output )
参数 |
参数说明 |
参数取值 |
input |
收方向 |
- |
output |
出方向 |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用收方向报文
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match interface input
相关命令
无
16.9.10match vxlan-vni
命令功能
此命令配置ipfix recorder的vxlan-vni字段,使用关键字no删除指定的vxlan-vni字段。
命令语法
match vxlan-vni
no match vxlan-vni
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用vxlan-vni
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match vxlan-vni
相关命令
无
16.9.11match nvgre-key
命令功能
此命令配置ipfix recorder的nvgre-key字段,使用关键字no删除指定的nvgre-key字段。
命令语法
match nvgre-key
no match nvgre-key
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用nvgre-key
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match nvgre-key
相关命令
无
16.9.12match transport tcp flags
命令功能
此命令配置ipfix recorder的tcp flags字段,使用关键字no删除指定的tcp flags字段。
命令语法
match transport tcp flags ( { ack | cwr | ece | fin | psh | rst | syn | urg } | )
no match transport tcp flags ( { ack | cwr | ece | fin | psh | rst | syn | urg } | )
参数 |
参数说明 |
参数取值 |
ack |
TCP ack字段 |
- |
cwr |
TCP ack字段 |
- |
ece |
TCP ece字段 |
- |
fin |
TCP finish字段 |
- |
psh |
TCP push字段 |
- |
rst |
TCP reset字段 |
- |
syn |
TCP synchronize字段 |
- |
urg |
TCP urgent字段 |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用tcp flags
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match transport tcp flags ack
相关命令
无
16.9.13match packet (drop | non-drop)
命令功能
此命令配置ipfix recorder的packet字段,使用关键字no删除指定的packet字段。
命令语法
match packet ( drop | non-drop )
no match packet ( drop | non-drop )
参数 |
参数说明 |
参数取值 |
drop |
被丢弃的报文 |
- |
non-drop |
未被丢弃的报文 |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置选用drop packet
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# match packet drop
相关命令
无
16.9.14collect counter
命令功能
此命令配置ipfix recorder收集ipfix流的byte和packet数目统计,使用关键字no设置不收集流的byte或者packet数目统计。
命令语法
collect counter (bytes | packets)
no collect counter(bytes | packets)
参数 |
参数说明 |
参数取值 |
bytes |
统计流的字节数目 |
- |
packets |
统计流的报文数目 |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置收集流记录中的byte数目
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# collect counter bytes
相关命令
无
16.9.15collect flow
命令功能
此命令配置ipfix recorder收集ipfix流的信息,使用关键字no设置不收集ipfix流的信息。
命令语法
collect flow ( drop | destination | fragmentation )
no collect flow ( drop | destination | fragmentation )
参数 |
参数说明 |
参数取值 |
drop |
统计ipfix流的丢弃情况 |
- |
destination |
统计流的目地地址 |
- |
fragmentation |
统计ipfix流的分片情况 |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置收集流信息中的目地地址
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# collect flow destination
相关命令
无
16.9.16collect ttl
命令功能
此命令配置ipfix recorder收集ipfix流的ttl信息,使用关键字no设置不收集ipfix流的ttl信息。
命令语法
collect ttl ( maximum | minimum | changed | )
no collect ttl ( maximum | minimum | changed | )
参数 |
参数说明 |
参数取值 |
maximum |
收集ipfix流的最大ttl值 |
- |
minimum |
收集ipfix流的最小ttl值 |
- |
changed |
收集ipfix流的ttl值的变化情况 |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置收集流信息中的最大ttl值和最小ttl值
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# collect ttl maximum
Switch(Config-ipfix-reocrder)# collect ttl minimum
相关命令
无
16.9.17collect timestamp
命令功能
此命令配置ipfix recorder收集ipfix流的timestamp信息,使用关键字no设置不收集ipfix流的timestamp信息。
命令语法
collect timestamp ( first | last )
no collect timestamp ( first | last )
参数 |
参数说明 |
参数取值 |
first |
收集ipfix流的开始时间值 |
- |
last |
收集ipfix流的结束时间值 |
- |
命令模式
IPFIX recorder配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX recorder配置模式下配置收集流信息中的开始时间值
Switch# configure terminal
Switch(config)# ipfix recorder recorder1
Switch(Config-ipfix-reocrder)# collect timestamp first
相关命令
无
16.9.18ipfix exporter
命令功能
此命令创建ipfix exporter并进入exporter配置模式,使用关键字no删除指定的ipfix exporter。
命令语法
ipfix exporter NAME
no ipfix exporter NAME
参数 |
参数说明 |
参数取值 |
NAME |
ipfix exporter的名字 |
不超过32字符的字符串 |
命令模式
全局配置模式
默认配置
无
使用说明
如果ipfix exporter名称为一个已经存在的名称,则此命令表示进入IPFIX exporter配置模式;如果ipfix exporter名称为新名称,则此命令表示创建此exporter并进入IPFIX exporter配置模式;此处创建的ipfix exporter配合其它命令使用,具体见相关章节。
举例说明
在全局配置模式下创建一个名为exporter1的ipfix exporter并进入配置模式
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)#
删除名称为exporter1的ipfix exporter
Switch# configure terminal
Switch(config)# no ipfix exporter exporter1
相关命令
template data timeout
flow data timeout
event flow start
event flow end (tcp-end|timeout)
transport protocol (udp|tcp)
16.9.19description
命令功能
此命令用于描述ipfix exporter,使用关键字no删除指定的描述。
命令语法
description DESCRIPTION
参数 |
参数说明 |
参数取值 |
DESCRIPTION |
对ipfix exporter 的描述 |
不超过64字符的字符串 |
命令模式
IPFIX exporter配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX exporter配置模式下对exporter进行描述
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# descrption this is a ipfix exporter
删除exporter的description
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# no description
相关命令
无
16.9.20destination
命令功能
此命令设置ipfix exporter需要发送的主机名,使用关键字no删除指定ipfix exporter需要发送的主机。
命令语法
destination HOST
no destination HOST
参数 |
参数说明 |
参数取值 |
HOST |
主机的名字,大小不超过32个字符 |
不超过32字符的字符串 |
命令模式
IPFIX exporter配置模式
默认配置
无
使用说明
使用host作为exporter的目的地时,host的IP地址会立即被解析出来。如果之后host和ip的映射关系发生改变,IPFIX不会随之改变报文的目的地,还会按照原来的目的IP发送报文。
举例说明
在IPFIX exporter配置模式下配置目的地为主机host1
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# destination host1
相关命令
无
16.9.21dscp
命令功能
此命令设置ipfix exporter需要发送出去的报文dscp值,使用关键字no删除指定ipfix exporter需要发送出去的报文dscp值。
命令语法
dscp DSCP
参数 |
参数说明 |
参数取值 |
DSCP |
dscp值 |
0-63 |
命令模式
IPFIX exporter配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX exporter配置模式下设置报文dscp值为20
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# dscp 20
相关命令
无
16.9.22domain-id
命令功能
此命令设置ipfix exporter需要发送出去的报文携带的ipfix domain值。
使用关键字no删除指定ipfix exporter需要发送出去的报文携带的ipfix domain值。
命令语法
domain-id ID
参数 |
参数说明 |
参数取值 |
ID |
domain id |
1-65535 |
命令模式
IPFIX exporter配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX exporter配置模式下设置报文携带的ipfix domain值为1000
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# domain-id 1000
相关命令
无
16.9.23source interface
命令功能
此命令设置ipfix exporter需要将流的信息从哪个interface发送出去。
使用关键字no删除指定ipfix exporter上的source interface信息。
命令语法
source interface interface-number
no source interface-number
命令模式
IPFIX exporter配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX exporter配置模式下设置将ipfix流的信息从eth-0-1上发送出去
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# source interface eth-0-1
相关命令
无
16.9.24template data timeout
命令功能
此命令设置ipfix exporter发送template 报文的时间间隔。
使用关键字no删除指定ipfix exporter上的template 报文发送时间间隔信息。
命令语法
template data timeout TIMEOUT
no template data timeout
参数 |
参数说明 |
参数取值 |
TIMEOUT |
ipfix exporter发送template 报文的时间间隔 |
1-86400 |
命令模式
IPFIX exporter配置模式
默认配置
600
使用说明
无
举例说明
在IPFIX exporter配置模式下设置发送template 报文的时间间隔为200秒
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# template data timeout 200
相关命令
无
16.9.25flow data timeout
命令功能
此命令设置ipfix exporter发送数据报文的时间间隔。
使用关键字no删除指定ipfix exporter上的数据报文发送时间间隔信息。
命令语法
flow data timeout TIMEOUT
no flow data timeout
参数 |
参数说明 |
参数取值 |
TIMEOUT |
ipfix exporter发送数据报文的时间间隔 |
1-86400 |
命令模式
IPFIX exporter配置模式
默认配置
600
使用说明
无
举例说明
在IPFIX exporter配置模式下设置发送数据报文的时间间隔为200秒
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# flow data timeout 200
相关命令
无
16.9.26transport protocol
命令功能
此命令设置ipfix exporter发送报文时使用的传输层协议即端口号。
使用关键字no删除指定ipfix exporter上的发送报文时使用的传输层协议及端口号。
命令语法
transport protocol udp port UDP_PORT
no transport protocol
参数 |
参数说明 |
参数取值 |
UDP_PORT |
传输协议号 |
范围大小是<2000-65535>,默认是2055 |
命令模式
IPFIX exporter配置模式
默认配置
2055
使用说明
无
举例说明
在IPFIX exporter配置模式下设置发送报文时使用的传输层协议为udp,端口号为3500
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# transport protocol udp 3500
相关命令
无
16.9.27ttl
命令功能
此命令设置ipfix exporter发送的报文的生存值ttl。
使用关键字no删除指定ipfix exporter上发送的报文的生存值ttl。
命令语法
ttl TTL
no ttl
参数 |
参数说明 |
参数取值 |
TTL |
TTL值 |
1-255 |
命令模式
IPFIX exporter配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX exporter配置模式下设置发送报文的ttl为255
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# ttl 255
相关命令
无
16.9.28event flow
命令功能
此命令设置ipfix exporter在何种flow事件下会立即发送数据。
使用关键字no取消指定ipfix exporter上flow event的设置。
命令语法
event flow start
no event flow start
event flow end ( tcp-end | timeout )
no event flow end ( tcp-end | timeout )
命令模式
IPFIX exporter配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX exporter配置模式下设置当tcp报文传输结束后立即向监控主机发送信息
Switch# configure terminal
Switch(config)# ipfix exporter exporter1
Switch(Config-ipfix-exporter)# event flow tcp-end
相关命令
无
16.9.29ipfix sampler
命令功能
此命令创建ipfix sampler并进入sampler配置模式。
使用关键字no删除指定的ipfix sampler。
命令语法
ipfix sampler NAME
no ipfix sampler NAME
参数 |
参数说明 |
参数取值 |
NAME |
ipfix sampler的名字 |
不超过32字符的字符串 |
命令模式
全局配置模式
默认配置
无
使用说明
如果ipfix sampler名称为一个已经存在的名称,则此命令表示进入IPFIX sampler配置模式;如果ipfix sampler名称为新名称,则此命令表示创建此sampler并进入IPFIX sampler配置模式;此处创建的ipfix sampler配合其它命令使用,具体见相关章节。
举例说明
在全局配置模式下创建一个名为sampler 1的ipfix sampler并进入配置模式
Switch# configure terminal
Switch(config)# ipfix sampler sampler 1
Switch(Config-ipfix-sampler)#
删除名称为recorder1的ipfix sampler
Switch# configure terminal
Switch(config)# no ipfix sampler sampler1
相关命令
1 out-of
16.9.30description
命令功能
此命令用于描述ipfix sampler,使用关键字no删除指定的描述。
命令语法
description DESCRIPTION
参数 |
参数说明 |
参数取值 |
DESCRIPTION |
对ipfix sampler的描述 |
不超过64字符的字符串 |
命令模式
IPFIX sampler配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX sampler配置模式下对sampler进行描述
Switch# configure terminal
Switch(config)# ipfix sampler sampler 1
Switch(Config-ipfix-sampler)# descrption this is a ipfix sampler
删除sampler的description
Switch# configure terminal
Switch(config)# ipfix sampler sampler 1
Switch(Config-ipfix-sampler)# no description
相关命令
无
16.9.311 out-of
命令功能
此命令设置ipfix sampler的采样频率。
使用关键字no取消指定ipfix sampler上取样频率设置。
命令语法
1 out of CLI_IPFIX_SAMPLER_RATE_RNG
参数 |
参数说明 |
参数取值 |
CLI_IPFIX_SAMPLER_RATE_RNG |
多少个报文取样一次 |
1-65535 |
命令模式
IPFIX sampler配置模式
默认配置
100
使用说明
无
举例说明
在IPFIX sampler配置模式下设置取样频率是1/100
Switch# configure terminal
Switch(config)# ipfix sampler sampler 1
Switch(Config-ipfix-sampler)# 1 out of 100
相关命令
无
16.9.32ipfix monitor (global)
命令功能
此命令创建ipfix monitor并进入monitor配置模式。
使用关键字no删除指定的ipfix monitor。
命令语法
ipfix monitor NAME
no ipfix monitor NAME
参数 |
参数说明 |
参数取值 |
NAME |
Ipfix monitor的名字 |
不超过32字符的字符串 |
命令模式
全局配置模式
默认配置
无
使用说明
如果ipfix monitor名称为一个已经存在的名称,则此命令表示进入IPFIX monitor配置模式;如果ipfix monitor名称为新名称,则此命令表示创建此monitor并进入IPFIX monitor配置模式;此处创建的ipfix monitor配合其它命令使用,具体见相关章节。
举例说明
在全局配置模式下创建一个名为monitor1的ipfix monitor并进入配置模式
Switch# configure terminal
Switch(config)# ipfix monitor monitor1
Switch(Config-ipfix-monitor)#
删除名称为monitor1的ipfix monitor
Switch# configure terminal
Switch(config)# no ipfix monitor monitor1
相关命令
recorder
exporter
16.9.33description
命令功能
此命令用于描述ipfix monitor,使用关键字no删除指定的描述。
命令语法
description DESCRIPTION
参数 |
参数说明 |
参数取值 |
DESCRIPTION |
对ipfix monitor的描述,Description不应超过64个字符 |
不超过64字符的字符串 |
命令模式
IPFIX monitor配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX monitor配置模式下对monitor进行描述
Switch# configure terminal
Switch(config)# ipfix monitor monitor1
Switch(Config-ipfix-monitor)# descrption this is a ipfix monitor
删除monitor的description
Switch# configure terminal
Switch(config)# ipfix monitor monitor1
Switch(Config-ipfix-monitor)# no description
相关命令
无
16.9.34recorder
命令功能
此命令用于设置ipfix monitor的recorder,使用关键字no删除monitor的recorder。
命令语法
recorder NAME
参数 |
参数说明 |
参数取值 |
NAME |
ipfix recorder的名字 |
不超过32字符的字符串 |
命令模式
IPFIX monitor配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX monitor配置模式下配置recorder
Switch# configure terminal
Switch(config)# ipfix monitor monitor1
Switch(Config-ipfix-monitor)# recorder recorder1
相关命令
无
16.9.35exporter
命令功能
此命令用于设置ipfix monitor的exporter,使用关键字no删除monitor的exporter。
命令语法
exporter NAME
参数 |
参数说明 |
参数取值 |
NAME |
ipfix exporter的名字 |
不超过32字符的字符串 |
命令模式
IPFIX monitor配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX monitor配置模式下配置exporter
Switch# configure terminal
Switch(config)# ipfix monitor monitor1
Switch(Config-ipfix-monitor)# exporter exporter1
相关命令
无
16.9.36flow mirror
命令功能
此命令用于设置ipfix monitor的flow mirror,使用关键字no删除monitor的flow mirror。
命令语法
flow mirror packet CLI_IPFIX_MIRROR_COUNT_RNG monitor to session 1
参数 |
参数说明 |
参数取值 |
CLI_IPFIX_MIRROR_COUNT_RNG |
包数值,取每条流定前指定数目包 |
范围1-255 |
命令模式
IPFIX monitor配置模式
默认配置
无
使用说明
无
举例说明
在IPFIX monitor配置模式下配置flow mirror
Switch# configure terminal
Switch(config)# ipfix monitor monitor1
Switch(Config-ipfix-monitor)# flow mirror packet 1 monitor to session 1
相关命令
无
16.9.37ipfix monitor (interface/port-group/vlan group)
命令功能
此命令用于启用ipfix。
命令语法
ipfix monitor ( input | output ) NAME ( sampler NAME | )
no ipfix monitor ( input | output )
参数 |
参数说明 |
参数取值 |
input |
对端口ingress方向的报文做ipfix |
- |
output |
对端口egress方向的报文做ipfix |
- |
NAME |
IPFIX monitor的名字 |
不超过32字符的字符串 |
sampler NAME |
IPFIX sampler的名字 |
不超过32字符的字符串 |
命令模式
端口配置模式
端口组配置模式
VLAN组配置模式
默认配置
无
使用说明
无
举例说明
在接口模式下对ingress方向做ipfix
Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# ipfix monitor input monitor sampler test-sample
相关命令
无
16.9.38ipfix global configure
命令功能
此命令用于进入IPFIX全局配置模式。
命令语法
ipfix global
命令模式
全局配置模式
默认配置
无
使用说明
无
举例说明
下面的例子显示了如何进入IPFIX全局配置模式
Switch# configure terminal
Switch(config)# ipfix global
Switch(config-ipfix-global)#
相关命令
无
16.9.39ipfix global flow
命令功能
此命令用于设置ipfix的全局配置。
命令语法
ipfix global flow aging CLI_IPFIX_AGING_INTVAL_RNG
flow export CLI_IPFIX_CACHE_EXPORT_INTVAL_RNG
参数 |
参数说明 |
参数取值 |
CLI_IPFIX_AGING_INTVAL_RNG |
流老化时间 |
范围1-65535,默认1800秒 |
CLI_IPFIX_CACHE_EXPORT_INTVAL_RNG |
流上报时间间隔 |
范围1-1000,默认5秒 |
命令模式
IPFIX全局配置模式
默认配置
无
使用说明
无
举例说明
在全局配置模式设置ipfix 流的老化时间为200秒
Switch# configure terminal
Switch(config)# ipfix global flow aging 200
在IPFIX全局配置模式设置IPFIX流的上报间隔为10秒
Switch# configure terminal
Switch(config)# ipfix global
Switch(config-ipfix-global)# flow export 10
相关命令
无
16.9.40show ipfix recorder
命令功能
此命令用于显示指定recorder的配置信息。
命令语法
show ipfix recorder NAME
参数 |
参数说明 |
参数取值 |
NAME |
ipfix recorder的名字 |
不超过32字符的字符串 |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
在特权模式下查看recorder1的配置
Switch# show ipfix recorder recorder1
相关命令
无
16.9.41show ipfix exporter
命令功能
此命令用于显示指定exporter的配置信息。
命令语法
show ipfix exporter NAME
参数 |
参数说明 |
参数取值 |
NAME |
ipfix exporter的名字 |
不超过32字符的字符串 |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
在特权模式下查看exporter1的配置
Switch# show ipfix exporter exporter1
相关命令
无
16.9.42show ipfix cache
命令功能
此命令用于显示ipfix状态信息。
命令语法
show ipfix cache monitor MNAME
show ipfix cache observe-point interface ( IFPHYSICAL | IFVLAN | IFAGG ) ( input | output )
show ipfix cache observe-point vlan “CLI_IPFIX_ALL_VLAN_CLI_RNG” ( input | output )
show ipfix cache observe-point port-group PGNAME ( input | output )
show ipfix cache observe-point vlan-group VGNAME ( input | output )
show ipfix cache observe-point cid-pair role-based
参数 |
参数说明 |
参数取值 |
MNAME |
ipfix monitor的名字 |
不超过32字符的字符串 |
IFPHYSICAL |
端口名字 |
支持物理端口,聚合端口,VLAN端口 |
input |
接口的input方向 |
- |
output |
接口的output方向 |
- |
CLI_IPFIX_ALL_VLAN_CLI_RNG |
VLAN id |
- |
PGNAME |
Port-group的名字 |
- |
VGNAME |
Vlan-group的名字 |
- |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
在特权模式下查看端口eth-0-1上ingress的流的状态
Switch# show ipfix cache observe-point interface eth-0-1 input
相关命令
无
16.9.43show ipfix monitor
命令功能
此命令用于显示指定monitor的配置信息。
命令语法
show ipfix monitor NAME
参数 |
参数说明 |
参数取值 |
NAME |
ipfix monitor的名字 |
不超过32字符的字符串 |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
在特权模式下查看monitor 1的配置
Switch# show ipfix monitor monitor 1
相关命令
无
16.9.44show ipfix sampler
命令功能
此命令用于显示指定sampler的配置信息。
命令语法
show ipfix sampler NAME
参数 |
参数说明 |
参数取值 |
NAME |
ipfix sampler的名字 |
不超过32字符的字符串 |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
在特权模式下查看sampler1的配置
Switch# show ipfix sampler sampler1
相关命令
无
16.9.45show resource ipfix
命令功能
此命令用于显示ipfix资源信息。
命令语法
show resource ipfix
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
Switch# show resource ipfix
相关命令
无
16.9.46clear ipfix cache monitor
命令功能
此命令用于清除指定monitor的cache信息。
命令语法
clear ipfix cache monitor NAME
参数 |
参数说明 |
参数取值 |
NAME |
IPFIX monitor对应的名称 |
不超过32字符的字符串 |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
在特权模式下清除ipfix test的cache
Switch# clear ipfix cache monitor test
相关命令
无
16.9.47clear ipfix cache observe-point interface
命令功能
此命令用于显示指定端口的cache信息。
命令语法
clear ipfix cache observe-point interface ( IFNAME ) ( input | output )
参数 |
参数说明 |
参数取值 |
IFPHYSICAL |
端口名字 |
支持物理端口,聚合端口,VLAN端口 |
input |
入方向流量 |
- |
output |
出方向流量 |
- |
命令模式
特权模式
默认配置
无
使用说明
无
举例说明
在特权模式下清除端口eth-0-1的cache
Switch# clear ipfix cache observe-point interface eth-0-1 input
相关命令
无
16.10Hardware Monitor命令
16.10.1hardware monitor watermark
命令功能
使用此命令修改水印功能的记录周期,使用该命令的no形式将记录周期恢复为默认值(30)。
命令语法
hardware monitor watermark interval <1-60>
no hardware monitor watermark interval
参数 |
参数说明 |
参数取值 |
<1-60> |
水印功能的记录周期。单位:分钟 |
1-60 |
命令模式
全局配置模式
默认配置
记录周期的默认值是30分钟
使用说明
水印功能用来周期性地记录一个周期内某接口最大的buffer cell占用数值和最大的延时数值。
举例说明
如下示例,显示了如何配置水印功能的记录周期为2分钟
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# hardware monitor watermark interval 2
相关命令
show hardware monitor watermark interface IFPHYSICAL
16.10.2show hardware monitor watermark interface
命令功能
使用此命令显示水印功能在一个记录周期内统计到的某端口上最大的buffer cell占用数值和最大的延时数值;使用此命令的clear形式清除某端口上的统计数据。
命令语法
show hardware monitor watermark interface IFPHYSICAL
clear hardware monitor watermark interface IFPHYSICAL
参数 |
参数说明 |
参数取值 |
IFPHYSICAL |
物理端口号 |
视具体版型而定 |
命令模式
特权模式
默认配置
无
使用说明
使用该命令前需要先使能端口上的buffer monitor和latency monitor功能
举例说明
如下示例,显示了如何配置水印功能的记录周期为1分钟,显示在eth-0-5端口上的统计数据
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# hardware monitor watermark interval 1
Switch(config)# end
Switch# show hardware monitor watermark interface eth-0-5
Switch# show hardware monitor watermark interface eth-0-5
Time Latency Buffer(total)
---------------------------------------------------------------------
Jan 28 07:12:25 16040000 58373
Jan 28 07:11:25 16032288 58373
相关命令
无
16.10.3hardware monitor notify server
命令功能
使用此命令配置通告服务器的IP地址和UDP端口号,使用该命令的no形式删除配置。
命令语法
hardware monitor notify server A.B.C.D ( port <1-65535> | )
no hardware monitor notify server
参数 |
参数说明 |
参数取值 |
A.B.C.D |
通告服务器的IP地址。 |
- |
<1-65535> |
UDP端口号。 |
1-65535 |
命令模式
全局配置模式
默认配置
默认端口号:20008
使用说明
配置此命令后,交换机将周期性或立即向指定服务器发送Buffer Stats Notify、Latency Stats Notify、Buffer Micro-burst Notify、Latency Event Notify或者Latency Average Notify报文
举例说明
如下示例,显示了如何配置通告服务器的IP地址为192.108.10.2,UDP端口号为35000
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# hardware monitor notify server 192.108.10.2 port 35000
相关命令
无
16.10.4hardware monitor notify interval
命令功能
使用此命令配置向通告服务器发送Stats Notify报文的时间间隔,使用该命令的no形式将时间间隔恢复为默认值(60)。
命令语法
hardware monitor notify interval <10-300>
no hardware monitor notify interval
参数 |
参数说明 |
参数取值 |
<10-300> |
发送Notify报文的时间间隔。单位:秒 |
10-300 |
命令模式
全局配置模式
默认配置
默认时间间隔:60秒
使用说明
无
举例说明
如下示例,显示了如何配置时间间隔为30秒
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# hardware monitor notify interval 30
相关命令
无
16.10.5hardware buffer-monitor notify
命令功能
使用此命令使能接口的buffer cell统计通告和拥塞事件通告功能;使用该命令的no形式关闭接口的buffer cell统计通告和拥塞事件通告功能
命令语法
hardware buffer-monitor notify
no hardware buffer-monitor notify
命令模式
端口配置模式
默认配置
N/A
使用说明
开启该功能后,交换机会周期性地向通告服务器发送Buffer Stats Notify报文,当有拥塞事件(Micro-burst)产生时,会立即向通告服务器发送Buffer Micro-burst Notify报文
举例说明
如下示例,显示了如何使能eth-0-9端口的Buffer统计通告和拥塞事件通告功能
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface eth-0-9
Switch(config-if)# hardware buffer-monitor notify
相关命令
无
16.10.6hardware latency-monitor notify
命令功能
使用此命令使能接口的Latency统计通告、延迟事件通告和平均延迟通告功能;使用此命令的no形式关闭接口的Latency统计通告、延迟事件通告和平均延迟通告功能
命令语法
hardware latency-monitor notify
no hardware latency-monitor notify
参数 |
参数说明 |
参数取值 |
N/A |
N/A |
N/A |
命令模式
端口配置模式
默认配置
N/A
使用说明
开启该功能后,交换机会周期性地向通告服务器发送Latency Stats Notify报文和Latency Average Notify报文,当有延迟事件产生时,会立即向通告服务器发送Latency Event Notify报文
Latency Stats Notify报文发送周期由hardware monitor notify interval命令控制
举例说明
如下示例,显示了如何使能eth-0-9端口的Latency统计通告、延迟事件通告和平均延迟通告功能
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface eth-0-9
Switch(config-if)# hardware latency-monitor notify
相关命令
无
16.10.7show hardware monitor statistics
命令功能
使用此命令显示交换机向通告服务器发出的Latency Interval Notify Messages、Latency Event Notify Messages、Buffer Interval Notify Messages、Buffer Event Notify Messages报文的数量;使用该命令的clear形式清除交换机的统计数据。
命令语法
show hardware monitor statistics
clear hardware monitor statistics
参数 |
参数说明 |
参数取值 |
N/A |
N/A |
N/A |
命令模式
特权模式
默认配置
N/A
使用说明
无
举例说明
如下示例,显示了交换机向通告服务器发出的四种类型的通告报文的数量
Switch# show hardware monitor statistics
Notify Statistics:
=======================================
Latency Interval Notify Messages : 0
Latency Event Notify Messages : 0
Buffer Interval Notify Messages : 0
Buffer Event Notify Messages : 0
Latency Average Notify Messages : 0
相关命令
无
16.10.8hardware buffer-monitor
命令功能
使用此命令使能端口的拥塞监控功能;使用此命令的no形式关闭端口的拥塞监控功能
命令语法
hardware buffer-monitor enable
no hardware buffer-monitor enable
参数 |
参数说明 |
参数取值 |
N/A |
N/A |
N/A |
命令模式
端口配置模式
默认配置
N/A
使用说明
无
举例说明
如下示例,显示了如何使能eth-0-9端口的拥塞监控功能
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface eth-0-9
Switch(config-if)# hardware buffer-monitor enable
相关命令
无
16.10.9hardware buffer-monitor micro-burst
命令功能
使用此命令使能交换机的拥塞事件上报功能;使用此命令的no形式关闭交换机的拥塞事件上报功能
命令语法
hardware buffer-monitor micro-burst enable
no hardware buffer-monitor micro-burst enable
参数 |
参数说明 |
参数取值 |
N/A |
N/A |
N/A |
命令模式
全局配置模式
默认配置
N/A
使用说明
无
举例说明
如下示例,显示了如何使能交换机的拥塞事件上报功能
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# hardware buffer-monitor micro-burst enable
相关命令
无
16.10.10hardware buffer-monitor micro-burst threshold
命令功能
使用此命令设置触发拥塞事件上报的高低阈值;使用此命令的no形式将高低阈值恢复为默认值
命令语法
hardware buffer-monitor micro-burst threshold low <8-16383> high <8-16383>
no hardware buffer-monitor micro-burst threshold
参数 |
参数说明 |
参数取值 |
<8-16383> |
触发拥塞事件上报的低阈值。单位:buffer cell |
8-16383 |
<8-16383> |
触发拥塞事件上报的高阈值。单位:buffer cell |
8-16383,必须大于低阈值 |
命令模式
全局配置模式
默认配置
低阈值默认值:16
高阈值默认值:64
使用说明
无
举例说明
如下示例,显示了如何设置触发拥塞事件上报的低阈值为64,高阈值为16000
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# hardware buffer-monitor micro-burst threshold low 64 high 16000
相关命令
无
16.10.11show hardware buffer-monitor status
命令功能
使用此命令显示交换机上buffer monitor相关的所有配置
命令语法
show hardware buffer-monitor status
参数 |
参数说明 |
参数取值 |
N/A |
N/A |
N/A |
命令模式
特权模式
默认配置
N/A
使用说明
N/A
举例说明
如下所示,显示交换机上有关buffer-monitor的所有配置
Switch# show hardware buffer-monitor status
Hardware buffer micro-burst event: disable
Hardware buffer micro-burst threshold low: 16 high: 64
Port buffer monitor
-----------------------------------------------------------------------------
eth-0-1 disable
eth-0-2 disable
eth-0-3 disable
eth-0-4 disable
eth-0-5 enable
eth-0-6 disable
eth-0-7 disable
eth-0-8 disable
eth-0-9 enable
eth-0-10 disable
eth-0-11 disable
eth-0-12 disable
eth-0-13 disable
eth-0-14 disable
eth-0-15 disable
eth-0-16 disable
eth-0-17 disable
eth-0-18 disable
eth-0-19 disable
eth-0-20 disable
相关命令
无
16.10.12show hardware buffer-monitor interface
命令功能
使用此命令显示某端口在采样时间点(10毫秒采样一次)上积累的报文数目;使用此命令的clear形式清除某端口的统计数据
命令语法
show hardware buffer-monitor interface IFPHYSICAL ( | <16-30000> )
clear hardware buffer-monitor interface IFPHYSICAL
参数 |
参数说明 |
参数取值 |
IFPHYSICAL |
物理端口号 |
视具体版型而定 |
(|<16-30000>) |
显示在终端的记录数量 |
16-30000 |
命令模式
特权模式
默认配置
N/A
使用说明
N/A
举例说明
如下所示,显示了eth-0-5端口上前20条统计数据
Switch# show hardware buffer-monitor interface eth-0-5 20
Brief CLI issued at : 08:39:15 UTC Fri Jan 28 2022
Flag (micro-burst) : S - Start record E - End record U - Update record
Flag Time Total count
--------------------------------------------------------
- 08:39:11.698066906 58368
- 08:39:11.688067287 58367
- 08:39:11.678067668 58365
- 08:39:11.668068049 58366
- 08:39:11.658068430 58369
- 08:39:11.648068811 58368
- 08:39:11.638069192 58367
- 08:39:11.628069573 58366
- 08:39:11.618069954 58370
- 08:39:11.608070335 58367
- 08:39:11.598070716 58368
- 08:39:11.588071097 58369
- 08:39:11.578071478 58368
- 08:39:11.568071859 58367
- 08:39:11.558072240 58367
- 08:39:11.548072621 58369
- 08:39:11.538073002 58366
- 08:39:11.528073383 58368
- 08:39:11.518073764 58369
- 08:39:11.508074145 58369
相关命令
无
16.10.13show hardware buffer-monitor micro-burst interface
命令功能
使用此命令显示某端口上统计到的拥塞事件;使用该命令的clear形式清除某端口上的统计数据。
命令语法
show hardware buffer-monitor micro-burst interface IFPHYSICAL
clear hardware buffer-monitor micro-burst interface IFPHYSICAL
参数 |
参数说明 |
参数取值 |
IFPHYSICAL |
物理端口号 |
视具体版型而定 |
命令模式
特权模式
默认配置
N/A
使用说明
N/A
举例说明
如下所示,显示了端口eth-0-5上的拥塞事件的统计数据
Switch# show hardware buffer-monitor micro-burst interface eth-0-5
Brief CLI issued at : 09:20:11 UTC Fri Jan 28 2022
Flag (micro-burst) : S - Start record E - End record
Flag Time(ns) Total count Threshold level
---------------------------------------------------------------------
E 09:20:06.892459921 15 0
S 09:19:05.087003316 64 0
相关命令
无
16.10.14hardware latency-monitor
命令功能
使用此命令使能端口的延迟监控功能;使用此命令的no形式关闭端口的延迟监控功能
命令语法
hardware latency-monitor enable
no hardware latency-monitor enable
参数 |
参数说明 |
参数取值 |
N/A |
N/A |
N/A |
命令模式
端口配置模式
默认配置
N/A
使用说明
N/A
举例说明
如下示例,显示了如何使能eth-0-9端口的延迟监控功能
DUT1# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
DUT1(config)# interface eth-0-9
DUT1(config-if)# hardware latency-monitor enable
相关命令
无
16.10.15hardware latency-monitor threshold event
命令功能
使用此命令设置全局触发延迟事件上报的阈值;使用此命令的no形式将阈值恢复为默认值
命令语法
hardware latency-monitor threshold event low <64-2147483647> high <64-2147483647>
no hardware latency-monitor threshold event
参数 |
参数说明 |
参数取值 |
<64-2147483647> |
触发延迟事件上报的低阈值。单位:纳秒 |
64-2147483647 |
<64-2147483647> |
触发延迟事件上报的高阈值。单位:纳秒 |
64-2147483647 |
命令模式
全局配置模式
默认配置
低阈值默认值:768
高阈值默认值:3072
使用说明
高低阈值的数值必须是64的整数倍。如果有报文的延迟时间高于高阈值,则交换机会上报一个延迟开始事件;若报文的延迟时间高于高阈值后低于低阈值,则交换机会上报一个延迟结束事件;该命令需先使能端口的延迟监控功能
举例说明
如下示例,显示了如何设置全局触发拥塞事件上报的低阈值为640ns,高阈值为64000ns
DUT1# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
DUT1(config)# hardware latency-monitor threshold event low 640 high 64000
相关命令
无
16.10.16hardware latency-monitor avg-latency interval
命令功能
使用此命令设置全局计算平均时延的周期;使用此命令的no形式将周期恢复为默认值
命令语法
hardware latency-monitor avg-latency interval <1-5>
no hardware latency-monitor avg-latency interval
参数 |
参数说明 |
参数取值 |
<1-5> |
计算平均时延的阈值。单位:秒 |
1-5 |
命令模式
全局配置模式
默认配置
周期默认值:5秒
使用说明
N/A
举例说明
如下示例,显示了如何设置全局计算平均时延的周期为3s
DUT1# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
DUT1(config)# hardware latency-monitor avg-latency interval 3
相关命令
无
16.10.17hardware latency-monitor range
命令功能
使用此命令配置系统的8个延迟区间;使用该命令的no形式将延迟区间恢复默认值
命令语法
hardware latency-monitor range <1-4261412864> <1-4261412864> <1-4261412864> <1-4261412864> <1-4261412864> <1-4261412864> <1-4261412864>
no hardware latency-monitor range
参数 |
参数说明 |
参数取值 |
<1-4261412864> |
延迟区间一 |
1-4261412864。单位:纳秒。必须是64的整数倍 |
<1-4261412864> |
延迟区间二 |
1-4261412864。单位:纳秒。必须是64的整数倍且大于区间一 |
<1-4261412864> |
延迟区间三 |
1-4261412864。单位:纳秒。必须是64的整数倍且大于区间二 |
<1-4261412864> |
延迟区间四 |
1-4261412864。单位:纳秒。必须是64的整数倍且大于区间三 |
<1-4261412864> |
延迟区间五 |
1-4261412864。单位:纳秒。必须是64的整数倍且大于区间四 |
<1-4261412864> |
延迟区间六 |
1-4261412864。单位:纳秒。必须是64的整数倍且大于区间五 |
<1-4261412864> |
延迟区间七 |
1-4261412864。单位:纳秒。必须是64的整数倍且大于区间六 |
命令模式
全局配置模式
默认配置
延迟区间一默认值:1-448
延迟区间二默认值:448-768
延迟区间三默认值:768-1152
延迟区间四默认值:1152-1536
延迟区间五默认值:1536-2048
延迟区间六默认值:2048-3072
延迟区间七默认值:3072-5120
延迟区间八默认值:5120-infinity
使用说明
无
举例说明
如下示例,显示了如何将八个延迟区间设置为1-640,640-3200,3200-6400,6400-12800,12800-25600,25600-128000,128000-256000,,256000-无穷大
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# hardware latency-monitor range 640 3200 6400 12800 25600 128000 256000
相关命令
无
16.10.18hardware latency-monitor drop
命令功能
使用此命令使能端口的高转发时延报文丢弃功能;使用该命令的no形式关闭此功能
命令语法
hardware latency-monitor drop
no hardware latency-monitor drop
参数 |
参数说明 |
参数取值 |
N/A |
N/A |
N/A |
命令模式
端口配置模式
默认配置
无
使用说明
无
举例说明
如下所示,显示了如何使能eth-0-9端口的高转发时延报文丢弃功能
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface eth-0-9
Switch(config-if)# hardware latency-monitor drop
相关命令
hardware latency-monitor threshold drop
16.10.19hardware latency-monitor threshold drop
命令功能
使用此命令设置端口丢弃高转发时延报文的阈值;使用此命令的no形式将其恢复为默认值
命令语法
hardware latency-monitor threshold drop <2-8>
no hardware latency-monitor threshold drop
参数 |
参数说明 |
参数取值 |
<2-8> |
丢弃阈值。单位:延时区间 |
2-8 |
命令模式
端口配置模式
默认配置
丢弃阈值的默认值为8,即转发时延位于第8个延时区间的报文将被丢弃
使用说明
使用该命令前需要先使能端口的高转发时延报文丢弃功能
举例说明
如下所示,显示了如何配置eth-0-9端口将转发时延位于第6个延时区间的报文丢弃
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface eth-0-9
Switch(config-if)# hardware latency-monitor threshold drop 6
相关命令
hardware latency-monitor range
16.10.20show hardware latency-monitor status
命令功能
使用此命令显示交换机上latency monitor相关的所有配置
命令语法
show hardware latency-monitor status
参数 |
参数说明 |
参数取值 |
N/A |
N/A |
N/A |
命令模式
特权模式
默认配置
N/A
使用说明
N/A
举例说明
如下所示,显示了交换机上有关latency-monitor的所有配置
Switch# show hardware latency-monitor status
Hardware latency monitor range(ns)
Range1: 1-448 Range2: 448-768 Range3: 768-1152 Range4: 1152-1536
Range5: 1536-2048 Range6: 2048-3072 Range7: 3072-5120 Range8: 5120-more
Port monitor event low event high drop-threshold
-----------------------------------------------------------------------------
eth-0-1 disable disable disable disable
eth-0-2 disable disable disable disable
eth-0-3 disable disable disable disable
eth-0-4 disable disable disable disable
eth-0-5 enable 768 3072 disable
eth-0-6 disable disable disable disable
eth-0-7 disable disable disable disable
eth-0-8 disable disable disable disable
eth-0-9 enable 768 3072 disable
eth-0-10 disable disable disable disable
eth-0-11 disable disable disable disable
eth-0-12 disable disable disable disable
eth-0-13 disable disable disable disable
eth-0-14 disable disable disable disable
eth-0-15 disable disable disable disable
eth-0-16 disable disable disable disable
eth-0-17 disable disable disable disable
eth-0-18 disable disable disable disable
eth-0-19 disable disable disable disable
eth-0-20 disable disable disable disable
相关命令
无
16.10.21show hardware latency-monitor interface
命令功能
使用此命令显示latency monitor在某端口上统计到的报文数目;使用该命令的clear形式清除某端口上的数据
命令语法
show hardware latency-monitor interface IFPHYSICAL ( | <16-30000> )
clear hardware latency-monitor interface IFPHYSICAL
参数 |
参数说明 |
参数取值 |
IFPHYSICAL |
物理端口号 |
视具体型号而定 |
<16-30000> |
显示在终端的记录数量 |
16-30000 |
命令模式
特权模式
默认配置
N/A
使用说明
N/A
举例说明
如下所示,显示了eth-0-5端口上前20条统计数据
Switch# show hardware latency-monitor interface eth-0-5 20
Brief CLI issued at: 09:52:57 UTC Fri Jan 28 2022
Format: 0-448 - the count of packets with latency between 0ns and 448ns
0 448 768 1152 1536 2048 3072 5120
- $$ - - - - - - -
Time 448 768 1152 1536 2048 3072 5120 more
09:52:57.366657807 35 2447 4492 3633 994 1256 1207 581
09:52:57.356657807 41 2519 4743 3675 1016 1463 1001 180
09:52:57.346657807 55 2752 5017 3957 961 1213 637 51
09:52:57.336657807 43 2463 4629 3519 877 1266 1123 721
09:52:57.326657807 41 2464 4827 3900 959 1243 805 403
09:52:57.316657807 37 2681 4951 3767 1015 1187 750 256
09:52:57.306657807 49 2411 4614 3541 848 1254 1175 754
09:52:57.296657807 32 2581 4571 3635 1038 1475 1138 167
09:52:57.286657807 41 2666 5036 3875 885 1057 874 207
09:52:57.276657807 38 2506 4802 3792 976 1163 1105 260
09:52:57.266657807 44 2602 5010 3581 826 966 1142 472
09:52:57.256657807 49 2599 5079 3855 918 1012 837 293
09:52:57.246657807 45 2539 4829 3919 923 1176 881 330
09:52:57.236657807 46 2628 4902 3658 925 1170 1040 273
09:52:57.226657807 41 2730 4940 3684 821 985 940 501
09:52:57.216657807 50 2766 5094 4038 890 959 748 96
09:52:57.206657807 42 2588 4813 3816 885 1144 1051 307
09:52:57.196657807 41 2496 4920 3728 788 1258 1227 180
09:52:57.186657807 35 2640 4810 3946 1010 1305 833 66
09:52:57.176657807 45 2496 4782 3809 873 1103 1062 474
相关命令
hardware latency-monitor range
16.10.22show hardware latency-monitor event interface
命令功能
使用此命令显示某端口上统计到的延迟事件;使用该命令的clear形式清除某端口上的统计数据。
命令语法
show hardware latency-monitor event interface IFPHYSICAL
clear hardware latency-monitor event interface IFPHYSICAL
参数 |
参数说明 |
参数取值 |
IFPHYSICAL |
物理端口号 |
视具体型号而定 |
命令模式
特权模式
默认配置
N/A
使用说明
N/A
举例说明
如下所示,显示了端口eth-0-5上的延迟事件的统计数据
Switch# show hardware latency-monitor event interface eth-0-5
Brief CLI issued at: 10:06:13 UTC Fri Jan 28 2022
Flags : S - Start record E - End record
Time RangeId Latency(ns) Status Source Port
----------------------------------------------------------------------------------
10:06:13.098854000 7 3232 S eth-0-3
10:06:13.098849000 2 576 E eth-0-3
10:06:13.098845000 7 3360 S eth-0-3
10:06:13.098840000 2 576 E eth-0-3
10:06:13.098836000 7 3232 S eth-0-3
10:06:13.098832000 2 736 E eth-0-1
10:06:13.098827000 7 3072 S eth-0-3
10:06:13.098823000 2 672 E eth-0-1
10:06:13.098818000 7 3968 S eth-0-3
10:06:13.098814000 2 672 E eth-0-3
10:06:13.098810000 7 3488 S eth-0-3
10:06:13.098805000 2 704 E eth-0-3
10:06:13.098801000 7 3168 S eth-0-3
10:06:13.098797000 2 640 E eth-0-3
相关命令
无