锐捷 CISCO 交换机配置命令
锐捷-.Cisco配置

实验拓扑图疑问1、锐捷交换机不支持VTP(server/client),需要手动逐个划分VLAN,划分的需逐个划分,不能连续划分,不然划分不到交换机上,例如:SW-A>enableSW-A#conf tSW-A(config)#vlan 10SW-A(config-vlan)#exitSW-A(config)#vlan 20SW-A(config-vlan)#exit错误划分(Cisco可以这样划分):SW-A>enableSW-A#conf tSW-A(config)#vlan 10SW-A(config-vlan)#vlan 20SW-A(config-vlan)#vlan 30SW-A(config-vlan)#------------------------------------------如果这样划分,交换机上面是没划分成功的,只是划分一个VLAN而已2,锐捷路由接口进入方法和Cisco区别SW-A>enableSW-A#configure terminalSW-A(config)#interface range fastEthernet 0/1 - 4 (锐捷只能支持这样)SW-A(config-if-range)#exitSW-A(config)#interface range fastEthernet0/1 - 4 (连接和不连接)SW-A(config-if-range)#3,锐捷端口聚合只有一种enableconf tinterface range f 0/1 - 4 ((例如做1-4的端口汇聚) )port-group 1exitinterface aggregateport 1(aggregateport就是这个汇聚的端口,要是配truck也要在aggregateport上配一变)switchport mode trunk4.锐捷路由器串口连接性问题,如果串口UP起来,但协议不UP起来,可能是串口不紧,不然就是封装(encapsulation)的问题5、三层做DHCP服务器,需要开启DHCP服务enableconf tserver-dhcp (开启DHCP服务)ip dhcp pool vlan106、生成树协议默认是没开的,需要开enableconf tspanning-tree (启用生成树协议)spanning-tree mode rstp (启用快速生成树协议)spanning-tree mst 0 priority 8192 (只能使用8192倍数)7、时间ACLenableconf ttime-range no-http (创建一个名为no-http的时间ACL)periodic weekdays 8:00 to 18:00 (周期为周一到周五8点到16点)exitip access-list extended limit_udp (创建一个名为limit_udp的扩展ACL)deny tcp any any eq www time-range no-http (禁止tcp所有主机访问www)int f0/1ip access-list limit_udp in查看命令:show time-range8、锐捷tftp前提:主机和路由同网段,能够互通,设置TFTP软件保存路径查看FLASH内文件:show flash复制FLASH内文件:copy flash:config.txt tftp9、锐捷3760聚合口aggregateport配置IP问题需要先配置三层AP,配置过程如下S3250# confS3250(config)# int aggretegateport 1S3250(config-if)# no switchportS3250(config-if)# ip address 192.168.100.1 255.255.255.0 S3250(config-if)# end再进入到接口下配置:S3250(config)#int r f 0/2-3S3250(config-if-range)#no switchportS3250(config-if-range)#port-group 1S3250(config-if-range)#end10、根据上图,如果SW1、SW2、RT1宣告OSPF,SW1、SW2、RT1在路由表上无法形成邻居,主要问题是SW2和SW3之间的F0/3口线插不进(松动) 或网线有问题,测试所有网线都是用直通线,也有可能是RT1和SW2之间网线有问题,今晚测试后问题是前者的问题!11、VRRP和DHCP测试没问题12、时间ACL放在SW2上13、ip nat inside source static 192.168.200.1 202.200.118.2公网主机ping 202.200.118.2 无法ping通,是因为2020.200.118.2 已经被192.168.200.1 映射出去了14、锐捷二层telnet问题解决配置过程:Switch>enableSwitch#configure terminal !进入全局配置模式Switch(config)#enable services telnet-service 开启交换机远程登录服务,默认已开启Switch(config)#enable secret level 1 0 earth 配置远程登陆密码(其中telnet的level为1,0代表不加密的密码。
锐捷网络交换机的配置命令集

