锐捷三层交换机命令大全

合集下载

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

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

【第一部分】交换机支持的命令: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路由协议。

锐捷网络交换机常用命令

锐捷网络交换机常用命令

锐捷网络交换机常用操作命令手册目录一、交换机配置模式介绍3二、交换机基本配置32.1 接口介质类型配置42.2 接口速度/双工配置52.3 VLAN配置62.4 端口镜像92.5 端口聚合102.6 交换机堆叠112.7 ACL配置122.8 端口安全142.9 交换机防攻击配置162.10 DHCP配置212.11 三层交换机配置22三、交换机常用查看命令24一、交换机配置模式介绍交换机配置模式主要有:? 用户模式:此模式只可以简单的查看一些交换机的配置和一些简单的修改。

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,此命令用户二层设备。

锐捷交换机、路由器常用命令

锐捷交换机、路由器常用命令

锐捷交换机、路由器常用命令锐捷交换机、路由器常用命令推荐交换机配置命令模式EXEC模式:用户模式switch>交换机信息的查看,简单测试命令特权模式switch#查看、管理交换机配置信息,测试、调试配置模式:全局配置模式switch(config)#配置交换机的整体参数接口配置模式switch(config-if)#配置交换机的接口参数进入全局配置模式Switch#c onfigure terminalSwitch(config)#exitSwitch#进入接口配置模式Switch(config)#interface fastethernet 0/1 Switch(config-if)#exitSwitch(config)#从子模式下直接返回特权模式Switch(config-if)#endSwitch#命令行其他功能获得帮助switch#?switch#show ?命令简写全写:switch# configure terminal简写:Switch# config使用历史命令Switch# (向上键)Switch# (向下键)配置交换机Telnet功能配置远程登陆密码Switch(config)#enable secret level 1 0 ruijie配置进入特权模式密码Switch (config)#enable secret level 15 0 ruijie 为交换机配置管理IPSwitch (config)#interface vlan 1Switch (config-if)#no shutdownSwitch (config-if)#ip address 192.168.1.1 255.255.255.0Switch (config-if)#end配置文件的管理保存配置将当前运行的参数保存到flash 中用于系统初始化时初始化参数Switch#copy running-config startup-config Switch#write memorySwitch#write删除配置永久性的删除flash 中不需要的文件使用命令delete flash:config.text删除当前的配置:在配置命令前加no例:switch(config-if)# no ip address查看配置文件内容Switch#show configure 查看保存在FLASH 里的配置信息Switch#show running-config 查看RAM里当前生效的配置配置Port VLAN创建VLAN10,将它命名为test的例子Switch# configure terminalSwitch(config)# vlan 10Switch(config-vlan)# name testSwitch(config-vlan)# end把接口0/10加入VLAN10Switch# configure terminalSwitch(config)# interface fastethernet 0/10 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 10 Switch(config-if)# end将一组接口加入某一个VLANSwitch(config)#interface range fastethernet 0/1-8,0/15,0/20Switch(config-if-range)# switchport access vlan 20注:连续接口0/1-8,不连续接口用逗号隔开,但一定要写明模块编号配置Tag VLAN-Trunk把Fa0/1配成Trunk口Switch# configure terminalSwitch(config)# interface fastethernet0/1 Switch(config-if)# switchport mode trunk把端口Fa0/20 配置为Trunk端口,但是不包含VLAN 2:Switch(config)# interface fastethernet 0/20 Switch(config-if)# switchport trunk allowed vlan remove 2Switch(config-if)# endNative VLAN配置命令:Switch(config-if)# switchport trunk native vlan 20Switch(config-if)# end注意:每个Trunk口的缺省native VLAN是VLAN 1 在配置Trunk链路时,请确保连接链路两端的Trunk口属于相同的native VLAN保存/清除VLAN信息将VLAN信息保存到flash中Switch#write memory从flash中只清除VLAN信息Switch#delete flash:vlan.dat从RAM中删除VLANSwitch(config)#no vlan VLAN-id生成树协议的配置开启生成树协议Switch(config)#Spanning-tree关闭生成树协议Switch(config)#no Spanning-tree配置生成树协议的类型Switch(config)#Spanning-tree mode stp/rstp锐捷全系列交换机默认使用MSTP协议配置交换机优先级Switch(config)#spanning-tree priority <0-61440>(“0”或“4096”的倍数、共16个、缺省32768)恢复到缺省值Switch(config)# no spanning-tree priority配置交换机端口的优先级Switch(config)#interface interface-typeinterface-numberSwitch(config-if)#spanning-tree port-priority number配置STP、RSTPSpanning Tree 的缺省配置:关闭STPSTP Priority 是32768STP port Priority 是128STP port cost 根据端口速率自动判断Hello Time 2秒Forward-delay Time 15秒Max-age Time 20秒可通过spanning-tree reset 命令让spanning tree 参数恢复到缺省配置查看生成树协议配置显示生成树状态Switch#show spanning-tree显示端口生成树协议的状态Switch#show spanning-tree interface fastethernet <0-2/1-24>配置aggregate port将该接口加入一个APSwitch#c onfigure terminalSwitch(config) # interface interface-type interface-idSwitch(config-if-range)#port-groupport-group-number如果这个AP不存在,可自动创建AG端口查看聚合端口的汇总信息Switch#show aggregateport summary查看聚合端口的流量平衡方式Switch#show aggregateport load-balance路由器上配置telnet第一步: 配置端口地址RouterA# configure terminal !进入全局配置模式RouterA(config)# interface fastethernet 1/0!进入路由器接口配置模式RouterA(config-if)# ip address 192.168.0.1 255.255.255.0!配置路由器管理接口IP 地址RouterA(config-if)# no shutdown !开启路由器f 1/0接口第二步:配置远程登录密码RouterA(config)# line vty 0 4 !进入路由器线路配置模式RouterA(config-line)#login !配置远程登录RouterA(config-line)# password star !设置路由器远程登录密码为“star”RouterA(config-line)#end第三步:配置路由器特权模式密码RouterA(config)# enable secret star !设置路由器特权模式密码为“star”或者RouterA(config)# enable password star查看配置文件show version !查看版本及引导信息show running-config !查看运行配置show startup-config !查看用户保存在NVRAM中的配置文件保存配置文件Router#copy running-config startup-config Router#write memoryRouter#write删除配置文件Router#delete flash:config.text !删除初始配置文件查看路由信息router#show ip routeCodes: C - connected,S –static,R –RIP,O- OSPFIA - OSPF inter area,E1-OSPF external type 1 E2 - OSPF external type 2,* - candidate default Gateway of last resort is 10.5.5.5 to network 0.0.0.0172.16.0.0/24 is subnetted, 1 subnetsC 172.16.11.0 is directly connected, serial1/2 O E2 172.22.0.0/16 [110/20] via 10.3.3.3, 01:03:01, Serial1/2S* 0.0.0.0/0 [1/0] via 10.5.5.5静态路由配置命令配置静态路由用命令ip routerouter(config)#ip route [网络编号] [子网掩码] [转发路由器的IP地址/本地接口]例:ip route 192.168.10.0 255.255.255.0 serial 1/2例:ip route 192.168.10.0 255.255.255.0 172.16.2.1静态路由描述转发路径的方式有两种指向本地接口(即从本地某接口发出)指向下一跳路由器直连接口的IP地址(即将数据包交给X.X.X.X)配置默认路由:router(config)#ip route 0.0.0.0 0.0.0.0 [转发路由器的IP地址/本地接口]RIP路由协议的版本RIPv1有类路由协议,不支持VLSM以广播的形式发送更新报文不支持认证RIPv2无类路由协议,支持VLSM以组播的形式发送更新报文支持明文和MD5的认证配置RIP协议配置步骤1、开启RIP路由协议进程Router(config)#router rip2、申请本路由器参与RIP协议的直连网段信息Router(config-router)#network 192.168.1.03、指定RIP协议的版本2(默认是version1) Router(config-router)#version 24、在RIPv2版本中关闭自动汇总Router(config-router)#no auto-summary查看RIP配置信息验证RIP的配置Router#show ip protocols显示路由表的信息Router#show ip route清除IP路由表的信息Router#clear ip route在控制台显示RIP的工作状态Router#debug ip ripOSPF协议OSPF配置如下:1、创建loopback接口,定义ROUTE ID routerA(config)#interface loopback 10routerA(config)#ip address 192.168.100.1 255.255.255.02、开启OSPF进程routerA(config)#router ospf 1010代表进程编号,只具有本地意义3、申请直连网段routerA(config-router)#network 10.1.1.0 0.0.0.255 area 0注意反掩码和区域号查看OSPF配置信息验证OSPF的配置Router#show ip ospf显示路由表的信息Router#show ip route清除IP路由表的信息Router#clear ip route在控制台显示OSPF的工作状态Router#debug ip ospf三层交换的路由功能三层交换机默认开启路由功能Switch(config)#ip routing (开启三层交换机路由功能)三层交换机配置路由接口的两种方法开启三层交换机物理接口的路由功能Switch(config)#interface fastethernet 0/5 Switch(config-if)#no switchportSwitch(config-if)#ip address 192.168.1.1 255.255.255.0Switch(config-if)#no shutdown关闭物理接口路由功能Switch(config-if)# switchport采用SVI方式(switch virtual interface)Switch(config)#interface vlan 10Switch(config-if)#ip address 192.168.1.1.255 255.255.0Switch(config-if)#no shutdown三层交换机和路由器相连的网络方法一(SVI):Switch(config)#interface f0/10Switch(config-if)#switchport access vlan 10 Switch(config-if)#exitSwitch(config)#interface vlan 10 switch(config-if)#ip address 192.168.10.1 255.255.255.0Switch(config-if)#no shutdown方法二(路由接口):Switch(config)#interface f0/10Switch(config-if)#no switchportSwitch(config-if)#ip address 192.168.10.1 255.255.255.0Switch(config-if)#no shutdown三层交换机路由协议的配置静态路由Switch(config)#ip route x.x.x.x x.x.x.x [x.x.x.x/interface]RIPSwitch(config)#router ripSwitch(config-router)#network X.X.X.X Switch(config-router)#version 2注:三层交换机不支持no auto-summary OSPFSwitch(config)#router ospfSwitch(config)#network X.X.X.X X.X.X.X area x查看三层交换机路由配置查看路由接口信息Switch#show ip interface查看路由表。

