工程实验室1.docx

上传人:牧羊曲112 文档编号:1757723 上传时间:2022-12-17 格式:DOCX 页数:269 大小:2.73MB
返回 下载 相关 举报
工程实验室1.docx_第1页
第1页 / 共269页
工程实验室1.docx_第2页
第2页 / 共269页
工程实验室1.docx_第3页
第3页 / 共269页
工程实验室1.docx_第4页
第4页 / 共269页
工程实验室1.docx_第5页
第5页 / 共269页
点击查看更多>>
资源描述

《工程实验室1.docx》由会员分享,可在线阅读,更多相关《工程实验室1.docx(269页珍藏版)》请在三一办公上搜索。

1、实验 交换机的基本配置【实验名称】交换机的基本配置。【实验目的】掌握交换机命令行各种操作模式的区别,能够使用各种帮助信息,以及用命令进行基本的配置。【背景描述】你是某公司新进的网管,公司要求你熟悉网络产品,公司采用全系列锐捷网络产品,首先要求你登录交换机,了解、掌握交换机的命令行操作技巧,以及如何使用一些基本命令进行配置。【需求分析】需要在交换机上熟悉各种不同的配置模式以及如何在配置模式间切换,使用命令进行基本的配置,并熟悉命令行界面的操作技巧。【实验拓扑】图2- 1 实验拓扑图【实验设备】三层交换机1台【预备知识】 交换机的命令行界面和基本操作【实验原理】交换机的管理方式基本分为两种:带内管

2、理和带外管理。通过交换机的Console口管理交换机属于带外管理,不占用交换机的网络接口,其特点是需要使用配置线缆,近距离配置。第一次配置交换机时必须利用Console端口进行配置。交换机的命令行操作模式,主要包括:用户模式、特权模式、全局配置模式、端口模式等几种。l 用户模式 进入交换机后得到的第一个操作模式,该模式下可以简单查看交换机的软、硬件版本信息,并进行简单的测试。用户模式提示符为switchl 特权模式 由用户模式进入的下一级模式,该模式下可以对交换机的配置文件进行管理,查看交换机的配置信息,进行网络的测试和调试等。特权模式提示符为switch#l 全局配置模式 属于特权模式的下一

3、级模式,该模式下可以配置交换机的全局性参数(如主机名、登录信息等)。在该模式下可以进入下一级的配置模式,对交换机具体的功能进行配置。全局模式提示符为switch(config)#l 端口模式 属于全局模式的下一级模式,该模式下可以对交换机的端口进行参数配置。端口模式提示符为switch(config-if)#交换机的基本操作命令包括:l Exit命令是退回到上一级操作模式。l End命令是指用户从特权模式以下级别直接返回到特权模式。l 交换机命令行支持获取帮助信息、命令的简写、命令的自动补齐、快捷键功能。配置交换机的设备名称和配置交换机的描述信息必须在全局配置模式下执行。l Hostname配

4、置交换机的设备名称。l 当用户登录交换机时,你可能需要告诉用户一些必要的信息。你可以通过设置标题来达到这个目的。你可以创建两种类型的标题:每日通知和登录标题。n Banner motd配置交换机每日提示信息motd message of the day。n Banner login配置交换机登录提示信息,位于每日提示信息之后。l 查看交换机的系统和配置信息命令要在特权模式下执行。a) Show version查看交换机的版本信息,可以查看到交换机的硬件版本信息和软件版本信息,用于进行交换机操作系统升级时的依据。b) Show mac-address-table查看交换机当前的MAC地址表信息。

5、c) Show running-config查看交换机当前生效的配置信息。【实验步骤】第一步:交换机各个操作模式直接的切换Swtichenable !使用enable命令从用户模式进入特权模式Swtich#configure terminal Enter configuration commands, one per line. End with CNTL/Z.!使用configure terminal命令从特权模式进入全局配置模式Swtich(config)#interface fastEthernet 0/1!使用interface命令进入接口配置模式Swtich(config-if)#S

6、wtich(config-if)#exit!使用exit命令退回上一级操作模式Swtich(config)#interface fastEthernet 0/2Swtich(config-if)#endSwtich#!使用end命令直接退回特权模式第二步:交换机命令行界面基本功能Switch ? !显示当前模式下所有可执行的命令 disable Turn off privileged commands enable Turn on privileged commands exit Exit from the EXEC help Description of the interactive he