锐捷网络交换机的配置命令集交换机>Enable 进入特权模式#Exit 返回上一级操作模式#End 返回到特权模式#write memory 或copy running-config startup-config 保存配置文件#del flash:config.text 删除配置文件(交换机及1700系列路由器)#erase startup-config 删除配置文件(2500系列路由器)#del flash:vlan.dat 删除Vlan配置信息(交换机)#Configure terminal 进入全局配置模式(config)# hostname switchA配置设备名称为switchA(config)#banner motd & 配置每日提示信息&为终止符(config)#enable secret level 1 0 star 配置远程登陆密码为star(config)#enable secret level 15 0 star 配置特权密码为starLevel 1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密(config)#enable services web-server 开启交换机WEB管理功能Services 可选以下:web-server(WEB管理)、telnet-server(远程登陆)等查看信息#show running-config 查看当前生效的配置信息#show interface fastethernet 0/3 查看F0/3端口信息#show interface serial 1/2 查看S1/2端口信息#show interface 查看所有端口信息#show ip interface brief 以简洁方式汇总查看所有端口信息#show ip interface 查看所有端口信息#show version 查看版本信息#show mac-address-table 查看交换机当前MAC地址表信息#show running-config 查看当前生效的配置信息#show vlan 查看所有VLAN信息#show vlan id 10 查看某一VLAN (如VLAN10)的信息#show interface fastethernet 0/1 switchport 查看某一端口模式(如F 0/1)#show aggregateport 1 summary 查看聚合端口AG1的信息#show spanning-tree 查看生成树配置信息#show spanning-tree interface fastethernet 0/1 查看该端口的生成树状态#show port-security 查看交换机的端口安全配置信息#show port-security address 查看地址安全绑定配置信息#show ip access-lists listname 查看名为listname的列表的配置信息#show access-lists端口的基本配置(config)#Interface fastethernet 0/3 进入F0/3的端口配置模式(config)#interface range fa 0/1-2,0/5,0/7-9 进入F0/1、F0/2、F0/5、F0/7、F0/8、F0/9的端口配置模式(config-if)#speed 10 配置端口速率为10M,可选10,100,auto(config-if)#duplex full 配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应)(config-if)#no shutdown 开启该端口(config-if)#switchport access vlan 10 将该端口划入VLAN10中,用于VLAN(config-if)#switchport mode trunk 将该端口设为trunk模式,用于Tag vlan可选模式为access , trunk(config-if)#port-group 1 将该端口划入聚合端口AG1中,用于聚合端口聚合端口的创建(config)# interface aggregateport 1 创建聚合接口AG1(config-if)# switchport mode trunk 配置并保证AG1为trunk 模式(config)#int f0/23-24(config-if-range)#port-group 1 将端口(端口组)划入聚合端口AG1中生成树(config)#spanning-tree 开启生成树协议(config)#spanning-tree mode stp 指定生成树类型为stp可选模式stp , rstp , mstp(config)#spanning-tree priority 4096 设置交换机的优先级为4096 , 优先级值小为高。
锐捷交换机配置命令

锐捷交换机配置命令交换机基本操作: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命令:1.将当前运行的配置参数复制到flash:Switch#write memoryBuilding configuration...[OK]Switch#2.清空flash中的配置参数:Switch#delete flash:config.textSwitch#3.交换机重新启动:Switch#reloadSystem configuration has been modified. Save? [yes/no]:n Proceed with reload? [confirm]4.配置交换机主机名:Switch(config)#hostname S2126G-1S2126G-1(config)#5.配置交换机口令: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 interface测定目的端的可达性: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>Native VLAN即PVID,默认情况下每个trunk口的native VLAN 是12)从主干链路中清除VLANSwitch(config-if)#switchport trunk allowed vlan except vlan-list 注:VLAN1不可被清除3)在主干链路中允许所有VLANSwitch(config-if)#switchport trunk allowed vlan all4)向主干链路中加入VLANSwitch(config-if)#switchport trunk allowed vlan add vlan-list 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 <接口名称> <接口编号>聚合端口的创建:Switch(config)# interface aggregateport 1 创建聚合接口AG1Switch(config-if)# switchport mode trunk 配置并保证AG1为 trunk 模式Switch(config)#int range f0/23-24Switch(config-if-range)#port-group 1 将端口(端口组)划入聚合端口AG1中生成树:Switch(config)#spanning-tree 开启生成树协议Switch(config)#spanning-tree mode stp 指定生成树类型为stp可选模式stp , rstp , mstpSwitch(config)#spanning-tree priority 4096 设置交换机的优先级为4096 , 优先级值小为高。
锐捷交换机配置命令

锐捷交换机配置命令交换机基本操作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 <接口名称> <接口编号>以上用于锐捷交换机的。
锐捷网络交换机简单配置命令

