display eth-trunk trunk-id verbose
display trunkmembership eth-trunk trunk-id display eth-trunk trunk-id load-balance display load-balance-profile NAME display trunk configuration
display lacp statistics eth-trunk trunk-id
//查看LACP模式下的LACP报文收发统计信息
collect forward-path sip source-ip-address dip destination-ip-address //查看指定流量的出入接口 reset lacp statistics eth-trunk trunk-id
//清除LACP收发报文的统计信息
配置VLAN (vlanif):
vlan vlan-id
vlan batch vlan-id1 to vlan-id2
name NAME
配置ACCESS接口: interface type number port link-type access port default vlan vlan-id quit
配置Trunk接口: interface x/x
port link-type trunk
port trunk allow-pass vlan vlan-id1 [ to vlan-id2 ]
//将接口加入到指定的VLAN中(即在trunk链路上允许的VLAN,类似HP交换机) port trunk pvid vlan vlan-id
//配置trunk接口的缺省VLAN(本征VLAN)
interface vlanif vlan-id
ip address ip-address { mask | mask-length } [ sub ], mtu VALUE
//需要重启接口以保证配置的MTU生效
配置VCMP (VTP):
system-view
vcmp role transparent
//配置VCMP管理域中设备的角色
display vcmp status
display vcmp interface brief
配置STP/RSTP:
stp enable
//使能交换机的STP/RSTP功能,默认启用 stp mode { stp | rstp }
//默认运行MSTP模式,兼容STP和RSTP stp root primary [ /secondary ]
//primary的BID自动设为0,secondary的BID自动设为4096。不能更改
stp priority VALUE //默认为32768
stp pathcost-standard { dot1d-1998 | dot1t | legacy }
//默认路径开销值的计算方法为IEEE 802.1t(dot1t)
stp bridge-diameter diameter
//配置网络直径,默认直径为7
interface x/x stp cost VALUE
//设置当前端口的路径开销值 stp port priority VALUE
//配置端口的优先级,默认128
display stp [ interface x/x | slot slot-id ] [ brief ]
配置RSTP端口保护:
stp edged-port default
//配置当前设备上所有端口为边缘端口,默认设备的所有端口为非边缘端口 stp bpdu-filter default
//配置当前设备所有端口为BPDU filter端口。缺省设备的所有端口为非BPDU filter端口
interface type number
stp edged-port enable
//将端口配置成边缘端口 stp bpdu-filter enable
//配置当前端口为BPDU filter端口
stp bpdu-protection
//配置交换设备边缘端口的BPDU保护功能 stp root-protection
//配置交换设备的Root保护功能 stp loop-protection
//配置交换设备根端口或Alternate端口的环路保护功能
error-down auto-recovery cause bpdu-protection interval interval-value
//使能端口自动恢复为Up的功能
配置和其他厂商设备互通的参数:
interface type number(参与STP的接口) stp no-agreement-check
//配置端口使用普通的快速迁移方式, 缺省使用增强的快速迁移机制
display stp topology-change
//查看STP/RSTP拓扑变化相关的统计信息
display stp [ interface x/x | slot slot-id ] tc-bpdu statistics //查看端口TC/TCN报文收发计数
display stp [ interface x/x | slot slot-id ] [ brief ]
配置MSTP:
stp mode mstp
stp region-configuration region-name NAME
//缺省情况下,MST域的域名等于交换设备主控板上管理网口的MAC地址
instance instance-id vlan { vlan-id1 [ to vlan-id2 ] } //配置多生成树实例和VLAN的映射关系 或:
vlan-mapping modulo modulo
//配置多生成树实例和VLAN按照缺省算法自动分配映射关系。缺省,MST域内所有的
VLAN都映射到生成树实例0
revision-level level
//配置MST域的MSTP修订级别
active region-configuration
//激活MST域的配置,使域名、VLAN映射表和MSTP修订级别生效
stp [ instance instance-id ] root primary stp [ instance instance-id ] root secondary stp [ instance instance-id ] priority priority
stp pathcost-standard { dot1d-1998 | dot1t | legacy }
interface type number
stp instance instance-id cost cost
stp instance instance-id port priority priority
display stp region-configuration
display stp region-configuration digest
Layer3配置:
IP地址/ARP:
arp static ip-address mac-address vid vlan-id interface x/x //配置静态ARP表项
reset arp
//清除ARP表项
arp ip-conflict-detect enable
//使能IP地址冲突检测功能
arp-ping ip ip-address
//测试IP地址是否已被使用,可透过禁Ping回复的防火墙
interface type number
ip address ip-address { mask | mask-length } arp-proxy enable
//使能接口的路由式ARP代理功能,默认关闭(没必要开启)
tcp min-mss mss-value
//全局,配置TCP连接的最小MSS值,默认216
display arp interface display arp statistics display arp vpn-instance
配置DHCP:
dhcp enable
//全局启用DHCP服务 ip pool POOL1
network 10.1.1.0 mask 255.255.255.128 dns-list 10.1.1.2 gateway-list 10.1.1.1
excluded-ip-address 10.1.1.2 excluded-ip-address 10.1.1.4 lease day 1
static-bind ip-address 10.1.1.4 mac-address dcd2-fc96-e4c0 //为静态DHCP客户端分配网络参数 domain-name NAME quit
interface vlanif 10
ip address 10.1.1.1 255.255.255.128 dhcp select global
//使能接口采用全局地址池的DHCP服务器功能
dhcp select relay
//启动接口的DHCP中继功能 dhcp relay server-ip 10.10.20.2
reset dhcp reset ip pool
display ip pool name NAME