锐捷交换机配置命令(分析运用)

锐捷交换机配置命令(分析运用)

锐捷交换机配置命令交换机基本操作: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]:nProceed 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-listVLAN的验证: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 , 优先级值小为高。

锐捷交换机三层配置

锐捷交换机三层配置
sdk_2(config-line)#exit ------> 回到全局配置模式
sdk_2(config)# enable secret 123 ------>配置进入特权模式的密码为123
sdk_2(config)#enable service web-server ------>全局web功能
sdk_1 (config)#ip dhcp ping packets 1
---->在dhcp server分配IP时会先去检测将要分配的IP地址是否已有人使用,如果没人使用则分配,若已有人使用则再分配下一个IP
sdk_1 (config)#ip dhcp excluded-address 192.168.10.1 192.168.10.100
sdk_1(config-line)#login ------>启用需输入密码才能telnet成功
sdk_1(config-line)#password Lhyj@)!$cd12371 ------> 将telnet密码设置为123
sdk_1(config-line)#exit ------> 回到全局配置模式
sdk_1 (config)#ip dhcp excluded-address 192.168.10.141 192.168.10.254 ---->设置地址为192.168.10.101至192.168.10.140的ip地址分配给客户端
sdk_1 (config)#ip dhcp exclude8.20.100
sdk_1(config)# enable secret Lhyj@)!$cd12371 ------>配置进入特权模式的密码为123

华为、H3C、锐捷三家交换机配置命令详解

华为、H3C、锐捷三家交换机配置命令详解

华为、H3C、锐捷三家交换机配置命令详解一、华为交换机基础配置命令1<Quidway> //用户视图,也就是在Quidway模式下运行命令。

<Quidway>system-view //进入配置视图[Quidway] vlan 10 //创建vlan 10,并进入vlan10配置视图,如果vlan10存在就直接进入vlan10配置视图[Quidway-vlan10] quit //回到配置视图[Quidway] vlan 100 //创建vlan 100,并进入vlan100配置视图,如果vlan10存在就直接进入vlan100配置视图[Quidway-vlan100] quit //回到配置视图2[Quidway] interface GigabitEthernet2/0/1 (10G光口)[Quidway- GigabitEthernet2/0/1] port link-type access //定义端口传输模式[Quidway- GigabitEthernet2/0/1] port default vlan 100 //将端口加入vlan100 [Quidway- GigabitEthernet2/0/1] quit //回到配置视图[Quidway] interface GigabitEthernet1/0/0 //进入1号插槽上的第一个千兆网口配置视图中。

0代表1号口[Quidway- GigabitEthernet1/0/0] port link-type access //定义端口传输模式[Quidway- GigabitEthernet2/0/1] port default vlan 10 //将这个端口加入到vlan10中[Quidway- GigabitEthernet2/0/1] quit3<Quidway>system-view[Quidway]vlan 10[Quidway-vlan10]port GigabitEthernet 1/0/0 to 1/0/29 //将0到29号口加入到vlan10中[Quidway-vlan10]quit4[Quidway] interface Vlanif100 // 进入vlan100接口视图与vlan 100命令进入的地方不同[Quidway-Vlanif100] ip address 119.167.200.90 255.255.255.252 // 定义vlan100管理IP三层交换网关路由[Quidway-Vlanif100] quit //返回视图[Quidway] interface Vlanif10 // 进入vlan10接口视图与vlan 10命令进入的地方不同[Quidway-Vlanif10] ip address 119.167.206.129 255.255.255.128 // 定义vlan10管理IP三层交换网关路由[Quidway-Vlanif10] quit5[Quidway]ip route-static 0.0.0.0 0.0.0.0 119.167.200.89 //配置默认网关。

[原创]三层交换机配置命令以及中文解释

[原创]三层交换机配置命令以及中文解释

