当前位置:文档之家› cisco 路由器常用命令

cisco 路由器常用命令

r1(config)# r1(config)# r1(config)# r1# r1# r1# r1# r1(config)# r1(config-if)# r1(config-if)# r1(config-if)# r1(config-if)# r1(config-if)# r1(config-if)# r1(config)# r1(configr1(configr1(configr1(config重启60秒内按 重启60秒内按 重启60秒内按
show ip ospf 26 --→ 查看ospf的 进程 show arp---308 show ip ospf border-routers-→查看 show ip ospf virtual-link -→查看虚链路状态
------------------和大家一起分 享:切记,命令只 有多敲才记得住, 才熟练-----------------------
#show run interface f0/17 ---查看该17号接 口的信息 #show macaddress-table aging-time ---查 看MAC地址表里的 地址是否超时 aging-time时间为
#show macaddress-table --查看交换机学到 的所有主机的mac #show version---查看设备的版本 #show flash-----查看设备的操作 系统
---------------exit表示一步一步 退出,end表示一 步退出到#号模式-------------------------
#NAME? #conf t config)#int f0/1 (提示:2950交换 机上有f0/1--f0/24或则更多) config-if)#no shutdown (开启这 个接口) configif)#duplex full(把这个接口 configif)#description TO hotsmane(主机 名)---描述当前接 口连接的信息,可 手工定义。 config-if)#exit
退出当前序列(即切换路由器)
disconnect n
中断1个活动会话(n表示第n个会话)
路由器的查看命令
show ip route show ip controllers serial 0--→查看 接口是否是DCE接 show ip interface brief-→查看接口大致 show ip protocol--→查看 show ip ospf interface serial 1 show ip ospf interface ethernet 0 show ip ospf neighbor
show ip ospf database nssaexternal--→--→ -→7查看NSSA外部 LSA show ip ospf database asbrsummary --→--→ --→4查看ASBR汇 总LSA
show ip route-→ 查看路由表 show ip ospf border-routers-→ 查看到达ABR和 ASBR的路由表
>I
(2500系列)
>confreg 0x2142 (2600系列)


用户模式
进入特权执行模式
进入全局配置模式
查看历史缓冲区大小
打开终端日志功能
向Telnet用户端发送日志信息
复制运行配置到启动配置文件
复制启动配置文件到运行配置
复制运行配置到TETP服务器 复制启动配置文件TFTP服务器 复制TFTP文件到运行配置 复制TFTP文件到启动配置文件 复制Flash中文件到TFTP服务器 复制TFTP服务器中文件到Flash 重新启动路由器 进入setup模式 以乱码的形式保存密码 允许零子网 关闭IP路由域名查找 无类查找(一种查找路由表的方式) 设置主机名 设置enable口令 设置加密的enable口令 配置路由器的提示信息 使用路由器的tftp-server功能 更改配置寄存器值到0x2102 加入静态路由
查处打开的Debug项
show sessions
显示活动会话
show controllers +接口
显示串口是dce还是dte
show line vty n
显示线路信息
debug arp
监测ARP信息
debug ip packet
监测IP包的有关信息
debug ip ospf
debug ip ospf adj--→查看建立一个
copy startup-config tftp
copy tftp running-config
copy tftp startup-config
copy flash tftp
copy tftp flash
reload
setup
service password-encryption
ip subnet-zero
show ip ospf database--→查看 链路状态数据库 show ip ospf database summary
show ip ospf database router 192.168.30.10---→1查看路由器 show ip ospf database network 192.168.17.18 -→2查看网络LSA show ip ospf database summary 172.16.121.0 -→3查看网络汇总 show ip ospf database external 10.83.10.0 ---→ 5查看自主系统外
---------------“查看配置信息, 或存储当前配置” 都在特权模式下输 入--------------------------
#show runningconfig ---查看当 前配置信息(此时 没有保存) #show startupconfig ---查看存 储以后的配置信息 (此时已保存)(查 看,存储都在特权 模式下输入) #show history 查 看最近输入过的命 令 #copy runningconfig startupconfig ---保存设 备当前配置 #write ---保存设 备当前配置 ---------------------------RAM:代表当前配 置信息(掉电后配 置全无)---暂时 存储器 NVRAM:信息已保存 到路由器(掉电后 配置存在)永久存 储器 #erase startupconfig ---清除交 换机或路由器的配 置信息
no ip domain-lookup
ip classless
hostname host_name
enable passwrod passwrod
enable secret passwrod
banner motd
tftp-server flash:XXXXXX.bin
config-register 0x2102
description
ip address ip_address mask
clock rate
bandwidth
no shutdown
shutdown
line con 0
exec-timeout 0 0
logging synchronous
login
password password
>o/r 0x2142 (2500系列)
邻接关系的过程
debug ip ospf events--→查看邻居
不能建立的原因
no debug all
关闭所有Debug操作
undebug all
关闭所有Debug操作
ping ip_address
测试网络连通性
traceroute ip_address
测试到目的地的路径
ctrl-shift-6 ,x
交换机的基础命令:
>enable #conf t config)#hostname cisco-2950(为本 设备起名字) config)#enable password cisco (这个密码在进入 console口之前生 效--明文密码) config)#enable secret microsoft(若在上 面的基础上也配了 这个,则认 microsoft-密文, 而不认cisco-明
show interface [type number]
查看接口信息
show ip interface [type number] 查看接口IP参数设置的详细信息
show ip interface brief
查看所有接口IP地址的摘要信息
show arp
查看ARP缓存
show running-config
config)#line vty 0 1(表示在本设备 上设置了远程登陆 用户,可同时允许 两个用户telnet到 本机)
configline)#password 123(这个密码在 远程用户telnet本 设备外网接口IP时 输入生效) configline)#login
---------------若想NO掉设备上的 密码--在哪里配 的,就在哪里no, 如下:------------------------#conf t config)#no enable password cisco[ NO 特权密 config)#line console 0 config-line)#no password 123 [NO 控制台密码] config-line)#end #exit >enable
模式 r1> r1# r1# r1(configr1(config)# r1(config)#
r1#
r1#
r1# r1# r1# r1# r1# r1# r1# r1# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)#
相关主题