博达交换机常用配置命令手册课堂PPT.ppt

上传人:peixunshi0 文档编号:63119 上传时间:2025-07-09 格式:PPT 页数:129 大小:3.39MB
下载 相关 举报
博达交换机常用配置命令手册课堂PPT.ppt_第1页
第1页 / 共129页
博达交换机常用配置命令手册课堂PPT.ppt_第2页
第2页 / 共129页
博达交换机常用配置命令手册课堂PPT.ppt_第3页
第3页 / 共129页
博达交换机常用配置命令手册课堂PPT.ppt_第4页
第4页 / 共129页
博达交换机常用配置命令手册课堂PPT.ppt_第5页
第5页 / 共129页
点击查看更多>>
资源描述

1、交换机使用教程交换机使用教程大纲大纲交换机应用结构配置介绍交换机应用结构配置介绍 博达交换机基本操作命令介绍博达交换机基本操作命令介绍 局域网网络安全局域网网络安全2博达交换机基本操作命令介绍博达交换机基本操作命令介绍通过通过SNMP网管软件管理网管软件管理 telnet远程管理远程管理Console配置配置路由器和交换机常用配置命令路由器和交换机常用配置命令 3博达交换机基本操作命令介绍博达交换机基本操作命令介绍通过通过SNMP网管软件管理网管软件管理 telnet远程管理远程管理Console配置配置路由器和交换机常用配置命令路由器和交换机常用配置命令 4Console配置配置交换机CON

2、SOLE端口速率设置为:波特率为9600,8位数据位,1位停止位,无奇偶校验,无流控;所以计算机的串口也需要把速率设置成相同。路由器及交换机和计算机主机串行口的连接如下图所示:5Windows超级终端配置超级终端配置采用操作系统自带的超级终端(Hyper Terminal)应用程序。用鼠标单击“开始”,选择“程序”,“附件”中的“超级终端”,运行“超级终端”。超级终端开始运行后,出现“连接说明”对话框,在名称输入项中键入连接名称,如“Switch”等,再选择一个图标,按“确定”。如下图:6Windows超级终端配置(续)超级终端配置(续)出现“电话号码”对话框,在“连接时使用”下拉菜单中选择“

3、直接连接到串口3”(假设console线连接串口3),按“确定”。如下图:7Windows超级终端配置(续)超级终端配置(续)出现“COM3属性”对话框,把波特率设为9600,数据位为8,奇偶校验为没有,停止位为1,流控为无,按“确定”完成设置。如下图:这时,就可以通过超级终端来控制交换机了。8交换机各种操作模式说明在交换机初始启动时,出现“Switch”的提示符时说明在用户态下,各状态之间相互转换如下图所示:9用户态出现“Switch”的提示符时,说明在用户态下。通过键入“?”键,你可以看到在用户态下可以使用的配置命令。在用户态的时候,用户可以键入“enter”或“enable”,可以进入管

4、理态。如果设置了特权态密码,在出现“password:”提示的时候需键入特权态密码。10管理态(特权态)当出现“Switch#”的提示符时,说明已进入管理态。并且,路由器提示如下信息:Sep 10 17:39:10 Unknown user enter privilege mode from console 0,level=15在特权态下,通过键入“?”键,你可以看到在特权态下可以使用的配置命令。在特权态下,键入“config”,可以进入配置态。键入“quit”或“exit”可退到用户态。11配置态配置态当出现类似“Switch_config#”的提示符时,说明已进入配置态。在配置态下,通过键

5、入“?”键,你可以看到在配置态下可以使用的配置命令。键入“quit”或“exit”可退到管理态。12博达交换机基本操作命令介绍博达交换机基本操作命令介绍通过通过SNMP网管软件管理网管软件管理 telnet远程管理远程管理Console配置配置交换机常用配置命令交换机常用配置命令 13telnet远程管理远程管理在博达路由器和交换机上配置了IP地址之后,还可以通过TELNET的方式实现远程的管理,只要可以PING通路由器或交换机上的IP地址的计算机均可以通过TELNET的方式对交换机进行管理工作。Switchenable Switch#Switch#config Switch_config#i