三层交换机配置命令以及中文解释基本配置S> enable 进入特权模式S# configure terminal 进入全局配置模式S(config)# hostname name 改变交换机名称S(config)# enable password level level_# password 设置用户口令(level_#=1)或特权口令(level_#=15)S(config)# line console 0 进入控制台接口S(config-line)# password console_password 接上一条命令,设置控制台口令S(config)# line vty 0 15 进入虚拟终端S(config-line)# password telnet_password 接上一条命令,设置Telnet口令S(config-line)# login 允许Telnet登录S(config)# enable password|secret privilege_password 配置特权口令(加密或不加密)S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进入接口子配置模式S(config-if)# [no] shutdown 关闭或启用该接口(默认启用)S(config)# ip address IP_address sunbet_mask 指定IP地址S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认网关S# show running-config 查看当前的配置S# copy running-config startup-config 将RAM中的当前配置保存到NVRAM中S> show interface [type slot_#/port_#] 查看所有或指定接口的信息S> show ip 显示交换机的IP配置(只在1900系列上可用)S> show version 查看设备信息S# show ip interface brief 验证IP配置S(config-if)# speed 10|100|auto 设置接口速率S(config-if)# duplex auto|full|half 设置接口双工模式S> show mac-address-table 查看CAM表S# clear mac-address-table 清除CAM表中的动态条目1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# 在CAM表中创建静态条目2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_# 在CAM表中创建静态条目1900(config)# mac-address-table restricted static MAC_address source_port list_of_allowed_interface 设置静态端口安全措施1900(config-if)# port secure 启用粘性学习1900(config-if)# port secure max-mac-count value 设置粘性学习特性能够学到的地址数量(默认132,取值范围是1-132)1900(config)# address-violation suspend|ignore|disable 改变安全选项1900> show mac-address-table security 验证端口安全措施2950(config)# switchport mode access 定义接口为主机端口而不是中继端口2950(config)# switchport port-security 启用端口安全措施2950(config)# switchport port-security maximum value 指定可与此接口相关的设备的最大数量2950(config)# switchport port-security violationprotect|restrict|shutdown 指定出现安全违规时应该发生的事2950(config)# switchport port-security mac-addressMAC_address 指定允许与此接口相关的确切的MAC地址2950(config)# switchport port-security mac-address sticky 启用粘性学习特性2950(config)# show port interface type [slot_#/] port_# 验证接口配置2950(config-if) description name 设置接口描述信息2950# show buffers 查看系统缓存的大小1900# copy nvram tftp:// IP_address_of_TFTP_server/ file_name 将配置文件备份到TFTP服务器上1900# copy tftp:// IP_address_of_TFTP_server/ file_name nvram 从TFTP服务器上恢复配置到NVRAM1900# delete nvram 删除配置文件2950# erase startup-config 删除配置文件3550# show tcam qos TCAM_ID statistics 查看TCAM剩余容量4000> enable 进入特权模式4000>(enable) set password 设置用户模式密码4000>(enable) set enablepass 设置授权密码4000>(enable) set interface sc0 IP_address mask 配置IP地址4000>(enable) set port enable|disable slot_#/port_# 启用/禁用接口4000>(enable) show port [slot_#/port_#] 显示接口信息4000>(enable) set port name slot_#/port_# name 设置交换机接口描述信息4000>(enable) set port speed slot_#/port_# 4|10|16|100|auto 设置交换机接口速率4000>(enable) set port duplex slot_#/port_# full|half 设置交换机接口双工模式4000>(enable) clear config all 删除NVRAM中的配置信息4000>(enable) erase all 删除FLASH中的内容4000>(enable) show flash 显示FLASH中的内容4000>(enable) show cam [count]dynamic|static|permanent|system [vlan_#] 显示CAM表VLAN 1900(config)# vtp domain VTP_domain_name 定义交换机域名1900(config)# vtp server|client|transparent 定义交换机VTP模式(默认服务器)1900(config)# vtp password VTP_password 配置VTP口令1900(config)# vtp pruning enable|disable 启用/禁用修剪(默认启用)1900(config)# vtp trap enable 启用SNMP陷阱(默认启用)1900# show vtp 验证VTP配置2950# vtp database 访问VLAN和VTP配置(以下均是在IOS12.1前用,12.1后全是在全局配置模式下)2950(vlan)# vtp domain VTP_domain_name 定义交换机域名2950(vlan)# vtp server|client|transparent 定义交换机VTP模式(默认服务器)2950(vlan)# vtp password VTP_password 配置VTP口令2950(vlan)# vtp pruning 启用/禁用修剪(默认启用)2950(config)# snmp-server enable traps vtp 启用SNMP陷阱(默认启用)2950# show vtp status 检查VTP配置2950# show vtp counters 显示与VTP消息发送与接收相关的VTP统计信息1900(config-if)# trunk on|off|desirable|auto 指定中继类型1900# show trunk A|B 验证接口中继(A是fa0/26,B是fa0/27)2950(config-if)# switchport mode trunk|dynamicdesirable|dynamic auto|nonegotiate 指定中继类型(默认自动协商)2950(config-if)# switchport trunk native|allowed|pruning vlan VLAN_# 配置中继2950(config-if)# switchport trunk pruning vlan remove VLAN_# 清除不希望消减的VLAN2950# show interfaces [type 0/port_#] switchport|trunk 验证接口中继1900(config)# vlan VLAN_# [name VLAN_name] 创建VLAN1900(config-if)# vlan-membership static VLAN_# 将该接口静态地分配给一个VLAN1900# show vlan 验证VLAN1900# show vlan-membership 查看VLAN成员关系1900# show spantree [VLAN_#] 查看VLAN的STP信息2950# vlan database 进入VLAN数据库(ISO12.1前用)2950(vlan)# vlan VLAN_# [name VLAN_name] 创建VLAN2950(config)# vlan VLAN_# 进入VLAN数据库(ISO12.1后用)2950(config-vlan)# name VLAN_name 创建VLAN2950(config-if)# switchport mode access 指定连接是接入链路连接2950(config-if)# switchport access vlan VLAN_# 指定VLAN是接入链路连接4000>(enable) set vlan VLAN_# name VLAN_name 配置VLAN4000>(enable) set vlan VLAN_# slot_#/port_#-port_# 为VLAN分配端口4000>(enable) set trunk slot_#/port_#[on|off|desirable|auto|nonegotiate] [VLAN_#][isl|dot1q|dot10|lane|negotiate] 配置中继4000>(enable) clear trunk slot_#/port_# VLAN_# 删除VLAN 4000>(enable) show trunk slot_#/port_# 验证中继端口4000>(enable) set vtp v2 enable 配置VTPv24000>(enable) set vtp [domain name] [modeclient|server|transparent] [passwd password] [pruning enable|disable] [v2 enable|disable] 设置VTP4000>(enable) show vtp domain 验证VTP域的信息4000>(enable) show vtp statistics 显示发出或收到的VTP通告信息的摘要内容4000>(enable) set vtp pruneeligible VLAN_# 设置VTP消减4000>(enable) clear vtp pruneeligible VLAN_# 清除不希望消减的VLANSTP 4000>(enable) set spantree enable|disable VLAN_# 启用/禁用STP(默认启用)2950(config)# [no] spanning-tree vlan VLAN_# 启用/禁用STP(默认启用)4000>(enable) show spantree [VLAN_#] 验证STP状态2950# show spanning-tree 验证STP状态4000>(enable) set spantree root [secondary] VLAN_# [dia network_diameter] [hello hello_time] 设置主根节点桥、备份节点桥、最大桥数量(2-7)、持续时间(1-10,默认2)4000>(enable) set spantree portcost slot_#/port_# cost_# 设置端口开销2950(config-if)# spanning-tree cost cost_# 设置端口开销4000>(enable) set spantree portpri slot_#/port_# priority_# 设置端口优先级4000>(enable) set spantree portvlanpri slot_#/port_#priority_# [VLAN_#] 改变VLAN的优先级设置2950(config-if)# spanning-tree vlan VLAN_# port-priority priority_# 设置端口优先级4000>(enable) set spantree fwddelay delay_# [VLAN_#] 设置从侦听状态到学习状态再到转发状态的时间间隔(默认15秒,取值范围是4-30秒)4000>(enable) set spantree hello interval_time [VLAN_#] 设置根节点交换机发送BPDU的时间间隔(默认2秒,取值范围是1-10秒)4000>(enable) set spantree maxage agingtime [VLAN_#] 设置交换机持有BPDU的时间(默认20秒,取值范围是6-40秒)2950(config)# spanning-tree vlan VLAN_# forward-time forward_time 设置从侦听状态到学习状态再到转发状态的时间间隔(默认15秒,取值范围是4-30秒)2950(config)# spanning-tree vlan VLAN_# hello-time hello_time 设置根节点交换机发送BPDU的时间间隔(默认2秒,取值范围是1-10秒)2950(config)# spanning-tree vlan VLAN_# max-age maxage 设置交换机持有BPDU的时间(默认20秒,取值范围是6-40秒)4000>(enable) set port channel slot_#/port_# on 建立以太通道集合4000>(enable) show port capabilities slot_#/port_# 查看端口的配置4000>(enable) show port channel 验证以太通道集合的配置2950(config-if)# channel-group group_number modeauto|desirable|on 建立以太通道集合2950# show etherchannelgroup_number|brief|detail|load-balance|port|port-channel|su mmary 验证以太通道集合的配置4000>(enable) set spantree portfast slot_#/port_# enable 配置PortFast2950(config-if)# spanning-tree portfast 配置PortFast4000>(enable) set spantree uplinkfast enable|disable [rate station_update_rate] [all-protocols off|on] 启用/禁用UplinkFast4000>(enable) show spantree uplinkfast 验证UplinkFast配置2950(config)# spanning-tree uplinkfast [max_update_rate] 启用/禁用UplinkFast2950# show spanning-tree uplinkfast 验证UplinkFast配置4000>(enable) set spantree backbonefast enable|disable 启用/禁用BackboneFast4000>(enable) show spantree backbonefast 验证BackboneFast配置2950(config)# spanning-tree backbonefast 启用BackboneFast虚拟网间路由2600(config)# interface type slot_#/port_#.subint_number 配置子接口2600(config-subif)# encapsulation dot1q|isl|sde|tr-isl VLAN_# 配置封装类型4000>(enable) show module 查看交换机的硬件配置4000>(enable) session module_# 访问L3SML3SM(config-if)# mac-address mac_address 分配MAC地址MLS 2600(config)# mls rp ip 启动MLS2600(config-if)# mls rp vtp-domain domain_name 分配路由器接口到VTP域中2600(config-if)# mls rp vlan-id VLAN_# 向接口分配VLAN2600(config-if)# mls rp management-interface 指定该接口为管理接口2600# show mls rp 提供全局MLS信息2600# show mls rp interface type slot_#/port_# 提供指定接口的MLS信息2600# show mls rp vtp-domain domain_name 提供VTP域的MLS信息6500>(enable) set mls enable 在MLS-SE上启动MLS6500>(enable) set mls include rp_ip_address 告诉交换机哪一个IP地址是正确的6500>(enable) show mls include 显示外部路由处理器的IP地址列表6500>(enable) set mls flow[destination|destination-source|full] 告诉MLS交换机要缓存候选数据包的哪些信息6500>(enable) show mls entry 显示第三层缓存表6500>(enable) set mls agingtime aging_time 改变缓存的衰老时间(默认256秒,取值范围是8-2032秒中的8的倍数值)6500>(enable) set mls agingtime fast fast_aging_timepkt_threshold 改变快速衰老周期和数据包门限值6500>(enable) show mls ip 验证MLS-SE的配置6500>(enable) clear mls entry [destination IP_address] [source IP_address] [flow protocol] [source_port] [destination_port] [all] 删除所有或指定MLS缓存记录3550(config)# ip routing 启动IP路由3550(config)# ip cef 启动CEF3550(config-if)# no switchport 将第二层接口转换为第三层接口3550(config-if)# ip route-cache cef 在接口上启动CEF3550# show ip cef 验证CEF组播3640(config)# ip multicast-routing 启动路由器上的组播服务3640(config-if)# ip pim dense-mode 将接口设置为PIM密集模式3640(config-if)# ip pim sparse-mode 将接口设置为PIM稀疏模式3640(config-if)# ip pim sparsed-dense-mode 将接口设置为PIM 稀疏-密集模式3640(config)# ip pim rp-address IP_address group_ACL_# [override] 手工配置RP3640(config)# ip pim send-rp-announce type slot_#/port_# scope ttl_value group-list ACL_# 通告RP组的分配3640(config)# ip pim send-rp-discovery scope ttl_value 配置RP映射代理3640(config-if)# ip multicast ttl-threshold ttl_value 设置TTL门限值3640(config-if)# ip igmp join-group group_address 加入组播组3640# show ip mroute 查看组播信息3640# ping 验证RP之间或其他组播路由器之间的连接3640# mtrace source_IP_address [destination_IP_address] [group] 组播traceroute3640(config-if)# ip cgmp 配置CGMP路由器4000>(enable) set cgmp enable 启动CGMP4000>(enable) show cgmp statistics 查看CGMP统计信息4000>(enable) show multicast group cgmp 查看交换机了解到的组播组信息4000>(enable) set cgmp leave enable 检查由客户端产生的IGMPv2的离开信息4000>(enable) set igmp enable 启动IGMP4000>(enable) ip igmp snooping 启动IGMP探听4000>(enable) set igmp fastleave enable 启动快速离开过程4000>(enable) show igmp statistics 显示交换机上IGMP探听的状态信息QoS 2950(config)# wrr-queue cos-map queue_ID cos_value 建立队列2950(config)# wrr-queue bandwidth bandwidth_value 设置队列门限2950(config)# class-maps name 定义对信息传输分类时的匹配标准2950(config-cmap)# match access-group ACL_# 识别被分类的信息传输2950(config)# policy-map name 确定为接入信息传输所设置的分类标准2950(config-pmap)# class name2950(config-pmap-c)# set ip dscp number2950(config-if)# service-policy input name 对该接口应用策略3550(config)# mls qos 启动QoS3550(config-if)# auto qos voip 在接口上启动自动服务质量3550(config)# priority-list priority_queue_# protocol protocol high|medium|normal|low [list ACL_#] 为优先级队列定义信息流3550(config)# priority-list priority_queue_# queue-limit limit_# 定义特定优先级队列的最大队列空间3550(config-if)# priority-group priority_queue_# 向特定输出接口分配优先级队列3550(config)# queue-list queue_list_# interface typeslot_#/port_# queue_number 为一个特定的定制队列定义信息流3550(config)# queue-list queue_list_# queue queue_number byte-count size_in_bytes [limit number_of_queue] 为特定的定制队列定义队列的最大空间3550(config-if)# custom-queue-list custom_queue_number 为特定的输出接口分配优先级队列4840(config)# ip slb serverfarm serverfarm_name 配置SLB冗余4840(config-slb-sfarm)# real IP_address [port_#] 指定虚拟IP 地址4840(config-slb-sfarm)# inservice 启动服务器4840(config)# virtual IP_address [network_mask] tcp|udp [port_number|wsp|wsp-wtp|wsp-wtls|wsp-wtp-wtls] [service service_name] 建立虚拟服务器IP地址。

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

