路由器常用命令
1. 查看路由器:
Router#show version
显示路由器的硬件配置,软件版本,内存大小以及配置寄存器设置等 其中configuration register
0x2102:正常启动 0x2142:配置文件
Router#show running-config
显示路由器当前正使用的配置信息,信息存储于RAM中,掉电丢失。
Router#show startup-config
显示路由器启动时所使用的配置信息,信息存储于NVRAM中,掉电不丢失。
Router#show ip arp(查看路由器上的ARP缓存表)
Router#show ip route(查看路由表,包括动态,静态和默认路由)
Router#show interface f0/0(查看F0/0的配置信息) 1)fastethernet 0/0 is up ,line protocol is up (正常) 2)fastethernet l 0/0 is up ,line protocol is down
(硬件正常,配置错误。或连线故障)
3)fastethernet 0/0 is down ,line protocol is down (硬件端口错误) 4)fastethernet 0/0 is administratively down ,line protocol is down (管理员关闭端口)
2. 路由器出厂参数恢复:
Router#erase startup-configure Router#reload
3. 路由器设置console控制台密码: 1)启用
Router(config)#line console 0 Router(config_line)#login
Router(config_line)#password 密码字符串
2)取消
Router(config)#line console 0 Router(config_line)login
Router(config_line)#no password
4. 配置console的其他参数 1)配置超时
Router(config)#line console 0
Router(config_line)#exec-timeout 分 秒
如果指定时间内没有对console进行配置,自动返回登录界面。 2)显示同步
Router(config)#line console 0
Router(config_line)#logging synchronous
5. 对所有密码加密:
Router(config)#service password-encryptoin
6. 关闭广播查找:
Router(config)#no ip domain-lookup 误操作引起的域名解析查找广播
7. 单臂路由:
Router1(config)#interface f0/0 进入f0/0端口
Router1(config-if)#no shut 开启端口
Router1(config-if)#interface f0/0.5 配置子端口
Router1(config-subif)#encapsulation dot1q 5 封装协议
Router1(config-subif)#ip address 192.168.5.1 255.255.255.0设置IP
8. 配置接口标识:
Router(config-if)#description This is a fast Ethernet port used to connecting the company’s intranet!
9.路由:配置路由器标识:
Router(config)#banner motd $ This is Aptech Company’s Route! $
10. 配置静态
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.2
目的网段 子网掩码 下一相邻接口地址
Router(config)#ip route 192.168.1.0 255.255.255.0 serial0 目的网段 子网掩码 出站接口 11. 配置默认路由:
Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.2
任意目标网段 任意掩码 下一相邻接口
Router(config)#ip classless (当路由器不能转发包时,匹配给默认路由)
12. 路由器telnet远程登录设置:
Router(config)#enable secret 特权密码
Router(config)#interface fastethernet 0/1
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#line vty 0 4
Router(config_line)#login
Router(config_line)#password 远程登录密码
13. 端口配置IP地址
Router(config)#interface f0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shut
14.路由器cisco2600的密码恢复:
1) Ctrl+break 启动路由器
2) Rommon>confreg 0x2142 ;启动时不加载配置文件
3) Rommon>reset ;监视模式下重启
4) Set up 模式选择:no
5) Router#copy startup-config running-config
6) Router#configure terminal
7) Router(config)#enable secret cisco
8) Router(config)#config-register 0x2102
9) Router#copy running-config start-co