↑↓ 选择 · Enter 打开 · Esc 关闭

Cisco 命令速查

90 条命令 · 点击右侧按钮复制命令

查看状态 2

show version 查看设备版本 ⭐ 基础
1
show ip interface brief 查看接口 IP 简表 ⭐ 基础
1

接口配置 3

interface GigabitEthernet0/0 进入接口 ⭐⭐ 常用
1
switchport mode access 配置端口为 access ⭐⭐ 常用
1
switchport mode trunk 配置端口为 trunk ⭐⭐ 常用
1

路由协议 3

router ospf 1 启用 OSPF ⭐⭐⭐ 高级
1
show ip ospf neighbor 查看 OSPF 邻居 ⭐⭐⭐ 高级
1
show ip route 查看路由表 ⭐⭐ 常用
1

安全 / ACL 1

access-list 100 permit ip any any 创建标准 ACL ⭐⭐⭐ 高级
1

故障排查 79

ping 8.8.8.8 测试连通性 ⭐ 基础
1
show running-config 查看当前配置 ⭐⭐ 常用
1
show startup-config 查看启动配置 ⭐⭐ 常用
1
show clock 查看系统时间 ⭐ 基础
1
show processes cpu 查看 CPU 使用 ⭐⭐ 常用
1
show memory statistics 查看内存 ⭐⭐ 常用
1
show environment 查看环境 ⭐⭐ 常用
1
show inventory 查看设备清单 ⭐⭐ 常用
1
ip address 192.168.1.1 255.255.255.0 配置接口 IP ⭐ 基础
1
no shutdown 启用接口 ⭐ 基础
1
shutdown 关闭接口 ⭐ 基础
1
description "To-ISP" 接口描述 ⭐⭐ 常用
1
show interfaces GigabitEthernet0/0 查看接口详情 ⭐ 基础
1
show interfaces status 查看接口状态 ⭐ 基础
1
show interfaces trunk 查看 trunk 端口 ⭐ 基础
1
show interfaces switchport 查看端口二层信息 ⭐ 基础
1
ip route 0.0.0.0 0.0.0.0 192.168.1.254 配置默认路由 ⭐⭐ 常用
1
router-id 1.1.1.1 OSPF router-id ⭐⭐⭐ 高级
1
network 192.168.1.0 0.0.0.255 area 0 OSPF 网络宣告 ⭐⭐⭐ 高级
1
show ip ospf interface OSPF 接口 ⭐⭐⭐ 高级
1
router eigrp 100 启用 EIGRP ⭐⭐ 常用
1
router bgp 65001 启用 BGP ⭐⭐⭐ 高级
1
show ip bgp summary BGP 摘要 ⭐⭐⭐ 高级
1
show ip bgp 查看 BGP 表 ⭐⭐⭐ 高级
1
vlan 10 创建 VLAN ⭐⭐ 常用
1
name Sales VLAN 命名 ⭐⭐ 常用
1
switchport trunk encapsulation dot1q trunk 封装 ⭐⭐ 常用
1
switchport trunk allowed vlan 10,20,30 trunk 允许 VLAN ⭐⭐ 常用
1
show vlan brief 查看 VLAN ⭐⭐ 常用
1
show vtp status VTP 状态 ⭐⭐ 常用
1
spanning-tree mode rapid-pvst STP 模式 ⭐⭐ 常用
1
spanning-tree vlan 10 priority 4096 STP 优先级 ⭐⭐ 常用
1
spanning-tree portfast PortFast ⭐⭐ 常用
1
show spanning-tree STP 状态 ⭐⭐ 常用
1
show spanning-tree summary STP 摘要 ⭐⭐ 常用
1
channel-group 1 mode active LACP 聚合 ⭐⭐ 常用
1
channel-group 1 mode desirable PAgP 聚合 ⭐⭐ 常用
1
interface Port-channel1 进入聚合口 ⭐⭐ 常用
1
show etherchannel summary 查看 EtherChannel ⭐⭐ 常用
1
access-list 10 permit 192.168.1.0 0.0.0.255 标准 ACL ⭐⭐⭐ 高级
1
access-list 100 permit tcp any any eq 80 扩展 ACL ⭐⭐⭐ 高级
1
ip access-list standard MYACL 命名 ACL ⭐⭐⭐ 高级
1
show ip access-lists 查看 ACL ⭐⭐⭐ 高级
1
enable secret cisco123 设置 enable 密码 ⭐ 基础
1
service password-encryption 加密所有密码 ⭐⭐ 常用
1
username admin privilege 15 secret admin123 创建用户 ⭐⭐ 常用
1
login block-for 60 attempts 3 within 30 防爆破 ⭐⭐ 常用
1
line vty 0 4 配置 VTY 线路 ⭐⭐ 常用
1
transport input ssh 只允许 SSH ⭐⭐ 常用
1
crypto key generate rsa 生成 RSA 密钥 ⭐⭐ 常用
1
ip ssh version 2 SSH v2 ⭐⭐ 常用
1
ip domain-name example.com 域名(SSH 需要) ⭐⭐ 常用
1
ip dhcp pool LAN DHCP 地址池 ⭐ 基础
1
show ip dhcp binding DHCP 绑定 ⭐ 基础
1
ip dhcp excluded-address 192.168.1.1 192.168.1.10 DHCP 排除地址 ⭐ 基础
1
ip nat inside source list 1 interface GigabitEthernet0/0 overload NAT 转换 ⭐⭐ 常用
1
show ip nat translations 查看 NAT ⭐⭐ 常用
1
configure terminal 进入全局配置 ⭐ 基础
1
end 退出到特权模式 ⭐⭐ 常用
1
exit 退出当前模式 ⭐⭐ 常用
1
enable 进入特权模式 ⭐ 基础
1
disable 退出特权模式 ⭐⭐ 常用
1
write memory 保存配置 ⭐ 基础
1
hostname Router1 设置主机名 ⭐ 基础
1
erase startup-config 擦除启动配置 ⭐⭐ 常用
1
traceroute 8.8.8.8 路由追踪 ⭐ 基础
1
show ip arp 查看 ARP ⭐⭐ 常用
1
show mac address-table MAC 表 ⭐⭐ 常用
1
show logging 查看日志 ⭐⭐ 常用
1
terminal monitor 日志实时显示 ⭐⭐ 常用
1
debug ip ospf events OSPF 调试 ⭐⭐⭐ 高级
1
debug ip packet IP 包调试 ⭐⭐ 常用
1
no debug all 关闭所有调试 ⭐⭐ 常用
1
show cdp neighbors CDP 邻居 ⭐ 基础
1
show cdp neighbors detail CDP 邻居详情 ⭐ 基础
1
ip access-group 100 in 应用 ACL 到接口 ⭐⭐⭐ 高级
1
show ip interface GigabitEthernet0/0 查看接口 ACL ⭐⭐⭐ 高级
1
copy running-config tftp: 备份到 TFTP ⭐⭐ 常用
1
copy tftp: running-config 从 TFTP 恢复 ⭐⭐ 常用
1

系统管理 2

copy running-config startup-config 保存配置 ⭐⭐ 常用
1
reload 重启设备 ⭐⭐ 常用
1