思科命令快捷方式:
Tab 补全命令
ctrl + k删除光标以后的所有字符
ctrl + u删除光标之前的所有字符
ctrl + a移动光标到行首
ctrl + e移动光标到行末
ctrl + c退回特权模式或退出setup模式
向上箭头 调出上条命令
向下箭头 调出下条命令
shift + ctrl +6 中断DNS查找、连续ping、traceroute等操作
ctrl + z或end退回特权模式
exit退回上一级
配置前准备:
no ip domain lookup #关闭域名解析,防止特权模式下输入命令错误而一直去解析
hostname #路由器重命名
line console 0
logging synchronous #显示信息同步
no exec-timeout #关闭会话超时
password 123 #设置登陆密码
login #需要输入密码才能登陆
clock set 9:00:00 12 march 2023
clock timezone GMT +8
开启telnet功能:
interface fast 0/0 #进入接口模式
description link to sw1 #端口说明
no shutdown #打开接口
ip adddress 1.1.1.1 255.255.255. 0 #配置ip与掩码
line vty 0 4 #进入虚拟终端线路0~4,表示允许5个并发登录
password 123 #配置telnet或ssh登陆时,远程登陆密码
login #登陆时需要输入密码
enable password 123 #设置使能密码,若加上参数secret,密码变为密文
debug:
terminal monitor #打开vty的终端监控
debug ip icmp #debug ping 数据
undebug all #关闭所有debug
开启SSH功能:
添加默认路由:
ip route 0.0.0.0 0.0.0.0 1.1.1.254
查看接口状态:
show interface
Cisco设备Show Interface命令详解_51CTO博客_cisco命令
show interface brief
show ip interface brief
查看文件:
show running-config
show startup-config
保存配置:
copy running-config startup-config或write
备份配置:
copy startup-config tftp #备份配置至tftp服务器,导出的配置文件可以通过“记事本”与“写字板”打开,但更改配置后,要保存为纯文本的格式。或者直接在特殊模式下复制粘贴。
恢复配置:
copy tftp startup-config
复位配置:
erease startup-config