7、lp system ping Send echo messages rcommand Run command on remote switch show Show running system information telnet Open a telnet connectiontraceroute Trace route to destinationSwtichen Swtichenable !使用tab键补齐命令Swtich#con?configure connect !使用?显示当前模式下所有以“con”开头的命令Swtich#conf tEnter configuration comm

8、ands, one per line. End with CNTL/Z.Swtich(config)#!使用命令的简写Swtich(config)#interface ?!显示interface命令后可执行的参数 Aggregateport Aggregate port interface Dialer Dialer interface FastEthernet Fast IEEE 802.3 GigabitEthernet Gbyte Ethernet interface Loopback Loopback interface Multilink Multilink-group interf

9、ace Null Null interface Tunnel Tunnel interface Virtual-ppp Virtual PPP interface Virtual-template Virtual Template interface Vlan Vlan interface range Interface range commandSwitch(config)#interfaceSwtich(config)#interface fastEthernet 0/1Switch(config-if)# Z Switch#!使用快捷键“Ctrl+Z”可以直接退回到特权模式Switch#

10、ping 1.1.1.1sending 5, 100-byte ICMP Echos to 1.1.1.1,timeout is 2000 milliseconds. CSwitch#!在交换机特权模式下执行ping 1.1.1.1命令,发现不能ping通目标地址,交换机默认情况下需要发送5个数据包,如不想等到5个数据包均不能ping通目标地址的反馈出现,可在数据包未发出5个之前通过执行快捷键“Ctrl+C”终止当前操作。第三步:配置交换机的名称和每日提示信息Switch(config)#hostname SW-1!使用hostname命令更改交换机的名称SW-1(config)#banner

11、 motd $!使用banner命令设置交换机的每日提示信息,参数motd指定以哪个字符为信息的结束符Enter TEXT message. End with the character $.Welcome to SW-1, if you are admin, you can config it.If you are not admin, please EXIT!$SW-1(config)#SW-1(config)#exitSW-1#Nov 25 22:04:01 %SYS-5-CONFIG_I: Configured from console by consoleSW-1#exitSW-1

12、CON0 is now availablePress RETURN to get startedWelcome to SW-1, if you are admin, you can config it.If you are not admin, please EXIT!SW-1第四步:配置接口状态锐捷全系列交换机Fastethernet接口默认情况下是10M/100Mbit/s自适应端口,双工模式也为自适应(端口速率、双工模式可配置)。默认情况下,所有交换机端口均开启。如果网络中存在一些型号比较旧的主机,还在使用10Mbit/s半双工的网卡,此时为了能够实现主机之间的正常访问,应当在交换机上进

13、行相应的配置,把连接这些主机的交换机端口速率设为10Mbit/s,传输模式设为半双工。SW-1(config)#interface fastEthernet 0/1!进入端口F0/1的配置模式SW-1(config-if)#speed 10!配置端口速率为10MSW-1(config-if)#duplex half!配置端口的双工模式为半双工SW-1(config-if)#no shutdown!开启端口,使端口转发数据。交换机端口默认已经开启。SW-1(config-if)#description This is a Accessport.!配置端口的描述信息,可作为提示。SW-1(conf

14、ig-if)#end SW-1#Nov 25 22:06:37 %SYS-5-CONFIG_I: Configured from console by consoleSW-1#SW-1#show interface fastEthernet 0/1Index(dec):1 (hex):1FastEthernet 0/1 is UP , line protocol is UP Hardware is marvell FastEthernetDescription: This is a Accessport.Interface address is: no ip address MTU 1500

15、bytes, BW 10000 Kbit Encapsulation protocol is Bridge, loopback not set Keepalive interval is 10 sec , set Carrier delay is 2 sec RXload is 1 ,Txload is 1 Queueing strategy: WFQ Switchport attributes: interfaces description:This is a Accessport. medium-type is copper lastchange time:329 Day:22 Hour:

16、 5 Minute: 2 Second Priority is 0 admin duplex mode is Force Half Duplex, oper duplex is Half admin speed is 10M, oper speed is 10M flow control admin status is OFF,flow control oper status is OFF broadcast Storm Control is OFF,multicast Storm Control is OFF,unicast Storm Control is OFF 5 minutes in

