na实验手册.doc_第1页
na实验手册.doc_第2页
na实验手册.doc_第3页
na实验手册.doc_第4页
na实验手册.doc_第5页
已阅读5页,还剩82页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

CCNA实验手册 Openlab西安分公司时代教育 潘熙 实验一:设备登陆及基础配置实验要求:使用console线登录路由器或交换机并进行基础配置实验目的:了解如何使用console 线登陆路由器或交换机及基础配置1.1设备的登陆方式一共有两种:.使用console线和超级终端或secureCRT登陆设备;部分电脑可能不存在com口,可以使用DB-9转USB接口进行转换.通过网络远程登陆设备,常使用telnet或ssh2,但默认情况下设备远程并未被开启,可手工开启同时设备需可以进行网络通信;1.2 当console线连接后,使用超级终端或secureCRT登录.计算机开始菜单-程序-附件-通讯-超级终端.配置超级终端1)配置区号(随便配置) 2) 点击确定3)选择主机上的com口,台式机一般仅存在com1口;使用USB转接口时,插入不同USB接口时对应com口编号可能为其他数值,需选择正确的接口4)点击还原为默认,使用默认参数,确定后登陆5) 设备正在启动.使用secureCRT通过console口登陆配置CRT1)开启CRT选择在标签中连接2)在弹出窗口选择新建会话 3)在弹出窗口中选择serial4) 在弹出窗口中选择正确的com接口编号,配置比特波为默认的9600 5)会话名称用于用户标记该会话 6)使用创建的会话连接1.3设备基础配置在初登设备时,由于设备没有可加载的startup-config或者寄存器值为不加载startup-config,设备会询问管理员是否进入初始化配置模式;初始化配置模式类似于问答模式,由设备提出问题管理员进行选择回答来对设备进行部分配置;但这种方法我们极少使用,因为直接手动配置来的更方便和直接,故选择NO.开启进行基础配置:Router 用户模式Routerenable 键入授权Router# 特权模式 Router#config terminal 键入配置终端Enter configuration commands, one per line. End with CNTL/Z.Router(config)# 全局配置模式Router(config)#line console 0 进入console口Router(config-line)# 线路配置模式(其他模式的一种)Router(config-line)#logging synchronous 日志同步Router(config-line)#exec-timeout 0 0 超时计时器为0分0秒,即为永不 超时,也可以使用 no exec-timeout 来关闭该计时器;但切记使用关闭命令时一定要将服务单词打、输齐,否则可能错误的关闭其他服务Router(config-line)#exitRouter(config)#no ip domain-lookup 关闭域名解析Router(config)#hostname R3 修改默认主机名为R3R3(config)# .基础配置-加密部分配置用户模式进入特权模式的密码R3(config)#enable ? password Assign the privileged level password secret Assign the privileged level secretR3(config)#enable password cisco R3(config)#enable secret cisco123 注:选择password时在running-config中看到密码为明文; 选择secret时在running-config中看到密码为密文;两种均使用时,secret密码生效可通过service password-encryption 命令开启密码加密服务,让running中所有以password开头的密码均变成简单的密文;.配置console口密码:R3(config)#R3(config)#line console 0R3(config-line)#password ciscoR3(config-line)#login 注:此时由于使用password命令,所以在running-config中和enable密码一样;一定要配置login,可以理解为确认使用该密码来登录 推荐做法:R3(config)#username ccna privilege 15 secret cisco 定义用户名为ccna权限15级(超级管理员)密码为running-config中密文的ciscoR3(config)#line console 0R3(config-line)#login local 要求console口使用本地用户数据来验证登录 当输入login local后先前配置的login被覆盖.保存配置R3#copy running-config startup-configDestination filename startup-config? Building configuration.OKR3# 或者使用写入R3#write Building configuration.OKR3# 实验二 交换机简单端口安全配置实验要求:1、 交换机开启端口安全服务,pc1和pc2所在位置更换主机后交换机逻辑关闭接口;2、 Pc3和pc4所在位置更换主机后交换不关闭接口但数据包将不会被转发实验目的:了解交换机简单端口工作原理、配置2.1 sw1 配置sw1(config)#interface range fastEthernet 0/1 -2 sw1(config-if-range)# 同时对交换机快速以太网1、2口进行配置sw1(config-if-range)#switchport mode access 要求接口模式为接入sw1(config-if-range)#switchport port-security 开启交换机接口端口安全服务配置交换端口安全服务接口绑定的mac地址获取方法: 1)可以手工输入,注意输入格式为3个16位点隔开 2) 也可让交换机将通过该接口数据的源mac地址自动粘连绑定sw1(config-if-range)#switchport port-security mac-address ? H.H.H 48 bit mac address sticky Configure dynamic secure addresses as stickysw1(config-if-range)#switchport port-security mac-address sticky 配置接口最多绑定地址数量,不同交换机最大数量不同sw1(config-if-range)#switchport port-security maximum ? Maximum addressessw1(config-if-range)#switchport port-security maximum 1注:当以上条件配置完成后,如果有未被绑定的源mac地址出现在该接口时,交换机将会逻辑关闭该接口。若选择地址获取为粘连时应该让接口下的pc进行一次通信,使交换机记录该mac地址。.在running-config中可看到被粘连的地址interface FastEthernet0/1 switchport mode access switchport port-security switchport port-security mac-address sticky switchport port-security mac-address sticky 0006.2AE1.C389.错误源mac出现后接口被逻辑关闭sw1#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/1 unassigned YES manual down down注:接口被逻辑关闭后将不能进行数据转发,即便让被绑定的源mac地址再次回到该接口下,该接口还是保持逻辑关闭状态,可以进入接口先shutdown再no shutdown该接口或者:sw2(config)#errdisable recovery cause psecure-violation触犯规则后的恢复sw2(config)#errdisable recovery interval 60触犯规则后60秒再重新启动2.2 sw2配置sw2(config)#interface range fastEthernet 0/1 -2sw2(config-if-range)#switchport mode access sw2(config-if-range)#switchport port-security sw2(config-if-range)#switchport port-security mac-address sticky sw2(config-if-range)#switchport port-security maximum 1sw2(config-if)#storm-control broadcast level 50 广播风暴压制级别为50%sw2(config-if)#switchport port-security violation protect 定义接口出现错误源mac时,及违约时的处理手段为保护-错误源mac数据不被转发 实验三 DHCP server配置实验要求:pc1、pc2、pc3、R3F0/0口均通过DHCP 的方式获取IP地址实验目的:了解DHCP 原理,以及配置路由器为DHCP Server3.1 R3 配置在配置dhcp server前,应该先配置接口地址同时开启接口;dhcp server前提条件:需要可以同client(客户端)通信,故必须存在拥有合法ip地址的接口,并且dhcp server或dhcp 中继的接口必须拥有下放广播域内的合法ip地址R3(config)#interface fastEthernet 0/1R3(config-if)#ip address 192.168.1.1 255.255.255.0R3(config-if)#no shutdown R3(config-if)#exitR3(config)#interface fastEthernet 0/2R3(config-if)#ip address 192.168.2.1 255.255.255.0R3(config-if)#no shutdown R3(config-if)#exitR3(config)#interface fastEthernet 0/3R3(config-if)#ip address 192.168.3.1 255.255.255.0R3(config-if)#no shutdown R3(config)#service dhcp 开启dhcp服务创建dhcp池塘ccna1,一台路由器上可以存在多个dhcp池塘,但一个池塘只能对应一个广播域(一个网段)进行下放R3(config)#ip dhcp pool ccna1 定义地址池所对应的网段地址,该命令也用于路由器区分池塘所对应接口同时表示池塘下放地址范围R3(dhcp-config)#network 192.168.1.0 255.255.255.0该网段的网关地址 R3(dhcp-config)#default-router 192.168.1.1 Dns server地址,前为首选后为备用R3(dhcp-config)#dns-server 8.8.8.8 8.8.4.4地址租约时间为0天1小时R3(dhcp-config)#lease 0 1R3(dhcp-config)#exitR3(config)#ip dhcp pool ccna2 池塘ccna2R3(dhcp-config)#network 192.168.2.0 255.255.255.0R3(dhcp-config)#default-router 192.168.2.1 R3(dhcp-config)#dns-server 8.8.8.8 8.8.4.4R3(dhcp-config)#lease 0 1R3(dhcp-config)#exitR3(config)#ip dhcp pool ccna3 池塘ccna3R3(dhcp-config)#network 192.168.3.0 255.255.255.0R3(dhcp-config)#default-router 192.168.3.1 R3(dhcp-config)#dns-server 8.8.8.8 8.8.4.4R3(dhcp-config)#lease 0 1R3(dhcp-config)#exit有时个别终端需要静态配置IP地址,故需将地址从池塘中排除可以排除单个地址,也可排除一段地址R3(config)#ip dhcp excluded-address 192.168.1.2 R3(config)#ip dhcp excluded-address 192.168.2.2 192.168.2.100R3(config)#exitR3#write 保存Building configuration.OKR3#3.2 client 获取地址Pc1 获取地址 192.168.1.3 255.255.255.0 默认网关192.168.1.1 Dns server 首选 8.8.8.8 备用8.8.4.4Pc1 获取地址 192.168.1.4 255.255.255.0 默认网关192.168.1.1 Dns server 首选 8.8.8.8 备用8.8.4.4Pc3 获取地址 192.168.2.101 255.255.255.0 默认网关192.168.2.1 Dns server 首选 8.8.8.8 备用8.8.4.4R3获取地址R3(config)#interface fastEthernet 0/0R3(config-if)#ip address dhcp R3(config-if)#no shutdown R3#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.3.2 YES DHCP up up同时如果该路由器没有通过其他方式获取管理距离低于254的缺省路由那么在其路由表中会出现管理距离为254的缺省路由,出现的原因是由dhcp server中R3(dhcp-config)#default-router 192.168.3.1 导致 实验四 静态路由实验要求:使用静态配置该网络,压缩路由表条目,全网可达实验目的:了解静态路由配置,实现手工汇总4.1配置 .R3 配置R3(config)#interface fastEthernet 0/0R3(config-if)#ip address 12.1.1.1 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exitR3(config)#interface loopback 0R3(config-if)#ip address 1.1.1.1 255.255.255.0R3(config-if)#exit对于R3在网络的未知网段有 2.2.1.0/24和2.2.2.0/24由于R3到达这两个网段出接口和下一条均相同,并且两个网络号可以进行汇总,故为节省R3的路由表条目可以使用:R3(config)#ip route 2.2.0.0 255.255.252.0 fastEthernet 0/0 12.1.1.2.R3配置R3(config)#interface fastEthernet 0/0R3(config-if)#ip address 12.1.1.2 255.255.255.0R3(config-if)#no shutdown R3(config-if)#exitR3(config)#interface loopback 0R3(config-if)#ip address 2.2.1.1 255.255.255.0R3(config-if)#exitR3(config)#interface loopback 1R3(config-if)#ip address 2.2.2.1 255.255.255.0R3(config-if)#exit对于R3而言网络中的未知网段为1.1.1.0/24R3(config)#ip route 1.1.1.0 255.255.255.0 fastEthernet 0/0 12.1.1.14.2查看路由表.R3路由表R3#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static routeGateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback0 2.0.0.0/22 is subnetted, 1 subnetsS 2.2.0.0 is directly connected, FastEthernet0/0 1/0 via 12.1.1.2 12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, FastEthernet0/0.R3路由表R3#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static routeGateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnetsS 1.1.1.0 is directly connected, FastEthernet0/0 1/0 via 12.1.1.1 2.0.0.0/24 is subnetted, 2 subnetsC 2.2.1.0 is directly connected, Loopback0C 2.2.2.0 is directly connected, Loopback1 12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, FastEthernet0/04.3 测试.R3R3# ping 2.2.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 2.2.1.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 3/8/12 msR3#ping 2.2.2.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 2.2.2.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/9/24 ms.R3R3#ping 1.1.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/7/28 ms 实验五 浮动静态及缺省路由实验要求:1、 R3的环回被模拟成连接ISP的公有网段链路,故在R3上不能使用配置到达1.1.1.0/24网段的静态路由2、 压缩路由表条目3、 我们希望在网络正常的情况下R3和R3使用以太网线路通信 ,当以太网不能进行通信时改为使用串行链路通信 实验目的: 了解静态缺省路由的配置,利用路由器加表时关注的管理距离来实现路径备份,同时关注当缺省与路由黑洞时相遇时的环路问题5.1 配置.R3配置R3(config)#interface fastEthernet 0/0R3(config-if)#ip address 13.1.1.1 255.255.255.0R3(config-if)#no shutdownR3(config-if)#exitR3(config)#interface loopback 0R3(config-if)#ip address 1.1.1.1 255.255.255.0R3(config-if)#exitR3(config)#interface serial 1/1R3(config-if)#ip address 12.1.1.1 255.255.255.0R3(config-if)#clock rate 64000 串行链路的DCE端需配置时钟频率R3(config-if)#no shutdown 由于R3到达这两个网段出接口和下一条均相同,并且两个网络号可以进行汇总,故为节省R3的路由表条目可以使用:R3(config)#ip route 2.2.0.0 255.255.252.0 fastEthernet 0/0 13.1.1.2修改通过默认管理距离起到路由路径备份R3(config)#ip route 2.2.0.0 255.255.252.0 Serial 1/0 12.1.1.2 2 在实际网络中,边界路由需要将所有未知目标网段的数据转发给ISP,故需要一条缺省路由条目指向ISP,这儿以环回代表了连接ISP的接口 R3(config)#ip route 0.0.0.0.0 0.0.0.0 loopback 0.R3配置R3(config)#interface serial 1/0R3(config-if)#ip address 12.1.1.2 255.255.255.0R3(config-if)#no shutdown R3(config-if)#exitR3(config)#interface fastEthernet 0/0R3(config-if)#ip address 13.1.1.2 255.255.255.0R3(config-if)#no shutdown R3(config-if)#exitR3(config)#interface loopback 0R3(config-if)#ip address 2.2.1.1 255.255.255.0R3(config-if)#exitR3(config)#interface loopback 1R3(config-if)#ip address 2.2.2.1 255.255.255.0R3(config-if)#exitR3需要将所有未知目标网段的数据转发给R3R3(config)#ip route 0.0.0.0 0.0.0.0 fastEthernet 0/0 13.1.1.1修改通过默认管理距离起到路由路径备份R3(config)#ip route 0.0.0.0 0.0.0.0 serial 1/0 12.1.1.1 2由于R3指向R3环的汇总地址为2.2.0.0 255.255.252.0 ,其中R3只拥有两个网段不存在2.2.0.0/24和2.2.3.0/24,故出现路由黑洞,同时R3的缺省指向R3,导致路由环路,因此需要在R3上将2.2.0.0/22指向空接口打破环路R3(config)#ip route 2.2.0.0 255.255.252.0 null 05.2 查看路由表.R3路由表R3#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static routeGateway of last resort is 0.0.0.0 to network 0.0.0.0 1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback0 2.0.0.0/22 is subnetted, 1 subnetsS 2.2.0.0 1/0 via 13.1.1.2 12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0 13.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, FastEthernet0/0S* 0.0.0.0/0 is directly connected, Loopback0.R3路由表R3#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static routeGateway of last resort is 13.1.1.1 to network 0.0.0.0 2.0.0.0/8 is variably subnetted, 3 subnets, 2 masksS 2.2.0.0/22 is directly connected, Null0C 2.2.1.0/24 is directly connected, Loopback0C 2.2.2.0/24 is directly connected, Loopback1 12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0 13.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, FastEthernet0/0S* 0.0.0.0/0 is directly connected, FastEthernet0/0 1/0 via 13.1.1.1.当R3与R3相连的以太网部分出现故障时路由表变更为.R3路由表R3#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static routeGateway of last resort is 0.0.0.0 to network 0.0.0.0 1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback0 2.0.0.0/22 is subnetted, 1 subnetsS 2.2.0.0 2/0 via 13.1.1.2 12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0S* 0.0.0.0/0 is directly connected, Loopback0.R3路由表R3#show ip rouR3#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static routeGateway of last resort is 12.1.1.1 to network 0.0.0.0 2.0.0.0/8 is variably subnetted, 3 subnets, 2 masksS 2.2.0.0/22 is directly connected, Null0C 2.2.1.0/24 is directly connected, Loopback0C 2.2.2.0/24 is directly connected, Loopback1 12.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0S* 0.0.0.0/0 2/0 via 12.1.1.1 is directly connected, Serial1/05.3测试.R3R3# ping 2.2.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 2.2.1.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 3/8/12 msR3#ping 2.2.2.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 2.2.2.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/9/24 ms.R3R3#ping 1.1.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 1/7/28 ms 实验六 静态路由综合实验实验要求:使用静态路由协议配置;R0环回模拟连接ISP;压缩路由表条目;R1与R2间链路,正常情况下使用以太网,当以太网出现问题时使用串行;全网可达.实验目的:充分了解静态、缺省、汇总、浮动静态、负载均衡、路由黑洞与缺省产生的环路问题6.1 配置.R0 配置R0(config)#interface loopback 0R0(config-if)#ip address 1.1.1.1 255.255.255.0R0(config-if)#exitR0(config)#interface serial 1/0R0(config-if)#ip address 10.1.1.1 255.255.255.0R0(config-if)#clock rate 64000R0(config-if)#no shutdown R0(config-if)#exitR0(config)#interface fastEthernet 0/0R0(config-if)#ip address 11.1.1.1 255.255.255.0R0(config-if)#no shutdown R0(config-if)#exitR0(config)#ip route 12.1.1.0 255.255.255.0 fastEthernet 0/0 11.1.1.2R0(config)#ip route 12.1.1.0 255.255.255.0 serial0/0 10.1.1.2 2R0(config)#ip route 13.1.1.0 255.255.255.0 fastEthernet 0/0 11.1.1.2R0(config)#ip route 13.1.1.0 255.255.255.0 serial0/0 10.1.1.2 2R0(config)#ip route 34.1.1.0 255.255.255.0 fas

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论