锐捷交换机常用配置命令详解
方式二: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配置
交换机升级
交换机防病毒访问控制列表

锐捷交换机常用命令速查.doc

锐捷交换机常用命令速查.doc

锐捷交换机常用命令速查.doc准备工作>Enable进入特权模式#Exit??返回上一级操作模式#End??返回到特权模式#writememory或copyrunning-configstartup-config??保存配置文件#delflash:config.text??删除配置文件(交换机及1700系列路由器)#erasestartup-config??删除配置文件(2500系列路由器)#delflash:vlan.dat删除Vlan配置信息(交换机)#Configureterminal进入全局配置模式(config)#hostnameswitchA??配置设备名称为switchA(config)#bannermotd&配置每日提示信息&为终止符(config)#enablesecretlevel10star??配置远程登陆密码为star(config)#enablesecretlevel150star配置特权密码为starLevel1为普通用户级别,可选为1~15,15为最高权限级别;0表示密码不加密(config)#enableservicesweb-server开启交换机WEB管理功能Services可选以下:web-server(WEB管理)、telnet-server(远程登陆)等查看信息#showrunning-config查看当前生效的配置信息#showinterfacefastethernet0/3??查看F0/3端口信息#showinterfaceserial1/2查看S1/2端口信息#showinterface查看所有端口信息#showipinterfacebrief以简洁方式汇总查看所有端口信息#showipinterface查看所有端口信息#showversion查看版本信息#showmac-address-table查看交换机当前MAC地址表信息#showrunning-config查看当前生效的配置信息#showvlan查看所有VLAN信息#showvlanid10查看某一VLAN(如VLAN10)的信息#showinterfacefastethernet0/1switchport查看某一端口模式(如F0/1)#showaggregateport1summary查看聚合端口AG1的信息#showspanning-tree查看生成树配置信息#showspanning-treeinterfacefastethernet0/1查看该端口的生成树状态#showport-security查看交换机的端口安全配置信息#showport-securityaddress??查看地址安全绑定配置信息#showipaccess-listslistname查看名为listname的列表的配置信息#showaccess-lists端口的基本配置(config)#Interfacefastethernet0/3进入F0/3的端口配置模式(config)#interfacerangefa0/1-2,0/5,0/7-9进入F0/1、F0/2、F0/5、F0/7、F0/8、F0/9的端口配置模式(config-if)#speed10配置端口速率为10M,可选10,100,auto(config-if)#duplexfull??配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应)(config-if)#noshutdown开启该端口(config-if)#switchportaccessvlan10将该端口划入VLAN10中,用于VLAN(config-if)#switchportmodetrunk将该端口设为trunk模式,用于Tagvlan?可选模式为access,trunk(config-if)#port-group1将该端口划入聚合端口AG1中,用于聚合端口聚合端口的创建(config)#interfaceaggregateport1??创建聚合接口AG1(config-if)#switchportmodetrunk??配置并保证AG1为trunk模式(config)#intf0/23-24(config-if-range)#port-group1将端口(端口组)划入聚合端口AG1中生成树(config)#spanning-tree开启生成树协议(config)#spanning-treemodestp指定生成树类型为stp可选模式stp,rstp,mstp(config)#spanning-treepriority4096设置交换机的优先级为4096,优先级值小为高。