17、put rate 0 bits/sec, 0 packets/sec 5 minutes output rate 0 bits/sec, 0 packets/sec 0 packets input, 0 bytes, 0 no buffer, 0 dropped Received 0 broadcasts, 0 runts, 0 giants 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort 0 packets output, 0 bytes, 0 underruns , 0 dropped 0 output errors, 0 collis

18、ions, 0 interface resetsSW-1#如果需要将交换机端口的配置恢复默认值,可以使用default命令。SW-1(config)#interface fastEthernet 0/1SW-1(config-if)#default bandwidth !恢复端口默认的带宽设置SW-1(config-if)#default description!取消端口的描述信息SW-1(config-if)#default duplex !恢复端口默认的双工设置SW-1(config-if)#endSW-1#Nov 25 22:11:13 %SYS-5-CONFIG_I: Configur

19、ed from console by consoleSW-1#SW-1#show interface fastEthernet 0/1Index(dec):1 (hex):1FastEthernet 0/1 is UP , line protocol is UP Hardware is marvell FastEthernetInterface address is: no ip address MTU 1500 bytes, BW 100000 Kbit Encapsulation protocol is Bridge, loopback not set Keepalive interval

20、 is 10 sec , set Carrier delay is 2 sec RXload is 1 ,Txload is 1 Queueing strategy: WFQ Switchport attributes: interfaces description: medium-type is copper lastchange time:329 Day:22 Hour:11 Minute:13 Second Priority is 0 admin duplex mode is AUTO, oper duplex is Full admin speed is AUTO, oper spee

21、d is 100M flow control admin status is OFF,flow control oper status is ON broadcast Storm Control is OFF,multicast Storm Control is OFF,unicast Storm Control is OFF 5 minutes input rate 0 bits/sec, 0 packets/sec 5 minutes output rate 0 bits/sec, 0 packets/sec 0 packets input, 0 bytes, 0 no buffer, 0

22、 dropped Received 0 broadcasts, 0 runts, 0 giants 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort 0 packets output, 0 bytes, 0 underruns , 0 dropped 0 output errors, 0 collisions, 0 interface resetsSW-1#第五步:查看交换机的系统和配置信息SW-1#show version !查看交换机的系统信息System description : Ruijie Dual Stack Multi-Lay

23、er Switch(S3760-24) By Ruijie Network!交换机的描述信息(型号等)System start time : 2008-11-25 21:58:44System hardware version : 1.0!设备的硬件版本信息System software version : RGNOS 10.2.00(2), Release(27932)!操作系统版本信息System boot version : 10.2.27014System CTRL version : 10.2.24136System serial number : 0000000000000SW-1

24、#SW-1#show running-config !查看交换机的配置信息Building configuration.Current configuration : 1279 bytes!version RGNOS 10.2.00(2), Release(27932)(Thu Dec 13 10:31:41 CST 2007 -ngcf32)hostname SW-1!vlan 1!no service password-encryption!interface FastEthernet 0/1!interface FastEthernet 0/2!interface FastEtherne

25、t 0/3!interface FastEthernet 0/4!interface FastEthernet 0/5!interface FastEthernet 0/6!interface FastEthernet 0/7!interface FastEthernet 0/8!interface FastEthernet 0/9!interface FastEthernet 0/10! interface FastEthernet 0/11!interface FastEthernet 0/12!interface FastEthernet 0/13!interface FastEther

26、net 0/14!interface FastEthernet 0/15!interface FastEthernet 0/16!interface FastEthernet 0/17!interface FastEthernet 0/18!interface FastEthernet 0/19!interface FastEthernet 0/20!interface FastEthernet 0/21!interface FastEthernet 0/22! interface FastEthernet 0/23!interface FastEthernet 0/24!interface

27、GigabitEthernet 0/25!interface GigabitEthernet 0/26!interface GigabitEthernet 0/27!interface GigabitEthernet 0/28!line con 0line vty 0 4 login!banner motd CWelcome to SW-1, if you are admin, you can config it.If you are not admin, please EXIT!C!end第六步:保存配置下面的3条命令都可以保存配置SW-1#copy running-config start

