思科路由器命令大全完整版.docx

上传人:b****7 文档编号:9368219 上传时间:2023-02-04 格式:DOCX 页数:13 大小:17.54KB
下载 相关 举报
思科路由器命令大全完整版.docx_第1页
第1页 / 共13页
思科路由器命令大全完整版.docx_第2页
第2页 / 共13页
思科路由器命令大全完整版.docx_第3页
第3页 / 共13页
思科路由器命令大全完整版.docx_第4页
第4页 / 共13页
思科路由器命令大全完整版.docx_第5页
第5页 / 共13页
点击查看更多>>
下载资源
资源描述

思科路由器命令大全完整版.docx

《思科路由器命令大全完整版.docx》由会员分享,可在线阅读,更多相关《思科路由器命令大全完整版.docx(13页珍藏版)》请在冰豆网上搜索。

思科路由器命令大全完整版.docx

思科路由器命令大全完整版

思科交换机路由器命令大全

交换机命令:

switch>         用户模式

1:

进入特权模式  enable

switch>enable

switch#

2:

进入全局配置模式  configureterminal

switch>enable

switch#configureterminal

switch(conf)#

3:

交换机命名hostnameaptech2950     以aptech2950为例

switch>enable

switch#configureterminal

switch(conf)#hostnameaptch-2950

aptech2950(conf)#

4:

配置使能口令  enablepasswordcisco    以cisco为例

switch>enable

switch#configureterminal

switch(conf)#hostnameaptch2950

aptech2950(conf)#enablepasswordcisco

5:

配置使能密码  enablesecretciscolab    以cicsolab为例--设置禁用IP地址解析特性,设置启用消息同步特性

switch>enable

switch#configureterminal

switch(conf)#hostnameaptch2950

aptech2950(conf)#enablesecretciscolab

aptech2950(conf)#noipdomain-lookup                   -----设置禁用IP地址解析特性

aptech2950(conf)#loggingsynchronous                    -----设置启用消息同步特性

aptech2950(conf)#interfacerangefastethernet0/1-20

aptech2950(conf-if-range)#spanning-treeportfast       -----设置快速

端口

aptech2950(conf)#interfacerangefastethernet0/23-24

aptech2950(conf-if-range)#swichportmodetrunk                 -----设置主干道端口

aptech2950(conf)#spanning-treeuplingkfast                        ---设置阻塞启用迅速(只可以在访问层启用)

6:

设置虚拟局域网vlan1   interfacevlan1

switch>enable

switch#configureterminal

switch(conf)#hostnameaptch2950

aptech2950(conf)#interfacevlan1

aptech2950(conf-if)#ipaddress192.168.1.1255.255.255.0      配置交换机端口ip和子网掩码

aptech2950(conf-if)#noshut                              是配置处于运行中

aptech2950(conf-if)#exit

aptech2950(conf)#ipdefault-gateway192.168.254             设置网关地址

7:

进入交换机某一端口interfacefastehernet0/17           以17端口为例

switch>enable

switch#configureterminal

switch(conf)#hostnameaptch2950

aptech2950(conf)#interfacefastehernet0/17

aptech2950(conf-if)#

8:

查看命令  show

switch>enable

switch#showversion  察看系统中的所有版本信息

showinterfacevlan1  查看交换机有关ip协议的配置信息

showrunning-configure查看交换机当前起作用的配置信息

showinterfacefastethernet0/1  察看交换机1接口具体配置和统计信息

showmac-address-table        查看mac地址表

showmac-address-tableaging-time  查看mac地址表自动老化时间

9:

交换机恢复出厂默认恢复命令

switch>enable

switch#erasestartup-configure

switch#reload

10:

双工模式设置

switch>enable

switch#configureterminal

switch2950(conf)#hostnameaptch-2950

aptech2950(conf)#interfacefastehernet0/17                 以17端口为例

aptech2950(conf-if)#duplexfull/half/auto                    有full,half,auto三个可选项

11:

cdp相关命令

switch>enable

switch#showcdp    查看设备的cdp全局配置信息

showcdpinterfacefastethernet0/17    查看17端口的cdp配置信息

showcdptraffic     查看有关cdp包的统计信息

showcdpnerghbors  列出与设备相连的cisco设备

12:

csico2950的密码恢复

拔下交换机电源线。

用手按着交换机的MODE键,插上电源线

在switch:

后执行flash_ini命令:

switch:

flash_ini