锐捷交换机配置命令参考说明

锐捷交换机配置命令参考说明
Switch(config-if)#medium-type fiber //把接口工作模式改为光口
Switch(config-if)#medium-type copper //把接口工作模式改为电口
? 默认情况下,接口是工作在电口模式
? 在项目实施中,如果光纤模块指示灯不亮,工作模式是否正确也是故障原因之一。
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk native vlan 100 //设置该端口NATIVE VLAN为100
? 端口只有工作在TRUNK模式下,才可以配置NATIVE VLAN;
switch>enable
switch#
switch#Switch#configure terminal
Switch(config)#
switch(config)#hostname 交换机名
Switch(config)#interface gigabitEthernet 1/1
switch (config)#enable secret level 1 0 rg 配置telnet管理密码为rg,其中1表示telnet密码,0表示密码不加密
2.5 端口聚合
端口聚合配置:
Switch(config)#interface fastEthernet 0/1
Switch (config-if)#port-group 1 //把端口f0/1加入到聚合组1中。
Switch (config-if)#no port-group 1 //把端口f0/1从聚合组1中去掉。
图3

锐捷交换机常用配置命令汇总,弱电人要看看,以后肯定用得到

锐捷交换机常用配置命令汇总,弱电人要看看,以后肯定用得到

锐捷交换机常用配置命令汇总,弱电人要看看,以后肯定用得到前言:正文:一、连接及远程登录用一台计算机作为控制台和网络设备相连接,通过计算机对网络设备进行配置。

1、硬件连接把Console线一端连接在计算机的串口上,另一端连接在网络设备的Console口上。

按照上面的线序制作一根双绞线,一端通过一个转换头连接在计算机的串口上,另一端连接在网络设备的Console口上。

2、软件安装在计算机上安装一个终端仿真软件来登录网络设备。

“超级终端”安装方法,通常是使用secureCRT较多。

按照提示的步骤进行安装,其中连接的接口应选择'COM1',端口的速率选择“9600”,数据流控制应选择'无',其它都使用默认即可。

二、基础命令连接上交换机后,需要进行命令配置,我们来看看配置的命令。

1、准备命令2、查看信息3、端口基本配置4、聚合端口创建5、生成树6、VLan的基本配置7、端口安全A、配置最大连接数限制B、IP和MAC地址绑定8、三层路由功能(只针对三层交换机)9、三层交换机路由协议三、锐捷交换机实现同VLAN不同交换通信我们都知道,同一个VLAN在同一个交换机中,是完全可以通信的。

那么对于同一个VLAN在不同的交换机上,如果不做配置,是无法通信的,我们可以看一下下面的示例。

示例1:(1)分析两台交换机S1和S2利用VLAN分割成几个虚拟局域网,S1中VLAN1、VLAN30与S2中的VLAN1、VLAN30虽然是同一个VLAN,但却不能直接通信。

那么如何使VLAN1、VLAN30同VLAN之间可以通信呢,不同的VLAN (2)配置配置S1:S1>enable //进入特权配置模式S1#configure terminal //全局配置模! 创建VLAN20 S1(config)#vlan 20 //创建vlan20S1(config-vlan)#name VLAN20 //给这个vlan命名vlan为vlan! 创建VLAN30S1(config-vlan)#vlan 30S1(config-vlan)#name VLAN30S1(config-vlan)#exit! 把F0/4~F0/7指派给VLAN20S1(config)#interface f0/4 //进入端口f0/4S1(config-if)#switchport access vlan 20 配置S2:S2>enableS2#configure terminal! 创建VLAN30S2(config)#vlan 30S2(config-vlan)#name VLAN30S2(config-vlan)#exit! 把F0/1~F0/5指派给VLAN30S2(config)#interface range f0/1-5 //将s2中的1到5端口划分到vlan3如此,配置就完成了。

锐捷三层交换机命令大全

锐捷三层交换机命令大全

交换机 >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: ;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路由协议。

锐捷交换机配置命令大全

