锐捷交换机基本配置命令

合集下载

(完整版)锐捷交换机命令大全

(完整版)锐捷交换机命令大全

【第一部分】交换机支持的命令:1.交换机基本状态:switch: ;ROM状态,路由器是rommon>hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态2.交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xxswitch#exit ;返回命令3.交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2 switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain;设置发vtp域名switch(config)#vtp password;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式4.交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address;设置IP地址switch(config)#ip default-gateway;设置默认网关switch#dir flash: ;查看闪存5.交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息【第二部分】路由器支持的命令:1.路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动2.路由器口令设置:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xx router(config)#(Ctrl+z) ;返回特权模式router#exit ;返回命令3.路由器配置:router(config)#int s0/0 ;进入Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address;设置IP地址router(config-if)#ip address second ;设置第二个IProuter(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address;设置子接口IProuter(config-subif.1)#encapsulation dot1q;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导4.路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftprouter#copy startup-config tftp ;开机配置存到tftprouter#copy tftp flash: ;下传文件到flashrouter#copy tftp startup-config;下载配置文件ROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置文件rommon>confreg 0x2102 ;恢复配置文件rommon>reset;重新引导rommon>copy xmodem: flash: ;从console传输文件rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP rommon>TFTP_FILE=c2600.bin ;指定下载的文件rommon>tftpdnld ;从tftp下载rommon>dir flash: ;查看闪存内容rommon>boot ;引导IOS5.静态路由:ip route;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例6.动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协议。

锐捷交换机配置命令

锐捷交换机配置命令

锐捷交换机配置命令交换机基本操作1.进入特权模式Switch>enableSwitch#2.返回用户模式Switch#exitPress RETURN to get started!Switch>配置模式:全局配置模式[主机名(config)#]:配置交换机的整体参数子模式:1.线路配置模式[主机名(config-line)#]:配置交换机的线路参数2.接口配置模式[主机名(config-if)#]:配置交换机的接口参数1.进入全局配置模式下Switch#configure terminalSwitch(config)#exitSwitch#2.进入线路配置模式Switch(config)#line console 0Switch(config-line)#exitSwitch(config)#3.进入接口配置模式Switch(config)#interface fastEthernet 0/1Switch(config-if)#exitSwitch(config)#从子模式下直接返回特权模式Switch(config-if)#endSwitch#交换机操作帮助特点:1.支持命令简写(按TAB键将命令补充完整)2.在每种操作模式下直接输入“?”显示该模式下所有的命令3.命令空格“?”显示命令参数并对其解释说明4.字符“?”显示以该字符开头的命令5.命令历史缓存: (Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令6.错误提示信息交换机显示命令:显示交换机硬件及软件的信息Switch#show version显示当前运行的配置参数Switch#show running-config显示保存的配置参数Switch#show configure常用交换机EXEC命令将当前运行的配置参数复制到flash:Switch#write memory Building configuration...[OK]Switch#清空flash中的配置参数:Switch#delete flash:config.textSwitch#交换机重新启动:Switch#reloadSystem configuration has been modified. Save? [yes/no]:nProceed with reload? [confirm]配置交换机主机名:Switch(config)#hostname S2126GS2126G(config)#配置交换机口令:1、配置交换机的登陆密码S2126G(config)#enable secret level 1 0 star“0”表示输入的是明文形式的口令2、配置交换机的特权密码S2126G(config)#enable secret level 15 0 Star“0”表示输入的是明文形式的口令常用交换机配置命令:1、为交换机分配管理IP地址S2126G(config)#interface vlan 1S2126G(config-if)#ip address {IP address} {IP subnetmask}[secondary] 2、将接口启用S2126G(config-if)#no shutdown3、将接口关闭S2126G(config-if)#shutdown4、配置接口速率S2126G(config-if)#speed [10|100|auto]5、配置接口双工模式S2126G(config-if)#duplex [auto|full|half显示接口状态:S2126G#show interfaces测定目的端的可达性:S2126G>ping {IP address}从TFTP服务器下载配置参数:S2126G#copy tftp startup-config管理交换机MAC地址表:1、查看MAC地址表S2126G#show mac-address-table2、配置MAC地址表记录的生存时间(缺省为300秒)S2126G(config)#mac-address-table aging-time <10-1000000>3、查看MAC地址表记录的生存时间S2126G#show mac-address-table aging-timeVLAN的配置:1.添加一个VLANS2126G(config)#vlan <1-4094>S2126G(config-vlan)#2.为VLAN命名(可选)S2126G(config-vlan)#name将交换机端口分配到VLAN1.配置Port VLANSwitch(config-if)#switchport access vlan <1-4094>2.配置Tag VLANSwitch(config-if)#switchport mode trunk1).配置本地(native)VLANSwitch(config-if)#switchport trunk native vlan <1-4094>2).从主干链路中清除VLANSwitch(config-if)#switchport trunk allowed vlan except注:VLAN1不可被清除VLAN的验证:1.显示全部的VLAN:Switch#show vlan2.显示单独的VLAN :Switch#show vlan id <1-4094>将VLAN信息保存到flash中:Switch#write memory从flash中清除VLAN信息:Switch#delete flash:vlan.datRSTP的配置:1.启用生成树:S2126G(config)#spanning-tree2.配置交换机优先级:S2126G(config)#spanning-tree priority <0-61440>“0”或“4096”的倍数(RSTP BPDU该值后12bit全0)3.配置交换机端口优先级:S2126G(config-if)#spanning-tree port-priority <0-240>“0”或“16”的倍数(RSTP BPDU该值后4bit全0)4、生成树hello时间的配置(由Root决定):S2126G(config)#spanning-tree hello-time <1-10>5、生成树的验证:Switch#show spanning-treeSwitch#show spanning-tree interface <接口名称> <接口编号>以上用于锐捷交换机的。

