交换机配置实验.doc_第1页
交换机配置实验.doc_第2页
交换机配置实验.doc_第3页
交换机配置实验.doc_第4页
交换机配置实验.doc_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

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

文档简介

实验一 计算机和交换机基本设置添加一个交换机,一个计算机,双击交换机,进入终端配置:systempassword:Quidwaysysname S3026 ;交换机命名S3026super password 111 ;设置特权密码S3026user-interface vty 0 4S3026-ui-vty0-4authentication-mode passwordS3026-ui-vty0-4set authentication-mode password simple 222S3026-ui-vty0-4user privilege level 3S3026-ui-vty0-4quitS3026quitsyspassword:111S3026display currect-configS3026dis currS3026vlan 2S3026-vlan2port ethernet0/2S3026-vlan2port e0/4 to et0/6S3026-vlan2quitS3026dis vlanS3026int e0/3S3026-Ethernet1port access vlan 2S3026-Ethernet1quitS3026dis vlanS3026dis currS3026interface vlan 1S3026-Vlan-interface1ip address 10.65.1.8 255.255.0.0S3026-Vlan-interface1quitS3026ip route-static 0.0.0.0 0.0.0.0 10.65.1.2S3026ip default-gateway 10.65.1.2S3026dis currS3026save双击小电脑:login:rootpassword:linuxrootPCA root#ifconfig eth0 10.65.1.1 netmask 255.255.0.0rootPCA root#ifconfigrootPCA root#route add default gw 10.65.1.2rootPCA root#routerootPCA root#ping 10.65.1.8rootPCA root#telnet 10.65.1.8实验二 配置端口聚合要求聚合的端口工作在全双工,速度一致,在同一槽口且连续。参数:ingress:源MAC, both:源和目的MAC对于SwitchA:Quidwaysysname SwitchASwitchAinterface 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:Quidwaysysname SwitchBSwitchBinterface 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实验三 基本VLAN设置SwitchAvlan 2SwitchA-vlan2port e0/2SwitchA-vlan2port e0/3 to e0/4SwitchA-vlan2vlan 3SwitchA-vlan3port e0/5 to e0/6SwitchAdis vlan allSwitchAdis currentSwitchBvlan 2SwitchB-vlan2port e0/3 to e0/4SwitchB-vlan2vlan 3SwitchB-vlan3port e0/5 to e0/6SwitchB-vlan3quitSwitchBdis vlan allSwitchBdis current设置计算机的IP为:PCA:10.65.1.1 PCB:10.66.1.1 PCC:10.65.1.3 PCD:10.66.1.3rootPCA root#ping 10.65.1.1 通 (本机IP)rootPCA root#ping 10.65.1.3 不通 (中间连接线是vlan 1)rootPCA root#ping 10.66.1.1 不通 (不同网络,不同vlan)rootPCA root#ping 10.66.1.3 不通 (不同网络,不同vlan)rootPCB root#ping 10.66.1.3 不通 (中间连接线是vlan 1)将PCA改接到SwitchA E0/2 (vlan 1)rootPCA root#ping 10.65.1.3 不通 (同网络,不同vlan)将PCC改接到SwitchB E0/2 (vlan 1)rootPCA root#ping 10.65.1.3 通 (同网络,同在vlan 1)再改回来,并设置trunk:S3026Ainterface ethernet0/8S3026A-Ethernet0/8port link-type trunkS3026A-Ethernet0/8port trunk permit vlan allS3026Binterface ethernet0/1S3026B-Ethernet0/1port link-type trunkS3026B-Ethernet0/1port trunk permit vlan allS3026B-Ethernet0/1quitS3026Bdis currrootPCA root#ping 10.65.1.3 通rootPCA root#ping 10.66.1.3 不通rootPCB root#ping 10.66.1.3 通即:PCA和PCC同在vlan 2 是通的,PCB和PCD同在vlan 3是通的。 PCA和PCB是不通的。同理PCC和PCD也是不通的。-再加入一个交换机switchC,将它串入switchA和switchB之间,连接方式: switchA:E0/8-switchC:E0/3; switchC:E0/6-switchB:E0/1(1) 新加入的SwitchC 默认状态时,测试连通性。 从PCA-PCC,从PCB-PCD 测试:rootPCA root# ping 10.65.1.3 (不通)rootPCB root# ping 10.66.1.3 (不通) 由于新加入的交换机没有设置trunk,端口默认vlan 1,交换机的trunk要成对出现,因为当dot1q不能和另一端交换信息时,会自动down掉。(2) 将交换机之间的连线都设置成trunk时,再测试连通性。S3026Cinterface ethernet0/3S3026C-Ethernet0/1port link-type trunkS3026C-Ethernet0/1port trunk permit vlan allS3026Cinterface ethernet0/6S3026C-Ethernet0/8port link-type trunkS3026C-Ethernet0/8port trunk permit vlan all现在有两条正确的trunk,再看一下联通情况:rootPCA root# ping 10.65.1.3 (通)rootPCB root# ping 10.66.1.3 (通)(3) 设置vtp VTP是vlan 传输协议,在VTP Server上配置的vlan 在条件允许条件下,可以从VTP Client 端看到VTP Server上的vlan,并将自己端口加入到vlan中。S3026Cvtp domain abcS3026Cvtp mode serverS3026Cvtp password okS3026Bvtp domain abcS3026Bvtp mode clientS3026Bvtp password okS3026A#disp vlanS3026B#disp vlanS3026C#disp vlan 当口令和域名一致时,client端可以学习到server端的vlan,在VTP Server端还可以有很多策略,这里只是说明最基本的问题。 VTP在企业、机关、学校的应用是很多的,在主交换机上设置好vlan以后,下级的交换机不用再设置vlan,可以将client的某些端口添加到VTP Server中定义的vlan中去,加强了管理。实验四 配置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 设置交换机端口的花费实验六 路由器BootROM升级 systemQuidwayreloadPress Ctrl+B to enter Boot Menu Boot Menu:1:Download application program2:Download Bootrom program3:Modify Bootrom password4:Exit menu5:Reboot Enter your choice(1-5):1Downloading application programfrom serial . (rs232)please choose your download speed:1:9600bps2:19200bps3:38400bps4:Exit and reboot Enter your choice(1-4):2Download speed is 38400bps. Please change the terminals speed to 38400bps. And select XMODEM protocol. Press ENTER key when ready.Downloading .CC (please select File-Send)# ok!Download completed.Write flash auccessfully!Quidway实验七 直联路由systempassword:Quidwayinterface ethernet0Quidway-Ethernet0ip addr 10.65.1.2 255.255.255.0Quidway-Ethernet0undo shutdownQuidway-Ethernet0int e1Quidway-Ethernet1ip addr 10.66.1.2 255.255.255.0Quidway-Ethernet1undo shutdownrootPCA root#ifconfig eth0 10.65.1.1 netmask 255.255.0.0rootPCB root#ifconfig eth0 10.66.1.1 netmask 255.255.0.0rootPCA root#ping 10.65.1.2 (通,没有关只能ping直连的口)rootPCA root#ping 10.66.1.2 (不通,PCA 没有设置网关)rootPCA root#route add default gw 10.65.1.2rootPCA root#ping 10.66.1.2 (通)rootPCA root#ping 10.66.1.1 (不通,因PCB没有网关)rootPCB root#route add default gw 10.66.1.2rootPCA root#ping 10.66.1.1 (通)去掉计算机Host B与Router的连线,再ping:rootPCA root#ping 10.66.1.2 不通(没有接线端口会自动down掉)再连接Host B与Router的连线,再ping:rootPCA root#ping 10.66.1.2 (通)实验八 单臂路由 设置PCA ip:10.65.1.1 gateway:10.65.1.2设置PCB ip:10.66.1.1 gateway:10.66.1.21.一个接口两个IP的情况systempassword:Quidwayinterface ethernet0Quidway-Ethernet0ip addr 10.65.1.2 255.255.255.0Quidway-Ethernet1ip addr 10.66.1.2 255.255.255.0 secondaryQuidway-Ethernet1undo shutdownrootPCA root#ping 10.66.1.1 通2划分两个子接口,对两个vlan的路由SwitchAvlan 2SwitchA-vlan2port e0/3SwitchAvlan 3SwitchA-vlan3port e0/6 SwitchAine e0/1SwitchA-Ethernet0/1port link-type trunkSwitchA-Ethernet0/1port trunk permit vlan allSwitchA-Ethernet0/1port trunk encap dot1qSwitchAdis currQuidwayint e0SwitchA-Ethernet0int e0.1SwitchA-Ethernet0.1encapsulation dot1q 2SwitchA-Ethernet0.1ip addr 10.65.1.2 255.255.255.0SwitchA-Ethernet0.1nudo shutSwitchA-Ethernet0.1int e0.2SwitchA-Ethernet0.2encapsulation dot1q 2SwitchA-Ethernet0.2ip addr 10.66.1.2 255.255.255.0SwitchA-Ethernet0.2nudo shutSwitchAdis currrootPCA root#ping 10.66.1.1 通实验九 静态路由实验 PCA:10.65.1.1 PCB:10.66.1.1 PCC:10.70.1.1 PCD:10.71.1.1RouterAinterface ethernet0RouterA-Ethernet0ip addrress 10.65.1.2 255.255.0.0RouterA-Ethernet0undo shutdownRouterA-Ethernet0int e1RouterA-Ethernet1ip addrress 10.66.1.2 255.255.0.0RouterA-Ethernet1undo shutdownRouterA-Ethernet1int s1RouterA-Serial1ip addrress 10.68.1.2 255.255.0.0RouterA-Serial1undo shutdownRouterA-Serial1clock rate 64000RouterA-Serial1quitRouterAip routingRouterAdis currRouterBinterface ethernet0RouterB-Ethernet0ip addrress 10.70.1.2 255.255.0.0RouterB-Ethernet0undo shutdownRouterB-Ethernet0int e1RouterB-Ethernet1ip addrress 10.71.1.2 255.255.0.0RouterB-Ethernet1undo shutdownRouterB-Ethernet1int s0RouterB-Serial0ip addrress 10.68.1.1 255.255.0.0RouterB-Serial0undo shutdownRouterB-Serial0quitRouterBip routingRouterBdis currrootPCA root#ifconfig eth0 10.65.1.1 netmask 255.255.0.0rootPCA root#route add default gw 10.65.1.2rootPCA root#ping 10.65.1.2 通rootPCA root#ping 10.66.1.2 通rootPCA root#ping 10.67.1.2 通rootPCA root#ping 10.68.1.2 不通rootPCA root#ping 10.69.1.2 不通RouterAip route-static 10.69.0.0 255.255.0.0 10.67.1.1rootPCA root#ping 10.69.1.1 通三个路由器的静态路由 (参考实验九图) 设置RouterA的IP:f0/0: 10.65.1.2 -PCA:10.65.1.1f0/1: 10.66.1.2 -PCB:10.66.1.1s0/0: 10.67.1.2s0/1: 10.68.1.2 -接RouterC s0/0 设置RouterC的IP:s0/0: 10.68.1.1 接RouterB s0/0 设置RouterB的IP:s0/0: 10.78.1.1 PCC:10.69.1.1f0/1: 10.70.1.2 -PCD:10.70.1.1 设置从PCA到PCC的静态路由ROAip routingROAip route-static 10.69.0.0 255.255.0.0 10.68.1.1ROAdisplay ip routeROBip route-static 10.69.0.0 255.255.0.0 10.78.1.1ROBdisplay ip routerootPCA root#ping 10.69.1.1 (通)rootPCA root#ping 10.78.1.1 (不通)rootPCA root#ping 10.70.1.1 (不通) 为什么PCA 到10.78.1.1不通呢?它是去10.69.1.1要经过的地方啊,这是由于在RouterA上,没有去10.78.0.0网络的路由,所以到这个网络它不知道要向哪去送。 如何让PCA到10.70.1.1 (PCD)通呢,像10.69.0.0网络一样,在路径的路由器上,再各写一条到10.70.0.0网络的静态路由就可以了。 如果每一条路径都写一组静态路由显然不好,由于PCA在这个网络中实际只有一条主通路,所以使用默认路由较好。 我们再做一个使用默认路由的小实验,先去掉原有的静态路由。ROAundo ip route-static 10.69.0.0 255.255.0.0 10.68.1.1ROAdisplay ip routeROAundo ip route-static 10.69.0.0 255.255.0.0 10.78.1.1ROBdisplay ip routerootPCA root#ping 10.69.1.1 (不通)ROAip route-static 0.0.0.0 0.0.0.0 10.68.1.1ROBdisplay ip routeROBip route-static 0.0.0.0 0.0.0.0 10.69.1.1ROBdisplay ip routerootPCA root#ping 10.69.1.1 (通)rootPCA root#ping 10.70.1.1 (通)rootPCA root#ping 10.78.1.1 (通) 路由表是路由器实现路由的指导思想。到一个网络通不通,要看路由表中有没有去目的网络的路由表项,动态路由可以自动创建路由表,定时更新。RouterB-Serial0undo ip addrress 10.67.1.1 255.255.0.0RouterB-Serial0ip addrress 10.70.1.1 255.255.0.0RouterCinterface serial0RouterC-Serial0ip addrress 10.67.1.1 255.255.0.0RouterC-Serial0undo shutdownRouterC-Serial0clock rate 64000RouterC-Serial0int s1RouterC-Serial1ip addrress 10.70.1.1 255.255.0.0RouterC-Serial1undo shutdownRouterC-Serial1quitRouterCip route-static 10.69.0.0 255.255.0.0 10.70.1.1RouterCdis currrootPCA root#ping 10.69.1.1 通rootPCA root#ping 10.68.1.1 不通实验十 动态路由实验RouterArip version 2 multicastRouterA-ripnetwork 10.0.0.0 ;可以用allRouterA-ripip routingRouterBrip version 2 multicastRouterB-ripnetwork 10.0.0.0RouterB-ripip routingRouterCrip version 2 multicastRouterC-ripnetwork 10.0.0.0RouterC-ripip routingRouterCdis ip routerootPCA root#ping 10.69.1.1 通rootPCA root#ping 10.70.1.1 通RouterA-rippeer 10.68.1.1 ;指明交换点RouterA-ripsummary ;聚合RouterA-Serial0rip split-horizon ;水平分隔RouterArip workRouterArip inputRouterArip outputQuidwayrouter id A.B.C.D ;配置路由器的IDQuidwayospf enable ;启动OSPF协议Quidway-ospfimport-route direct ;引入直联路由Quidway-Serial0ospf enable area 0 ;配置OSPF区域Quidway-Serial0link-protocol ppp实验十一 访问控制列表实验1基本访问列表RouterCfirewall enableRouterCfirewall default permitRouterCacl 10RouterC-acl-10rule normal deny source 10.65.1.1RouterC-acl-10rule normal permit source anyRouterCint s0RouterC-Serial0firewall packet-filter 10 inboundRouterC-Serial0quitRouterCdisplay aclrootPCA root#ping 10.69.1.1 不通rootPCB root#ping 10.69.1.1 通RouterCundo acl 10RouterCdisplay aclrootPCA root#ping 10.69.1.1 通rootPCB root#ping 10.69.1.1 通RouterCacl 11RouterC-acl-11rule normal deny source 10.65.1.1 0.0.0.255RouterC-acl-11rule normal permit source anyRouterCint s0RouterC-Serial0firewal

温馨提示

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

评论

0/150

提交评论