CCNA实验手册.docx

上传人:b****8 文档编号:28150504 上传时间:2023-07-08 格式:DOCX 页数:89 大小:112.59KB
下载 相关 举报
CCNA实验手册.docx_第1页
第1页 / 共89页
CCNA实验手册.docx_第2页
第2页 / 共89页
CCNA实验手册.docx_第3页
第3页 / 共89页
CCNA实验手册.docx_第4页
第4页 / 共89页
CCNA实验手册.docx_第5页
第5页 / 共89页
点击查看更多>>
下载资源
资源描述

CCNA实验手册.docx

《CCNA实验手册.docx》由会员分享,可在线阅读,更多相关《CCNA实验手册.docx(89页珍藏版)》请在冰豆网上搜索。

CCNA实验手册.docx

CCNA实验手册

CCNA实验手册

第一章路由器的基本配置

1.1登录到Cisco路由器

1.将PC的串行接口(COM通讯端口)和路由器的CONSOLE端口通过反转电缆(Roll-overCable)连接,使用超级终端(开始->运行->Hypertrm)登陆到路由器,端口设置参数还原为默认值即可,如图所示。

2.打开路由器电源开关,观察路由器启动过程。

若路由器此时已经启动,可以在键入命令reload使路由器重新启动。

填写路由器以下参数:

路由器内存:

IOS版本号:

接口类型和数目:

FLASH容量:

1.2CLI的工作模式

1.进入Setup模式,了解Setup模式的作用和可设置的参数,Setup模式是一个友好的一问一答式的配置模式,当路由器在NVRAM中找不到startup-configuration时会提示是否要进入Setup模式。

问:

在特权模式下如何进入Setup模式?

想放弃Setup模式的配置,该如何退出?

2.进入CommandLineInterface(CLI)后,可看到系统提示符Router>,键入“?

”查看命令列表。

键入enable进入特权模式,打“?

”查看命令列表。

Privileged-Mode下可执行详细检验命令,并且是配置路由器的必经模式。

键入configureterminal进入全局配置模式,查看命令列表。

3.把路由器的主机名(hostname)改为wolf_gw_1,为以太接口配置描述:

tor2,为路由器设置登陆欢迎画面:

Hello,world.

1.3路由器的登录接口设置

我们前面提到三种主要的登录接口分别是Console、Aux和vty。

这三个接口的安全配置为路由器提供了基本的安全。

Console接口的安全配置

配置步骤:

Router(Config)#lineconsole0

Router(Config-line)#login

Router(Config-line)#passwordcisco

VirtualTerminal接口的安全配置

配置步骤:

Router(Config)#linevty04

Router(Config-line)#login

Router(Config-line)#passwordcisco

AUX接口的安全配置

配置步骤:

Router(Config)#lineaux0

Router(Config-line)#login

Router(Config-line)#passwordcisco

思考下列三种配置的区别?

linevty04

login

nopassword

linevty04

nologin

passwordcisco

linevty04

nologin

nopassword

1.3.1特权模式的安全配置

我们可以给路由器的特权模式配置一个安全的密文,当操作员要从用户模式进入到特权模式时则必须输入我们设定的密文。

Cisco为我们提供了两种加密的模型:

普通加密与MD5.

普通加密

配置步骤:

Router>enable

Router#configt

Router(config)#enablepasswordcisco

使用普通加密配置的特权模式的密码是以明文方式保存在路由器上,可以通过showrun命令查看到:

Router#shrun

Buildingconfiguration...

....<忽略>....

enablepasswordcisco//在这里我们可以看到路由器的明文密码

....<忽略>....

这样会带来很大的安全隐患,但IOS为我们提供了一种隐藏的方法:

(使用Servicespassword-encryption命令)

Router#conft

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#servicepassword-encryption

Router(config)#

使用这条命令之后明文密码会以一定的算法变为非明文的!

但是,这种所谓的加密的密文仍能非常简单的使用数学算法破解。

Router#shrun

Buildingconfiguration...

....<忽略>....

enablepassword7121A0C041104//现在密码是编码过的

....<忽略>....

MD5算法加密

使用MD5算法所进行的特权模式的加密会提供更多的密码安全特性。

配置步聚:

Router>enable

Router#configt

Router(config)#enablesecretpassword

使用这样的方法所配置的明文即无法使用命令查看到,也无法使用软件反破解回原文密码。

故提供了较高的安全性。

Router#shrun

Buildingconfiguration...

....<忽略>....

enablesecret5$1$.ejI$929cFq2DO5OfqrpNHD4ys///这里是md5级加密的密码

....<忽略>....

如果我们同时在一台路由器上配置了普通密码加密和MD5模式加密,且分别使用不同的密码,那么最终登入路由器所签权使用的密码是哪一个配置的?

1.3.2配置命令别名(CommandAliases)

我们可以以较简洁的命令来代替一个真实的命令

例:

Router1#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router1(config)#aliasexecrtshowiproute

Router1(config)#aliasexeconshowipospfneighbor

Router1(config)#end

Router1#

按上例我们可以实现输入rt代替showiproute的目的。

我们可以通过使用showaliases查看当前路由器所创建的别名

1.3.3清除启动文件

默认时,路由器在重启时会自动加载上一次所保存的配置,如果我想重新初始化一台路由器做其它配置时,需要删除配置文件:

我们可以使用erasenvram命令删除startup-config

Router1#erasenvram:

Erasingthenvramfilesystemwillremoveallfiles!

Continue?

[confirm]

[OK]

Eraseofnvram:

complete

Router1#reload

Systemconfigurationhasbeenmodified.Save?

[yes/no]:

no

Proceedwithreload?

[confirm]

Youcanachievethesameresultwiththeerasestartup-configcommand:

Router1#erasestartup-config

Erasingthenvramfilesystemwillremoveallfiles!

Continue?

[confirm]

[OK]

Eraseofnvram:

complete

Router1#reload

Proceedwithreload?

[confirm]

1.3.4配置思科发现协议(CDP)

我们可以在路由器上全局性的启用或禁用CDP,也可以单独在接口上启用或禁用CDP;默认在所有接口上启用CDP。

Router1#configureterminal

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router1(config)#cdprun//在全局下启用CDP

Router1(config)#interfaceSerial0/0

Router1(config-if)#cdpenable//在本接口下启用CDP

Router1(config-if)#exit

Router1(config)#interfaceFastEthernet0/0

Router1(config-if)#nocdpenable

Router1(config-if)#exit

Router1(config)#interfaceFastEthernet1/0

Router1(config-if)#cdpenable

Router1(config-if)#end

Router1#

♦使用showcdpneighbors命令查看周边的Cisco设备。

Router1#showcdpneighbors

CapabilityCodes:

R-Router,T-TransBridge,B-SourceRouteBridge

S-Switch,H-Host,I-IGMP,r-Repeater

DeviceIDLocalIntrfceHoldtmeCapabilityPlatformPortID

Router2Ser0/0179R2621Ser0/1

Switch1Fas1/0152TSWS-C29242/2

Router1#

♦若相查看周边Cisco设备的详细信息,可以使用showcdpneighborsdetails

Router1#showcdpneighborsdetail

-------------------------

DeviceID:

Router2

Entryaddress(es):

IPaddress:

10.1.1.2

...<忽略>...

Router1#

相关命令参考:

showcdp

showcdpneighbors

showcdpneighborsdetail

cdprun

cdpenable

cdptime

1.3.5用户任务管理

我们可以使用showusers可以查看登录到当前路由器的所有连接

AS252-Rack>shuser

LineUserHost(s)IdleLocation

1tty1incoming00:

00:

17Rack04R1

18vty0Rack01r100:

00:

17192.168.100.61

19vty1192.168.100.13900:

46:

2010.192.3.85

20vty2192.168.100.13900:

56:

5010.192.3.85

22vty4rack05r100:

43:

4610.192.3.85

rack05r200:

44:

49

rack05r300:

44:

43

rack05r400:

45:

21

rack05r500:

44:

34

*23vty5idle00:

00:

0010.192.3.85

InterfaceUserModeIdlePeerAddress

AS252-Rack>

通过使用send来在控制台对用户发送消息

AS252-Rack>shuser

LineUserHost(s)IdleLocation

1tty1incoming00:

00:

04Rack04R1

18vty0Rack01r100:

00:

04192.168.100.61

19vty1192.168.100.13900:

51:

2610.192.3.85

22vty4rack05r100:

48:

5210.192.3.85

rack05r200:

49:

55

rack05r300:

49:

48

rack05r400:

50:

26

rack05r500:

49:

40

*23vty5idle00:

00:

0010.192.3.85

InterfaceUserModeIdlePeerAddress

AS252-Rack>sendvty5

Entermessage,endwithCTRL/Z;abortwithCTRL/C:

hello!

AS252-Rack>

 

使用showsession命令来查看从当前路由器出发连接了哪些目的网络地址:

AS252-Rack>shsess

ConnHostAddressByteIdleConnName

*1rack06r1192.168.202.24800rack06r1

AS252-Rack>

1.3.6启用HTTP方式管理Router

通过使用iphttpserver命令可以打开路由器的Web管理界面:

Router#conft

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#iphttpserver

Router(config)#

Router#

当配置完命令,打开浏览器,并在地址栏中输入路由器的某个接口的地址,之后输入正确的口令,就可以打开内置的Web管理方式。

1.3.7创建静态Hostname表

通过使用iphost可以创建主机名与IP地址相对应的条目。

Router#

Router#conft

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#iphostRack11R1202.100.2.1

Router(config)#exit

Router#showhosts

Defaultdomainisnotset

Name/addresslookupusesdomainservice