锐捷交换机常用配置命令

锐捷交换机常用配置命令

锐捷交换机常用配置命令TYYGROUP system office room 【TYYUA16H-TYY-TYYYUA8Q8-一、交换机配置模式介绍.........................................二、交换机基本配置.............................................接口介质类型配置.........................................................接口速度/双工配置........................................................VLAN配置................................................................端口镜像.................................................................端口聚合.................................................................交换机堆叠...............................................................ACL配置.................................................................端口安全.................................................................交换机防攻击配置.........................................................DHCP配置................................................................三层交换机配置...........................................................三、交换机常用查看命令.........................................一、交换机配置模式介绍交换机配置模式主要有:用户模式:此模式只可以简单的查看一些交换机的配置和一些简单的修改。

锐捷交换机常用配置命令

锐捷交换机常用配置命令

一、交换机配置模式介绍交换机配置模式主要有:用户模式:此模式只可以简单的查看一些交换机的配置和一些简单的修改。

Switch>特权模式:此模式可以查看一些交换机的配置,后面讲述的很多show命令便是在此模式下进行的,还可以对一些简单的设置配置,例如时间。

Switch> enable 1F1000M2126G50G2150G2150G2150G800.073c800.073c800.073c800.073c800.073c2126G0.0.00.0.01.1.10.0.00.0.0S* 0.0.0Switch#S代表是静态路由,C代表是直连路由。

三、交换机常用查看命令show cpu //查看CPU利用率switch #show cpuCPU utilization for five seconds: 3%CPU utilization for one minute : 6%CPU utilization for five minutes: 6%如果CPU利用率偏高,就要考虑网络中是否有攻击或者网络设备是否能胜任当前的网络负载。

一般来说,CPU超过30%就不正常了。

show clock //查看交换机时钟switch #show clockSystem clock : 2007-3-18 10:29:14 Sundayshow logging //查看交换机日志switch #show loggingSyslog logging: EnabledConsole logging: Enabled(debugging)Monitor logging: DisabledBuffer logging: Enabled(debugging)Server logging severity: debuggingFile logging: Disabled注意,日志前面都有时间,但交换机的时钟往往和生活中的时钟对不上,这时需要我们使用show clock 查看交换机时钟,进而推断日志发生的时间,便于发现问题。

锐捷交换机典型配置指令

锐捷交换机典型配置指令

