1路由器交换机基本配置.docx

上传人:b****7 文档编号:11195457 上传时间:2023-02-25 格式:DOCX 页数:14 大小:47.64KB
下载 相关 举报
1路由器交换机基本配置.docx_第1页
第1页 / 共14页
1路由器交换机基本配置.docx_第2页
第2页 / 共14页
1路由器交换机基本配置.docx_第3页
第3页 / 共14页
1路由器交换机基本配置.docx_第4页
第4页 / 共14页
1路由器交换机基本配置.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

1路由器交换机基本配置.docx

《1路由器交换机基本配置.docx》由会员分享,可在线阅读,更多相关《1路由器交换机基本配置.docx(14页珍藏版)》请在冰豆网上搜索。

1路由器交换机基本配置.docx

1路由器交换机基本配置

一.熟悉交换机,路由器的基本配置.

1.路由器的几个操作模式

Router>//用户模式

Router>enable//用户模式敲入enable进入特权模式

Router#configureterminal//特权模式敲入configuretermina进入配置模式

Router(config)#interfaceethernet0//配置模式敲入interface+接口类型+接口编号,进入配置模式(如:

interfaceserial0或是interfaceserial0/1,interfacefast1/1,接口编号是多少具体要看是哪个型号的设备)

Router(config-if)#exit//从接口模式退出到配置模式

Router(config)#exit//从配置模式退出到enable模式

Router#//enable模式,也是特权模式.

注意:

任何时候按Ctrl-z或是end都会退出到特权模式

2.命名主机名

路由默认主机名为Router

例如:

把路由器的主机名命名为XM-WENPING-R2600-A

Router(config)#hostnameXM-WENPING-R2600-A

XM-WENPING-R2600-A(config)#

XM-WENPING-R2600-A(config)#hostnameWisdom //设置主机名是Wisdom

Wisdom(config)#

3.给路由器设置时间

Wisdom(config)#Wisdom#clockset23:

46:

50sep42006

Wisdom#showclock       //用showclock命令查看时间

23:

46:

57.527UTCMonSep42006

Wisdom#

4.给路由器设置banner //登录信息

Wisdom(config)#bannermotd#  

EnterTEXTmessage.Endwiththecharacter'#'.

Welcometowisdom!

!

#

Wisdom(config)#end

Wisdom#exit

03:

12:

58:

%SYS-5-CONFIG_I:

Configuredfromconsolebyconsole

Wisdom#exit

Wisdomcon0isnowavailable

PressRETURNtogetstarted.

Welcometowisdom!

!

  //配置是banner之后无论谁登录到路由器都会先看到的信息.

Wisdom>enable

Wisdom#

Banner信息很多情况下是一些警告的信息:

如:

bannermotd^C

*********************************************************

*[WARNING]*

*Ifyouarenotauthorisedtoaccessthissystem*

*exitimmediately.*

*Unauthorisedaccesstothissystemisforbiddenby*

*companypolicies,national,andinternationallaws.*

*Unauthorisedusersaresubjecttocriminalandcivil*

*penaltiesaswellascompanyinitiateddisciplinary*

*proceedings.*

**

*Byentryintothissystemyouacknowledgethatyou*

*areauthorisedtoaccessitandhavethelevelof*

*privilegeatwhichyousubsequentlyoperateon*

*thissystem*

*Youconsentbyentryintothissystemtothe*

*monitoringofyouractivities*

*********************************************************

^C

5.路由器,交换机接口的描述

Wisdom(config)#interfaceethernet0

Wisdom(config-if)#descriptionToFuzhou-R2600-A //描述ethernet0口是接到福州的路由器A,一般都要尽可以的描述详细一点,这样有利于日后的维护.

6.路由器,交换机密码的设置

A.enable密码的设置(enable的密码就是从用户模式到特权模式的密码,enable的密码有两种,一种是加密的,一种是不加密码的,建议使用enablesecret设置密码)

Wisdom(config)#enablepasswordcisco

Wisdom(config)#enablesecretcisco1

Wisdom(config)#end

Wisdom#disable

03:

29:

29:

%SYS-5-CONFIG_I:

Configuredfromconsolebyconsole

Wisdom>enable

Password:

//这里要输入的是cisco1,如果enable的两个密码同时设置,只是secret生效.

Wisdom#

Wisdom#showrun

Buildingconfiguration...

Currentconfiguration:

!

enablesecret5$1$LNtZ$XFAQft5YyTsrXFVAXNp0Y/   //加密过的

enablepasswordcisco//显示为明文,容易被破解.不过可以手工加密,用命令servicepassword-encryption进行加密

