各品牌网络设备,日常命令使用
命令
描述
enable
从用户模式进入特权模式
configure terminal
进入配置模式
interface g0/0
进入千兆以太网接口模式
ip address 172.16.0.1 255.255.0.0
配置接口的ip 地址
no shutdown
打开接口
line vty 0 4
进入虚拟终端vty 0 – vty 4
password CISCO
配置密码
login
用户要进入路由器,需要先进行登录
exit
退回到上一级模式
enable password CISCO
配置进入特权模式的密码,密码不加密
end
直接回到特权模式
show int g0/0
显示g0/0 接口的信息
hostname Terminal-Server
配置路由器的主机名
enable secret ccielab
配置进入特权模式的密码,密码加密
no ip domain-lookup
路由器不使用DNS 服务器解析主机的IP 地址
logging synchronous
路由器上的提示信息进行同步,防止信息干扰我们输入命令
no ip routing
关闭路由器的路由功能
ip default-gateway 10.1.14.254
配置路由器访问其他网段时所需的网关
show line
显示各线路的状态
line 33 48
进入33-48 线路模式
transport input all
允许所有协议进入线路
int loopback0
进入loopback0 接口
ip host R1 2033 1.1.1.1
为1.1.1.1 主机起一个主机名
alias exec cr1 clear line 33
为命令起一个别名
privilege exec level 0 clear line
把命令clear line 的等级改为0,在用户模式下也可以执行它
banner motd
设置用户登录路由器时的提示信
clock set
设置路由器的时间
show clock
显示路由器的时间
show history
显示历史命令
terminal no editing
关闭CLI 的编辑功能
terminal editing
打开CLI 的编辑功能
terminal history size 50
修改历史命令缓冲区的大小
copy running-config startup-config
把内存中的配置文件保存到NVRAM 中
clock rate 128000
配置串口上的时钟(DCE 端)
show version
显示路由器的IOS 版本等信息
show running-config
显示内存中的配置文件
show startup-config
显示NVRAM 中的配置文件
show interface s0/0/0
显示接口的信息
show flash
显示flash 的有关信息
show controllers s0/0/0
显示s0/0/0 的控制器信息
show ip arp
显示路由器中的arp 表
copy running-config tftp
把内存中的配置文件拷贝到tftp 服务器上
copy tftp running-config
把tftp 服务器上的配置文件拷贝到内存中
copy flash:c2800nm-adventerprisek9-mz.124-11.T1.bin tftp
把flash 中的IOS 拷贝到tftp 服务器上
confreg 0x2142
在rommon 模式下修改配置寄存器值
i
在rommon 模式下重启路由器
copy startup-config running-config
把NVRAM 中的配置文件拷贝到内存中
config-register 0x2102
修改配置寄存器值
reload
重启路由器
delete flash:c2800nm-adventerprisek9-mz.124-11.T1.bin
删除flash 中的IOS
copy tftp flash
从tftp 服务器上拷贝IOS 到flash 中
tftpdnld
rommon 模式下,从tftp 服务器下载IOS
show cdp
显示CDP 运行信息
show cdp interface
显示CDP 在各接口的运行情况
show cdp neighbors
显示CDP 邻居信息
show cdp entry R2
显示CDP 邻居R2 的详细信息
clear cdp table
清除CDP 邻居表
no cdp enable
接口下关闭CDP
no cdp run/ cdp run
关闭/打开整个路由器的CDP
cdp timer 30 CDP
每30 秒发送一次
cdp holdtime 120
让邻居为本设备发送的CDP 消息保持120 秒
静态路由相关配置
命令 | 描述 |
---|---|
ip route X.X.X.X 掩码 接口或者下一条ip地址 | 配置静态路由 |
show ip route | 查看路由表 |
ip classless/ no ip classless | 打开/关闭有类路由功能 |
ping 2.2.2.2 source loopback 0 | 指定源端口进行ping 测试 |
RIP命令汇总
命令 | 描述 |
---|---|
show ip route | 查看路由表 |
show ip protocols | 查看IP 路由协议配置和统计信息 |
show ip rip database | 查看RIP 数据库 |
debug ip rip | 动态查看RIP 的更新过程 |
clear ip route * | 清除路由表 |
router rip | 启动RIP 进程 |
network | 通告网络 |
version | 定义RIP 的版本 |
no auto-summary | 关闭自动汇总 |
ip rip send version | 配置RIP 发送的版本 |
ip rip receive version | 配置RIP 接收的版本 |
passive-interface | 配置被动接口 |
neighbor | 配置单播更新的目标 |
ip summary-address rip | 配置RIP 手工汇总 |
key chain | 定义钥匙链 |
key key-id | 配置Key ID |
key-string | 配置Key ID 的密匙 |
ip rip triggered | 配置触发更新 |
ip rip authentication mode | 配置认证模式 |
ip rip authentication key-chain | 配置认证使用的钥匙链 |
timers basic | 配置更新的计时器 |
maximum-paths | 配置等价路径的最大值 |
ip default-network | 向网络中注入默认路由 |