一、系统视图与基础配置
system-view
(进入系统视图)sysname [name]
(修改交换机名称)save
(保存配置)reboot
(重启设备)display current-configuration
(查看当前运行配置)display version
(查看系统版本)display device
(查看设备基本信息)undo sysname
(恢复默认名称)return
(直接返回用户视图)quit/exit
(返回上级视图)info-center timestamp debugging
(关闭配置变更提示)reset saved-configuration
(清空保存的配置)display startup
(查看下次启动文件)startup saved-configuration [filename]
(指定启动文件)
二、接口配置
interface [interface-type][interface-number]
(进入接口视图)ip address [ip] [mask]
(配置接口IP)undo ip address
(删除接口IP)shutdown
(关闭接口)undo shutdown
(启用接口)description [text]
(接口描述)speed {10|100|1000|auto}
(设置端口速率)duplex {half|full|auto}
(设置双工模式)negotiation auto
(开启自协商port link-type {access|trunk|hybrid}
(设置端口模式)port default vlan [ID]
(Access端口加入VLAN)port trunk allow-pass vlan [ID]
(Trunk端口允许VLAN)port hybrid pvid vlan [ID]
(设置Hybrid端口PVID)port hybrid untagged/tagged vlan [ID]
(Hybrid端口标记模式)display interface brief
(查看接口摘要)display interface [interface]
(查看详细接口状态)
三、VLAN配置
vlan [ID]
(创建VLAN)undo vlan [ID]
(删除VLAN)vlan batch [ID1] [ID2]
(批量创建VLAN)interface Vlanif [ID]
(进入VLAN虚接口)display vlan [ID]
(查看VLAN信息)port-group [name]
(创建端口组)group-member [interface]
(向端口组添加成员)port-isolate enable
(开启端口隔离)stp enable
(开启生成树协议)stp priority [0-61440]
(设置生成树优先级)
四、路由协议
ip route-static [dest] [mask] [gateway]
(静态路由)rip
(进入RIP配置视图)version 2
(设置RIP版本)network [network-address]
(RIP/OSPF宣告网络)ospf [process-id]
(进入OSPF配置)area [area-id]
(配置OSPF区域)bgp [as-number]
(进入BGP配置)peer [ip] as-number [as]
(配置BGP邻居)display ip routing-table
(查看路由表)display bgp peer
(查看BGP邻居状态
五、DHCP服务
dhcp enable
(全局启用DHCP)dhcp select interface
(接口启用DHCP)dhcp server dns-list [dns-ip]
(配置DNS服务器)dhcp server excluded-ip-address [start-ip] [end-ip]
(排除IP段)display dhcp server statistics
(查看DHCP统计)
六、ACL与安全
acl [number]
(创建ACL)rule [id] permit/deny [protocol] source [ip] [mask]
(定义规则)traffic-filter inbound/outbound acl [acl-number]
(应用ACL)user-interface vty 0 4
(进入VTY线路视图)protocol inbound {ssh|telnet}
(设置远程登录协议)authentication-mode aaa
(设置AAA认证)ssh user [username] authentication-type password
(创建SSH用户)stelnet server enable
(开启SSH服务)display acl [acl-number]
(查看ACL配置)display ssh user
(查看SSH用户)
七、QoS配置
traffic classifier [name]
(创建流分类)if-match [acl/ipv4-destination]
(定义匹配规则)traffic behavior [name]
(创建流行为)remark dscp [value]
(标记DSCP优先级)queue af bandwidth [percentage]
(配置队列带宽)traffic policy [name]
(创建流策略)classifier [name] behavior [name]
(绑定分类与行为)traffic-policy [name] inbound
(应用流策略)
八、端口镜像
observe-port [interface]
(配置观察端口)port-mirroring to observe-port [interface] inbound/outbound
(配置镜像端口)display observe-port
(查看镜像配置)
九、日志与时间
clock timezone [zone] add [hh:mm]
(配置时区)clock datetime [hh:mm:ss YYYY-MM-DD]
(手动设置时间)ntp-service unicast-server [ip]
(配置NTP服务器)info-center enable
(开启日志功能)info-center loghost [ip]
(配置日志服务器)terminal logging
(开启终端日志显示)display clock
(查看当前时间)
十、设备管理
lldp enable
(开启LLDP协议)display lldp neighbor brief
(查看LLDP邻居)display cpu-usage
(查看CPU利用率)display memory-usage
(查看内存使用)display power
(查看电源状态)display fan
(查看风扇状态)display temperature
(查看设备温度)
十一、高级
vrrp vrid [num] virtual-ip [ip]
(配置VRRP虚拟IP)vrrp vrid [num] priority [value]
(设置VRRP优先级)qos car inbound cir [kbps]
(配置限速策略)mac-address static [mac] vlan [id] interface [int]
(绑定静态MAC)display mac-address
(查看MAC地址表)display arp
(查看ARP表)snmp-agent community read [name]
(配置SNMP只读团体字)snmp-agent trap enable
(开启SNMP告警)igmp-snooping enable
(开启组播侦听)loopback-detection enable
(开启环路检测)