《锐捷交换机配置命令》由会员分享,可在线阅读,更多相关《锐捷交换机配置命令(7页珍藏版)》请在金锄头文库上搜索。
1、精心整理锐捷交换机配置命令交换机基本操作:1. 进入特权模式SwitchenableSwitch#2. 返回用户模式Switch#exitPressRETURNtogetstarted!Switch配置模式:全局配置模式主机名(config)#:配置交换机的整体参数 子模式:1. 线路配置模式主机名(config-line)#:配置交换机的线路参数2. 接口配置模式主机名(config-if)#:配置交换机的接口参数1进入、退出全局配置模式Switch#configureterminalSwitch(config)#exitSwitch#2. 进入、退出线路配置模式Switch(config)
2、#lineconsole0Switch(config-line)#exitSwitch(config)#3. 进入、退出接口配置模式Switch(config)#interfacefastEthernet0/1Switch(config-if)#exitSwitch(config)#从子模式下直接返回特权模式Switch(config-if)#endSwitch#精心整理交换机操作帮助:1. 支持命令简写(按 TAB 键将命令补充完整)2. 在每种操作模式下直接输入“?”显示该模式下所有的命令3. 命令空格“?”显示命令参数并对其解释说明4. “字符?”显示以该字符开头的命令5命令历史缓存:(
3、C trl+P )显示上一条命令,(C trl+N )显示下一条命令6. 错误提示信息交换机显示命令:显示交换机硬件及软件的信息Switch#showversion显示当前运行的配置参数Switch#showrunning-config显示保存的配置参数Switch#showconfigure常用交换机EXEC命令:1. 将当前运行的配置参数复制到flash:Switch#writememoryBuildingconfiguration.OKSwitch#2. 清空flash中的配置参数:Switch#deleteflash:config .textSwitch#3交换机重新启动:Switch
4、#reloadSystemconfigurationhasbeenmodified.Save?yes/no:nProceedwithreload?confirm4. 配置交换机主机名:Switch(config)#hostnameS2126G-1S2126G-1(config)#5. 配置交换机口令:1)配置交换机的登陆密码S2126G(config)#enablesecretlevel10star“0”表示输入的是明文形式的口令2)配置交换机的特权密码精心整理S2126G(config)#enablesecretlevel150star “0”表示输入的是明文形式的口令常用交换机配置命令:1
5、、为交换机分配管理 IP 地址S2126G(config)#interfacevlan1S2126G(config-if)#ipaddressIPaddressIPsubnetmasksecondary2、将接口启用S2126G(config-if)#noshutdown3、将接口关闭S2126G(config-if)#shutdown4、配置接口速率S2126G(config-if)#speed10|100|auto5、配置接口双工模式S2126G(config-if)#duplexauto|full|half显示接口状态:S2126G#showinterface测定目的端的可达性:S212
6、6GpingIPaddress从TFTP服务器下载配置参数:S2126G#copytftpstartup-config管理交换机MAC地址表:1、查看MAC地址表S2126G#showmac-address-table2、配置MAC地址表记录的生存时间(缺省为300秒)S2126G(config)#mac-address-tableaging-time3、查看 MAC 地址表记录的生存时间S2126G#showmac-address-tableaging-timeVLAN 的配置:1. 添加一个 VLANS2126G(config)#vlanS2126G(config-vlan)#2. 为 V
7、LAN 命名精心整理S2126G(config-vlan)#name 名字 将交换机端口分配到 VLAN1. 配置 PortVLAN Switch(config-if)#switchportaccessvlan2. 配置 TagVLANSwitch(config-if)#switchportmodetrunk1) 配置本地(na tive)VLANSwitch(config-if)#switchporttrunknativevlanNat iveVLAN 即 PVID,默认情况下每个 trunk 口的 nat iveVLAN 是 12) 从主干链路中清除VLANSwitch(config-if
8、)#switchporttrunkallowedvlanexceptvlan-list 注:VLAN1不可被清除3) 在主干链路中允许所有VLANSwitch(config-if)#switchporttrunkallowedvlanall4) 向主干链路中加入VLANSwitch(config-if)#switchporttrunkallowedvlanaddvlan-listVLAN的验证:1. 显示全部的 VLAN: Switch#showvlan2. 显示单独的 VLAN: Switch#showvlanid将VLAN信息保存到flash中:Switch#writememory从fla
9、sh中清除VLAN信息:Switch#deleteflash:vlan.datRSTP的配置:1. 启用生成树:S2126G(config)#spanning-tree2. 配置交换机优先级:S2126G(config)#spanning-treepriority“0” 或“4096” 的倍数(RSTPBPDU 该值后 12bit 全 0)3. 配置交换机端口优先级:S2126G(config-if)#spanning-treeport-priority“0”或“ 16”的倍数(RSTPBPDU该值后4bit全0)精心整理4、生成树 hello 时间的配置(由 Root 决定): S2126G
10、(config)#spanning-treehello-time5、生成树的验证:Switch#showspanning-treeSwit ch#showspanning-t reei nt erface 接口名称接口编号聚合端口的创建:Switch(config)#interfaceaggregateport1 创建聚合接口 AG1Switch(configif)#switchportmodetrunk 配置并保证 AG1 为 trunk 模式 Switch(config)#intrangef0/23-24Switch(config-if-range)#port-groupl 将端口(端口组
11、)划入聚合端口 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 的虚拟端口配置模式Switch该IP地址Switch(
12、config-if)#noshutdown 启用该端口端口安全:Swit ch(config)#i nt erfacefas tet herne t0/1 进入一个端口Switch(config-if)#switchportport-security 开启该端口的安全功能1) 配置最大连接数限制Switch(config-if)#switchportport-secruitymaxmum1 配置端口的最大连接数为 1,最大连接数为128Switch(config-if)#switchportport-secruityviolationshutdown配置安全违例的处理方式为shutdown,可
13、选为protect (当安全地址数满后,将未知名地址丢弃)、 res trie t(当违例时,发送一个Trap通知)、shu tdown (当违例时将端口关闭,并发送Trap通知, 可在全局模式下用 errdisablerecovery 来恢复)2) IP和MAC地址绑定Switch与IP地址十六进制a-f用小写字母)精心整理 三层交换机路由功能:1)开启三层交换机的路由功能Switch(config)#iprouting2)开启端口的三层路由功能Switch(config)#interfacefastethernet0/1Switch(config-if)#noswitchport (这样就可以为某一端口配置 IP)SwitchSwitch(config-if)#noshutdown