由于自己刚开始学习网络及其设备方面的知识,基础理论还非常贫乏,所以只能给出学习过程中记录的命令
路由器命令
[toc]
普通模式
特权模式
- 进入
enable - 离开
disable
IP信息与接口
- 接口概要
show ip interface brief - 查看路由
show ip route - 查看协议信息
show ip protocols - 查看接口
show ip interface <interface>,example:show ip interface s0/0.
物理接口
- 查看特定端口
show interface <interface>,example:show interface s0/0
历史命令
- 条数
terminal history size <#number> - 查看历史命令
show history - 关闭/开启历史命令
terminal [no] history
配置文件及备份还原
- 查看运行配置
show running-config - 通过远程文件服务器备份
copy <running-config> <tftp/ftp>[://ip-address/file-name] - 通过远程文件服务器还原
copy <tftp/ftp>[://ip-address/file-name] <running-config>
CDP协议应用
- 查看启用接口连接的设备
show cdp neighbors - 查看配置
show cdp
调试
- 开启/关闭ip
[no] debug ip <protocol name>, example:debug ip icmp/rip
全局配置模式
一般命令
- 配置模式调用特权模式命令
do <command> - 进入
configure terminal - 离开
end - 更名
hostname <name>
设置时间时区
- 时间日期
clock set <hh::mm::ss> [month] [year] - 时区
clock timezone <timezone>, example:clock timezone GMT +8
设置远程虚拟终端登录密码
- 设置非安全密码
enable password <passwd> - 设置安全密码
enable secret <passwd>
物理接口配置模式
- 进入所需配置的接口
interface <serial/fastEthernet/loopback> <#number>,example:interface serial 1/1. - 设置ip地址
ip address <ip> <mask> - 开启/关闭接口
[no] shutdown - 离开
end
网络协议与路由操作
- 增加/删除路由
[no] ip route <net address> <net mask> <interface/gateway/next nop address> -
默认路由
[no] ip route 0.0.0.0 0.0.0.0 <interface/gateway/next nop address>
RIP配置
- 进入
router rip - 宣告自己的直连路由到相邻网络
network <connected-route/gateway/net address> - 配置定时器
timer basic <send update timer> <invalid after timer> <hold down timer> <flushed after timer> - 负载均衡,关闭快速交换,使用进程交换
no ip cef - 被动接口设置
passive-interface <interface> -
关闭所有接口
passive-interface default - 告知需要单播更新对端直连IP
neighbor <connected-ip-address>
CDP协议应用
- 修改发现间隔时间
cdp timer <seconds> - 接口信息保持时间
cdp holdtime <seconds>
终端线路配置模式
- 进入虚终端
line vty <0-max> - 设置密码
password <passwd> - 离开
end