Nameserversare255.255.255.255

HostFlagsAgeTypeAddress(es)

Rack11R1(perm,OK)0IP202.100.2.1

1.3.8禁示域名解析

当我们在路由器上输入一个错命令时,路由器会进行解析:

Router#hello

Translating"hello"...domainserver(255.255.255.255)

(255.255.255.255)

Translating"hello"...domainserver(255.255.255.255)

%Unknowncommandorcomputername,orunabletofindcomputeraddress

Router#

可以通过使用noipdomain-lookup命令来关闭域名解析:

Router#conft

Enterconfigurationcommands,oneperline.EndwithCNTL/Z.

Router(config)#noipdomain-lookup

Router(config)#exit

Router#hello

Translating"hello"

Translating"hello"

%Unknowncommandorcomputername,orunabletofindcomputeraddress

Router#

这里我们再输入错域的命令时,路由器不会再对这个命令进行域名解析,从而节省我们的时间

 

1.3.9常用Tcp/ip测试命令(ping、……)

Ping

使用Ping命令可以判断是否能够到达目的地。

C1209-AS252>ping192.168.100.252

Typeescapesequencetoabort.

Sending5,100-byteICMPEchosto192.168.100.252,timeoutis2seconds:

!

!

!

!

!

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

使用不跟参数的ping命令即扩展ping命令可以指定更多的参数:

Router#ping

Protocol[ip]:

TargetIPaddress:

192.168.1.1

Repeatcount[5]:

Datagramsize[100]:

Timeoutinseconds[2]:

Extendedcommands[n]:

Sweeprangeofsizes[n]:

Typeescapesequencetoabort.

Sending5,100-byteICMPEchosto61.134.1.4,timeoutis2seconds:

!

!

!

!

!

Successrateis100percent(5/5),round-tripmin/avg/max=584/610/640ms

在IOS中ICMP回应请求的响应中ping命令接收到的代码的解释:

Ping命令代码

解释

!

收到了ICMPEchoReply

.

未接收任何信息

U

ICMP不可到达目的主机(包可被传送到与目的子网相连的路由器,但主机无响应)

N

ICMP不可到达网络(路由选择表中没有与数据包目标匹配的项)

P

ICMP不可到达端口(包被传递到目的主机,但目的端口没有被应用程序打开)

Q

ICMP源地址失踪

M

ICMP无法将报文分段

?

收到无法识别的包

Traceroute

使用traceroute命令可以查看由本地出发到达目的地所经过的所有路由:

Router>trace172.33.4.5

Typeescapesequencetoabort.

Tracingtherouteto61.134.1.4

1192.1.2.2424msec4msec4msec

2192.1.2.2418msec8msec8msec

3192.1.2.338msec8msec8msec

4192.1.7.12916msec16msec12msec

5192.1.3.8112msec12msec16msec

6192.1.3.5416msec16msec16msec

7131.216.216.7116msec16msec20msec

8131.4.9760msec64msec60msec

9192.13.53.960msec64msec60msec

10192.11.34.46108msec84msec84msec

11192.11.36.22128msec128msec128msec

1213.3.3.4108msec120msec104msec

13172.16.0.1296msec296msec300msec

14172.33.1.1284msec288msec280msec

15172.33.4.1312msec304msec372msec

16172.33.4.5296msec*304msec

1.3.10备份和恢复Router的配置文件

路由器的running-config为当前路由器的配置,会随时输入命令而发生变化,此文件为内存中一个文件:

Router#dirsystem:

Directoryofsystem:

/

2dr-x0memory

1-rw-657running-config

11dr-x0vfiles

Nospaceinformationavailable

Router#

而我们可以把这个running-config拷贝到nvram中,并改名为startup-config,这样当路由器断电或是重启起动时,路由器会自动的加载nvram中的startup-config这个文件,实现我们的配置不丢失。

Router#dirsystem:

Directoryofsystem:

/

2dr-x0memory

1-rw-657running-config

11dr-x0vfiles

Nospaceinformationavailable

Router#dirnvram:

Directoryofnvram:

/

30-rw-0startup-config

31----0private-config

32762bytestotal(32712bytesfree)

Router#

Router#copyrunning-configstartup-config

Destinationfilename[startup-config]?

Buildingconfiguration...

[OK]

Router#dirnvram:

Directoryofnvram:

/

30-rw-657startup-config

31----24private-config

32762bytestotal(32031bytesfree)

Router#

第二章StaticRoute配置

2.1基本静态路由设置

实验目的:

路由全通

RouterA

RouterA#shorun

Buildingconfiguration...

Currentconfiguration:

584bytes

version12.2

noservicesingle-slot-reload-enable

servicetimestampsdebuguptime

servicetimestampsloguptime

noservicepassword-encryption

hostnameRouterA

loggingrate-limitconsole10excepterrors

ip

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

当前位置:首页 > IT计算机 > 计算机硬件及网络

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

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