6、nterface vlan 1 Switch_config_v1#ip address 192.168.0.1 255.255.255.0 Switch_config_v1#exit Switch_config#enable password bdcom Switch_config#aaa authentication login default enable Switch_config#aaa authentication enable default enable 14博达交换机基本操作命令介绍博达交换机基本操作命令介绍通过通过SNMP网管软件管理网管软件管理 telnet远程管理远程管理

7、Console配置配置交换机常用配置命令交换机常用配置命令 15通过通过SNMP网管软件管理网管软件管理 网管软件通过SNMP网管协议可以管理到博达交换机,博达路由器和交换机上的配置如下所示:Switch_config#snmp-server community public RW Switch_config#snmp-server host 192.168.0.119 public 16博达交换机基本操作命令介绍博达交换机基本操作命令介绍通过通过SNMP网管软件管理网管软件管理 telnet远程管理远程管理Console配置配置交换机常用配置命令交换机常用配置命令 17帮助命令(帮助命令(1

8、在任一命令模式下,键入?,获取该命令模式下所有命令在任一命令模式下,键入?,获取该命令模式下所有命令及其简单描述。及其简单描述。Switch#?cd -Change directory chinese -Help message in Chinese clear -Clear something config -Enter configurative mode connect -Open a outgoing connection copy -Copy configuration or image data date -Set system date debug -Debugging fun