Wisdom(config)#servicepassword-encryption

Wisdom#showrun

Buildingconfiguration...

Currentconfiguration:

!

enablesecret5$1$LNtZ$XFAQft5YyTsrXFVAXNp0Y/   //加密过的

enablepassword7104D000A0618  //手工加密过的

B.设置交换机路由器的console口密码

Wisdom(config)#lineconsole0

Wisdom(config-line)#login  //启用密码 nologin是不启用密码

Wisdom(config-line)#passwordcisco//设置的密码为cisco

Wisdom(config-line)#end

03:

39:

51:

%SYS-5-CONFIG_I:

Configuredfromconsolebyconsole

Wisdom#exit

Wisdomcon0isnowavailable

PressRETURNtogetstarted.

Welcometowisdom!

!

UserAccessVerification

Password:

  //要输入console口密码cisco才可以进入用户模式

Wisdom>

C.设置路由器交换机的vty密码(也是就是远程登陆telnet的密码)

Wisdom(config)#linevty04  //04的意思是0到4,5个人可以同时登录

Wisdom(config-line)#login  //启用密码,nologin是不启用密码

Wisdom(config-line)#passwordcisco //设置的密码为cisco 

测试网络的连通性:

telnet+IPaddress

D:

删除enable,console,vty密码

Wisdom(config)#noenablepassword 

Wisdom(config)#noenablesecret

Wisdom(config)#linecon

Wisdom(config)#lineconsole0

Wisdom(config-line)#nopassword

Wisdom(config)#linevty04

Wisdom(config-line)#nopassword

Wisdom(config-line)#

E.两条常用的命令 

阻止会话退出--exec-timeout

使光标还原到原来的位置,重新显示被覆盖的命里--loggingsynchronous

Wisdom(config)#lineconsole0

Wisdom(config-line)#exec-timeout00 //0分0秒表示永远不超时,等同于noexec-timeout

Wisdom(config)#lineconsole0

Wisdom(config-line)#loggingsynchronous

F.路由器和交换机的基本配置是一样的.大同小异.这里介绍怎么远程telnet到交换机.

Switch(config)#hostnameSW2950//命名主要机

SW2950(config)#interfacevlan1//在二层的交换机上配置一个三层管理地址

SW2950(config-if)#ipadd192.168.10.225255.255.255.0

SW2950(config-if)#noshutdown//启用接口

SW2950(config)#linevty04

SW2950(config-line)#login

SW2950(config-line)#passwordcisco

SW2950(config-line)#

pc>telnet192.168.10.225

Trying192.168.10.225...Open

UserAccessVerification

Password:

SW2950>

这证明远程telnet成功.

G:

配置R1.R2.R3的基本配置,使得在R1可以ping通12.1.1.2,ping通13.1.1.3

配置R1:

R1(config)#noipdomain-lookup//关掉域名查找

R1(config)#lineconsole0

R1(config-line)#login

R1(config-line)#passwordcisco

R1(config-line)#loggingsynchronous

R1(config-line)#exec-timeout00

R1(config-line)#

配置路由器的E0口IP地址

Router(config)#hostnameR1

R1(config)#interfaceethernet0//配置E0接口的IP地址

R1(config-if)#ipaddress11.1.1.1255.255.255.0

R1(config-if)#noshutdown

R1(config-if)#nokeepalive

R1(config-if)#exit

配置路由器的S0口IP地址

R1(config)#interfaceserial0

R1(config-if)#ipaddress12.1.1.1255.255.255.0

R1(config-if)#clockrate4000000//给DCE接口配置时钟

R1(config-if)#noshutdown

配置路由器的S1口IP地址

R1(config)#interfaceserial1

R1(config-if)#ipaddress13.1.1.1255.255.255.0

R1(config-if)#clockrate4000000

R1(config-if)#noshutdown

配置R2:

R2(config)#noipdomain-lookup//关掉域名查找

R2(config)#lineconsole0

R2(config-line)#login

R2(config-line)#passwordcisco

R2(config-line)#loggingsynchronous

R2(config-line)#exec-timeout00

R2(config-line)#

Router(config)#hostnameR2

R2(config)#interfaceethernet0

R2(config-if)#ipaddress22.1.1.2255.255.255.0

R2(config-if)#noshutdown

R2(config-if)#nokeepalive

R2(config-if)#exi

R2(config)#interfaceserial0

R2(config-if)#ipaddress12.1.1.2255.255.255.0

R2(config-if)#noshutdown

配置R3:

R3(config)#noipdomain-lookup//关掉域名查找

R3(config)#lineconsole0

R3(config-line)#login

R3(config-line)#passwordcisco

