1. 基本配置
命令
解释
banner motd
配置登录前的消息横幅。
clock set
手动设置系统时钟。
configure terminal
进入全局配置模式。
disable
退出特权EXEC模式。
domain-name
设置设备的域名。
enable
进入特权EXEC模式。
enable password
设置特权EXEC模式的密码。
enable secret
设置加密的特权EXEC模式密码。
end
退出配置模式,返回特权EXEC。
exit
退出当前模式或配置级别。
exec-timeout
设置EXEC会话超时时间。
hostname
设置系统主机名。
ip default-gateway
设置默认网关。
ip domain-lookup
启用DNS主机名解析。
ip domain-name
定义默认域名。
ip ftp password
设置FTP连接密码。
ip ftp username
设置FTP连接用户名。
ip name-server
指定DNS名称服务器地址。
ip telnet source-interface
指定Telnet源接口。
ip tftp source-interface
指定TFTP源接口。
line aux 0
进入辅助线路配置模式。
line console 0
进入控制台线路配置模式。
line vty 0 4
进入虚拟终端线路配置模式。
login
启用登录密码检查。
logging buffered
启用缓冲日志记录。
logging console
启用控制台日志记录。
logging host
指定远程syslog主机。
logging trap
设置syslog消息日志级别。
no
否定命令或恢复默认。
no ip domain-lookup
禁用DNS主机名解析。
ntp server
配置NTP服务器用于时间同步。
password
设置线路密码。
reload
重启设备。
service dhcp
启用DHCP服务器功能。
service password-encryption
加密配置中的所有密码。
service timestamps
配置调试和日志消息的时间戳。
show boot
显示引导相关信息。
show calendar
显示硬件日历。
show clock
显示系统时钟。
show environment
显示环境监控状态。
show file systems
显示文件系统信息。
show flash
显示Flash内存信息。
show history
显示命令历史缓冲区。
show inventory
显示已安装硬件组件列表。
show logging
显示日志状态和syslog消息。
show memory
显示内存使用统计。
show parser
显示解析器相关信息。
show platform
显示平台特定信息。
show privilege
显示当前特权级别。
show processes
显示活动进程信息。
show processes cpu
显示CPU利用率。
show running-config
显示当前运行配置。
show startup-config
显示启动配置。
show tech-support
显示系统信息集合用于故障排除。
show terminal
显示终端线路参数。
show users
显示当前使用终端线路信息。
show version
显示系统硬件和软件状态。
2. 接口配置
命令
解释
bandwidth
设置接口带宽值。
description
为接口添加描述文本。
duplex
设置接口双工模式。
encapsulation
设置接口封装类型。
interface
进入接口配置模式。
ip address
为接口分配IP地址。
ip address dhcp
通过DHCP为接口获取IP地址。
ipv6 address
为接口分配IPv6地址。
mtu
设置接口最大传输单元。
no shutdown
激活接口。
shutdown
关闭接口。
speed
设置接口速度。
switchport mode access
将端口设置为访问模式。
switchport mode trunk
将端口设置为中继模式。
cdp enable
启用CDP接口发现。
no cdp enable
禁用CDP接口发现。
clock rate
设置串口时钟速率(DCE端)。
ip ospf message-digest-key
配置OSPF接口认证密钥。
keepalive
启用保持活动消息。
no keepalive
禁用保持活动消息。
ip mtu
设置IP MTU大小。
ip tcp adjust-mss
调整TCP MSS值。
service-policy input
应用输入QoS策略。
service-policy output
应用输出QoS策略。
channel-group
将接口添加到链路聚合组。
interface range
配置多个接口范围。
ip helper-address
转发UDP广播到指定地址。
no ip address
移除接口IP地址。
ip proxy-arp
启用代理ARP。
no ip proxy-arp
禁用代理ARP。
ip route-cache
启用快速交换。
no ip route-cache
禁用快速交换。
ip unnumbered
使用另一接口的IP地址。
standby
配置HSRP组。
authentication
设置HSRP认证。
preempt
启用HSRP抢占。
priority
设置HSRP优先级。
ip ospf priority
设置OSPF DR优先级。
ip ospf cost
设置OSPF接口成本。
ip ospf network
设置OSPF网络类型。
ip ospf hello-interval
设置OSPF Hello间隔。
ip ospf dead-interval
设置OSPF Dead间隔。
ip ospf authentication
启用OSPF接口认证。
ip ospf authentication-key
设置OSPF认证密钥。
ip ospf area
将接口分配到OSPF区域。
ip ospf passive-interface
将接口设置为OSPF被动。
ip eigrp as
设置EIGRP自治系统。
ip eigrp metric
设置EIGRP接口度量。
ip rip authentication mode
设置RIP认证模式。
ip rip authentication key-chain
设置RIP密钥链。
ip ospf mtu-ignore
忽略OSPF MTU检查。
ip ospf demand-circuit
配置OSPF按需电路。
ip ospf flood-reduction
减少OSPF洪泛。
ip ospf transmit-delay
设置OSPF传输延迟。
ip ospf lsa-group-pacing
设置OSPF LSA组间距。
3. VLAN 和交换
命令
解释
vlan
创建VLAN。
name
为VLAN命名。
no vlan
删除VLAN。
switchport access vlan
将访问端口分配到VLAN。
switchport trunk allowed vlan
指定中继允许的VLAN。
switchport trunk native vlan
设置中继原生VLAN。
switchport nonegotiate
禁用DTP协商。
switchport port-security
启用端口安全。
switchport port-security maximum
设置MAC地址最大数。
switchport port-security mac-address
指定静态MAC地址。
switchport port-security violation
设置违规动作。
spanning-tree mode
设置STP模式。
spanning-tree vlan
为VLAN配置STP。
spanning-tree portfast
启用PortFast。
spanning-tree bpduguard enable
启用BPDU保护。
spanning-tree cost
设置STP端口成本。
spanning-tree port-priority
设置STP端口优先级。
spanning-tree root
配置根桥。
vtp mode
设置VTP模式。
vtp domain
设置VTP域。
vtp password
设置VTP密码。
vtp pruning
启用VTP修剪。
show vlan brief
显示VLAN摘要。
show interfaces trunk
显示中继接口。
show spanning-tree
显示STP信息。
show mac address-table
显示MAC地址表。
show port-security
显示端口安全状态。
interface vlan
配置SVI接口。
ip routing
启用IP路由。
switchport mode dynamic
设置动态中继模式。
switchport voice vlan
设置语音VLAN。
spanning-tree loopguard default
启用环路保护。
spanning-tree pathcost
设置路径成本方法。
vtp version
设置VTP版本。
vlan database
进入VLAN数据库模式。
show vtp status
显示VTP状态。
spanning-tree extend system-id
扩展系统ID。
switchport protected
启用端口保护。
switchport access vlan dynamic auto
动态分配VLAN。
4. 路由
命令
解释
ip route
配置静态路由。
no ip route
删除静态路由。
ip default-gateway
设置默认网关(交换机)。
router rip
进入RIP配置模式。
version
设置RIP版本。
network
启用RIP网络。
no auto-summary
禁用自动汇总。
passive-interface
设置被动接口。
distance
设置管理距离。
maximum-paths
设置最大路径数。
router ospf
进入OSPF配置模式。
router-id
设置OSPF路由器ID。
network
启用OSPF网络。
area
指定OSPF区域。
default-information originate
注入默认路由。
redistribute
重分发路由。
router eigrp
进入EIGRP配置模式。
network
启用EIGRP网络。
autonomous-system
设置EIGRP自治系统。
variance
设置EIGRP不等价负载均衡。
metric maximum-hops
设置EIGRP最大跳数。
ip route-cache eigrp
启用EIGRP快速缓存。
router bgp
进入BGP配置模式。
neighbor
配置BGP邻居。
remote-as
设置远程自治系统。
network
注入BGP网络。
show ip route
显示路由表。
show ip protocols
显示路由协议状态。
show ip ospf neighbor
显示OSPF邻居。
show ip eigrp neighbors
显示EIGRP邻居。
show ip bgp summary
显示BGP摘要。
clear ip route
清除路由表。
ip route 0.0.0.0
配置默认路由。
ip summary-address
配置汇总地址。
maximum-paths eigrp
设置EIGRP最大路径。
ip ospf database-timer
设置OSPF数据库定时器。
ip ospf lsa-refresh-interval
设置OSPF LSA刷新间隔。
router rip authentication
启用RIP认证。
key chain
创建密钥链。
accept-lifetime
设置密钥接受生命周期。
send-lifetime
设置密钥发送生命周期。
ip next-hop-self
BGP下一跳自我。
bgp log-neighbor-changes
记录BGP邻居变化。
neighbor shutdown
关闭BGP邻居。
show ip rip database
显示RIP数据库。
5. 安全
命令
解释
access-list
创建访问控制列表。
ip access-group
应用ACL到接口。
ip access-list extended
创建扩展命名ACL。
ip access-list standard
创建标准命名ACL。
permit
允许流量。
deny
拒绝流量。
log
记录匹配流量。
username
创建本地用户。
aaa new-model
启用AAA。
aaa authentication
配置认证方法。
aaa authorization
配置授权方法。
crypto key generate rsa
生成RSA密钥。
ip ssh
启用SSH。
ip ssh version
设置SSH版本。
line vty
配置VTY线路。
transport input ssh
仅允许SSH输入。
no transport input telnet
禁用Telnet。
service password-encryption
加密密码。
enable secret
设置加密启用密码。
ip inspect
配置CBAC检查。
zone security
定义安全区域。
zone-pair
创建区域对。
crypto isakmp policy
配置ISAKMP策略。
crypto ipsec transform-set
配置IPsec转换集。
crypto map
创建加密映射。
show access-lists
显示ACL。
show aaa
显示AAA状态。
show ip inspect sessions
显示检查会话。
show crypto isakmp sa
显示ISAKMP SA。
show crypto ipsec sa
显示IPsec SA。
access-list log-input
记录输入匹配。
ip access-list resequence
重新编号ACL。
aaa local authentication attempts maximum
设置认证尝试最大值。
crypto pki
配置PKI。
trustpoint
配置信任点。
enrollment
配置注册。
ip access-list session
会话ACL。
control-plane host
保护控制平面。
policing
限速控制平面流量。
no service pad
禁用PAD服务。
no ip http server
禁用HTTP服务器。
no ip http secure-server
禁用HTTPS服务器。
login local
使用本地认证。
privilege level
设置特权级别。
aaa session-id common
公共会话ID。
6. QoS
命令
解释
class-map
创建类映射。
match
定义匹配条件。
policy-map
创建策略映射。
class
在策略中应用类。
bandwidth
分配带宽。
priority
设置优先队列。
shape
配置整形。
police
配置警报。
random-detect
启用WRED。
service-policy
应用策略到接口。
mls qos
启用QoS。
mls qos map
配置QoS映射。
auto qos voip
自动QoS语音。
show policy-map
显示策略映射。
show class-map
显示类映射。
interface output
输出接口QoS。
queue-limit
设置队列限制。
random-detect precedence
WRED优先级检测。
fair-queue
启用公平队列。
wrr-queue
配置WRR队列。
priority-queue out
输出优先队列。
qos pre-classify
预分类。
ip precedence
设置IP优先级。
ip dscp
设置DSCP值。
set
在策略中设置标记。
table-map
映射表。
mls qos trust
信任CoS或DSCP。
auto qos trust cos
信任CoS。
show mls qos
显示QoS状态。
compress stac
压缩STAC。
compress predictor
压缩预测器。
frame-relay ip rtp priority
FR RTP优先级。
frame-relay traffic-shaping
FR流量整形。
random-detect dscp
WRED DSCP检测。
bandwidth remaining percent
剩余带宽百分比。
shape average
平均整形速率。
police rate
警报速率。
exceed-action
超过动作。
conform-action
符合动作。
7. 监控和故障排除
命令
解释
show ip interface brief
显示接口IP和状态摘要。
show interfaces
显示接口详细统计。
show cdp neighbors
显示CDP邻居。
show cdp neighbors detail
显示CDP邻居详细。
ping
测试连通性。
traceroute
跟踪路由路径。
debug
启用调试。
undebug all
禁用所有调试。
terminal monitor
监控调试输出。
show logging
显示日志。
show tech-support
显示技术支持信息。
show processes cpu history
显示CPU历史。
show memory statistics
显示内存统计。
show spanning-tree summary
显示STP摘要。
show ip ospf interface
显示OSPF接口。
show ip eigrp topology
显示EIGRP拓扑。
clear counters
清除接口计数器。
show controllers
显示控制器状态。
debug ip packet
调试IP包。
debug ip rip
调试RIP。
debug ip ospf adj
调试OSPF邻接。
show ip traffic
显示IP流量统计。
show buffer
显示缓冲区。
show stack
显示栈使用。
terminal length 0
禁用分页。
show running-config interface
显示接口运行配置。
show ip cache
显示快速缓存。
debug ethernet
调试以太网。
show frame-relay map
显示FR映射。
show frame-relay pvc
显示FR PVC。
show isdn status
显示ISDN状态。
show x25 vc
显示X.25 VC。
debug ppp
调试PPP。
debug chap
调试CHAP。
show access-lists counters
显示ACL计数器。
clear ip bgp
清除BGP。
show ip bgp
显示BGP表。
debug aaa
调试AAA。
show crypto key
显示加密密钥。
show standby brief
显示HSRP摘要。
8. 其他高级
命令
解释
ip nat inside
配置NAT内接口。
ip nat outside
配置NAT外接口。
ip nat inside source
配置NAT源地址转换。
ip nat pool
创建NAT地址池。
ip route-map
创建路由映射。
match
匹配条件。
set
设置动作。
snmp-server community
配置SNMP社区。
snmp-server host
配置SNMP主机。
logging source-interface
设置日志源接口。
archive
配置配置归档。
boot system
设置引导系统。
ip http server
启用HTTP服务器。
ip http authentication
HTTP认证。
eem applet
创建EEM applet。
event
EEM事件。
action
EEM动作。
interface tunnel
配置隧道接口。
tunnel source
设置隧道源。
tunnel destination
设置隧道目标。
ip ospf virtual-link
OSPF虚拟链路。
area virtual-link
区域虚拟链路。
ip summary-address eigrp
EIGRP汇总。
distribute-list
分发列表过滤。
offset-list
偏移列表。
passive-interface default
默认被动接口。
no passive-interface
取消被动接口。
ip multicast-routing
启用组播路由。
ip pim
配置PIM。
show ip mroute
显示组播路由。
ip dhcp pool
创建DHCP池。
network
DHCP网络。
default-router
DHCP默认路由器。
dns-server
DHCP DNS服务器。
lease
DHCP租期。
show ip dhcp binding
显示DHCP绑定。
clear ip dhcp binding
清除DHCP绑定。
ip ftp server-write-enable
启用FTP服务器写入。
copy tftp
从TFTP复制。
delete
删除文件。
mkdir
创建目录。
rmdir
删除目录。
format
格式化文件系统。
squeeze
压缩Flash空间。
verify
验证文件。
show file
显示文件信息。
这些命令覆盖了Cisco IOS的核心,够你从入门到运维全用上。

总数约250条,分类齐全,实际场景多练手。有什么遗漏或想深挖的,评论区说!