一、密码设置Ruijie> enableRuijie#configuration terminalRuijie(config)# enable password密码Ruijie(config)# line console 0Ruijie(config-line)# password密码Ruijie(config-line)# loginRuijie(config)# line vty 0 4Ruijie(config-line)# password 密码Ruijie(config-line)# login二、设备命名、接口命名、VLAN命名Ruijie> enableRuijie# configuration terminalRuijie(config)# hostname名字Ruijie(config)# interface fastethernet 0/1Ruijie(config-if)# description 接口描述内容Ruijie(config)# vlan vlan编号Ruijie(config-vlan)#name名字二、POE供电的配置及查看Ruijie> enableRuijie# configuration terminalRuijie(config)# interface fastethernet 0/1Ruijie(config-if)# poe enableRuijie(config)# interface range fastethernet 0/1 - 24Ruijie(config- if -range)# poe enableRuijie# show poe interface 接口编号Ruijie# show poe powersupply三、接口模式设置、速率、双工、光电模式转换Ruijie# configuration terminalRuijie(config)# interface fastethernet 0/1Ruijie(config-if)# medium-type { fiber | copper } Ruijie(config-if)# speed {10 | 100 | 1000 | auto } Ruijie(config-if)# duplex {auto | full | half }四、设备配置保存、备份、删除、重启Ruijie> enableRuijie# writeRuijie# copy flash:/config.text xmodemRuijie# delete config.textRuijie# reload五、设备管理IP及SNMP团体属性配置Ruijie# configuration terminalRuijie(config)# interface vlan 管理vlan编号Ruijie(config-if)# ip address ip地址子网掩码Ruijie(config)# snmp community string ro六、基于时间的访问控制列表Ruijie> enableRuijie# clock set hh:mm:ss month day yearRuijie# configuration terminalRuijie(config)# ntp server x.x.x.xRuijie(config)# time-range time-range-nameRuijie(config-time-range)# periodic weekdays 8:00 to 18:00Ruijie(config)# ip access-list extended 100Ruijie(config-ext-nacl)# permit ip any any time-range time-range-name Ruijie(config)# interface gigabitEthernet 0/1Ruijie(config-if)# ip access-group 100 in。

锐捷交换机常用配置命令详解

锐捷交换机常用配置命令详解
方式二:XMODEM的升级方式
交换机升级
*
方式二:XMODEM的升级方式 要升级的软件版本与当前运行版本有一定的要求时,可以通过XMODEM方式来进行升级。 步骤:主机的配置接口和PC机的串口相连接,并把超级终端速率设置为57600重新启动交换机后不断按ESC键,直到出现以下界面 TOOLS MENU ***************************************************** ******* 1 -- Download ****** ******* 2 -- Upload ****** ******* 3 -- File Info ****** ******* 4 -- Delete File ****** ******* 5 -- Rename File ****** ******* 6 -- Run Main File ****** ******* 7 -- Format Flash ****** ******* 8 -- Defrag Flash ****** ******* 9 -- download all files(DHCP + TFTP)****** ***************************************************** Input command:
*
锐捷网络使用培训
BRAND PLANING
内部材料
*
培训内容
CONTENTS
01
交换机的配置命令
03
GSN相关配置
02
SAM相关配置
交换机的配置培训
*
交换机的密码配置
如何清除密码
交换机的VLAN配置
交换机升级
交换机防病毒访问控制列表

锐捷交换机命令大全

锐捷交换机命令大全