锐捷交换机配置命令大全

锐捷交换机配置命令一、交换机基本配置交换机命名:在项目实施的时候,建议为处于不同位置的交换机命名,便于记忆,可提高后期管理效率。

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,此命令用户二层设备。

通过以上几个命令的配置,设备便可以实现远程管理,在项目实施时(尤其是设备位置比较分散)特别能提高效率。

1.1 接口介质类型配置锐捷为了降低SME客户的总体拥有成本,推出灵活选择的端口形式:电口和光口复用接口,方便用户根据网络环境选择对应的介质类型。

但光口和电口同时只能用其一,如图1,如使用了光口1F,则电口1不能使用。

接口介质类型的转换:Switch(config)#interface gigabitethernet 0/1Switch(config-if)#medium-type fiber //把接口工作模式改为光口Switch(config-if)#medium-type copper //把接口工作模式改为电口默认情况下,接口是工作在电口模式在项目实施中,如果光纤模块指示灯不亮,工作模式是否正确也是故障原因之一。

锐捷交换机配置命令

锐捷交换机配置命令

锐捷交换机配置命令交换机基本操作:1.进入特权模式Switch>enableSwitch#2.返回用户模式Switch#exit子模式1.2.1.2.3.Switch(config-if)#exitSwitch(config)#从子模式下直接返回特权模式Switch(config-if)#endSwitch#交换机操作帮助:1.支持命令简写(按TAB键将命令补充完整)2.在每种操作模式下直接输入“?”显示该模式下所有的命令3.命令空格“?”显示命令参数并对其解释说明4.“字符?”显示以该字符开头的命令5.命令历史缓存:(Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令6.错误提示信息交换机显示命令:显示交换机硬件及软件的信息Switch#showversion1.[OK]2.清空3.4.S2126G-1(config)#5.配置交换机口令:1)配置交换机的登陆密码S2126G(config)#enablesecretlevel10star“0”表示输入的是明文形式的口令2)配置交换机的特权密码S2126G(config)#enablesecretlevel150star“0”表示输入的是明文形式的口令常用交换机配置命令:1、为交换机分配管理IP地址S2126G(config)#interfacevlan1S2126G(config-if)#ipaddress{IPaddress}{IPsubnetmask}[secondary] 2、将接口启用S2126G(config-if)#noshutdown345从TFTP1、查看2、配置3、查看MAC地址表记录的生存时间S2126G#showmac-address-tableaging-timeVLAN的配置:1.添加一个VLANS2126G(config)#vlan<1-4094>S2126G(config-vlan)#2.为VLAN命名S2126G(config-vlan)#name名字将交换机端口分配到VLAN1.配置PortVLANSwitch(config-if)#switchportaccessvlan<1-4094>2.配置TagVLANSwitch(config-if)#switchportmodetrunk1)配置本地(native)VLAN2注34VLAN1.2.将VLAN从RSTP1.启用生成树:S2126G(config)#spanning-tree2.配置交换机优先级:S2126G(config)#spanning-treepriority<0-61440>“0”或“4096”的倍数(RSTPBPDU该值后12bit全0)3.配置交换机端口优先级: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创建聚合接口AG1优先SVIIP,此IP1)配置最大连接数限制Switch(config-if)#switchportport-secruitymaxmum1配置端口的最大连接数为1,最大连接数为128Switch(config-if)#switchportport-secruityviolationshutdown配置安全违例的处理方式为shutdown,可选为protect(当安全地址数满后,将未知名地址丢弃)、restrict(当违例时,发送一个Trap通知)、shutdown(当违例时将端口关闭,并发送Trap通知,可在全局模式下用errdisablerecovery来恢复)2)IP和MAC地址绑定Switch(config-if)#switchportport-securitymac-addressip-address 与IP地址十六进制a-f用小写字母)三层交换机路由功能:1)开启三层交换机的路由功能Switch(config)#iprouting2)开启端口的三层路由功能。

锐捷交换机命令大全

锐捷交换机命令大全

锐捷交换机命令大全【第一部分】交换机支持的命令: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 ;设置路由器IPrommon>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路由协议。

锐捷交换机常用命令速查

锐捷交换机常用命令速查

>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: ;ROM状态,路由器是rommon>hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置: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 ;返回命令答案补充交换机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模式交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address;设置IP地址switch(config)#ip default-gateway答案补充设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息答案补充2. 路由器支持的命令:路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动路由器口令设置: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 ;返回命令路由器配置: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 ;设置第二个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 ;重新引导答案补充路由器文件操作: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 ;引导IOS静态路由: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 ;默认路由举例动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协议。

锐捷系列交换机常用配置的命令

锐捷系列交换机常用配置的命令

