文档详情

锐捷交换机配置命令

hs****ma
实名认证
店铺
DOC
38KB
约4页
文档ID:494597192
锐捷交换机配置命令_第1页
1/4

锐捷交换机配置命令交换机基本操作:进入特权模式Switch>enableSwitch#返回用户模式Switch#exitPressRETURNtogetstarted!Switch>配置模式:全局配置模式[主机名(config)#]:配置交换机的整体参数子模式:线路配置模式[主机名(config-line)#]:配置交换机的线路参数接口配置模式[主机名(config-if)#]:配置交换机的接口参数进入、退出全局配置模式Switch#configureterminalSwitch(config)#exitSwitch#进入、退出线路配置模式Switch(config)#lineconsole0Switch(config-line)#exitSwitch(config)#进入、退出接口配置模式Switch(config)#interfacefastEthernet0/1Switch(config-if)#exitSwitch(config)#从子模式下直接返回特权模式Switch(config-if)#endSwitch#交换机操作帮助:支持命令简写(按TAB键将命令补充完整)在每种操作模式下直接输入“?”显示该模式下所有的命令命令空格“?”显示命令参数并对其解释说明“字符?”显示以该字符开头的命令命令历史缓存:(Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令错误提示信息交换机显示命令:显示交换机硬件及软件的信息Switch#showversion显示当前运行的配置参数Switch#showrunning-config显示保存的配置参数Switch#showconfigure常用交换机EXEC命令:1.将当前运行的配置参数复制到flash:Switch#writememoryBuildingconfiguration...2. [OK]Switch#清空flash中的配置参数:Switch#deleteflash:config.textSwitch#交换机重新启动:3. Switch#reloadSystemconfigurationhasbeenmodified.Save?[yes/no]:nProceedwithreload?[confirm]配置交换机主机名:4. Switch(config)#hostnameS2126G-1S2126G-1(config)#配置交换机口令:配置交换机的登陆密码S2126G(config)#enablesecretlevel10star“0”表示输入的是明文形式的口令配置交换机的特权密码S2126G(config)#enablesecretlevel150star“0”表示输入的是明文形式的口令常用交换机配置命令:1、为交换机分配管理IP地址S2126G(config)#interfacevlan1S2126G(config-if)#ipaddress{IPaddress}{IPsubnetmask}[secondary]2、将接口启用S2126G(config-if)#noshutdown3、将接口关闭S2126G(config-if)#shutdown4、配置接口速率S2126G(config-if)#speed[10|100|auto]5、配置接口双工模式S2126G(config-if)#duplex[auto|full|half]显示接口状态:S2126G#showinterface测定目的端的可达性:S2126G>ping{IPaddress}从TFTP服务器下载配置参数:S2126G#copytftpstartup-config管理交换机MAC地址表:1、查看MAC地址表S2126G#showmac-address-table2、配置MAC地址表记录的生存时间(缺省为300秒)S2126G(config)#mac-address-tableaging-time<10-1000000>3、查看MAC地址表记录的生存时间S2126G#showmac-address-tableaging-timeVLAN勺配置:1. 添加一个VLANS2126G(config)#vlan<1-4094>S2126G(config-vlan)#为VLAN命名S2126G(config-vlan)#name名字将交换机端口分配到VLAN配置PortVLANSwitch(config-if)#switchportaccessvlan<1-4094>配置TagVLANSwitch(config-if)#switchportmodetrunk1)配置本地(native)VLANSwitch(config-if)#switchporttrunknativevlan<1-4094>NativeVLAN即PVID,默认情况下每个trunk口的nativeVLAN是1从主干链路中清除VLANSwitch(config-if)#switchporttrunkallowedvlanexceptvlan-list注:VLAN1不可被清除在主干链路中允许所有VLANSwitch(config-if)#switchporttrunkallowedvlanall向主干链路中加入VLANSwitch(config-if)#switchporttrunkallowedvlanaddvlan-listVLAN的验证:显示全部的VLAN:Switch#showvlan显示单独的VLAN:Switch#showvlanid<1-4094>将VLAN信息保存到flash中:Switch#writememory从flash中清除VLAN信息:Switch#deleteflash:vlan.datRSTP的配置:1. 启用生成树:2. S2126G(config)#spanning-tree配置交换机优先级:S2126G(config)#spanning-treepriority<0-61440>3. “0”或“4096”的倍数(RSTPBPDU该值后12bit全0)配置交换机端口优先级:S2126G(config-if)#spanning-treeport-priority<0-240>“0”或“16”的倍数(RSTPBPDU该值后4bit全0)4、生成树hello时间的配置(由Root决定):S2126G(config)#spanning-treehello-time<1-10>5、生成树的验证:Switch#showspanning-treeSwitch#showspanning-treeinterface<接口名称><接口编号>聚合端口的创建:Switch(config)#interfaceaggregateport1创建聚合接口AG1Switch(config-if)#switchportmodetrunk配置并保证AG1为trunk模式Switch(config)#intrangef0/23-24Switch(config-if-range)#port-group1将端口(端口组)划入聚合端口AG1中生成树:Switch(config)#spanning-tree开启生成树协议Switch(config)#spanning-treemodestp指定生成树类型为stp可选模式stp,rstp,mstpSwitch(config)#spanning-treepriority4096设置交换机的优先级为4096,优先级值小为高。

优先级可选值为0,4096,8192,……,为4096的倍数交换机默认值为32768SVI接口配置:Switch(config)#interfacevlan10进入VLAN10的虚拟端口配置模式为VLAN10的虚拟端口配置IP及掩码,二层交换机只能配置一个IP,此IP是作为管理IP使用,例如,使用Telnet的方式登录该IP地址Switch(config-if)#noshutdown启用该端口端口安全:Switch(config)#interfacefastethernet0/1进入一个端口Switch(config-if)#switchportport-security1)配置最大连接数限制开启该端口的安全功能Switch(config-if)#switchportport-secruitymaxmum1配置端口的最大连接数为1,最大连接数为128Switch(config-if)#switchportport-secruityviolationshutdown配置安全违例的处理方式为shutdown,可选为protect(当安全地址数满后,将未知名地址丢弃)、restrict(当违例时,发送一个Trap通知)、shutdown(当违例时将端口关闭,并发送Trap通知,可在全局模式下用errdisablerecovery来恢复)2)IP和MAC地址绑定接口配置模式下配置MAC地址与IP地址进行绑定(MAC地址十六进制a—f用小写字母)三层交换机路由功能:开启三层交换机的路由功能Switch(config)#iprouting开启端口的三层路由功能Switch(config)#interfacefastethernet0/1Switch(config-if)#noswitchport(这样就可以为某一端口配置IP)Switch(config-if)#ipaddressSwitch(config-if)#noshutdown。

下载提示
相似文档
正为您匹配相似的精品文档