[第一部分]交换机支持的命令:1.交换机基本状态:switch: ;ROM状态,路由器是rommon>hostname> ;用户模式hostname# ;特权模式hostname<config># ;全局配置模式hostname<config-if># ;接口状态2.交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch<config>#hostname;设置交换机的主机名switch<config>#enable secret xxx ;设置特权加密口令switch<config>#enable password xxa ;设置特权非密口令switch<config>#line console 0 ;进入控制台口switch<config-line>#line vty 0 4 ;进入虚拟终端switch<config-line>#login ;允许登录switch<config-line>#password xx ;设置登录口令xxswitch#exit ;返回命令3.交换机VLAN设置:switch#vlan database ;进入VLAN设置switch<vlan>#vlan 2 ;建VLAN 2switch<vlan>#no vlan 2 ;删vlan 2switch<config>#int f0/1 ;进入端口1switch<config-if>#switchport access vlan 2 ;当前端口加入vlan 2switch<config-if>#switchport mode trunk ;设置为干线switch<config-if>#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch<config-if>#switchport trunk encap dot1q ;设置vlan 中继switch<config>#vtp domain;设置发vtp域名switch<config>#vtp password;设置发vtp密码switch<config>#vtp mode server ;设置发vtp模式switch<config>#vtp mode client ;设置发vtp模式4.交换机设置IP地址:switch<config>#interface vlan 1 ;进入vlan 1switch<config-if>#ip address;设置IP地址switch<config>#ip default-gateway;设置默认网关switch#dir flash: ;查看闪存5.交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息[第二部分]路由器支持的命令:1.路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动2.路由器口令设置:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router<config>#hostname;设置交换机的主机名router<config>#enable secret xxx ;设置特权加密口令router<config>#enable password xxb ;设置特权非密口令router<config>#line console 0 ;进入控制台口router<config-line>#line vty 0 4 ;进入虚拟终端router<config-line>#login ;要求口令验证router<config-line>#password xx ;设置登录口令xx router<config>#<Ctrl+z> ;返回特权模式router#exit ;返回命令3.路由器配置:router<config>#int s0/0 ;进入Serail接口router<config-if>#no shutdown ;激活当前接口router<config-if>#clock rate 64000 ;设置同步时钟router<config-if>#ip address;设置IP地址router<config-if>#ip addresssecond ;设置第二个IP router<config-if>#int f0/0.1 ;进入子接口router<config-subif.1>#ip address;设置子接口IProuter<config-subif.1>#encapsulation dot1q;绑定vlan中继协议router<config>#config-register 0x2142 ;跳过配置文件router<config>#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导4.路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftprouter#copy startup-config tftp ;开机配置存到tftprouter#copy tftp flash: ;下传文件到flashrouter#copy tftp startup-config;下载配置文件ROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置文件rommon>confreg 0x2102 ;恢复配置文件rommon>reset;重新引导rommon>copy xmodem: flash: ;从console传输文件rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IPrommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IPrommon>TFTP_FILE=c2600.bin ;指定下载的文件rommon>tftpdnld ;从tftp下载rommon>dir flash: ;查看闪存内容rommon>boot ;引导IOS5.静态路由:ip route;命令格式router<config>#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例router<config>#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例6.动态路由:router<config>#ip routing ;启动路由转发router<config>#router rip ;启动RIP路由协议.router<config-router>#network;设置发布路由router<config-router>#negihbor;点对点帧中继用.7.帧中继命令:router<config>#frame-relay switching ;使能帧中继交换router<config-s0>#encapsulation frame-relay ;使能帧中继router<config-s0>#fram-relay lmi-type cisco ;设置管理类型router<config-s0>#frame-relay intf-type DCE ;设置为DCE router<config-s0>#frame-relay dlci 16 ;router<config-s0>#frame-relay local-dlci 20 ;设置虚电路号router<config-s0>#frame-relay interface-dlci 16 ;router<config>#log-adjacency-changes ;记录邻接变化router<config>#int s0/0.1 point-to-point ;设置子接口点对点router#show frame pvc ;显示永久虚电路router#show frame map ;显示映射8.基本访问控制列表:router<config>#access-listpermit|denyrouter<config>#interface;default:deny anyrouter<config-if>#ip access-groupin|out ;defaultut例1:router<config>#access-list 4 permit 10.8.1.1router<config>#access-list 4 deny 10.8.1.0 0.0.0.255router<config>#access-list 4 permit 10.8.0.0 0.0.255.255 router<config>#access-list 4 deny 10.0.0.0 0.255.255.255 router<config>#access-list 4 permit anyrouter<config>#int f0/0router<config-if>#ip access-group 4 in9.扩展访问控制列表:access-listpermit|deny icmp[type]access-listpermit|deny tcp[port]例3:router<config>#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echorouter<config>#access-list 101 permit ip any anyrouter<config>#int s0/0router<config-if>#ip access-group 101 in例3:router<config>#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80router<config>#access-list 102 permit ip any anyrouter<config>#interface s0/1router<config-if>#ip access-group 102 out10.删除访问控制例表:router<config>#no access-list 102router<config-if>#no ip access-group 101 in11.路由器的nat配置Router<config-if>#ip nat inside ;当前接口指定为内部接口Router<config-if>#ip nat outside ;当前接口指定为外部接口Router<config>#ip nat inside source static [p] [port]Router<config>#ip nat inside source static 10.65.1.2 60.1.1.1Router<config>#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80Router<config>#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0Router<config>#ip nat inside source list 1 pool p1Router<config>#ip nat inside destination list 2 pool p2Router<config>#ip nat inside source list 2 interface s0/0 overloadRouter<config>#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotaryRouter#show ip nat translationrotary 参数是轮流的意思,地址池中的IP轮流与NAT分配的地址匹配.overload参数用于PAT 将内部IP映射到一个公网IP不同的端口上.12.外部网关协议配置:routerA<config>#router bgp 100routerA<config-router>#network 19.0.0.0routerA<config-router>#neighbor 8.1.1.2 remote-as 20013.配置PPP验证:RouterA<config>#usernamepasswordRouterA<config>#int s0RouterA<config-if>#ppp authentication {chap|pap}[第三部分]PIX防火墙命令Pix525<config>#nameif ethernet0 outside security0 ;命名接口和级别Pix525<config>#interface ethernet0 auto ;设置接口方式Pix525<config>#interface ethernet1 100full ;设置接口方式Pix525<config>#interface ethernet1 100full shutdownPix525<config>#ip address inside 192.168.0.1 255.255.255.0Pix525<config>#ip address outside 133.0.0.1 255.255.255.252Pix525<config>#global <if_name> natid ip-ip ;定义公网IP区间Pix525<config>#global <outside> 1 7.0.0.1-7.0.0.15 ;例句Pix525<config>#global <outside> 1 133.0.0.1 ;例句Pix525<config>#no global <outside> 1 133.0.0.1 ;去掉设置Pix525<config>#nat <if_name> nat_id local_ip [netmark]Pix525<config>#nat <inside> 1 0 0内网所有主机<0代表0.0.0.0>可以访问global 1指定的外网.Pix525<config>#nat <inside> 1 172.16.5.0 255.255.0.0内网网段的主机可以访问global 1指定的外网.Pix525<config>#route if_name 0 0 gateway_ip [metric] ;命令格式Pix525<config>#route outside 0 0 133.0.0.1 1 ;例句Pix525<config>#route inside 10.1.0.0 255.255.0.0 10.8.0.1 1 ;例句Pix525<config>#static <inside, outside> 133.0.0.1 192.168.0.8表示内部ip地址,访问外部时被翻译成全局地址.Pix525<config>#static <dmz, outside> 133.0.0.1 172.16.0.8中间区域ip地址,访问外部时被翻译成全局地址.。

