收藏 分销(赏)

na实验手册.doc

上传人:xrp****65 文档编号:7037082 上传时间:2024-12-25 格式:DOC 页数:87 大小:1.06MB
下载 相关 举报
na实验手册.doc_第1页
第1页 / 共87页
na实验手册.doc_第2页
第2页 / 共87页
点击查看更多>>
资源描述
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口登陆 配置CRT 1)开启CRT选择在标签中连接 2)在弹出窗口选择新建会话 3)在弹出窗口中选择serial 4) 在弹出窗口中选择正确的com接口编号,配置比特波为默认的9600 5)会话名称用于用户标记该会话 6)使用创建的会话连接 1.3设备基础配置 在初登设备时,由于设备没有可加载的startup-config或者寄存器值为不加载startup-config,设备会询问管理员是否进入初始化配置模式; 初始化配置模式类似于问答模式,由设备提出问题管理员进行选择回答来对设备进行部分配置;但这种方法我们极少使用,因为直接手动配置来的更方便和直接,故选择NO .开启进行基础配置: Router> 用户模式 Router>enable 键入授权 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)#exit Router(config)#no ip domain-lookup 关闭域名解析 Router(config)#hostname R3 修改默认主机名为R3 R3(config)# .基础配置--加密部分 配置用户模式进入特权模式的密码 R3(config)#enable ? password Assign the privileged level password secret Assign the privileged level secret R3(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 0 R3(config-line)#password cisco R3(config-line)#login 注:此时由于使用password命令,所以在running-config中和enable密码一样;一定要配置login,可以理解为确认使用该密码来登录 推荐做法: R3(config)#username ccna privilege 15 secret cisco 定义用户名为ccna权限15级(超级管理员)密码为running-config中密文的cisco R3(config)#line console 0 R3(config-line)#login local 要求console口使用本地用户数据来验证登录 当输入login local后先前配置的login被覆盖 .保存配置 R3#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] R3# 或者使用写入 R3#write Building configuration... [OK] R3# 实验二 交换机简单端口安全配置 实验要求: 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 sticky sw1(config-if-range)#switchport port-security mac-address sticky 配置接口最多绑定地址数量,不同交换机最大数量不同 sw1(config-if-range)#switchport port-security maximum ? <1-132> Maximum addresses sw1(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 -2 sw2(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 1 sw2(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 Server 3.1 R3 配置 在配置dhcp server前,应该先配置接口地址同时开启接口; dhcp server前提条件:需要可以同client(客户端)通信,故必须存在拥有合法ip地址的接口,并且dhcp server或dhcp 中继的接口必须拥有下放广播域内的合法ip地址 R3(config)#interface fastEthernet 0/1 R3(config-if)#ip address 192.168.1.1 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#interface fastEthernet 0/2 R3(config-if)#ip address 192.168.2.1 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#interface fastEthernet 0/3 R3(config-if)#ip address 192.168.3.1 255.255.255.0 R3(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 1 R3(dhcp-config)#exit R3(config)#ip dhcp pool ccna2 池塘ccna2 R3(dhcp-config)#network 192.168.2.0 255.255.255.0 R3(dhcp-config)#default-router 192.168.2.1 R3(dhcp-config)#dns-server 8.8.8.8 8.8.4.4 R3(dhcp-config)#lease 0 1 R3(dhcp-config)#exit R3(config)#ip dhcp pool ccna3 池塘ccna3 R3(dhcp-config)#network 192.168.3.0 255.255.255.0 R3(dhcp-config)#default-router 192.168.3.1 R3(dhcp-config)#dns-server 8.8.8.8 8.8.4.4 R3(dhcp-config)#lease 0 1 R3(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.100 R3(config)#exit R3#write 保存 Building configuration... [OK] R3# 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.4 Pc1 获取地址 192.168.1.4 255.255.255.0 默认网关192.168.1.1 Dns server 首选 8.8.8.8 备用8.8.4.4 Pc3 获取地址 192.168.2.101 255.255.255.0 默认网关192.168.2.1 Dns server 首选 8.8.8.8 备用8.8.4.4 R3获取地址 R3(config)#interface fastEthernet 0/0 R3(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/0 R3(config-if)#ip address 12.1.1.1 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#interface loopback 0 R3(config-if)#ip address 1.1.1.1 255.255.255.0 R3(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/0 R3(config-if)#ip address 12.1.1.2 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#interface loopback 0 R3(config-if)#ip address 2.2.1.1 255.255.255.0 R3(config-if)#exit R3(config)#interface loopback 1 R3(config-if)#ip address 2.2.2.1 255.255.255.0 R3(config-if)#exit 对于R3而言网络中的未知网段为1.1.1.0/24 R3(config)#ip route 1.1.1.0 255.255.255.0 fastEthernet 0/0 12.1.1.1 4.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 route Gateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 2.0.0.0/22 is subnetted, 1 subnets S 2.2.0.0 is directly connected, FastEthernet0/0 [1/0] via 12.1.1.2 12.0.0.0/24 is subnetted, 1 subnets C 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 route Gateway of last resort is not set 1.0.0.0/24 is subnetted, 1 subnets S 1.1.1.0 is directly connected, FastEthernet0/0 [1/0] via 12.1.1.1 2.0.0.0/24 is subnetted, 2 subnets C 2.2.1.0 is directly connected, Loopback0 C 2.2.2.0 is directly connected, Loopback1 12.0.0.0/24 is subnetted, 1 subnets C 12.1.1.0 is directly connected, FastEthernet0/0 4.3 测试 .R3 R3# ping 2.2.1.1 Type 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 ms R3#ping 2.2.2.1 Type 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 .R3 R3#ping 1.1.1.1 Type 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/0 R3(config-if)#ip address 13.1.1.1 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#interface loopback 0 R3(config-if)#ip address 1.1.1.1 255.255.255.0 R3(config-if)#exit R3(config)#interface serial 1/1 R3(config-if)#ip address 12.1.1.1 255.255.255.0 R3(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/0 R3(config-if)#ip address 12.1.1.2 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#interface fastEthernet 0/0 R3(config-if)#ip address 13.1.1.2 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#interface loopback 0 R3(config-if)#ip address 2.2.1.1 255.255.255.0 R3(config-if)#exit R3(config)#interface loopback 1 R3(config-if)#ip address 2.2.2.1 255.255.255.0 R3(config-if)#exit R3需要将所有未知目标网段的数据转发给R3 R3(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 0 5.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 route Gateway of last resort is 0.0.0.0 to network 0.0.0.0 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 2.0.0.0/22 is subnetted, 1 subnets S 2.2.0.0 [1/0] via 13.1.1.2 12.0.0.0/24 is subnetted, 1 subnets C 12.1.1.0 is directly connected, Serial1/0 13.0.0.0/24 is subnetted, 1 subnets C 13.1.1.0 is directly connected, FastEthernet0/0 S* 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 route Gateway 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 masks S 2.2.0.0/22 is directly connected, Null0 C 2.2.1.0/24 is directly connected, Loopback0 C 2.2.2.0/24 is directly connected, Loopback1 12.0.0.0/24 is subnetted, 1 subnets C 12.1.1.0 is directly connected, Serial1/0 13.0.0.0/24 is subnetted, 1 subnets C 13.1.1.0 is directly connected, FastEthernet0/0 S* 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
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传
相似文档                                   自信AI助手自信AI助手

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服