28、up-config SW-1#write memory SW-1#write【注意事项】1、命令行操作进行自动补齐或命令简写时,要求所简写的字母必须能够惟一区别该命令。如switch#conf可以代表configure,但switch#co无法代表configure,因为co开头的命令有两个copy和configure,设备无法区别。2、注意区别每个操作模式下可执行的命令种类。交换机不可以跨模式执行命令。3、配置设备名称的有效字符是22个字节。4、配置每日提示信息时,注意终止符不能在描述文本中出现。如果键入结束的终止符后仍然输入字符,则这些字符将被系统丢弃。5、交换机端口在默认情况下是开启的,

29、AdminStatus是UP状态,如果该端口没有实际连接其他设备,OperStatus是down状态。6、show running-config查看的是当前生效的配置信息,该信息存储在RAM(随机存储器里),当交换机掉电,重新启动时会重新生成新的配置信息。实验 在交换机上配置Telnet【实验名称】在交换机上配置Telnet【实验目的】学习如何在交换机上启用Telent,实现通过Telnet远程访问交换机。【背景描述】企业园区网覆盖范围较大时,交换机会分别放置在不同的地点,如果每次配置交换机都需要在交换机所在地点现场配置,管理员的工作量会很大。此时可以在交换机上进行Telnet配置,这样再需要

30、配置交换机时,管理员可以远程以Telnet方式登录配置。【需求分析】需要掌握如何配置交换机的密码,以及如何配置Telnet,掌握以Telnet的方式远程访问交换机的方法。【实验拓扑】 图2-2 实验拓扑图【实验设备】 二层交换机 1台三层交换机 1台【预备知识】 交换机的基本配置方法【实验原理】 在两台交换机上配置VLAN 1的IP地址,用双绞线将两台交换机的F0/1端口连接起来,分别配置Telnet,然后就可以实现在每台交换机以Telnet的方式登录另一台交换机。【实验步骤】第一步:在两台交换机上配置主机名、管理IP地址S3760(config)#hostname L3-SW!配置3层交换机

31、的主机名L3-SW(config)#interface vlan 1!配置3层交换机的管理IP地址L3-SW(config-if)#ip address 192.168.1.1 255.255.255.0L3-SW(config-if)#no shutdown L3-SW(config-if)#endS2126G (config)#hostname L2-SW!配置2层交换机的主机名L2-SW(config)#interface vlan 1!配置2层交换机的管理IP地址L2-SW(config-if)#ip address 192.168.1.2 255.255.255.0L2-SW(con

32、fig-if)#no shutdown L2-SW(config-if)#end第二步:在三层交换机上配置TelnetL3-SW(config)#enable password 0 star!配置enable的密码L3-SW(config)#line vty 0 4!进入线程配置模式L3-SW(config-line)#password 0 star!配置Telnet的密码L3-SW(config-line)#login!启用Telnet的用户名密码验证L3-SW(config-line)#exit第三步:在二层交换机上配置TelnetL2-SW(config)#enable secret l

33、evel 1 0 star!配置Telnet的密码,即level 1的密码L2-SW(config)#enable secret 0 star!配置enable密码,默认是level 15的密码第四步:使用Telnet远程登录可以在3层交换机L3-SW上以Telnet的方式登录2层交换机L2-SW,进行验证:L3-SW#telnet 192.168.1.2Trying 192.168.1.2, 23.User Access VerificationPassword: !提示输入Telnet密码,输入设置的密码starL2-SWenable Password: !提示输入enable密码,输入设

34、置的密码starL2-SW#!现在已经进入了二层交换机L2-SW,可以正常的进行配置L2-SW#L2-SW#exit!使用exit命令退出Telnet登录L3-SW#可以在2层交换机L2-SW上以Telnet的方式登录3层交换机L3-SW,进行验证:L2-SW#telnet 192.168.1.1Trying 192.168.1.1 . OpenUser Access VerificationPassword:!提示输入Telnet密码,输入设置的密码starL3-SWenPassword:!提示输入enable密码,输入设置的密码starL3-SW#L3-SW#exitConnection

35、to 192.168.1.1 closed by foreign host !使用exit命令退出Telnet登录L2-SW#【备注事项】如果没有配置enable的密码,将不能登录到交换机进行配置,可以进入用户模式,但无法进入特权模式,二层交换机此时的提示信息为“% No password set”,三层交换机此时的提示信息为“Password required, but none set”。【参考配置】L3-SW#show running-configBuilding configuration.Current configuration : 1359 bytes!version RGNOS

