




已阅读5页,还剩23页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
华为模拟器3.0&3.31实验注释主编:孙通无锡立信职教中心校2008年11月19日实验一 口令和主机名设置1.交换机的初始化 当交换机没有进行配置时,接入超级终端会提示是否以对话方式进行配置,初始化内容主要有IP地址、网关、主机名和口令等。配置文件是flash:config.text。 2924交换机进入ROM方式是在上电时按住其mode键,本软件是按Ctrl+Break键,出现:switch ;按Ctrl+Break键switch:reset ;或用boot命令 如果有配置文件进入用户模式,否则提交对话: - System Configuration Dialog -At any point you may enter a question mark ? for help.Use ctrl-c to abort configuration dialog at any prompt.Default settings are in square brackets .Continue with configuration dialog? yes/no:yEnter IP address:Enter IP netmask:Would you like to enter a default gateway address? yes:IP address of default gateway:Enter host name Switch:swaThe enable secret is a one-way cryptographic secret used instead of the enable password when it exists.Enter enable secret:aaaWould you like to configure a Telnet password? yes:Enter Telnet password:aWould you like to enable as a cluster command switch? no:The following configuration command script was created:.Press RETURN to get started.swaenpassword:aaaswa#copy run start (保存配置信息)swa#dir flash: (查看闪存中的文件)再次进入对话方式:swa#setup2.路由器的初始化(路由器初始化与交换机类似)router ;用户模式,按Ctrl+Breakrommonreset ;进入ROM监控状态,复位引导Continue with configuration dialog? yes/no:yesAt any point you may enter a question mark ? for help.Use ctrl-c to abort configuration dialog at any prompt.Default settings are in square brackets .Would you like to enter basic management setup? yes/no:yesConfiguring global parameters: Enter host name router:ra回车 The enable secret is a password used to protect access to privileged EXEC and configuration modes. This password, after entered, becomes encrypted in the configuration. Enter enable secret:aaa回车 The enable password is used when you do not specify an enable secret password,with some older software versions, and some boot images. Enter enable password:aa回车 The virtual terminal password is used to protect access to the router over a network interface. Enter virtual terminal password :a回车 Enter interface name used to connect to the management network from the above interface summary:FastEthernet0/0回车 Configuring interface FastEthernet0/0:回车 Use the 100 Base-TX (RJ-45) connector? yes:回车 Operate in full-duplex mode? no:回车 Configure IP on this interface? yes:回车 IP address for this interface :回车 Subnet mask for this interface :回车0 Go to the IOS command prompt without saving this config.1 Return back to the setup without saving this config.2 Save this configuration to nvram and exit.Enter your selection 2:回车raenpassword aaa (进入特权模式)ra#show run (显示配置信息)ra#w (保存配置信息)ra#dir flash: (显示配置文件) (配置文件在2621路由器不能删除,放弁配置文件要用寄存器设置0x2142);3. 用命令行设置交换机和路由器的口令和主机名 先对交换机进行操作,双击SwitchA,出现:switchen ;第一次密码为空switch#conf t ;进入全局配置模式switch(config)#hostname swa ;设置交换机名swa(config)#enable secret aaa ;设置特权加密口令为 aaaswa(config)#enable password aax ;设置特权非密口令为 aaxswa(config)#line console 0 ;进入控制台口(Rs232)swa(config-line)#password aa ;设置console登录口令为aaswa(config-line)#login ;登录要求口令验证swa(config-line)#line vty 0 4 ;进入虚拟终端virtual ttyswa(config-line)#password a ;设置vty的登录口令为aswa(config-line)#login ;登录要求口令验证swa(config-line)#exit ;返回上一层swa(config)#exit ;返回上一层swa#sh run ;看配置信息swa#exit ;返回命令swaenpassword: ;请问输入哪个口 (aaa) secret是设置加密口令,一般都使用这种口令设置方式,它优先级高,即没设置secret口令时,非加密口令才有效。4. 备份IOS和配置文件 在实际工作中经常需要备份路由器的IOS和配置文件,以备系统有问题时的恢复。可以这样操作:router#dir nvram:router#copy flash:c2621.bin tftp:router#copy startup-config tftp:router#实验二 计算机与交换机IP地址设置1. 双击HostA, 输入用户名和口令。PCA login:rootPassword:linuxroot#PCA root# ifconfig eth0 netmask 设置 IP root#PCA root# ifconfig 查看 IProot#PCA root# ifconfig eth0 netmask down关闭网卡root#PCA root# route add default gw 设置网关root#PCA root# route 查看网关 root#PCA root# route del default gw 删除网关2. 双击HostB, 输入用户名和入口令,键入?可以求得帮助。PCB login:rootPassword:linux root#PCB root# ifconfig eth0 netmask 设置 IProot#PCB root# ifconfig root#PCB root# route add default gw 设置网关root#PCB root# route 这里只是说明设置网关的方法,关于它的意义在后面实现才能体现。rootPCA root# ping (通) rootPCB root# ping (通)rootPCA root# ping (通) rootPCB root# ping (通) 可见交换机不用做任何设置,就可以让两个计算机连通。交换机默认状态是所有端口全在vlan1,可以替代HUB使用,交换机的端口独享带宽。3.双击SwitchAswitchen 进入特权模式switch#conf t 进入全局配置模式:switch(config)#int vlan 1 进入默认vlan状态:switch(config-if)#ip address 设置ip地址和掩码:switch(config)#ip default-gateway 设置switch的网关:switch#sh run 查看当前配置: 测试联通情况:switch#ping (通) ;ping HostAswitch#ping (通) ;ping HostBswitch#ping (通) ;ping自己switch#ping (不通) ;没有这个IP,所以不通。 设置交换机的IP地址,一般是做远程序管理用,即用telnet 远程登录到交换机。至于交换机的网关,则是为了提供从交换机连接到其它设备的路由。4.双击PCArootPCA root# ping (通) ;从电脑ping 交换机 rootPCA root# telnet ;从电脑登录到交换机enter password:* ;输入虚拟终端密码switch ;登录成功实验三 配置端口聚合要求聚合的端口工作在全双工,速度一致,在同一槽口且连续。对于SwitchA:SwitchAinterface ethernet0/1SwitchA-Ethernet0/1duplex fullSwitchA-Ethernet0/1speed 100SwitchA-Ethernet0/1port link-type trunkSwitchA-Ethernet0/1port trunk permit vlan allSwitchA-Ethernet0/1int e0/2SwitchA-Ethernet0/2duplex fullSwitchA-Ethernet0/2speed 100SwitchA-Ethernet0/2port link-type trunkSwitchA-Ethernet0/2port trunk permit vlan all对于SwitchB:SwitchBinterface ethernet0/1SwitchB-Ethernet0/1duplex fullSwitchB-Ethernet0/1speed 100SwitchB-Ethernet0/1port link-type trunkSwitchB-Ethernet0/1port trunk permit vlan allSwitchB-Ethernet0/1int e0/2SwitchB-Ethernet0/2duplex fullSwitchB-Ethernet0/2speed 100SwitchB-Ethernet0/2port link-type trunkSwitchB-Ethernet0/2port trunk permit vlan all聚合操作:SwitchAlink-aggregation ethernet0/1 to ethernet0/2 bothSwitchBlink-aggregation ethernet0/1 to ethernet0/2 bothSwitchAdisplay link-aggregation ethernet0/1SwitchAundo link-aggregation all实验四 配置primary VLAN和secondary VLAN 主vlan一般用于一个网络段的情况,主vlan和子vlan间可以访问,而子vlan之间是不能访问的。SwitchAvlan 2SwitchA-vlan2port ethernet 0/5 to ethernet 0/6SwitchAvlan 3SwitchA-vlan3port ethernet 0/7 to ethernet 0/8SwitchAvlan 5SwitchA-vlan5port ethernet 0/1 to ethernet 0/4SwitchA-vlan5isolate-user-vlan enable ;vlan5是主vlanSwitchA-vlan5quitSwitchAisolate-user-vlan 5 secondary 2,3 ;vlan2,3是子vlanSwitchBvlan 2SwitchB-vlan2port ethernet 0/5 to ethernet 0/6SwitchBvlan 3SwitchB-vlan3port ethernet 0/7 to ethernet 0/8SwitchAvlan 4SwitchB-vlan4port ethernet 0/1 to ethernet 0/4SwitchB-vlan4isolate-user-vlan enable ;vlan4是主vlanSwitchB-vlan4quitSwitchBisolate-user-vlan 4 secondary 2,3 ;vlan2,3是子vlan实验五 交换机的镜像与生成树(一) 设置镜像镜像是一个端口的数据被映射到另一个端口,进行数据分析。Quidwaymonitor-port e0/8Quidwayport mirror e0/1或:Quidwayport mirror e0/1 to e0/2 observing-port e0/8(二) 生成树Quidwaystp enable|disableQuidwaystp priority 4096 设置交换机的优先级Quidwaystp root primary 设置交换机为树根Quidway-Ethernet0/1stp cost 200 设置交换机端口的花费实验六 交换机VLAN实验1. 规划ip地址 PCA的ip 地址: PCB的ip 地址: PCC的ip 地址: PCD的ip 地址: SWA的ip 地址: SWB的ip 地址: SWA的f0/5f0/7 vlan 2 ,f0/8为trunk SWB的f0/5f0/7 valn 2 ,f0/1为trunk 用ping命令测试,从PCA和PCB到各点的连通情况。2.设置VLAN 双击SwitchA,改名SwitchA为SWA,建立2 个vlan,分别为vlan 2、vlan 3switchenswitch#sh vlanswitch#conf tswitch(config)#hosthame SWAswitch(config)#exitSWA#vlan databaseSWA(vlan)#vlan 2SWA(vlan)#vlan 3SWA(vlan)#exitSWA#conf tSWA#sh vlan将SWA交换机的f0/5,f0/6,f0/7 加入到vlan 2SWA#conf tSWA(config)#int f0/5SWA(config-if)#switchport access vlan 2SWA(config-if)#int f0/6SWA(config-if)#switchport access vlan 2SWA(config-if)#int f0/7SWA(config-if)#switchport access vlan 2SWA(config-if)# endSWA#sh vlan在SWB上与SWA上类似,将SWB的f0/5,f0/6,f0/7 加入到vlan 2。3.测试可通性从PCA到PCC测试:rootPCA root# ping (通)从PCA到PCB测试:rootPCA root# ping (不通,不同网段,不同VLAN)从PCB到PCD测试:rootPCB root# ping (不通,不在一个广播域,要求设置干线trunk)从PCA到SWA测试:rootPCA root# ping (通,同一网段,同在vlan 1)从PCA到SWB测试:rootPCA root# ping (通,同一网段,同在vlan 1)从SWA到PCA测试:SWA#ping (通)从SWA到PCB测试:SWA#ping (不通,不同网段,不同VLAN)从SWA到SWB测试:SWA#ping (通)4. 设置干线trunk将连接两个交换机的端口设置成trunk。SWA#conf tSWA(config)#int f0/8SWA(config-if)#switchport mode trunkSWA(config-if)#switchport trunk allowed vlan 1,2,3SWA(config-if)#switchport trunk encap dot1qSWA(config-if)#endSWA#show runSWB#conf tSWB(config)#int f0/1SWB(config-if)#switchport mode trunkSWB(config-if)#switchport trunk allowed vlan 1,2,3SWB(config-if)#switchport trunk encap dot1qSWB(config-if)#end 交换机创建trunk时,默认allowed all,所以trunk allowed命令可以不用。 dot1q是vlan中继协议(802.1q),由于正确设置了trunk,两个交换机间可以多个vlan通过,所以这时PCA和PCC通,PCB和PCD也可以通。这与没设置vlan时的连通情况一样,但这时由于vlan的存在,隔离了广播域,提高了通讯能力。rootPCA root# ping (通,PCA与PCC同在vlan 1)rootPCB root# ping (通,PCB与PCD同在vlan 2)rootPCA root# ping (不通,PCA与PCB要求路由) 5. 设置vtpVTP(Vlan Trunk Protocol)是vlan 干线传输协议,在VTP Server上配置的vlan 在条件允许条件下,可以从VTP Client端通看到VTP Server上的vlan,并将指定的端口加入到vlan中。SWA#vlan databaseSWA(vlan)#vtp serverSWA(vlan)#vtp domain abcSWA(vlan)#vtp password okSWB(vlan)#vtp clientSWB(vlan)#vtp domain abcSWB(vlan)#vtp password okSWA#sh vlanSWB#sh vlan 当口令和域名一致时,client端可以学习到server端的vlan,当然在VTP Server端还可以有很多策略,这里只是说明最基本的应用。 VTP在多vlan情况下应用是很有意义的,在主交换机上设置好vlan以后,在下级的交换机不用再设置vlan,可以将 VTP client的某些端口添加到VTP Server中设置的vlan中去,加强了vlan的集中管理。实验七 路由器接口ip及直联路由 本实验配置路由器的IP地址,测试路由器的直联路由和计算机网关的作用。实验中有两个计算机,一个路由器。1. 设置计算机ip地址 设置PCA 的IP地址为: 网关: 设置PCB 的IP地址为: 网关: 设置ROA f0/0 IP 为: 设置ROA f0/1 IP 为: 设置计算机PCA的ip地址和网关的操作:rootPCA root# ifconfig eth0 netmask rootPCA root# ifconfigrootPCA root# route add default gw rootPCA root# route 设置计算机PCB的ip地址和网关的操作:rootPCB root# ifconfig eth0 netmask rootPCB root# ifconfigrootPCA root# route add default gw rootPCA root# route2. 双击Router A,配置路由器的接口IP地址:routerenrouter#conf trouter(config)#hostname roaroa(config)int f0/0roa(config-if)#ip address roa(config-if)#no shutdown (默认是shutdown)roa(config-if)#exitroa(config)int f0/1roa(config-if)#ip address roa(config-if)#no shutroa(config)int s0/0roa(config-if)#ip address roa(config-if)#no shutroa(config-if)#clock rate 64000roa(config)int s0/1roa(config-if)#ip address roa(config-if)#no shutroa(config-if)#exitroa(config)#ip routing (默认是关闭的)3检查网络联通情况rootPCA root# ping (通) (ping自己的网关)rootPCA root# ping (通) (ping f0/1)rootPCA root# ping (通) (ping PCB)rootPCA root# ping (不通) (端口空时down)rootPCA root# ping (不通) (端口空时down)rootPCB root# ping (通) (ping自己的网关)rootPCB root# ping (通) (ping f0/0)rootPCB root# ping (通) (ping PCA)rootPCB root# ping (不通) (端口s0/0空时down)rootPCB root# ping (不通) (端口s0/1空时down)roa#ping (通) (ping PCA)roa#ping (通) (ping f0/0)roa#ping (通) (ping PCB)roa#ping (通) (ping f0/1)roa#ping (不通) (端口s0/0空时down)roa#ping (不通) (端口s0/1空时down)实验八 一个vlan下的单臂路由 在一个vlan下,可以通过设置计算机的secondary ip实现在一个物理网络上两个具有不同网段IP计算机的联通。 1.设置计算机PCA的ip地址root#PCA root# ifconfig eth0 netmask root#PCB root# ifconfig eth0 netmask root#PCA root# ping (不通)(PCA ping PCB)root#PCB root# ping (不通)(PCB ping PCA) PCA与PCB是不通的,因为它们在不同的网络段。 2. 设置路由器接口f0/0有两个ip地址。roa(config)#int f0/0roa(config-if)#ip address roa(config-if)#ip address secondaryroa(config-if)#no shutroa(config-if)#exitroa(config)#ip routing 3. 测试可通性root#PCA root# ping (通)root#PCA root# ping (通)root#PCA root# ping (不通)root#PCA root# ping (不通) 为什么PCA和PCB还是不通呢?哦,还没有设置计算机的网关。root#PCA root# route add default gw root#PCB root# route add default gw 4) 去掉交换机与路由器的联接线root#PCA root# ping (不通了)root#PCB root# ping (不通了)由此可以看出,PCA与PCB之间的发送的数据包是经过路由器的,从路由器f0/0入,再从f0/0出,所以称之为单臂路由。这种情况PCA和PCB在链路层是同一个广播域,对网络带宽不利。如果划分VLAN可以隔离广播域。通过子接口可以实现对不同VLAN的路由。 5) 在交换机上的情况switchenswitch#conf tswitch(config)#int vlan 1switch(config-if)#ip address switch(config-if)#exitswitch(config)#ip default-gateway switch#ping (通)switch#ping (通) 断开交换机与路由器的联线,再执行从交换机ping 命令:switch#ping (通) switch#ping (不通) 这说明不同网络段IP的联通是要通过路由器的。实验九 子接口单臂路由本实验接上一个实验,计算机和交换机的IP地址和网关不变,但要求交换机工作在两个VLAN的情况下,一个是原有的默认vlan 1,另一个是新设置的vlan 2,含f0/6、f0/7。当交换机设置成两个vlan时,逻辑上已经成为两个网络,广播被隔离了。两个vlan 的网络要通信,必须通过路由器, 如果接入路由器的一个物理端口,则必须有两个子接口分别与两个vlan对应,同时还要求与路由器相联的交换机的端口f0/1要设置为trunk,因为这个口要通过两个vlan的数据包。 对于secondary ip的情况,实质上是一个接口,不能实现对两个vlan的路由。 1. 设置交换机的vlan 和trunkswitch#vlan databaseswitch(vlan)#vlan 2switch(vlan)#vlan 3switch(vlan)#exitswitch#show vlanswitch#conf tswitch(config)#int f0/6switch(config-if)#switchport access vlan 2switch(config-if)#int f0/7switch(config-if)#switchport access vlan 2switch(config-if)#int f0/1switch(config-if)#switchport mode trunkswitch(config-if)#switchport trunk allowed vlan allswitch(config-if)#switchport trunk encap dot1qswitch(config-if)#endswitch#sh vlanswitch#sh runswitch(config)#hostname SWASWA(config)#计算机的ip地址分别为、,网关分别指向路由器的子接口、。root#PCA root# ping (不通) 因为现在路由器还没有设置子接口,所以PCA与PCB不通。 2. 设置路由器f0/0 为两个子接口roa(config)#int f0/0roa(config-if)#no shutroa(config-if)#int f0/0.1roa(config-subif)#encapsulation dot1q 1roa(config-subif)#ip address roa(config-subif)#int f0/0.2roa(config-subif)#encapsulation dot1q 2roa(config-subif)#ip address roa(config-subif)#exitroa(config)#ip routingroa#sh run实验十 静态路由 1.设置计算机和路由器的IP地址 设置PCA、PCB的IP地址分别为:和。root#PCA root# ifconfig eth0 netmask root#PCB root# ifconfig eth0 netmask root#PCC root# ifconfig eth0 netmask root#PCA root# route add default gw root#PCB root# route add default gw root#PCC root# route add default gw 设置RouterA的IP地址: (子网掩码是)f0/0: - (PCA) (箭头表示连接)f0/1: s0/0: s0/1: - (RouterA的s0/1接RouterB的s0/0) 设置RouterB的IP地址:s0/0: (PCB) 2设置路由器的静态路由: 设置路由器的IP地址(略) 先看一下路由表: show ip route 是显示路由表命令,它可以看到直联网络,静态路由和动态路由的情况,这是一个很常用的命令。ROA#show ip route (只能看到直连路由)ROA(config)#ip route ROA(config)#ip routingROA#show ip route (多了一条静态路由) 从PCA ping PCB :rootPCA root# ping (通) 从PCA ping rootPCA root# ping (不通) 再设置一条静态路由:ROA(config)#ip route ROA(config)#endROA#show ip route (又多了一条静态路由)rootPCA root# ping (通了) 3设置路由器的默认路由 先去掉两条静态路由:ROA(config)#no ip route ROA(config)#no ip route rootPCA root# ping (不通)rootPCA root# ping (不通) 设置RouterA的默认路由:ROA(config)#ip route ROA#show ip routerootPCA root# ping (通)rootPCA root# ping (通)使用指定静态路由时,要查看指定的目的网络,使用默认路由时,不判断目的网络。将匹配不了的数据包都发送给默认的下一跳。路由器设置中一般最后有一条默认路由。问题:如果有三个路由器,静态路由如果设置呢?要求静态路由接力! 4. 三个路由器的静态路由 参考实验九图 设置RouterA的IP:f0/0: -PCA:f0/1: -PCB:s0/0: s0/1: -接RouterC s0/0 设置RouterC的IP:s0/0: 接RouterB s0/0 设置RouterB的IP:s0/0: PCC:f0/1: -PCD: 设置从PCA到PCC的静态路由ROA(config)#ip routingROA(co
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年公路工程试验检测师资格考试(公共基础)综合能力测试题及答案(洛阳)
- 多重耐药菌预防与控制标准操作规程试题含答案
- 职业病诊断医师考试(职业性尘肺病)复习题及答案(清远2025年)
- 刀具考试试题及答案
- 2025年食品安全管理员考试参考题目及答案(一)
- 希腊小学考试题目及答案
- 多晶硅制取工转正考核试卷及答案
- 农村柑橘培训试题及答案
- 2025公路工程二建考试真题及答案
- 农发行咸宁市赤壁市2025秋招小语种岗笔试题及答案
- 工业污水处理基础设施建设项目可行性研究报告
- 2025 种植护理术中配合技巧课件
- 《组织行为学》课件-第1章 组织行为学概述
- 高炉大修总结课件
- 调动员工积极性工会课件
- 露天煤矿边坡课件
- 龙门吊吊装施工方案
- 【核心素养】3.1《学习有方法 - 掌握方法很重要》 教学课件
- 蜂鸟众包培训知识课件
- 上海浦东新区浦东公安分局文员招聘考试真题2024
- 单侧双通道UBE手术
评论
0/150
提交评论