锐捷交换机配置命令

锐捷交换机配置命令
#erase startup-config 删除配置文件(2500系列路由器)
#del flash:vlan.dat 删除Vlan配置信息(交换机)
#Configure terminal 进入全局配置模式
(config)# hostname switchA 配置设备名称为switchA
Level 1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密
(config)#enable services web-server 开启交换机WEB管理功能
Services 可选以下:web-server(WEB管理)、telnet-server(远程登陆)等
从TFTP服务器下载配置参数:S2126G#copy tftp startup-config
管理交换机MAC地址表:
1、查看MAC地址表
S2126G#show mac-address-table
2、配置MAC地址表记录的生存时间(缺省为300秒)
S2126G(config)#mac-address-table aging-time <10-1000000>
S2126G(config-vlan)#name
将交换机端口分配到VLAN
1.配置Port VLAN
Switch(config-if)#switchport access vlan <1-4094>
2.配置Tag VLAN
Switch(config-if)#switchport mode trunk
1).配置本地(native)VLAN
Switch(config-if)#switchport trunk native vlan <1-4094>
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

交换机基本操作
1.进入特权模式
Switch>enable
Switch#
2.返回用户模式
Switch#exit
Press RETURN to get started!
Switch>
配置模式:
全局配置模式[主机名(config)#]:配置交换机的整体参数
子模式:
1.线路配置模式[主机名(config-line)#]:配置交换机的线路参数
2.接口配置模式[主机名(config-if)#]:配置交换机的接口参数
1.进入全局配置模式下
Switch#configure terminal
Switch(config)#exit
Switch#
2.进入线路配置模式
Switch(config)#line console 0
Switch(config-line)#exit
Switch(config)#
3.进入接口配置模式
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#exit
Switch(config)#
从子模式下直接返回特权模式
Switch(config-if)#end
Switch#
交换机操作帮助特点:
1.支持命令简写(按TAB键将命令补充完整)
2.在每种操作模式下直接输入“?”显示该模式下所有的命令
3.命令空格“?”显示命令参数并对其解释说明
4.字符“?”显示以该字符开头的命令
5.命令历史缓存: (Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令
6.错误提示信息
交换机显示命令:
显示交换机硬件及软件的信息Switch#show version
显示当前运行的配置参数Switch#show running-config
显示保存的配置参数Switch#show configure
常用交换机EXEC命令
将当前运行的配置参数复制到flash:Switch#write memory Building configuration...
[OK]
Switch#
清空flash中的配置参数:Switch#delete flash:config.text
Switch#
交换机重新启动:Switch#reload
System configuration has been modified. Save? [yes/no]:n
Proceed with reload? [confirm]
配置交换机主机名:Switch(config)#hostname S2126G
S2126G(config)#
配置交换机口令:
1、配置交换机的登陆密码
S2126G(config)#enable secret level 1 0 star
“0”表示输入的是明文形式的口令
2、配置交换机的特权密码
S2126G(config)#enable secret level 15 0 Star
“0”表示输入的是明文形式的口令
常用交换机配置命令:
1、为交换机分配管理IP地址
S2126G(config)#interface vlan 1
S2126G(config-if)#ip address {IP address} {IP subnetmask}[secondary] 2、将接口启用
S2126G(config-if)#no shutdown
3、将接口关闭
S2126G(config-if)#shutdown
4、配置接口速率
S2126G(config-if)#speed [10|100|auto]
5、配置接口双工模式
S2126G(config-if)#duplex [auto|full|half
显示接口状态:S2126G#show interfaces
测定目的端的可达性:S2126G>ping {IP address}
从TFTP服务器下载配置参数:S2126G#copy tftp startup-config
管理交换机MAC地址表:
1、查看MAC地址表
S2126G#show mac-address-table
2、配置MAC地址表记录的生存时间(缺省为300秒)
S2126G(config)#mac-address-table aging-time <10-1000000>
3、查看MAC地址表记录的生存时间
S2126G#show mac-address-table aging-time
VLAN的配置:
1.添加一个VLAN
S2126G(config)#vlan <1-4094>
S2126G(config-vlan)#
2.为VLAN命名(可选)
S2126G(config-vlan)#name
将交换机端口分配到VLAN
1.配置Port VLAN
Switch(config-if)#switchport access vlan <1-4094>
2.配置Tag VLAN
Switch(config-if)#switchport mode trunk
1).配置本地(native)VLAN
Switch(config-if)#switchport trunk native vlan <1-4094>
2).从主干链路中清除VLAN
Switch(config-if)#switchport trunk allowed vlan except
注:VLAN1不可被清除
VLAN的验证:
1.显示全部的VLAN:Switch#show vlan
2.显示单独的VLAN :Switch#show vlan id <1-4094>
将VLAN信息保存到flash中:Switch#write memory
从flash中清除VLAN信息:Switch#delete flash:vlan.dat
RSTP的配置:
1.启用生成树:S2126G(config)#spanning-tree
2.配置交换机优先级:S2126G(config)#spanning-tree priority <0-61440>
“0”或“4096”的倍数(RSTP BPDU该值后12bit全0)
3.配置交换机端口优先级:S2126G(config-if)#spanning-tree port-priority <0-240>
“0”或“16”的倍数(RSTP BPDU该值后4bit全0)
4、生成树hello时间的配置(由Root决定):S2126G(config)#spanning-tree hello-time <1-10>
5、生成树的验证:Switch#show spanning-tree
Switch#show spanning-tree interface <接口名称> <接口编号>
以上用于锐捷交换机的。

相关文档
最新文档