cisco路由器保存命令
如果您正在寻找关于cisco路由器保存命令和cisco路由器常见的命令状态的详细信息和实用建议,那么您来对了地方。
本文内容目录一览:
- 1、Cisco路由器配置命令
- 2、cisco路由器中保存路由器ram配置文件到nvram中的命令是什么?
- 3、cisco路由器日志的保存与查看
- 4、如何保存cisco路由器设置
- 5、Cisco常用的路由器交换机配置命令
- 6、知道思科路由器上保存命令的帮下忙
Cisco路由器配置命令
Cisco路由器配置命令大全
为方便考生复习思科路由器的配置,以下是我为大家整理的Cisco路由器配置命令,欢迎阅读与收藏。
1. switch配置命令
(1)模式转派猛乱换命令
用户模式----特权模式, 使用命令"enable"
特权模式----全局配置模式, 使用命令"config t"
全局配置模式----接口模式尘档, 使用命令"interface+接口类型+接口号"
全局配置模式----线控模式, 使用命令"line+接口类型+接口号"
注:
用户模式:查看初始化的信息.
特权模式:查看所有信息、调试、保存配置信息
全局模式:配置所有信息、针对整个路由器或交换机的所有接口
接口模式:针对某一个接口的配置
线控模式:对路由器进行控制的接口配置
(2)配置命令
show running config 显示所有的配置
show versin 显示版本号和寄存器值
shut down 关闭接口
no shutdown 打开接口
ip add +ip地址 配置IP地址
secondary+IP地址 为接口配置第二个IP地址
show interface+接口类型+接口号 查看接口管理性
show controllers interface 查看接口是否有DCE电缆
show history 查看历史记录
show terminal 查看终端记录大小
hostname+主机名 配置路由器或交换机的标识
config memory 修改保存在NVRAM中的启动配置
exec timeout 0 0 设置控制台会话超时为0
service password-encryptin 手工加密所有密码
enable password +密码 配置明文密码
ena sec +密码 配置密文密码
line vty 0 4/15 进入telnet接口
password +密码 配置telnet密码
line aux 0 进入AUX接口
password +密码 配置密码
line con 0 进入CON接口
password +密码 配置密码
bandwidth+数字 配置带宽
no ip address 删除已配置的IP地址
show startup config 查看NVRAM中的配置信息
copy run-config atartup config 保存信息知轮到NVRAM
write 保存信息到NVRAM
erase startup-config 清除NVRAM中的配置信息
show ip interface brief 查看接口的谪要信息
banner motd # +信息 + # 配置路由器或交换机的描素信息
description+信息 配置接口听描素信息
vlan database 进入VLAN数据库模式
vlan +vlan号+ 名称 创建VLAN
switchport access vlan +vlan号 为VLAN为配接口
interface vlan +vlan号 进入VLAN接口模式
ip add +ip地址 为VLAN配置管理IP地址
vtp+service/tracsparent/client 配置SW的VTP工作模式
vtp +domain+域名 配置SW的VTP域名
vtp +password +密码 配置SW的密码
switchport mode trunk 启用中继
no vlan +vlan号 删除VLAN
show spamming-tree vlan +vlan号 查看VLA怕生成树议
2. 路由器配置命令
ip route+非直连网段+子网掩码+下一跳地址 配置静态/默认路由
show ip route 查看路由表
show protocols 显示出所有的被动路由协议和接口上哪些协议被设置
show ip protocols 显示了被配置在路由器上的路由选择协议, 同时给出了在路由选择协议中使用的定时器等信息
router rip 激活RIP协议
路由器的几个基本命令:
Routerenable 进入特权模式
Router#disable 从特权模式返回到用户模式
Router#configure terminal 进入到全局配置模式
Router(config)#interface ethernet 1 进入到路由器编号为1的以太网口
exit 返回上层模式
end 直接返回到特权模式
========================================================
注意:
1、CISCO CATALYST(交换机),如果在初始化时没有发现“用户配置”文件,就会自动载入Default Settings(默认配置)文件,进行交换机初始化,以确保交换机正常工作。
2、CISCO Router(路由器)在初始化时,如果没有发现“用户配置”文件,系统会自动进入到“初始化配置模式”(系统配置对话模式,SETUP模式, STEP BY STEP CONFIG模式),不能正常工作!
========================================================
1、CONSOLE PORT(管理控制台接口):距离上限制,独占的方式。刚开始配置的时候一般使用这个。
2、AUX port(辅助管理接口):可以挂接MODEM实现远程管理,独占的方式。
3、Telnet:多人远程管理(决定于性能,VTY线路数量)不安全。后期维护,远程管理登陆。
========================================================
注意:
交换机、路由器配置命令都是回车后立即执行,立即生效的。在运行中的机器上修改命令的时候要特别注意。
========================================================
Router(config)#hostname ?
WORD This system's network name
在配置模式下修改当前主机的本地标识,例:
------------------
Router(config)#hostname r11
r11(config)#
------------------
r11(config-if)#ip address ?
A.B.C.D IP address
为当前端口设置IP地址,使用前先进入需要配置的端口,例:
------------------
r11(config)#interface ethernet 1
r11(config-if)#ip address 172.16.1.1 255.255.255.0
------------------
r11show version
r11#show version 观察IOS版本,设备工作时间,相关接口列表
r11#show running-config 查看当前生效的配置,此配置文件存储在RAM
r11#show interfaces ethernet 1 查看以太网接口的状态,工作状态等等等...
========================================================
r11#reload 重新加载Router(重启)
r11#setup 手工进入setup配置模式
r11#show history 查看历史命令(最近刚用过的命令)
r11#terminal history size0-256设置命令缓冲区大小,0 : 代表不缓存
r11#copy running-config startup-config 保存当前配置
注意概念:
nvram:非易失性内存,断电信息不会丢失 -- 用户配置 -- 保存着startup-config
ram:随机存储器,断电信息全部丢失 -- 当前生效配置 -- 保存着running-config
startup-config:在每次路由器或是交换机启动时候,会主动加载(默认情况)
========================================================
设置说明和密码的几个命令:
r11(config)#banner motd [char c] 同时要以[char c]另起一行结束,描述机器登陆时的说明
r11(config-if)#description 描述接口注释,需要在端口配置模式下
配置console口密码:
------------------
r11(config)#line console 0 进入到consolo 0
r11(config-line)#password eliuzd 设置一个密码为“eliuzd”
r11(config-line)#login 设置login(登陆)时使用密码
------------------
配置enable密码:
------------------
r11(config)#enable password cisco 设置明文的enable密码
r11(config)#enable secret eliuzd 设置暗文的enable密码(优先于明文被使用)
r11(config)#service password-encryption 加密系统所有明文密码(功能较弱)
------------------
配置Telnet密码:
------------------
r11(config)#line vty 0
r11(config-line)#password cisco
r11(config-line)#login
------------------
========================================================
配置虚拟回环接口:(回环接口默认为UP状态)
(config)# 下,虚拟一个端口
------------------
r11(config)#interface loopback 0 创建一个回环接口loopback 0
r11(config-if)#ip address 192.168.1.1 255.255.255.0 配置它的IP地址
no * 做配置的反向操作(删除配置)
------------------
=========================================================
路由器 DCE/DTE 仅存在广域网中
r11#show controllers serial 0 用于查看DCE与DTE的属性,serial 0路由器广域网端口
DCE的Router需要配置时钟频率
r11(config-if)#clock rate ? 配置DCE接口的时钟频率(系统指定频率)
一般实际情况下,这个不需要自己配置,因为DCE设备都在运营商那。
=========================================================
r11#show interfaces serial 1
查看端口状态,第一行提示说明
Serial1 is administratively down, Line protocol is down
没有使用no shutdown命令激活端口
Serial1 is down, Line protocol is down
1、对方没有no shutdown激活端口
2、线路损坏,接口没有任何连接线缆
Serial1 is up, line protocol is down
1、对方没有配置相同的二层协议,Serial接口default encapsulation: HDLC
2、可能没有配置时钟频率
3、可能没有正确的配置三层地址(可能)
Serial1 is up,line protocol is up
接口工作正常
========================================================
查看CDP信息的几个命令:
r11#show cdp neighbors 查看CDP的邻居(不含IP)
r11#show cdp neighbors detail 查看CDP的邻居(包含三层的IP地址)
r11#show cdp entry * 查看CDP的邻居(包含三层的IP地址)老命令
r1(config)#no cdp run 在全局配置模式关闭CDP协议(影响所有的接口)
r1(config-if)#no cdp enable 在接口下关闭CDP协议(仅仅影响指定的接口)
r11#clear cdp table 清除CDP邻居表
r11#show cdp interface serial 1 查看接口的CDP信息
注意两个提示:
Sending CDP packets every 60 seconds(每60秒发送cdp数据包)
HoldTime 180 seconds(每个cdp数据包保持180秒)
========================================================
r11(config)#ip host 设置静态的主机名映射
r11#show sessions 查看设置过的映射主机名
========================================================
Telnet *.*.*.* 被telnet的设备,需要设置line vty的密码,如果需要进入特权模式需要配置enable密码
cisco路由器中保存路由器ram配置文件到nvram中的命令是什么?
copy run start 意信和思是把当前正在运行的配置保存为开机配置至NVram 。。滑高盯一般是配置改动以后将改动保存 以免路由器关机以后新配置消失 因为RAM 断电就掉数据。
当然要做备份的话 可以保存至 copy run tftp 或者copy start tftp (如果这两个一样的话)保存至tftp服务器
当然破解密码念皮也要用上。。
cisco路由器日志的保存与查看
日志对于网络安全来说非常重要,他记录了系统每天发生的各种拆桥友各样的事情,你可以通过他来检查错误发生的原因,或者受到时者留下的痕迹。
Cisco是目前使用比较广泛的一种路由器,在许多行业系统中有非常普遍的应用。以下是在日常工作中积累的一些对Cisco路由器日志设置方面的经验,这些实例都在实际应用中调试通过并投入使用,我们可以利用路由器日志快速定位及排除故障。
路由器是各种信息传输的枢纽,被广泛用于企事业单位的网络建设中,承担着局域网之间及局域网与广域网之问连接的重任。
路由器的一些重要信息可以通过syslog机制在内部网络的Unix主机上作日志。在路由器运行过程中,路由器会向日志主机发送包括链路建立失败信息、包过滤信息等等日志信息,通过登录到日志主机,网络管理员可以了解日志事件,对日志文件进行分析,可以帮助管理员进行故障定位、故障排除和网络安全管理。
cisco路由器二、路由器日志记录存放的
sysloqd提供下列方法供您记录系统发生的事件:
(1)指定的远端主机
如果你不将系统信息记录在本地机器上,你可以写下网络中另一个主机的名称,然后在主机旅槐名称前面加上@符号(例如(@)ccunix1.variox.int,但被你指定的主机上必须要有sysloqd)。这可以防止由于硬盘错误等情况使日志文件丢失。
(2)一般文件
这是最普遍的方式。你可以指定好文件路径与文件名称,但是必须以目录符号/开始,系统才会知道这是一个文件。例如/var/adm/maillog表示要记录到/var/adm下面一个称为maillog的文件。如果之前没有这个文件,系统会自动产生一个。
(3)指定的终端机或其他设备
你也可以将系统记录写到一个终端机或是设备上。若将系统记录写到终端机,则目前正在使用该终端机的使用者就会直接在屏幕上看到系统信息(例如/dev/conso旧或是/dev/tty1,你可以拿一个屏幕专门来显示系统信息)。若将系统记录写到打印机(例如/dev/!p0)。,则你会有一长条印满系统记录的纸,这样网络入侵者就不能修改日志来隐藏入侵痕迹。
以上就是syslog各项记录程度及记录方式的写法,可以依照自己的需求记录下自己所需要的内容。但是这些记录都是一直追加上去的,除非将文件自行删除掉,否则这些文件就会越来越大。Syslog设备是一个网络者的显着目标,通过修改日消耐志来隐藏入侵痕迹,因此我们要特别注意。
养成每周(或更短的时间)定期检查一次记录文件的习惯,并将过期的记录文件依照流水号或是日期备份,以后查阅时也比较容易。千万不要记录下.,这样无论什么都被记录下来,结果会导致文件太大,要找资料时根本无法马上找出来。