锐捷常用命令交换机基本命令switch>enable !从用户模式进入特权模式switch # configure terminal !从特权模式进入全局配置模式switch (config)# hostname SwitchA !设置交换机名称为为“SwitchA”SwitchA (config)# enable secret level 1 0 star 设置交换机远程登陆telnet口令SwitchA (config)# enable secret level 15 0 star 将交换机特权模式口令配置为“star”SwitchA (config)# interface vlan 1 !进入交换机管理接口配置模式SwitchA (config-if)#ip address 172.16.0.1 255.255.255.0 配置交换机的IP地址SwitchA (config-if)# no shutdown ! 启用端口S2150G(config)#ip default-gateway 192.168.1.254 //配置网关地址为192.168.1.254S2150G(config)#interface range f 1/0/1-48,2/0/1-48S2150G(config-if) #spanning-tree bpdufilter enabled//将上联光纤口启动过滤Bpdu报文功能,提高网络的稳定性S2150G(config-if)#spanning-tree bpdufilter disabled //禁用Bpdu过滤功能S2150G(config) #snmp-server community public ro //给交换机启动SNMP协议,便于StarView网管工具发现SwitchA # show ip interface 显示三层IP接口的各个属性SwitchA #show mac-address-table 显示交换机MAC地址表的记录SwitchA# show running-config 查看交换机的当前配置SwitchA#show interface fastethernet 0/1 该命令查看接口设置和统计信息SwitchA# copy running-config startup-config 或SwitchA# write memory 保存配置Delete flash:config.text !清除配置文件Delete flash:vlan.dat !删除VLAN配置文件虚拟局域网VLAN配置S2126G(config)# vlan 10 !创建vlan 10S2126G(config-vlan)# name test10 !将Vlan 10命名为test10S2126G(config-vlan)# exit !返回交换机全局配置模式S2126G(config)# interface fastethernet 0/1 !进入F0/1的接口配置模式S2126G(config-if)# switch access vlan 10 !将F0/1端口加入vlan 10中S2126G(config-if)#exitS2126G(config)# interface range fastEthernet 0/2-3 , 0/5S3550(config-if-range)# switch access vlan 10S3550(config)# interface vlan 20 ! 创建虚拟接口vlan 20S3550(config-if)# ip address 172.16.10.254 255.255.255.0 配置虚拟接口vlan 20的IP地址S3550(config-if)# no shutdown !启用端口S2126# show vlan !该命令显示VLAN的成员端口等信息S3550# show vlan id 10 !验证配置配置交换机之间的Trunk连接:注意S3550和S2126均需配置S3550(config)# interface fastEthernet 0/1 !进入F0/1接口配置模式S3550(config-if)# switchport mode trunk !将F0/1设置为Trunk模式S3550# show interface fastEthernet 0/1 switchport链路聚合S3550(config)# interface range fastEthernet 0/1-2 !使用该命令同时配置多个接口S3550(config-if-range)#port-group 1 !配置F0/1和F0/2归属于AG1S3550(config-if-range)#endS3550# show aggregateport 1 summary !显示聚合端口AG1摘要信息S3550(config)# interface aggregatePort 1 !进入AG1接口模式S3550(config-if)# switchport mode trunk !将端口设为tag vlan模式S3550(config-if)# endS3550(config)# ip routing !启动路由功能生成树SwitchA(config)# spanning-tree ! 开启生成树协议SwitchA(config)# spanning-tree mode stp ! 设置生成树为STP(802.1D)SwitchA (config)# spanning-tree priority 4096 配置SwitchA为根交换机即将SwitchA的优先级设置为4096配置S3550A和S3550B间的F0/2连接为主链路:S3550A (config)# interface fastEthernet 0/2S3550A (config-if)# spanning-tree port-priority 0 !设置F0/2的端口优先级为0S2126A (config-if)# speed 10SwitchA(config)# endSwitchA# show spanning-tree !显示交换机的生成树模式及相关状态SwitchA# show spanning-tree interface fastEthernet 0/1 ! 显示Fa0/1接口STP状态快速生成树S3550A (config)# spanning-tree mode rstp ! 设置生成树为RSTP(802.1W)S3550A (config)# spanning-tree priority 0 配置S3550A为根交换机即设置SwitchA的优先级为0ACL配置Switch(config)#access-list 1 permit 172.16.0.0 0.0.255.255 靠近目的Switch(config)#interface ethernet 0Switch(config-if)#ip access-group 1 outSwitch(config)#access-list 101 deny tcp 192.168.1.0 0.0.0.255 host 192.168.10.100 eq 80Switch(config)#access-list 101 permit ip any anySwitch(config)#interface ethernet 1Switch(config-if)#ip access-group 101 outSwitch # show access-list 显示所有的ACLSwitch # show ip access-lists 1 显示IP ACL1Switch # show ip interface fastEthernet 1/1 显示f1/1接口的访问列表静态路由格式:router(config)# ip route [未直连的目的网段] [子网掩码] [转发路由器的IP地址/本地接口R1(config)# ip route 172.16.2.0 255.255.255.0 172.16.21.2 !配置静态路由R1# show ip route !查看路由表缺省路由:ip route 0.0.0.0 0.0.0.0 [转发路由器的IP地址/本地接口RIP协议R1(config)# router rip !启用RIP进程R1(config-router)# network 172.16.1.0 !公布直连网络R1(config-router)# network 172.16.21.0 !公布直连网络router# show ip protocols !验证RIP的配置R1# show ip interface brief !显示接口的摘要信息router# debug ip rip !在控制台显示RIP的工作状态PPP协议R1(config)# interface serial 1/2R1(config-if)# ip address 172.16.10.1 255.255.255.0R1(config-if)# encapsulation ppp !配置接口封装为PPP;两端均需配置R1(config-if)# no shutdownR1(config-if)# clock rate 64000NAT让内部主机在公网地址缺乏的情况下可以访问外部网络(主要命令)R1(config)# ip route 0.0.0.0 0.0.0.0 serial 1/2 先做缺省路由R1(config-if)#ip nat inside 进入F0/1,定义为内网接口R1(config-if)#ip nat outside 进入S1/2,定义为外网接口R1(config)#ip nat pool internet 200.1.8.7 200.2.8.7 netmask 255.255.255.0 定义内部全局地址池R1(config)#access-list 10 permit 172.16.1.0 0.0.0.255 定义允许转换的地址R1(config)#ip nat inside source list 10 pool internet overload 为内部本地调用转换地址池NAT发布主机R1(config)# ip route 0.0.0.0 0.0.0.0 serial 1/2 先做缺省路由R1(config)#int fa0/1R1(config-if)#ip nat insideR1(config-if)#exitR1(config)#int s1/2R1(config-if)#ip nat outsideR1(config-if)#exitR1(config)#ip nat pool webserver 172.16.8.5 172.16.8.5 netmask 255.255.255.0 定义内网服务器地址池R1(config)#access-list 3 permit host 200.1.8.7 定义外网的公网IPR1(config)#ip nat inside destination list 3 pool webserver 将外网的公网IP地址转换为web服务器地址R1(config)#ip nat inside source static tcp 172.16.8.5 80 200.1.8.7 80 定义访问外网IP的80端口时转换为内网的服务器IP 的80端口。

锐捷交换机命令大全

锐捷交换机命令大全

【第一部分】交换机支持的命令:1.交换机基本状态:s w i t c h:;R O M状态,路由器是r o m m o n> h o s t n a m e>;用户模式h o s t n a m e#;特权模式h o s t n a m e(c o n f i g)#;全局配置模式h o s t n a m e(c o n f i g-i f)#;接口状态2.交换机口令设置:s w i t c h>e n a b l e;进入特权模式s w i t c h#c o n f i g t e r m i n a l;进入全局配置模式s w i t c h(c o n f i g)#h o s t n a m e;设置交换机的主机名s w i t c h(c o n f i g)#e n a b l e s e c r e t x x x;设置特权加密口令s w i t c h(c o n f i g)#e n a b l e p a s s w o r d x x a;设置特权非密口令s w i t c h(c o n f i g)#l i n e c o n s o l e0;进入控制台口s w i t c h(c o n f i g-l i n e)#l i n e v t y04;进入虚拟终端s w i t c h(c o n f i g-l i n e)#l o g i n;允许登录s w i t c h(c o n f i g-l i n e)#p a s s w o r d x x;设置登录口令x x s w i t c h#e x i t;返回命令3.交换机V L A N设置:s w i t c h#v l a n d a t a b a s e;进入V L A N设置s w i t c h(v l a n)#v l a n2;建V L A N 2 s w i t c h(v l a n)#n o v l a n2;删v l a n 2 s w i t c h(c o n f i g)#i n t f0/1;进入端口 1 s w i t c h(c o n f i g-i f)#s w i t c h p o r t a c c e s s v l a n2;当前端口加入v l a n2 s w i t c h(c o n f i g-i f)#s w i t c h p o r t m o d e t r u n k;设置为干线s w i t c h(c o n f i g-i f)#s w i t c h p o r t t r u n k a l l o w e d v l a n1,2;设置允许的v l a n s w i t c h(c o n f i g-i f)#s w i t c h p o r t t r u n k e n c a p d o t1q;设置v l a n中继s w i t c h(c o n f i g)#v t p d o m a i n;设置发v t p域名s w i t c h(c o n f i g)#v t p p a s s w o r d;设置发v t p密码s w i t c h(c o n f i g)#v t p m o d e s e r v e r;设置发v t p模式s w i t c h(c o n f i g)#v t p m o d e c l i e n t;设置发v t p模式4.交换机设置I P地址:s w i t c h(c o n f i g)#i n t e r f a c e v l a n1;进入v l a n 1 s w i t c h(c o n f i g-i f)#i p a d d r e s s;设置I P地址s w i t c h(c o n f i g)#i p d e f a u l t-g a t e w a y;设置默认网关s w i t c h#d i r f l a s h:;查看闪存5.交换机显示命令:s w i t c h#w r i t e;保存配置信息s w i t c h#s h o w v t p;查看v t p配置信息s w i t c h#s h o w r u n;查看当前配置信息s w i t c h#s h o w v l a n;查看v l a n配置信息s w i t c h#s h o w i n t e r f a c e;查看端口信息s w i t c h#s h o w i n t f0/0;查看指定端口信息【第二部分】路由器支持的命令:1.路由器显示命令:router#showrun;显示配置信息router#showinterface;显示接口信息router#showiproute;显示路由信息router#showcdpnei;显示邻居信息router#reload;重新起动2.路由器口令设置:router>enable;进入特权模式router#configterminal;进入全局配置模式router(config)#hostname;设置交换机的主机名router(config)#enablesecretxxx;设置特权加密口令router(config)#enablepasswordxxb;设置特权非密口令router(config)#lineconsole0;进入控制台口router(config-line)#linevty04;进入虚拟终端router(config-line)#login;要求口令验证router(config-line)#passwordxx;设置登录口令xxrouter(config)#(Ctrl+z);返回特权模式router#exit;返回命令3.路由器配置:router(config)#ints0/0;进入Serail接口router(config-if)#noshutdown;激活当前接口router(config-if)#clockrate64000;设置同步时钟router(config-if)#ipaddress;设置IP地址router(config-if)#ipaddresssecond;设置第二个IProuter(config-if)#intf0/0.1;进入子接口router(config-subif.1)#ipaddress;设置子接口IProuter(config-subif.1)#encapsulationdot1q;绑定vlan中继协议router(config)#config-register0x2142;跳过配置文件router(config)#config-register0x2102;正常使用配置文件router#reload;重新引导4.路由器文件操作:router#copyrunning-configstartup-config;保存配置router#copyrunning-configtftp;保存配置到tftprouter#copystartup-configtftp;开机配置存到tftprouter#copytftpflash:;下传文件到flashrouter#copytftpstartup-config;下载配置文件ROM状态:Ctrl+Break;进入ROM监控状态rommon>confreg0x2142;跳过配置文件rommon>confreg0x2102;恢复配置文件rommon>reset;重新引导rommon>copyxmodem:flash:;从console传输文件;设置路由器IP;设置路由器掩码rommon>T;指定TFTP服务器IPrommon>TFTP_FILE=c2600.bin;指定下载的文件rommon>tftpdnld;从tftp下载rommon>dirflash:;查看闪存内容rommon>boot;引导IOS5.静态路由:iproute;命令格式;静态路由举例;默认路由举例6.动态路由:router(config)#iprouting;启动路由转发router(config)#routerrip;启动RIP路由协议。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