36、 10.2.00(2), Release(27932)(Thu Dec 13 10:31:41 CST 2007 -ngcf32)hostname L3-SW!vlan 1!no service password-encryption!enable password star!interface FastEthernet 0/1!interface FastEthernet 0/2!interface FastEthernet 0/3!interface FastEthernet 0/4!interface FastEthernet 0/5!interface FastEthernet 0/6

37、!interface FastEthernet 0/7!interface FastEthernet 0/8!interface FastEthernet 0/9!interface FastEthernet 0/10!interface FastEthernet 0/11!interface FastEthernet 0/12!interface FastEthernet 0/13!interface FastEthernet 0/14!interface FastEthernet 0/15!interface FastEthernet 0/16!interface FastEthernet

38、 0/17!interface FastEthernet 0/18!interface FastEthernet 0/19!interface FastEthernet 0/20!interface FastEthernet 0/21!interface FastEthernet 0/22!interface FastEthernet 0/23!interface FastEthernet 0/24!interface GigabitEthernet 0/25!interface GigabitEthernet 0/26!interface GigabitEthernet 0/27!inter

39、face GigabitEthernet 0/28!interface VLAN 1 ip address 192.168.1.1 255.255.255.0!line con 0line vty 0 4 login password star!endL2-SW#show running-config System software version : 1.66(8) Build Dec 22 2006 RelBuilding configuration.Current configuration : 380 bytes!version 1.0!hostname L2-SWvlan 1!ena

40、ble secret level 1 5 $2H.Y*T73C,tZV/4D+S(W&QG1X)svenable secret level 15 5 $2,1u_;C3&-8U0H!interface fastEthernet 0/1!interface vlan 1 no shutdown ip address 192.168.1.2 255.255.255.0 !end实验 跨交换机实现VLAN【实验名称】跨交换机实现VLAN。【实验目的】掌握如何在交换机上划分基于端口的VLAN、如何给VLAN内添加端口,理解跨交换机之间VLAN的特点。【背景描述】假设某企业有两个主要部门:销售部和技术部

41、,其中销售部门的个人计算机系统连接在不同的交换机上,他们之间需要相互进行通信,但为了数据安全起见,销售部和技术部需要进行相互隔离,现要在交换机上做适当配置来实现这一目标。【需求分析】通过划分Port VLAN实现交换机的端口隔离,然后使在同一VLAN里的计算机系统能跨交换机进行相互通信,而在不同VLAN里的计算机系统不能进行相互通信。【实验拓扑】图3-1 实验拓扑图【实验设备】三层交换机 1台二层交换机 1台【预备知识】 交换机的基本配置方法,VLAN的工作原理和配置方法,Trunk的工作原理和配置方法【实验原理】VLAN(Virtual Local Area Network,虚拟局域网)是指

42、在一个物理网段内,进行逻辑的划分,划分成若干个虚拟局域网。VLAN最大的特性是不受物理位置的限制,可以进行灵活的划分。VLAN具备了一个物理网段所具备的特性。相同VLAN内的主机可以互相直接访问,不同VLAN间的主机之间互相访问必须经由路由设备进行转发。广播数据包只可以在本VLAN内进行传播,不能传输到其他VLAN中。Port Vlan是实现VLAN的方式之一,Port Vlan是利用交换机的端口进行VLAN的划分,一个端口只能属于一个VLAN。Tag Vlan是基于交换机端口的另外一种类型,主要用于实现跨交换机的相同VLAN内主机之间可以直接访问,同时对于不同VLAN的主机进行隔离。Tag

43、Vlan遵循了IEEE802.1q协议的标准。在利用配置了Tag vlan的接口进行数据传输时,需要在数据帧内添加4个字节的802.1q标签信息,用于标识该数据帧属于哪个VLAN,以便于对端交换机接收到数据帧后进行准确的过滤。【实验步骤】第一步:配置两台交换机的主机名Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname L2-SWL2-SW(config)#S3750#configure terminal Enter configuration commands, one per line. End with CNTL/Z.S3750(config)#hostname L3-SWL3-SW(config)#第二步:在三层交换机上划分VLAN 添加端口L3-SW(config)#vlan 10L3-SW(config-vlan)#name xiaoshou!划分销售部的VLAN 10L3-SW(config-vlan)#vlan 20L3-SW(config-vlan)

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

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号