R3(config-line)#loggingsynchronous

R3(config-line)#exec-timeout00

R3(config-line)#exit

Router(config)#hostnameR3

R3(config)#interfaceethernet0

R3(config-if)#ipaddress33.1.1.3255.255.255.0

R3(config-if)#noshutdown

R3(config-if)#nokeepalive

R3(config)#intserial0

R3(config-if)#ipaddress13.1.1.3255.255.255.0

R3(config-if)#noshutdown

配置了以前步骤之后用命令showinterface检查接口的状态.

R1#showipinterfacebrief

InterfaceIP-AddressOK?

MethodStatusProtocol

Ethernet011.1.1.1YESmanualupup

Serial012.1.1.1YESmanualupup

Serial113.1.1.1YESmanualupup

R1#showinterfacesethernet0

Ethernet0isup,lineprotocolisup

HardwareisLance,addressis00e0.b05b.018e(bia00e0.b05b.018e)

Internetaddressis11.1.1.1/24

MTU1500bytes,BW10000Kbit,DLY1000usec,

reliability255/255,txload1/255,rxload1/255

EncapsulationARPA,loopbacknotset

Keepalivenotset

ARPtype:

ARPA,ARPTimeout04:

00:

00

…………..

…………..

R1#showinterfacesserial0

Serial0isup,lineprotocolisup

HardwareisHD64570

Internetaddressis12.1.1.1/24

MTU1500bytes,BW1544Kbit,DLY20000usec,

reliability255/255,txload1/255,rxload1/255

EncapsulationHDLC,loopbacknotset

Keepaliveset(10sec)

…………

……………….

R1#showinterfacesserial1

Serial1isup,lineprotocolisup

HardwareisHD64570

Internetaddressis13.1.1.1/24

MTU1500bytes,BW1544Kbit,DLY20000usec,

reliability255/255,txload1/255,rxload1/255

EncapsulationHDLC,loopbacknotset

Keepaliveset(10sec)

……………..

……………………..

R1#

R2#showipinterfacebrief

InterfaceIP-AddressOK?

MethodStatusProtocol

Ethernet022.1.1.2YESmanualupup

Serial012.1.1.2YESmanualupup

Serial1unassignedYESunsetadministrativelydowndown

R3#showipinterfacebrief

InterfaceIP-AddressOK?

MethodStatusProtocol

Ethernet033.1.1.3YESmanualupup

Serial013.1.1.3YESmanualupup

Serial1unassignedYESunsetadministrativelydowndown

在R1测试到R2R3的连通性,使用ping的命令

Ping+ipaddress

如:

R1#ping12.1.1.2

Typeescapesequencetoabort.

Sending5,100-byteICMPEchosto12.1.1.2,timeoutis2seconds:

!

!

!

!

!

//5个!

表明网络是通的

Successrateis100percent(5/5),round-tripmin/avg/max=4/4/8ms

R1#ping13.1.1.3

Typeescapesequencetoabort.

Sending5,100-byteICMPEchosto13.1.1.3,timeoutis2seconds:

!

!

!

!

!

//5个!

表明网络是通的

Successrateis100percent(5/5),round-tripmin/avg/max=4/4/8ms

R1#

在路由器或是交换机里使用ping命令

如果ping的结果是!

!

!

!

!

则表明网络正常.

如果ping的结果是…..则表明网络不通.

如果ping的结果是U.U.U则表明下一跳不可达.

H:

路由器交换机几条常用的命令:

Showversion//查看软件版本

showrunning-config//查看当前运行的配置文件

showstartup-config//查看已保存过的配置文件

showipintbrie//查看接口基本状态

showinterface//查看接口状态的详细信息

copyrunstar//把当前运行的配置COPY到NVRAM(断电后不丢失)

showcontrollerserial0//检察s0口的串行线是否连接好

R1#showcontrollersserial0

HDunit0,idb=0x29A524,driverstructureat0x2A1AE8

buffersize1524HDunit0,V.35DCEcable,clockrate4000000

…………

R1#showcontrollersserial1

HDunit0,idb=0x29A524,driverstructureat0x2A1AE8

buffersize1524HDunit0,V.35DCEcable,clockrate4000000//DCE接口要配置时钟

…………

R2#showcontrollersserial0

HDunit0,idb=0x270B50,driverstructureat0x278108

buffersize1524HDunit0,V.35DTEcable//DTE接口不用配置时钟

………………

I.清除NVRAM(注:

交换机和路由器所用命令一样)

SW2950#erasestartup-config

要重起路由器或是交换机,配置才会丢失.

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

当前位置:首页 > 经管营销 > 经济市场

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

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