如何保存cisco路由器设置
保存cisco路由器设置有两种方法。如下:
方法一:最常用的,
特权模式下:
router#copy run start
方巧桥法二:
router#write
如果启动加载不了配置可以用命令 copy start run
补充:
如果你要孝高猛把配置保存到电脑
你可以像升级IOS那样 用命令把配置复制念誉出来
命令:
copy flash:config tftp:
Cisco常用的路由器交换机配置命令
cisco制造的路由器设备、交换机和其他设备承载了全世界80%的互联网通信,成为硅谷中新经济的传奇,那么你了解Cisco常用的路由器交换机配置命令吗?下面是我整理的一些关于Cisco常用的路由器交换机配置命令的相关资料,供你参考。
Cisco常用的路由器支持的命令:
路由器显示命令:
router#show run ;显示配置信息
router#show interface ;显示接口信伍信息
router#show ip route ;显示路由信息
router#show cdp nei ;显示邻居信息
router#reload ;重新起动
路由器口令设置:
routerenable ;进入特权模式
router#config terminal ;进入全局配置模式
router(config)#hostname ;设置交换机的主机名
router(config)#enable secret xxx ;设置特权加密口令
router(config)#enable password xxb ;设置特权非密口令
router(config)#line console 0 ;进入控制台口
router(config-line)#line vty 0 4 ;进入虚拟终端
router(config-line)#login ;要求口令验证
router(config-line)#password xx ;设置登录口令xx
router(config)#(Ctrl+z) ; 返回特权模式
router#exit ;返回命令
路由器配置:
router(config)#int s0/0 ;进入Serail接口
router(config-if)#no shutdown ;激活当前接口
router(config-if)#clock rate 64000 ;设置同步时钟
router(config-if)#ip address ;设置IP地址游银
router(config-if)#ip address second ;设滑磨或置第二个IP
router(config-if)#int f0/0.1 ;进入子接口
router(config-subif.1)#ip address ;设置子接口IP
router(config-subif.1)#encapsulation dot1q ;绑定vlan中继协议
router(config)#config-register 0x2142 ;跳过配置文件
router(config)#config-register 0x2102 ;正常使用配置文件
router#reload ;重新引导
路由器文件操作:
router#copy running-config startup-config ;保存配置
router#copy running-config tftp ;保存配置到tftp
router#copy startup-config tftp ;开机配置存到tftp
router#copy tftp flash: ;下传文件到flash
router#copy tftp startup-config ;下载配置文件
ROM状态:
Ctrl+Break ;进入ROM监控状态
rommonconfreg 0x2142 ;跳过配置文件
rommonconfreg 0x2102 ;恢复配置文件
rommonreset ;重新引导
rommoncopy xmodem: flash: ;从console传输文件
rommonIP_ADDRESS=10.65.1.2 ;设置路由器IP
rommonIP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码
rommonTFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP
rommonTFTP_FILE=c2600.bin ;指定下载的文件
rommontftpdnld ;从tftp下载
rommondir flash: ;查看闪存内容
rommonboot ;引导IOS
静态路由:
ip route ;命令格式
router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例
router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例
动态路由:
router(config)#ip routing ;启动路由转发
router(config)#router rip ;启动RIP路由协议。
router(config-router)#network ;设置发布路由
router(config-router)#negihbor ;点对点帧中继用。
帧中继命令:
router(config)#frame-relay switching ;使能帧中继交换
router(config-s0)#encapsulation frame-relay ;使能帧中继
router(config-s0)#fram-relay lmi-type cisco ;设置管理类型
router(config-s0)#frame-relay intf-type DCE ;设置为DCE
router(config-s0)#frame-relay dlci 16 ;
router(config-s0)#frame-relay local-dlci 20 ;设置虚电路号
router(config-s0)#frame-relay interface-dlci 16 ;
router(config)#log-adjacency-changes ;记录邻接变化
router(config)#int s0/0.1 point-to-point ;设置子接口点对点
router#show frame pvc ;显示永久虚电路
router#show frame map ;显示映射
基本访问控制列表:
router(config)#access-list permit|deny
router(config)#interface ;default:deny any
router(config-if)#ip access-group in|out ;defaultut
例1:
router(config)#access-list 4 permit 10.8.1.1
router(config)#access-list 4 deny 10.8.1.0 0.0.0.255
router(config)#access-list 4 permit 10.8.0.0 0.0.255.255
router(config)#access-list 4 deny 10.0.0.0 0.255.255.255
router(config)#access-list 4 permit any
router(config)#int f0/0
router(config-if)#ip access-group 4 in
扩展访问控制列表:
access-list permit|deny icmp [type]
access-list permit|deny tcp [port]
例3:
router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo
router(config)#access-list 101 permit ip any any
router(config)#int s0/0
router(config-if)#ip access-group 101 in
例3:
router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
router(config)#access-list 102 permit ip any any
router(config)#interface s0/1
router(config-if)#ip access-group 102 out
删除访问控制例表:
router(config)#no access-list 102
router(config-if)#no ip access-group 101 in
路由器的nat配置
Router(config-if)#ip nat inside ;当前接口指定为内部接口
Router(config-if)#ip nat outside ;当前接口指定为外部接口
Router(config)#ip nat inside source static [p] [port]
Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1
Router(config)#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80
Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0
Router(config)#ip nat inside source list 1 pool p1
Router(config)#ip nat inside destination list 2 pool p2
Router(config)#ip nat inside source list 2 interface s0/0 overload
Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary
Router#show ip nat translation
rotary 参数是轮流的意思,地址池中的IP轮流与NAT分配的地址匹配。
overload参数用于PAT 将内部IP映射到一个公网IP不同的端口上。
外部网关协议配置
routerA(config)#router bgp 100
routerA(config-router)#network 19.0.0.0
routerA(config-router)#neighbor 8.1.1.2 remote-as 200
配置PPP验证:
RouterA(config)#username password
RouterA(config)#int s0
RouterA(config-if)#ppp authentication {chap|pap}
3.PIX防火墙命令
Pix525(config)#nameif ethernet0 outside security0 ;命名接口和级别
Pix525(config)#interface ethernet0 auto ;设置接口方式
Pix525(config)#interface ethernet1 100full ;设置接口方式
Pix525(config)#interface ethernet1 100full shutdown
Pix525(config)#ip address inside 192.168.0.1 255.255.255.0
Pix525(config)#ip address outside 133.0.0.1 255.255.255.252
Pix525(config)#global (if_name) natid ip-ip ;定义公网IP区间
Pix525(config)#global (outside) 1 7.0.0.1-7.0.0.15 ;例句
Pix525(config)#global (outside) 1 133.0.0.1 ;例句
Pix525(config)#no global (outside) 1 133.0.0.1 ;去掉设置
Pix525(config)#nat (if_name) nat_id local_ip [netmark]
Pix525(config)#nat (inside) 1 0 0
内网所有主机(0代表0.0.0.0)可以访问global 1指定的外网。
Pix525(config)#nat (inside) 1 172.16.5.0 255.255.0.0
内网172.16.5.0/16网段的主机可以访问global 1指定的外网。
Pix525(config)#route if_name 0 0 gateway_ip [metric] ;命令格式
Pix525(config)#route outside 0 0 133.0.0.1 1 ;例句
Pix525(config)#route inside 10.1.0.0 255.255.0.0 10.8.0.1 1 ;例句
Pix525(config)#static (inside, outside) 133.0.0.1 192.168.0.8
表示内部ip地址192.168.0.8,访问外部时被翻译成133.0.0.1全局地址。
Pix525(config)#static (dmz, outside) 133.0.0.1 172.16.0.8
中间区域ip地址172.16.0.8,访问外部时被翻译成133.0.0.1全局地址。
Cisco常用的交换机支持的命令:
交换机基本状态:
switch: ;ROM状态, 路由器是rommon
hostname ;用户模式
hostname# ;特权模式
hostname(config)# ;全局配置模式
hostname(config-if)# ;接口状态
交换机口令设置:
switchenable ;进入特权模式
switch#config terminal ;进入全局配置模式
switch(config)#hostname ;设置交换机的主机名
switch(config)#enable secret xxx ;设置特权加密口令
switch(config)#enable password xxa ;设置特权非密口令
switch(config)#line console 0 ;进入控制台口
switch(config-line)#line vty 0 4 ;进入虚拟终端
switch(config-line)#login ;允许登录
switch(config-line)#password xx ;设置登录口令xx
switch#exit ;返回命令
交换机VLAN设置:
switch#vlan database ;进入VLAN设置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;删vlan 2
switch(config)#int f0/1 ;进入端口1
switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2
switch(config-if)#switchport mode trunk ;设置为干线
switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan
switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继
switch(config)#vtp domain ;设置发vtp域名
switch(config)#vtp password ;设置发vtp密码
switch(config)#vtp mode server ;设置发vtp模式
switch(config)#vtp mode client ;设置发vtp模式
交换机设置IP地址:
switch(config)#interface vlan 1 ;进入vlan 1
switch(config-if)#ip address ;设置IP地址
switch(config)#ip default-gateway ;设置默认网关
switch#dir flash: ;查看闪存
交换机显示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看当前配置信息
switch#show vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
switch#show int f0/0 ;查看指定端口信息
知道思科路由器上保存命令的帮下忙
1、首先交换机连接电源线。
2、胡笑然后用端口线连烂键接电脑,一头是R232端口,一头是RJ45类似网信水晶头。
3、打开超级终端,输入一个名字,确定。
4、选择一个端口,一般是端口1,不行的话试裤历含试端口2等等。
5、点击还原为默认设置。
6、进入界面后点击回车即可保存。
了解这些路由器和无线网络的技巧和方法可以让您更好地掌控您的网络,从而享受更好的上网体验。