锐捷网络交换机配置命令交换机:>Enable进入特权模式#Exit返回上一级操作模式#End返回到特权模式#write memory或copy running-config startup-config 保存配置文件#del flash:config.text删除配置文件(交换机及1700系列路由器)#erase startup-config删除配置文件(2500系列路由器)#del flash:vlan.dat删除Vlan配置信息(交换机)#Configure terminal进入全局配置模式(config)# hostname switchA配置设备名称为switchA(config)#banner motd &配置每日提示信息&为终止符(config)#enable secret level 1 0 star 配置远程登陆密码为star(config)#enable secret level 15 0 star配置特权密码为starLevel 1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密(config)#enable services web-server开启交换机WEB管理功能Services可选以下:web-server(WEB管理)、telnet-server(远程登陆)等查看信息:#show running-config查看当前生效的配置信息#show interface fastethernet 0/3查看F0/3端口信息#show interface serial 1/2查看S1/2端口信息#show interface查看所有端口信息#show ip interface brief以简洁方式汇总查看所有端口信息#show ip interface查看所有端口信息#show version查看版本信息#show mac-address-table查看交换机当前MAC地址表信息#show running-config查看当前生效的配置信息#show vlan查看所有VLAN信息#show vlan id 10查看某一VLAN (如VLAN10)的信息#show interface fastethernet 0/1 switchport 查看某一端口模式(如F 0/1)#show aggregateport 1 summary查看聚合端口AG1的信息#show spanning-tree查看生成树配置信息#show spanning-tree interface fastethernet0/1查看该端口的生成树状态#show port-security查看交换机的端口安全配置信息#show port-security address查看地址安全绑定配置信息#show ip access-lists listname 查看名为listname的列表的配置信息。
锐捷交换机常用配置命令详解