9、ctions delete -Delete a file dir -List files in flash memory 18帮助命令(帮助命令(2)键入一命令,后接以空格分隔的?,列出该位置下所有的键入一命令,后接以空格分隔的?,列出该位置下所有的关键字或参数。关键字或参数。Switch#show?aaa -Show AAA information aggregator-group -Link Aggregation information alias -Alias for command arp -ARP table break -Switch breakpoint information

10、 cluster -Cluster information configuration -Show configuration in flash memory debug -State of each debugging option dot1x -IEEE 802.1X information hosts -Host table interface -Interface status and configuration ip -IP Configuration information 19帮助命令(帮助命令(3)键入一字符串,后紧接?,列出以该字符串打头的所有命键入一字符串,后紧接?,列出以

11、该字符串打头的所有命令。令。Switch#d?date -Set system date debug -Debugging functions delete -Delete a file dir -List files in flash memory disconnect -Discoonect an existing outgoing network connection download -Download with ZMODEM20设置显示方式设置显示方式 博达交换机支持中英文显示,通过下面的命令可以容易地在两种显示方式下切换。1、chinese:设置显示方式为中文。2、english:

12、设置显示方式为英文。Switch#?chinese -Help message in Chinese english -Help message in English21设置主机名设置主机名 为了方便地识别多台交换机,可以通过“hostname”命令给交换机设置一个名称以便识别。设置好交换机名称后,在原来提示符的头部将变为新设置的交换机名称。Switch_config#hostname bdcom说明:bdcom为交换机名称。长度小于等于24个字符。字符串中可以包括数字,字母,符号,下划线。取消路由器名称使用命令:bdcom_config#no hostname bdcom Switch_co

13、nfig#22保存配置信息保存配置信息 博达路由器和交换机保存配置信息命令及操作如下所示:Switch#writeSaving current configuration.OK!说明:路由器下一次启动时,根据最后一次写入的配置信说明:路由器下一次启动时,根据最后一次写入的配置信息工作,可以写入多次。息工作,可以写入多次。未写入的配置将在重新启动后丢未写入的配置将在重新启动后丢失。失。23删除文件和热重启删除文件和热重启删除文件Switch#delete?WORD -file name -delete startup-config重启交换机Switch#reboot?noconfirm -Wit

14、hout confirm -With confirm24查看配置查看配置显示路由器中保存(即用write命令保存在闪存中)的配置信息 show config显示路由器当前的全部配置信息(在内存中的配置信息)show running-config25显示显示flash中的文件中的文件DIR命令:显示保存在命令:显示保存在FLASH中的文件列表情况。中的文件列表情况。Switch#dirDirectory of/:html SAT OCT 28 12:53:33 20060 Switch.bin 3461091 FRI JAN 26 09:17:33 20071 Function.map 1004

15、208 SAT OCT 28 12:52:10 2006free space 240844826显示显示MAC地址表地址表Show mac address-table:显示交换机动态:显示交换机动态MAC地址表;地址表;Switch_config#show mac address-table Mac Address Table -Vlan Mac Address Type Ports -All 00e0.0f5f.d650 STATIC CPU 1 00e0.0f27.4208 DYNAMIC f0/1 1 00e0.0f5f.d651 STATIC f0/1 1 00e0.0f5f.d655

16、 STATIC f0/5 1 00e0.0f5f.d656 STATIC f0/6 1 00e0.0f5f.d657 STATIC f0/7 1 00e0.0f5f.d658 STATIC f0/827显示显示VLAN表表Show vlan:显示交换机:显示交换机VLAN表;表;Switch_config#show vlan VLAN Status Name Ports -1 Static Default F0/1,F0/5,F0/6,F0/7,F0/8 F0/9,F0/10,F0/11,F0/12,F0/13 F0/14,F0/15,F0/16,F0/17,F0/18 F0/19,F0/20

17、F0/21,F0/22,F0/23 F0/24 2 Static VLAN0002 F0/1,F0/2 3 Static VLAN0003 F0/1,F0/3 4 Static VLAN0004 F0/1,F0/428升级软件升级软件1/通过console口升级2/通过TFTP服务器升级3/通过FTP服务器升级 通过通过TFTP升级升级 首先要启动tftp服务器,设置tftp服务器的当前工作目录为将下载的路由器软件所在的目录,并保证路由器与服务器连通(可以ping通)。switch#copy tftp flash29大纲大纲交换机应用结构配置介绍交换机应用结构配置介绍 博达交换机基本操作命令

18、介绍博达交换机基本操作命令介绍 网络安全交流网络安全交流 30交换机应用结构配置介绍交换机应用结构配置介绍 端口镜像端口镜像端口端口MAC地址绑定地址绑定生成树协议生成树协议端口聚合端口聚合802.1Q的的VLAN 配置配置端口限速端口限速广播风暴控制广播风暴控制31创建创建VLAN该命令在全局模式操作Switch_config#SwitchenableSwitch#configSwitch_config#vlan 2vlan vlan_id32删除删除VLAN该命令在全局模式操作Switch_config#SwitchenableSwitch#configSwitch_config#no v

19、lan 2no vlan vlan_id33给给VLAN命名命名该命令在VLAN配置模式下操作Switch_config_vlan_id#SwitchenableSwitch#configSwitch_config#vlan 2Switch_config_vlan2#name Engineeringname word34分配交换机端口到分配交换机端口到VLAN中中以下命令在端口模式Switch_config_fsolt num/port num#Switch_config_fsolt num/port num#Switch_config#interface fastEthernet 0/2Sw

20、itch_config_f0/2#switchport mode accessSwitch_config_f0/2#switchport pvid 2Switchport mode trunk|accessSwitchport pvid vlan_id35VLAN基本配置基本配置Switchenable Switch#config Switch_config#vlan 2Switch_config_vlan2#name SaleSwitch_config_vlan2#exitSwitch_config#vlan 3Switch_config_vlan3#name EngineeringSwit

21、ch_config_vlan3#exitSwitch_config#interface fastEthernet 0/2Switch_config_f0/2#switchport pvid 2Switch_config_f0/2#exitSwitch_config#interface fastEthernet 0/3Switch_config_f0/3#switchport pvid 3Switch_config_f0/3#exitSwitch_config#exit36查看查看VLAN 信息信息Switch#show vlanVLAN Status Name Ports-1 Static D

22、efault F0/1,F0/4,F0/5,F0/6,F0/7 F0/8,F0/9,F0/10,F0/11,F0/12 F0/13,F0/14,F0/15,F0/16,F0/17 F0/18,F0/19,F0/20,F0/21,F0/22 F0/23,F0/242 Static sale F0/23 Static Engineering F0/3可以看到交换机里面配置的所有VLAN信息,并且可以清楚的看出VLAN和端口的对应状态37VLAN间路由间路由在二层交换机上划分VLAN之后,各个不同的VLAN之间是不能进行通信的,如果要使各个不同的VLAN之间可以互相通信,那么就要用到路由技术。例如:

23、1.二层交换机上联路由器2.二层交换机上联三层交换机3.直接使用三层交换机38VLAN间路由(间路由(1)二层交换机上联路由器 不论VLAN有多少个,路由器与二层交换机都只用一条网线连接。在二层交换机和路由器上配置它们之间相连的端口使用Trunk,使多个VLAN共享同一物理链路连接到同一路由器。这种连接方式要求路由器支持子接口,每个子接口对应一个VLAN,对应一个逻辑子网。39配置举例配置举例拓扑结构如图:在二层交换机上划分VLAN 2,VLAN 3,VLAN 2和VLAN 3是不同的子网。现要实现VLAN 2和VLAN 3可以互相通信。40相关的配置相关的配置交换机的所需的配置interfa

24、ce FastEthernet0/1 switchport mode trunk!interface FastEthernet0/2 switchport pvid 2!interface FastEthernet0/3 switchport pvid 3!vlan 1-3路由器所需的配置interface FastEthernet0/0.2 ip address 192.168.0.1 255.255.255.0encapsulation dot1Q 2!interface FastEthernet0/0.3 ip address 192.168.1.1 255.255.255.0 enca

25、psulation dot1Q 3!41PC所需要的配置所需要的配置PC 1 (VLAN 2中的PC)IP Address.:192.168.0.25Subnet Mask.:255.255.255.0Default Gateway.:192.168.0.1PC 2 (VLAN 3中的PC)IP Address.:192.168.1.25Subnet Mask.:255.255.255.0Default Gateway.:192.168.1.142VLAN间路由(间路由(2)二层交换机上联三层交换机 不论VLAN有多少个,三层交换机与二层交换机都只用一条网线连接。在二层交换机和三层交换机之间相

26、连的端口使用Trunk,使多个VLAN共享同一物理链路连接到同一台三层交换机。43配置举例配置举例拓扑结构如图:在二层交换机上划分VLAN 2,VLAN 3,VLAN 2和VLAN 3是不同的子网。现要实现VLAN 2和VLAN 3可以互相通信。44二层交换机所需的主要配置二层交换机所需的主要配置interface FastEthernet0/1 switchport mode trunk!interface FastEthernet0/2 switchport pvid 2!interface FastEthernet0/3 switchport pvid 3!vlan 1-345二层交换机

27、所需的详细配置二层交换机所需的详细配置Switch#show runBuilding configuration.Current configuration:!version 2.0.1Hservice timestamps log dateservice timestamps debug date!aaa authentication login default noneaaa authentication enable default none!interface FastEthernet0/1 switchport mode trunk /该端口默认在VLAN1中!interface F

28、astEthernet0/2switchport pvid 2!interface FastEthernet0/3switchport pvid 3!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10!interface FastEthernet0/11!interface FastE

29、thernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthe

30、rnet0/23!interface FastEthernet0/24!vlan 1-3!46三层交换机所需的主要配置三层交换机所需的主要配置interface FastEthernet0/1 switchport mode trunk!interface VLAN1 ip address 192.168.1.1 255.255.255.0 no ip directed-broadcast!interface VLAN2 ip address 192.168.2.1 255.255.255.0 no ip directed-broadcast!interface VLAN3 ip addres

31、s 192.168.3.1 255.255.255.0 no ip directed-broadcast!vlan 1-347三层交换机所需的详细配置三层交换机所需的详细配置Switch#show runBuilding configuration.Current configuration:!version 2.0.1Hservice timestamps log dateservice timestamps debug date!aaa authentication login default noneaaa authentication enable default none!inter

32、face FastEthernet0/1 switchport mode trunk /该端口默认在VLAN1中!interface FastEthernet0/2!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10!interfac

33、e FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface F

34、astEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface VLAN1 /建立逻辑接口VLAN1,实现各个逻辑接口之间的通信 ip address 192.168.1.1 255.255.255.0 no ip directed-broadcast!interface VLAN2 ip address 192.168.2.1 255.255.255.0 no ip directed-broadcast!interface VLAN3 ip address 192.168.3.1 255.255.

35、255.0 no ip directed-broadcast!vlan 1-3!48PC所需要的配置所需要的配置PC 1 (VLAN 2中的PC)IP Address.:192.168.2.25Subnet Mask.:255.255.255.0Default Gateway.:192.168.2.1PC 2 (VLAN 3中的PC)IP Address.:192.168.3.25Subnet Mask.:255.255.255.0Default Gateway.:192.168.3.149VLAN间路由(间路由(3)使用三层交换机 在三层交换机上建立相应的逻辑接口,VLAN与逻辑接口一一对应

36、使用三层交换机自带的三层路由引擎,就可以实现各个VLAN(逻辑子网)之间的通信了。50配置举例配置举例拓扑结构如图,在三层交换机上划分VLAN 2,VLAN 3,VLAN 4,每个VLAN都是单独的逻辑子网,现要使VLAN 2,VLAN 3,VLAN 4可以互相通信。51三层交换机所需的配置三层交换机所需的配置interface FastEthernet0/2 switchport pvid 2!interface FastEthernet0/3 switchport pvid 3!interface FastEthernet0/4 switchport pvid 4!interface V

37、LAN2 ip address 192.168.2.1 255.255.255.0!interface VLAN3 ip address 192.168.3.1 255.255.255.0!interface VLAN4 ip address 192.168.4.1 255.255.255.0!vlan 1-452三层交换机所需的详细配置三层交换机所需的详细配置Switch_config#show runBuilding configuration.Current configuration:!version 2.0.1Hservice timestamps log dateservice t

38、imestamps debug date!interface FastEthernet0/1!interface FastEthernet0/2 switchport pvid 2!interface FastEthernet0/3 switchport pvid 3!interface FastEthernet0/4 switchport pvid 4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEth

39、ernet0/9!interface FastEthernet0/10!interface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEtherne

40、t0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface VLAN2 /创建VLAN接口 ip address 192.168.2.1 255.255.255.0 /配上IP地址,作为该VLAN中的PC的网关 no ip directed-broadcast!interface VLAN3 ip address 192.168.3.1 255.255.255.0 no ip directed-broadca

41、st!interface VLAN4 ip address 192.168.4.1 255.255.255.0 no ip directed-broadcast!vlan 1-4!53本章学习重点本章学习重点PVLAN54(三)(三)PVLANPC1和PC2可以互相访问,PC3和PC4可以互相访问,但PC1和PC2不可以访问PC3和PC4,但这些PC1/2/3/4都可以访问几台服务器SERVER这样的应用就要使用PVLAN来完成55PVLAN端口介绍端口介绍PVLAN(Private VLAN)中端口扮演三种角色1.Promiscuous(混杂端口)这种端口一般为上联端口,网络出口。这种端口可

42、以和同一PVLAN里面得所有端口互相通讯2.Isolated (孤立端口)这种端口就是孤立端口,一般用于接各个用户。这种端口只能和Promiscuous端口进行通讯。Isolated端口之间不能互相通讯。3.Community (大众端口)这种类型得端口之间可以互相通讯,也可以和Promiscuous端口通讯,但是不能同其他Isolated端口互相通讯,这种端口主要应用同一PVLAN中给那些需要互相通讯得一组用户使用56配置举例配置举例PVLAN 应用一应用一(1)业务VLAN与服务器VLAN之间通信用户在二层交换机上划分了VLAN 2,VLAN 3,VLAN 4;VLAN 2和VLAN 3中

43、是客户机,VLAN 4中是服务器。现要实现所有的VLAN在同一个子网,VLAN 2和VLAN 3之间不能互访,但是VLAN 2和VLAN 3均能访问VLAN 4。57二层交换机所需的配置二层交换机所需的配置interface FastEthernet0/2 switchport mode trunk switchport pvid 2 switchport trunk vlan-allowed 2,4 switchport trunk vlan-untagged 2,4!interface FastEthernet0/3 switchport mode trunk switchport pvi

44、d 3 switchport trunk vlan-allowed 3-4 switchport trunk vlan-untagged 3-4!interface FastEthernet0/4 switchport mode trunk switchport pvid 4 switchport trunk vlan-untagged all!58二层交换机所需的详细配置二层交换机所需的详细配置Switch#show runBuilding configuration.Current configuration:!version 2.0.1Jservice timestamps log da

45、teservice timestamps debug date!no spanning-tree!interface FastEthernet0/1 switchport mode trunk /把这个端口配置成trunk口,使其能够承载多个VLAN流量,至少要承载vlan2和vlan4的流量 switchport pvid 2 switchport trunk vlan-allowed 2,4 /该trunk口可以承载VLAN2和VLAN4的流量,也可以switchport trunk vlan-allowed all switchport trunk vlan-untagged 2,4 /

46、VLAN2和VLAN4的流量数据从这个口出去的时候,把TAG标记去掉,因为大部分的网卡都不识别TAG帧!interface FastEthernet0/2 switchport mode trunk switchport pvid 2 switchport trunk vlan-allowed 2,4 switchport trunk vlan-untagged 2,4!interface FastEthernet0/3 switchport mode trunk switchport pvid 3 switchport trunk vlan-allowed 3-4 switchport tr

47、unk vlan-untagged 3-4!interface FastEthernet0/4 /FastEthernet0/4作为上联口或者连接服务器VLAN switchport mode trunk switchport pvid 4 switchport trunk vlan-untagged all /该口必须要能够承载所有的VLAN流量,并且把所有的TAG标记都去掉!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!inter

48、face FastEthernet0/9!interface FastEthernet0/10!interface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface

49、 FastEthernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!vlan 1-4!59查看查看VLAN配置配置Switch#show vlanVLAN Status Name Ports-1 Static Default F0/1,F0/4,F0/5,F0/6,F0/7,F0/8,F0/9,F0/10,F0/11,F0/12,F0/13,F0/14,F0/15,F0/16,F0/17,F0/18,F0/19,

50、F0/20,F0/21,F0/22,F0/23,F0/242 Static VLAN0002 F0/2,F0/43 Static VLAN0003 F0/3,F0/44 Static VLAN0004 F0/2,F0/3,F0/460配置举例配置举例PVLAN 应用二应用二(2)业务VLAN与上联设备之间进行通信用户在二层交换机上划分了VLAN 2,VLAN 3;VLAN 2和VLAN 3中是客户机。现要实现所有的VLAN在同一个子网,VLAN 2和VLAN 3之间不能互访,但是VLAN 2和VLAN 3均能与路由器通信。61交换机所需的配置交换机所需的配置interface FastEthe

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

当前位置:首页 > 通信/电子 > 数据通信与网络

宁ICP备18001539号-1