锐捷三层交换机命令大全TPMK standardization office【 TPMK5AB- TPMK08- TPMK2C- TPMK18】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 , 优先级值小为高。

优先级可选值为0,4096,8192,……,为4096的倍数。

交换机默认值为32768 VLAN的基本配置(config)#vlan 10 创建VLAN10(config-vlan)#name vlanname 命名VLAN为vlanname(config-if)#switchport access vlan 10 将该端口划入VLAN10中某端口的接口配置模式下进行(config)#interface vlan 10 进入VLAN 10的虚拟端口配置模式(config-if)# ip address 192.168.1.1 255.255.255.0 为VLAN10的虚拟端口配置IP及掩码,二层交换机只能配置一个IP,此IP是作为管理IP使用,例如,使用Telnet 的方式登录的IP地址(config-if)# no shutdown 启用该端口端口安全(config)# interface fastethernet 0/1 进入一个端口(config-if)# switchport port-security 开启该端口的安全1.配置最大连接数限制(config-if)# switchport port-secruity maxmum 1 配置端口的最大连接数为1,最大连接数为128(config-if)# switchport port-secruity violation shutdown配置安全违例的处理方式为shutdown,可选为protect (当安全地址数满后,将未知名地址丢弃)、restrict(当违例时,发送一个Trap通知)、shutdown(当违例时将端口关闭,并发送Trap通知,可在全局模式下用errdisable recovery来恢复) 2.IP和MAC地址绑定(config-if)#switchport port-security mac-address xxxx.xxxx.xxxx ip-address 172.16.1.1接口配置模式下配置MAC地址xxxx.xxxx.xxxx和IP172.16.1.1进行绑定(MAC地址注意用小写)三层路由(针对三层交换机)(config)# ip routing 开启三层交换机的路由(config)# interface fastethernet 0/1(config-if)# no switchport 开启端口的三层路由(这样就可以为某一端口配置IP) (config-if)# ip address 192.168.1.1 255.255.255.0(config-if)# no shutdown三层交换机路由协议(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 配置静态路由注:172.16.1.0 255.255.255.0 为目标网络的网络号及子网掩码172.16.2.1 为下一跳的地址,也可用接口表示,如ip route 172.16.1.0255.255.255.0 serial 1/2(172.16.2.0所接的端口)(config)# router rip 开启RIP协议进程(config-router)# network 172.16.1.0 申明本设备的直连网段信息(config-router)# version 2 开启RIP V2,可选为version 1(RIPV1)、version 2(RIPV2)(config-router)# no auto-summary 关闭路由信息的自动汇总(只有在RIPV2支持) (config)# router ospf 开启OSPF路由协议进程(针对1762,无需使用进程ID)(config)# router ospf 1 开启OSPF路由协议进程(针对2501,需要加OSPF进程ID)(config-router)# network 192.168.1.0 0.0.0.255 area 0申明直连网段信息,并分配区域号(area0为骨干区域)IP ACL:交换机采用命名的访问控制列表;分标准(stand)和扩展(extended)两种1.标准ACL(config)#ip access-list stand listname 定义命名标准列表,命名为listname,stand为标准列表(config-std-nacl)#deny 192.168.30.0 0.0.0.255 拒绝来自192.168.30.0网段的IP流量通过注:deny:拒绝通过;可选:deny(拒绝通过)、permit(允许通过)192.168.30.0 0.0.0.255:源地址及源地址通配符;可使用any表示任何IP(config-std-nacl)#permit any(config-std-nacl)#end 返回2.扩展ACL(config)#ip access-list extended listname定义命名扩展列表,命名为listname,extended为扩展(config-ext-nacl)#deny tcp 192.168.30.0 0.0.0.255 192.168.10.0 0.0.0.255 eq www 拒绝源地址为192.168.30.0网段的IP访问目的地址为192.168.10.0网段的WWW 服务注:deny:拒绝通过,可选:deny(拒绝通过)、permit(允许通过)tcp: 协议名称,协议可以是udp, ip,eigrp, gre, icmp, igmp, igrp等等。

192.168.10.0 0.0.0.255:源地址及源地址通配符192.168.30.0 0.0.0.255:目的地址及目的地址通配符eq:操作符(lt-小于,eq-等于,gt-大于,neg-不等于,range-包含)www:端口号,可使用名称或具体编号可以使用的协议名称(或编号)和端口名称(或编号)请打?查询。

(config-ext-nacl)#permit ip any any 允许其它通过(config-ext-nacl)#end 返回(config)#interface vlan 10 进入端口配置模式(config-if)# ip access-group listname in 访问控制列表在端口下in方向应用;可选:in(入栈)、out(出栈)(config-if)#end 返回注:配置ACL时,若只想对其中部分IP进行限制访问时,必须配置允许其流量通过,否则设备只会对限制IP进行处理,不会对非限制IP进行允许通过处理。

相关文档
最新文档