交换机升级
*
方式二: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 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 1 switch(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: ;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、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
锐捷CISCO 交换机配置命令。
交换机配置模式主要有:用户模式:此模式只可以简单的查看一些交换机的配置和一些简单的修改。
Switch>特权模式:此模式可以查看一些交换机的配置,后面讲述的很多show命令便是在此模式下进行的,还可以对一些简单的设置配置,例如时间。
Switch> enable //在用户模式下输入enable将进入配置模式Switch#全局配置模式:此模式下可以进行对交换机的配置,例如:命名、配置密码、设路由等。
Switch#configure erminal //特权模式下可以通过config terminal 命令进入配置模式Switch(config)#端口配置模式:此模式下对端口进行配置,如配置端口ip等。
Switch(config)#interface gigabitEthernet 1/1 //配置模式下输入interface gigabitEthernet 1/1进入到端口g 1/1接口模式。
二、交换机基本配置交换机命名:在项目实施的时候,建议为处于不同位置的交换机命名,便于记忆,可提高后期管理效率。
switch(config)#hostname ruijie //ruijie为该交换机的名字交换机配置管理密码:配置密码可以提高交换机的安全性,另外,telnet登录交换机的时候,必须要求有telnet管理密码。
switch (config)#enable secret level 1 0 rg //配置telnet管理密码为rg,其中1表示telnet密码,0表示密码不加密switch (config)#enable secret level 15 0 rg //配置特权模式下的管理密码rg,其中15表示为特权密码交换机配置管理IPswitch (config)#interface vlan 1 //假设管理VLAN为VLAN 1switch (config-if)#ip address 192.168.1.1 255.255.255.0 //给管理VLAN配置管理IP地址switch (config-if)#no shutdown //激活管理IP,养成习惯,无论配置什么设备,都使用一下这个命令交换机配置网关:switch(config)#ip default-gateway 192.168.1.254 //假设网关地址为192.168.1.254,此命令用户二层设备。
通过以上几个命令的配置,设备便可以实现远程管理,在项目实施时(尤其是设备位置比较分散)特别能提高效率。
2.1 接口介质类型配置锐捷为了降低SME客户的总体拥有成本,推出灵活选择的端口形式:电口和光口复用接口,方便用户根据网络环境选择对应的介质类型。
但光口和电口同时只能用其一,如图1,如使用了光口1F,则电口1不能使用。
图1接口介质类型的转换:Switch(config)#interface gigabitethernet 0/1Switch(config-if)#medium-type fiber //把接口工作模式改为光口Switch(config-if)#medium-type copper //把接口工作模式改为电口默认情况下,接口是工作在电口模式在项目实施中,如果光纤模块指示灯不亮,工作模式是否正确也是故障原因之一。
2.2 接口速度/双工配置命令格式:Switch(config)#interface interface-id //进入接口配置模式Switch(config-if)#speed {10 | 100 | 1000 | auto } //设置接口的速率参数,或者设置为auto Switch(config-if)#duplex {auto | full | half} //设置接口的双工模式? 1000只对千兆口有效;? 默认情况下,接口的速率为auto,双工模式为auto。
配置实例:实例将gigabitethernet 0/1的速率设为1000M,双工模式设为全双工:Switch(config)#interface gigabitethernet 0/1Switch(config-if)#speed 1000Switch(config-if)#duplex full? 在故障处理的时候,如果遇到规律性的时断时续或掉包,在排除其他原因后,可以考虑是否和对端设备的速率和双工模式不匹配,尤其是两端设备为不同厂商的时候。
? 光口不能修改速度和双工配置,只能auto。
2.3 VLAN配置添加VLAN到端口:在交换机上建立VLAN:Switch (config)#vlan 100 //建立VLAN 100Switch (config)#name ruijie //该VLAN名称为ruijie将交换机接口划入VLAN 100中:Switch (config)#interface range f 0/1-48 //range表示选取了系列端口1-48,这个对多个端口进行相同配置时非常有用Switch (config-if-range)#switchport access vlan 100 //将接口划到VLAN 100中Switch (config-if-range)#no switchport access vlan //将接口划回到默认VLAN 1中,即端口初始配置交换机端口的工作模式:Switch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode access //该端口工作在access模式下Switch(config-if)#switchport mode trunk //该端口工作在trunk模式下? 如果端口下连接的是PC,则该端口一般工作在access模式下,默认配置为access模式。
? 如果端口是上联口,且交换机有划分多个VLAN,则该端口工作在TRUNK模式下。
图2如图2:端口F0/1、F0/2、F0/3都必须工作在TRUNK模式下。
NA TIVE VLAN配置:Switch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk native vlan 100 //设置该端口NATIVE VLAN为100? 端口只有工作在TRUNK模式下,才可以配置NA TIVE VLAN;? 在TRUNK上Native VLAN的数据是无标记的(Untagged),所以即使没有在端口即使没有工作在TRUNK模式下,Native Vlan仍能正常通讯;? 默认情况下,锐捷交换机的NA TIVE VLAN为1。
建议不要更改。
VLAN修剪配置:Switch(config)#interface fastEthernet 0/2Switch(config-if)#switchport trunk allowed vlan remove 2-9,11-19,21-4094 //设定VLAN要修剪的VLANSwitch(config-if)#no switchport trunk allowed vlan //取消端口下的VLAN修剪图3如图3,VLAN1是设备默认VLAN,VLAN10和VLAN20是用户VLAN,所以需要修剪掉的VLAN为2-9,11-19,21-4094。
(4094为VLAN ID的最大值)VLAN信息查看:Switch#show vlanVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/1 ,Fa0/11,Fa0/12Fa0/13,Fa0/14,Fa0/15Fa0/16,Fa0/17,Fa0/18Fa0/19,Fa0/20,Fa0/21Fa0/22,Fa0/23,Fa0/24100 VLAN0100 active Fa0/1 ,Fa0/2 ,Fa0/3Fa0/4 ,Fa0/5 ,Fa0/6Fa0/7 ,Fa0/8 ,Fa0/9Fa0/10Switch#2.4 端口镜像端口镜像配置:Switch (config)# monitor session 1 destination interface GigabitEthernet 0/2//配置G0/2为镜像端口Switch (config)# monitor session 1 source interface GigabitEthernet 0/1 both//配置G0/1为被镜像端口,且出入双向数据均被镜像。
Switch (config)# no monitor session 1 //去掉镜像1? S21、S35等系列交换机不支持镜像目的端口当作普通用户口使用,如果需要做用户口,请将用户MAC与端口绑定。
? 锐捷SME交换机镜像支持一对多镜像,不支持多对多镜像。
去除TAG标记:Switch (config)# monitor session 1 destination interface GigabitEthernet 0/2 encapsulation replicate// encapsulation replicate表述镜像数据不带TAG标记。
? 目前该功能只有S37、S57、S86、S96交换机支持,其他型号交换机不支持。
? 锐捷交换机支持两种模式:镜像目的口输出报文是否带TAG根据源数据流输入的时候是否带TAG来决定。
强制所有的镜像输出报文都不带TAG ,受限于目前芯片的限制,只支持二层转发报文不带Tag,经过三层路由的报文,镜像目的端口输出的报文会带Tag。
端口镜像信息查看:S3750#sh monitor session 1Session: 1Source Ports:Rx Only : NoneTx Only : NoneBoth : Fa0/1Destination Ports: Fa0/2encapsulation replicate: true2.5 端口聚合端口聚合配置:Switch(config)#interface fastEthernet 0/1Switch (config-if)#port-group 1 //把端口f0/1加入到聚合组1中。
Switch (config-if)#no port-group 1 //把端口f0/1从聚合组1中去掉。