查看flash中的文件:

switch:

dirflash:

把“config.text”文件改名为“config.old”:

switch:

renameflash:

config.textflash:

config.old

执行boot:

   switch:

boot

交换机进入是否进入配置的对话,执行no:

进入特权模式察看flash里的文件:

showflash:

把“config.old”文件改名为“config.text”:

   switch:

renameflash:

config.oldflash:

config.text

把“config.text”拷入系统的“running-configure”:

copyflash:

config.textsystem:

running-configure

把配置模式重新设置密码存盘,密码恢复成功。

13:

交换机telnet远程登录设置:

switch>en

switch#configureterminal

switch(conf)#hostnameaptech-2950

aptech2950(conf)#enablepasswordcisco          以cisco为特权模式密码

aptech2950(conf)#interfacefastethernet0/1        以17端口为telnet

远程登录端口

aptech2950(conf-if)#ipaddress192.168.1.1255.255.255.0

aptech2950(conf-if)#noshut

aptech2950(conf-if)#exit

aptech2950(conf)linevty04                   设置0-4个用户可以telnet远程登陆

aptech2950(conf-line)#login

aptech2950(conf-line)#passwordedge            以edge为远程登录的用户密码

主机设置:

ip         192.168.1.2               主机的ip必须和交换机端口的地址在同一网络段

netmask    255.255.255.0

gate-way   192.168.1.1               网关地址是交换机端口地址

运行:

telnet192.168.1.1

进入telnet远程登录界面

password:

edge               

aptech2950>en

password:

cisco

aptech#

14:

交换机配置的重新载入和保存

设置完成交换机的配置后:

aptech2950(conf)#reload

是否保存(y/n)   y:

保存设置信息        n:

不保存设置信息

路由器命令

router>         用户模式

1:

进入特权模式  enable

router>enable

router#

2:

进入全局配置模式  configureterminal

router>enable

router#configureterminal

router(conf)#

3:

交换机命名hostnameroutera    以routerA为例

router>enable

router#configureterminal

router(conf)#hostnamerouterA

routera(conf)#

4:

配置使能口令  enablepasswordcisco    以cisco为例

router>enable

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#enablepasswordcisco

5:

配置使能密码  enablesecretciscolab    以cicsolab为例

router>enable

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#enablesecretciscolab

6:

进入路由器某一端口interfacefastehernet0/17           以17端口为例

router>enable

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#interfacefastehernet0/17

routerA(conf-if)#

进入路由器的某一子端口interfacefastethernet0/17.1       以17端口的1子端口为例

router>enable

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#interfacefastehernet0/17.1

7:

设置端口ip地址信息

router>enable

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#interfacefastehernet  0/17                以17端口为例

routerA(conf-if)#ipaddress192.168.1.1255.255.255.0      配置交换机端口ip和子网掩码

routerA(conf-if)#noshut                              是配置处于运行中

routerA(conf-if)#exit

8:

查看命令  show

router>enable

router#showversion  察看系统中的所有版本信息

showinterfacevlan1  查看交换机有关ip协议的配置信息

showrunning-configure查看交换机当前起作用的配置信息

showinterfacefastethernet0/1  察看交换机1接口具体配置和统计信息

showmac-address-table        查看mac地址表

showmac-address-tableaging-time  查看mac地址表自动老化时间

       showcontrollersserial+编号    查看串口类型

       showiprouter      查看路由器的路由表

9:

cdp相关命令

router>enable

router#showcdp    查看设备的cdp全局配置信息

showcdpinterfacefastethernet0/17    查看17端口的cdp配置信息

showcdptraffic     查看有关cdp包的统计信息

showcdpnerghbors  列出与设备相连的cisco设备

10:

csico2600的密码恢复

重新启动路由器,在启动过程中按下win+break键,使路由器进入rommonitor

在提示符下输入命令修改配置寄存器的值,然后重新启动路由器

remmon1>confreg0x2142

remmon2>reset

重新启动路由器后进入setup模式,选择“no”,退回到exec模式,此时路由器原有的配置仍然保存在startup-config中,为使路由器恢复密码后配置不变把startup-config中配置保存到running-config中,然后重新设置enable密码,并把配置寄存器改回0x2102:

router>enable

router#copystartup-configrunning-config

router#configureterminal

router(conf)#enablepasswordcisco

router(conf)#config-register0x2102

保存当前配置到startup-config,重新启动路由器。

router#copyrunning-configstartup-config

