设备不区分大小写 Enable Disable exit Configure terminal #全局配置模式 Hostname 名字 #改名 No ip domain lookup #关闭域名查询 Enable password 密码 #添加设备密码(明文) Enable secret 密码 #添加设备密码(密文) No enable password/secret Show running-config #运行配置 Show ip interface brief #IP简要信息 Write #保存配置 copy running-config startup-config Line console 0 #进入 Exec-timeout 0 0 #取消超时退出 Login #开启认证 Interface vlan 1 #进入端口 Ip address x.x.x.x x.x.x.x #添加端口 No shutdown #开启 Line vty 0 4 #远程端口 Password 密码 #设置远程访问密码 No login #取消远程密码认证 Telnet #远程 ping Service timestmaps log datetime msec #开启日志时间戳 Service timestmaps debug datetime msec #开启调试信息的时间戳 Service password-encryption #开启密码加密服务 Interface fast/gigabit/XGigabit/ethernet #进入端口模式 Erase startup-config或者delete nvram;startup-config #删除启动配置文件 Dir /all #查看文件存储路径 Reload #重启设备 Show session #查看本地设备主动发起的会话 Show users #查看本地设备有哪些用户登陆 Resume id号 #在不同会话之间快速切换 Ctrl+shift+6,X #前三个一起按然后松开按6 跳转回本地设备 Ip routing #开启三层交换路由功能 Ip route x.x.x.x x.x.x.x x.x.x.x #静态路由表 目标网段+指定端口 Show ip route No ip proxy-arp #关闭三层端口的代理ARP Service dhcp #开启DHCP Ip dhcp pool 名称 #建立DHCP地址池 Network #分配的网段 Default-router #网关 Dns-server #DNS Show ip dhcp binding Ip dhcp excluded-address x.x.x.x #DHCP地址排除 Description 标签 #为端口添加标记 Ip helper-address x.x.x.x #DHCP中继 Show mac-address-table Vlan 数字 #创建vlan Name #vlan起名 Interface fastethernet0/0 Switchport mode access #转为接入模式 Switchport accress vlan n #端口加入vlan n Interface range fast0/0 , fast0/10 #进入1和10端口 Interface range fast0/0 - 10 #进入1到10端口 no switchport #将3层交换机的二层端口转为3层 Switchport mode trunk #转为trunk模式 Show interface trunk Switchport teunk encapsulation dot1q #修改trunk标签协议 Delete flash/vlan.dat #????????????????? Show interface fastetherent0/0 switchport #查看该端口上所有与vlan相关的参数信息 Switchport trunk allowed vlan wod/add/remove/all Switchport trunk native vlan+数字号 spanning-tree vlan 1 priority 0 #修改优先级默认32768 小 优先级高 spanning-tree vlan 1 root primary #将自动改为优先级最高 no spanning-tree vlan 200 #默认,交换机为每个 VLAN 打开了 STP ,在此关闭; show spanning-tree

standby 10 priority 200 #修改HSRP优先级 默认100 大 优先级高 standby 10 preempt #开启抢占功能 必要配置 standby 10 track fas0/1 priority 150 #出现故障端口优先级降低150

interface range fastEthernet 0/2 - 3 channel-group 1 mode on #channel链路捆绑 exit interface port-channel 1