cisco交换机路由器配置12个经典试验.docx

上传人:b****7 文档编号:9062516 上传时间:2023-02-03 格式:DOCX 页数:20 大小:75.89KB
下载 相关 举报
cisco交换机路由器配置12个经典试验.docx_第1页
第1页 / 共20页
cisco交换机路由器配置12个经典试验.docx_第2页
第2页 / 共20页
cisco交换机路由器配置12个经典试验.docx_第3页
第3页 / 共20页
cisco交换机路由器配置12个经典试验.docx_第4页
第4页 / 共20页
cisco交换机路由器配置12个经典试验.docx_第5页
第5页 / 共20页
点击查看更多>>
下载资源
资源描述

cisco交换机路由器配置12个经典试验.docx

《cisco交换机路由器配置12个经典试验.docx》由会员分享,可在线阅读,更多相关《cisco交换机路由器配置12个经典试验.docx(20页珍藏版)》请在冰豆网上搜索。

cisco交换机路由器配置12个经典试验.docx

cisco交换机路由器配置12个经典试验

cisco交换机、路由器配置12个经.典试验

cisco交换机、路由器配置12个经典试验

实验一:

  1.口令和设备名设置

  添加任意的交换机或路由器,先对交换机进行操作,双击SwitchA

1.  switch>en

2.  password:

;第一次密码为空,直接回车

3.  switch#conft;进入全局配置模式

4.  switch(config)#hostnameswa;设置交换机名

5.  swa(config)#enablesecretaaa;设置特权加密口令为aaa

6.  swa(config)#enablepasswordaax;设置特权非密口令为aax

7.  swa(config)#lineconsole0;进入控制台口(Rs232)状态

8.  swa(config-line)#login;允许登录

9.  swa(config-line)#passwordaa;设置登录口令aa

10.  swa(config-line)#linevty04;进入虚拟终端virtualtty

11.  swa(config-line)#login;允许登录

12.  swa(config-line)#passworda;设置登录口令a

13.  swa(config-line)#exit;返回上一层

14.  swa(config)#exit;返回上一层

15.  swa#shrun;看配置信息

16.  swa#exit;返回命令

17.  swa>en

18.  password:

;试验哪一个口令可以通过

复制代码

  双击ROA对路由器进行与交换机类似的设置。

  2.清除口令

  清除交换机口令,实际中是在开机时按住交换机上的mode钮,本模拟机按Ctrl+Break

  清除路由器口令,参考如下:

双击ROA

  先配置路由的特权口令:

1.  router>en

2.  password:

;第一次密码为空,直接回车

3.  router#conft;进入全局配置模式

4.  router(config)#enablesecretaaa;设置特权加密口令为aaa

5.  router(config)#exit;返回

6.  router#exit

7.  router>en

8.  password:

aaa

9.  router#

10.  清除口令是打开寄存器配置开关:

11.  router#reload;重新启动,按Ctrl+Break

12.  rommon>

13.  rommon>confreg0x2142;跳过配置,26xx36xx45xx

14.  rommon>reset     ;重新引导,等效于重开机

15.  router>en

16.  password:

17.  router#conft

18.  router(config)#enablesecretbbb;设置特权加密口令为aaa

19.  router(config)#config-register0x2102;正常使用配置文件

20.  router(config)#exit

21.  router#exit

22.  router>en

23.  password:

bbb

24.  router#

复制代码

  实验二:

计算机与交换机IP地址设置

  图文件:

switch1

  规划ip地址:

  PCA:

10.65.1.1

  PCB:

10.65.1.2

  SWA:

10.65.1.3

  1.双击PCA

  输入用户名:

root

  输入口令:

linux

  设置IP:

[root#PCAroot]#ifconfigeth010.65.1.1netmask255.255.0.0

  查看IP:

[root#PCAroot]#ifconfig

  删除IP:

[root#PCAroot]#ifconfigeth010.65.1.1netamsk255.255.0.0down

  设置网关:

[root#PCAroot]#routeadddefaultgw10.65.1.9

  查看网关:

[root#PCAroot]#route

  删除网关:

[root#PCAroot]#routedeldefaultgw10.65.1.9

  2.双击PCB

  输入用户名:

root

  输入口令:

linux

  设置IP:

[root#PCBroot]#ifconfigeth010.65.1.2netmask255.255.0.0

  设置网关:

[root#PCBroot]#routeadddefaultgw10.65.1.9

  3.双击SWA

  进入特权模式:

switch>en

  进入全局配置模式:

switch#conft

  进入默认VLAN状态:

switch(config)#intvlan1

  设置ip地址和掩码:

switch(config-if)#ipaddress10.65.1.3

  但不需要IOS的支持,在IOS损坏的情况下往往使用这种方式。

  2.在特权模式下的升级

  装入图文件:

router1b

  要求TFTPServer(PCA)接入路由器的以太口,且PCA的ip地址与路由接口的ip地址

  在一个网络段。

设置TFTP的ip地址为:

10.65.1.1

  双击HostA:

1.  login:

root

2.  password:

linux

3.  [root#linuxroot]#ifconfigeth010.65.1.1netmask255.255.0.0

4.  [root#linuxroot]#ifconfig;查看IP地址

复制代码

  双击要升级的路由器:

  设置与之tftpserver相联接口f0/0的ip地址

1.  router(cnfig-if)#ipaddress10.65.1.2255.255.0.0

2.  router#copytftpflash:

3.  tftpserveripaddress:

10.65.1.1

4.  flashfilename:

C2621.bin

5.  ###############################################################

6.  ###############################################################

7.  #######

8.  ok!

9.  router#dirflash:

10.  c2621.bin

复制代码

  这种方式传输的速度较快,使用的是以太网的速率。

但要求IOS是好的,所以升级

  IOS使用这种方式较好。

  3.在rommon监控状态下,使用TFTP升级

  装入图文件:

router1c

  要求路由器console与计算机rs232相连,路由器f0/0与计算机网卡相连。

1.  router>Ctrl+Break;进入ROM监控状态

2.  rommon>ip_address=10.65.1.10;设置路由器IP

3.  rommon>ip_subnet_mask=255.255.0.0;设置路由器掩码

4.  rommon>tftp_server=10.65.1.1;指定TFTP服务器IP

5.  rommon>tftp_file=c2600.bin;所要下载的文件

6.  rommon>tftpdnld;ROM监控状态升级IOS

7.  ###############################################################

8.  ###############################################################

9.  #######

10.  ok!

11.  rommon>dirflash:

;查看闪存中的内容

12.  c2621.bin

13.  rommon>boot;引导IOS

14.  router>

复制代码

  实验五路由器接口ip设置

  装入图文件:

router1d

  本实验两个计算机,一个路由器,测试路由器的直路由。

  设置PCA的IP地址为:

10.65.1.1255.255.0.0

  设置PCB的IP地址为:

10.66.1.1255.255.0.0

  设置ROf0/0的IP为:

10.65.1.2255.255.0.0

  设置ROf0/1的IP为:

10.66.1.2255.255.0.0

  1.设置计算机ip地址

  设置IP:

[root#PCAroot]#ifconfigeth010.65.1.1netmask255.255.0.0

  查看IP:

[root#PCAroot]#ifconfig

  设置网关:

[root#PCAroot]#routeadddefaultgw10.65.1.2

  查看网关:

[root#PCAroot]#route

  设置IP:

[root#PCBroot]#ifconfigeth010.65.1.1netmask255.255.0.0

  查看IP:

[root#PCBroot]#ifconfig

  2.双击ROA,配置路由器的接口IP地址:

1.  router>en

2.  router#conft

3.  router(config)#hostnameroa

4.  roa(config)intf0/0

5.  roa(config-if)#ipaddress10.65.1.2255.255.0.0

6.  roa(config-if)#noshutdown

7.  roa(config)intf0/1

8.  roa(config-if)#ipaddress10.66.1.2255.255.0.0

9.  roa(config-if)#noshut

10.  roa(config)ints0/0

11.  roa(config-if)#clockrate64000

12.  roa(config-if)#ipaddress10.67.1.2255.255.0.0

13.  roa(config-if)#noshut

14.  roa(config)ints0/1

15.  roa(config-if)#clockrate64000

16.  roa(config-if)#ipaddress10.68.1.2255.255.0.0

17.  roa(config-if)#noshut

复制代码

  3.在计算机PCA分别ping路由器的四个接口f0/0、f0/1、s0/0、s0/1

1.  [root#PCAroot]#ping10.65.1.2

2.  [root#PCAroot]#ping10.66.1.2

3.  [root#PCAroot]#ping10.67.1.2

4.  [root#PCAroot]#ping10.68.1.2

5.  [root#PCBroot]#ping10.65.1.2

6.  [root#PCBroot]#ping10.66.1.2

7.  [root#PCBroot]#ping10.67.1.2

8.  [root#PCBroot]#ping10.68.1.2

复制代码

  上面的ping命令,这PCA都可以通,但PCB只能与直联口通,因为PCB没有设置网关。

  下面设置PCB的网关:

1.  [root#PCBroot]#routeadddefaultgw10.66.1.2

2.  [root#PCBroot]#route

复制代码

  设置网关:

[root#PCBroot]#routeadddefaultgw10.65.1.9

  查看网关:

[root#PCBroot]#route

  再从PCBping各个接口,结果如何?

(通)。

  实验六路由器接口的secondaryip

  装入图文件:

router1e

  这个图含有一个路由器,一个交换机,两个计算机。

计算机的IP不变,即:

  1.检查计算机和交换机的IP和网关,要求:

  PCA的IP地址:

10.65.1.1网关指向:

10.65.1.2

  PCB的IP地址:

10.66.1.1网关指向:

10.66.1.2

  此时PCA与PCB是不通的,因为它们的网络Id不一样。

  设置交换机的IP地址:

1.  switch(config)#intvlan1

2.  switch(config-if)#ipaddress10.65.1.8255.255.0.0

复制代码

  2.设置路由器的接口f0/0的有两个ip地址。

1.  roa(config)intf0/0

2.  roa(config-if)#ipaddress10.65.1.2255.255.0.0

3.  roa(config-if)#noshut

4.  roa(config-if)#ipaddress10.66.1.2255.255.0.0secondary

5.  roa(config-if)#noshut

6.  roa#shrun

复制代码

  3.测试可通性

1.  [root#PCAroot]#ping10.66.1.1

2.  [root#PCAroot]#ping10.66.1.2

3.  [root#PCBroot]#ping10.65.1.1

4.  [root#PCBroot]#ping10.65.1.2

5.  switch#ping10.65.1.1

6.  switch#ping10.66.1.1

复制代码

  以上都是可以通的,如果去掉交换机与路由的连线,PCA和PCB还可以通吗?

  可见PCA到PCB的发包是经过路由器的,称之为单臂路由。

  这种情况PCA和PCB在同广播域中,对工作带宽不利。

如果划分VLAN可以隔离广播域,

  下面实验是子接口对不同VLAN的路由。

  实验七使用路由器子接口路由情况

  装入图文件:

router1e(同上图)

  此实验计算机和交换机的IP地址和网关不变,但要求交换机工作在两个VLAN的情况下,

  一个是原有的默认VALN,另一个是新设置的VLAN2,含f0/5、f0/6。

  1.设置交换机,增加一个vlan2

1.  switch#vlandatabase

2.  Switch(vlan)#vlan2

3.  Switch(vlan)#exit

4.  Switch#conft

5.  Switch(config)#hostnameSWA

6.  SWA(config)#intf0/5

7.  SWA(config-if)#switchportaccessvlan2

8.  SWA(config-if)#intf0/6

9.  SWA(config-if)#switchportaccessvlan2

10.  SWA(config-if)#intf0/1

11.  SWA(config-if)#switchportmodetrunk

12.  SWA(config-if)#

13.  SWA#shvlan

14.  SWA#shrun(检查设置情况)

复制代码

  2.路由器f0/0有两个子接口

1.  roa(config)intf0/0

2.  roa(config-if)#intf0/0.1

3.  roa(config-subif.1)#encapsulationisl

4.  roa(config-subif.1)#ipaddress10.65.1.2255.255.0.0

5.  roa(config-subif.1)#noshut

6.  roa(config-subif.1)#intf0/0.2

7.  roa(config-subif.2)#encapsulationisl

8.  roa(config-subif.2)#ipaddress10.66.1.2255.255.0.0

9.  roa(config-subif.2)#noshut

10.  roa#shrun

复制代码

  检查计算机ip地址与子接口ip地址同网络,计算机网关指向网络的子接口ip。

  3.测试可通性

1.  [root#PCAroot]#ping10.66.1.1

2.  [root#PCAroot]#ping10.66.1.2

3.  [root#PCBroot]#ping10.65.1.1

4.  [root#PCBroot]#ping10.65.1.2

复制代码

  在使用一个路由器接口的情况下,如果下接的网络含有不同的VLAN,则要求路由器的接口

  要划分成子接口,并绑定isl协议。

在交换机上通过多个VLAN的接口,要设置成trunk。

  如果去掉交换机与路由的连线,PCA和PCB还可以通吗?

可见这也是一种单臂路由。

  实验八静态路由实验

  装入图文件:

router2

  先实验有两个路由器,两个计算机。

规划IP地址:

  1.设置计算机和路由器的IP

  设置ROA的IP:

1.  f0/0:

10.65.1.2-->PCA:

10.65.1.1

2.  f0/1:

10.66.1.2

3.  s0/0:

10.67.1.2

4.  s0/1:

10.68.1.2-->

复制代码

  设置ROB的IP:

1.  s0/0:

10.68.1.1<--

2.  s0/1:

10.69.1.2

3.  f0/0:

10.70.1.2

4.  f0/1:

10.71.1.2-->PCB:

10.71.1.1

复制代码

  2.静态路由:

1.  ROA(config)#iproute10.71.0.0255.255.0.010.68.1.1

2.  ROA(config)#iprouting

3.  ROA#showiproute

4.  从PCApingPCB即:

5.  [root@PCAroot]#ping10.71.1.1

6.  [root@PCAroot]#ping10.70.1.2

复制代码

  3.默认路由

1.  ROA(config)#noiproute10.71.0.0255.255.0.010.68.1.1

2.  ROA(config)#iproute0.0.0.00.0.0.010.68.1.1

3.  ROA#showiproute

4.  [root@PCAroot]#ping10.71.1.1

5.  [root@PCAroot]#ping10.70.1.2

复制代码

  使用指定静态路由时,只ping能指定网络,使用默认路由时,不判断目的网络。

  4.静态路由接力

  再装入图文件:

router3

  这个网络有三个路由器,四个计算机。

  假设计算机PCC的IP地址是:

10.90.1.1

  假设计算机PCD的IP地址是:

10.91.1.1

  如果要从PCA到PCC可通,要在路经的路由器接力设置静态路由。

如:

1.  ROA(config)#iproute10.90.0.0255.255.0.0

2.  ROA(config)#iproute10.90.0.0255.255.0.0

3.  [root@PCAroot]#ping10.90.1.1

复制代码

  实验九三个路由器的静态路由

  装入图文件:

router3

  设置ROA的IP:

1.  f0/0:

10.65.1.2-->PCA:

10.65.1.1

2.  f0/1:

10.66.1.2-->PCB:

10.66.1.1

3.  s0/0:

10.67.1.2

4.  s0/1:

10.68.1.2-->

复制代码

  设置ROB的IP:

1.  s0/0:

10.68.1.1<--

2.  s0/1:

10.69.1.2-->

3.  f0/0:

10.70.1.2

4.  f0/1:

10.71.1.2

复制代码

  设置ROC的IP:

1.  s0/0:

10.69.1.1<--

2.  s0/1:

10.72.1.2

3.  f0/1:

10.73.1.2-->PCC:

10.73.1.1

4.  f0/0:

10.74.1.2-->PCD:

10.74.1.1

复制代码

  设置从PCA到PCC的静态路由

1.  ROA(config)#iprouting

2.  ROA(config)#iproute10.73.0.0255.255.0.010.68.1.1

3.  ROA#showiproute

4.  ROB(config)#iproute10.73.0.0255.255.0.010.71.1.1

5.  ROB#showiproute

6.  [root@PCAroot]#ping10.73.1.1

复制代码

  使用默认路由

1.  ROA(config)#noiproute10.73.0.0255.255.0.010.66.1.1

2.  [root@PCAroot]#ping10.73.1.1

3.  ROA(config)#iproute0.0.0.0.0.0.0.010.68.1.1

4.  [root@PCAroot]#ping10.73.1.1

复制代码

  实验九三个路由器动态路由实验

  装入图文件:

router3

  实验网络与上个实验相同,ip地址也不变,现在用动态路由实现网络的连通。

1.  ROA(config)#iprouting

2.  ROA(config)#routerrip

3.  ROA(config-router)#network10.0.0.0

4.  ROB(config)#iprouting

5.  ROB(config)#routerrip

6.  ROB(config-router)#network10.0.0.0

7.  ROC(config)#ip

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

当前位置:首页 > 工程科技 > 机械仪表

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

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