router#reload

11:

路由器telnet远程登录设置:

router>en

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#enablepasswordcisco          以cisco为特权模式密码

routerA(conf)#interfacefastethernet0/1        以17端口为telnet远程登录端口

routerA(conf-if)#ipaddress192.168.1.1255.255.255.0

routerA(conf-if)#noshut

routerA(conf-if)#exit

routerA(conf)linevty04                   设置0-4个用户可以telnet远程登陆

routerA(conf-line)#login

routerA(conf-line)#passwordedge            以edge为远程登录的用户密码

主机设置:

ip         192.168.1.2               主机的ip必须和交换机端口的地址在同一网络段

netmask    255.255.255.0

gate-way   192.168.1.1               网关地址是交换机端口地址

运行:

telnet192.168.1.1

进入telnet远程登录界面

password:

edge               

routera>en

password:

cisco

routera#

12:

配置路由器的标识   banner$……………$

在全局配置的模式下利用“banner”命令可以配置路由器的提示信息,所有连接到路由器的终端都会收到。

router>en

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#bannermotd$Thisisaptechcompany’  router!

Pleasedon’tchangetheconfigurationwithoutpermission!

$

13:

配置接口标识     description………

接口标识用于区分路由器的各个接口。

router>en

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#interfacefastethernet0/1      以0/1接口为例

routerA(conf-if)#descriptionthisisafastEthernetportusedtoconnectingthecompany’sintranet!

       

14:

配置超时

超时适用于设置在多长时间没有对console进行配置,自动返回exec会话时间。

默认为10分钟。

router>en

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#lineconsole0

routerA(conf-if)#exec-timeout00             第一个“0”代表分钟,第二个“0”代表秒

15:

配置串口参数

两台路由器通过串口连接需要一个做为DTE,一个做为DCE。

DCE设备要向DTE设备提供时钟频率和带宽。

DCE配置:

router>en

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#interfaceserial0/0

routerA(conf_if)#clockrate64000           提供时钟频率为64000

routerA(conf_if)#bandwidth64             提供带宽为64

DTE配置:

路由器串口配置ip地址

router>en

router#configureterminal

router(conf)#hostnamerouterB

routerB(conf)#interfaceserial0/0

routerB(conf_if)#ipaddress192.168.1.1255.255.255.0

16:

静态路由的配置

配置路由器A的主机名和接口参数

router>enable

router#configureterminal

router(conf)#hostnamerouterA

routerA(conf)#interfacefastethernet0/1           路由器A的1端口为两路由器的连接端口

routerA(conf-if)#ipaddress192.168.2.1255.255.255.0

routerA(conf-if)#noshutdown

routerA(conf-if)#exit

routerA(conf)#interfacefastethernet0/0          路由器A的0端口为与主机的连接端口

routerA(conf-if)#ipaddress192.168.1.2255.255.255.0

routerA(conf-if)#noshutdown

主机A的ip地址为192.168.1.1

255.255.255.0

192.168.1.2

配置路由器B的主机名和接口参数

router>enable

router#configureterminal

router(conf)#hostnamerouterB

routerB(conf)#interfacefastethernet0/0           路由器B的0端口为两路由器的连接端口

routerB(conf-if)#ipaddress192.168.2.2255.255.255.0

routerB(conf-if)#noshutdown

routerB(conf-if)#exit

routerB(conf)#interfacefastethernet0/1           路由器B的1端口为与主机的连接端口

routerB(conf-if)#ipaddress192.168.3.1255.255.255.0

主机B的ip地址为192.168.3.2

255.255.255.0

192.168.3.1

配置路由器A的静态路由表

routerA(conf)#iprouter192.168.3.0  255.255.255.0  192.168.2.2

配置路由器B的静态路由表

routerA(conf)#iprouter192.168.1.0  255.255.255.0  192.168.2.1

在routerA和routerB上配置默认路由

routerA(conf)#iproute0.0.0.00.0.0.0192.168.2.2

routerA(conf)#ipclassless

routerB(conf)#iproute0.0.0.00.0.0.0192.168.2.1

routerB(conf)#ipclassless

在routerA和routerB上配置动态路由(RIP)

routerA(conf)#routerrip

routerA(conf)#network192.168.1.0

routerA(conf)#network192.168.2.0

routerB(conf)#routerrip

routerB(conf)#network192.168.2.0

routerB(conf)#network192.168.3.0

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 高等教育 > 文学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1