当前位置:文档之家› 锐捷网络交换机的配置命令集

锐捷网络交换机的配置命令集

锐捷网络交换机的配置命令集
锐捷网络交换机的配置命令集

锐捷网络交换机的配置命令集

交换机

>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 配置特权密码为star

Level 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 , 优先级值小为高。优先级可选值为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.0 255.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进行允许通过处理。

锐捷交换机基本配置命令

交换机基本操作 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

锐捷交换机常用操作命令

一、交换机配置模式介绍 (2) 二、交换机基本配置 (2) 2.1 接口介质类型配置 (3) 2.2 接口速度/双工配置 (3) 2.3 VLAN配置 (4) 2.4 端口镜像 (5) 2.5 端口聚合 (6) 2.6 交换机堆叠 (6) 2.7 ACL配置 (7) 2.8 端口安全 (8) 2.9 交换机防攻击配置 (10) 2.10 DHCP配置 (13) 2.11 三层交换机配置 (14) 三、交换机常用查看命令 (16)

一、交换机配置模式介绍 交换机配置模式主要有: 用户模式:此模式只可以简单的查看一些交换机的配置和一些简单的修改。 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表示为特权密码 交换机配置管理IP switch (config)#interface vlan 1 //假设管理VLAN为VLAN 1 switch (config-if)#ip address 192.168.1.1 255.255.255.0 //给管理VLAN配置管理IP地址 switch (config-if)#no shutdown //激活管理IP,养成习惯,无论配置什么设备,都使用一下这个命令

H3C三层交换机配置命令

H3C三层交换机配置命令 [Quidway]dis cur ;显示当前配置[Quidway]display current-configuration ;显示当前配置[Quidway]display interfaces ;显示接口信息[Quidway]display vlan all ;显示路由信息[Quidway]display version ;显示版本信息 [Quidway]super password ;修改特权用户密码 [Quidway]sysname ;交换机命名[Quidway]interface ethernet 0/1 ;进入接口视图 [Quidway]interface vlan x ;进入接口视图[Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0 ;配置VLAN的IP地址 [Quidway]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关 [Quidway]rip ;三层交换支持 [Quidway]local-user ftp 增加用户名 [Quidway]user-interface vty 0 4 ;进入虚拟终端 [S3026-ui-vty0-4]authentication-mode password ;设置口令模式 [S3026-ui-vty0-4]set authentication-mode password simple 222 ;设置口令 [S3026-ui-vty0-4]user privilege level 3 ;用户级别 [Quidway]interface ethernet 0/1 ;进入端口模式 [Quidway]int e0/1 ;进入端口模式 [Quidway-Ethernet0/1]duplex {half|full|auto} ;配置端口工作状态 [Quidway-Ethernet0/1]speed {10|100|auto} ;配置端口工作速率 [Quidway-Ethernet0/1]flow-control ;配置端口流控 [Quidway-Ethernet0/1]mdi {across|auto|normal} ;配置端

锐捷交换机常用配置基础命令

一、交换机基本配置 1、交换机命名: 在项目实施的时候,建议为处于不同位置的交换机命名,便于记忆,可提高后期管理效率。 switch(config)#hostname ruijie //ruijie为该交换机的名字 2、交换机配置管理密码: 配置密码可以提高交换机的安全性,另外,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表示为特权密码3、交换机配置管理IP switch (config)#interface vlan 1 //假设管理VLAN为VLAN 1 switch (config-if)#ip address 192.168.1.1 255.255.255.0 //给管理VLAN配置管理IP地址 switch (config-if)#no shutdown //激活管理IP,养成习惯,无论配置什么设备,都使用一下这个命令 4、交换机配置网关: switch(config)#ip default-gateway 192.168.1.254 //假设网关地址为192.168.1.254,此命令用户二层设备。通过以上几个命令的配置,设备便可以实现远程管理,在项目实施时(尤其是设备位置比较分散)特别能提高效率。 二、接口介质类型配置 锐捷为了降低SME客户的总体拥有成本,推出灵活选择的端口形式:电口和光口复用接口,方便用户根据网络环境选择对应的介质类型。 但光口和电口同时只能用其一,如图1,如使用了光口1F,则电口1不能使用。 1、接口介质类型的转换: Switch(config)#interface gigabitethernet 0/25-28

三层交换机的配置命令

三层交换机的图,如图所示: 一.交换机的配置: S2的配置命令: Enable Conf terminal Hostname S2 Switch(config)#vlan 10 Switch(config-vlan)#name stu10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#name stu20 Switch(config)#interface f0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config)#interface f0/2 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 20 Switch(config)#inte f0/24 Switch(config-if)#switchport mode trunk

S3的配置命令: Enable Conf terminal Hostname S3 Switch(config)#vlan 10 Switch(config-vlan)#name stu10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#name stu20 Switch(config)#interface f0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config)#interface f0/2 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 20 Switch(config)#inte f0/24 Switch(config-if)#switchport mode trunk 二.三层交换机的配置命令 Enable Conf terminal Switch(config)#vlan 10 Switch(config-vlan)#vlan 20 Switch(config)#interface f0/1 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config)#interface f0/2 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config)#interface vlan 10 Switch(config-if)#ip address 192.168.10.254 255.255.255.0 Switch(config-if)#no shutdown

锐捷交换机配置手册簿完整

锐捷S3550配置手册 第一部分:交换机概述 一:交换机的几种配置方法 本部分包括以下内容: 控制台 远程登录 其它配置方法 本部分内容适用于交换机、路由器等网络设备。 控制台 用一台计算机作为控制台和网络设备相连,通过计算机对网络设备进行配置。 1、硬件连接: 把Console线一端连接在计算机的串行口上,另一端连接在网络设备的Console口上。Console线在购置网络设备时会提供,它是一条反转线,你也可以自己用双绞线进行制作。

按照上面的线序制作一根双绞线,一端通过一个转接头连接在计算机的串行口上,另一端连 接在网络设备的Console口上。 注意:不要把反转线连接在网络设备的其他接口上,这有可能导致设备损坏。 2、软件安装: 在计算机上需要安装一个终端仿真软件来登录网络设备。通常我们使用Windows自带的“超级终端”。超级终端的安装方法: 开始| 程序| 附件| 通信| 超级终端。 按照提示的步骤进行安装,其中连接的接口应选择“COM1”,端口的速率应选择“9600”,数据流控制应选择“无”,其它都使用默认值。

登录后,就可以对网络设备进行配置了。 说明:超级终端只需安装一次,下次再使用时可从“开始| 程序| 附件| 通信| 超级终端”中找到上次安装的超级终端,直接使用即可。 远程登录 通过一台连接在网络中的计算机,用Telnet命令登录网络设备进行配置。 远程登录条件: 1、网络设备已经配置了IP地址、远程登录密码和特权密码。 2、网络设备已经连入网络工作。

3、计算机也连入网络,并且可以和网络设备通信。 说明:远程登录的计算机不是连接在网络设备Console口上的计算机,而是网络中任一台计算机。 远程登录方法: 在计算机的命令行中,输入命令“telnet 网络设备IP地址”,输入登录密码就可以进入网 络设备的命令配置模式。 说明:远程登录方式不能用来配置新设备,新设备应该用控制台配置IP地址等参数,以后才能使用远程登录进行配置。 其它配置方法 除了控制台和远程登录之外,还有其它一些配置方法配置网络设备。 1、TFTP服务器: TFTP服务器是网络中的一台计算机,你可以把网络设备的配置文件等信息备份到TFTP服务器之中,也可以把备份的文件传回到网络设备中。 由于设备的配置文件是文本文件,所以,你可以用文本编辑软件打开进行修改,再把修改后 的配置文件传回网络设备,这样就可以实现配置功能。你也可以用TFTP服务器把一个已经做好的配置文件上传到一台同型号的设备中实现对它的配置。

华为三层交换机配置方法及命令

Enable //进入私有模式 Configure terminal //进入全局模式 service password-encryption //对密码进行加密 hostname Catalyst 3550-12T1 //给三层交换机定义名称 enable password 123456. //enable密码 Enable secret 654321 //enable的加密密码(应该是乱码而不是654321这样) Ip subnet-zero //允许使用全0子网(默认都是打开的) Ip name-server 172.16.8.1 172.16.8.2 //三层交换机名字Catalyst 3550-12T1对应的IP地址是172.16.8.1 Service dhcp //提供DHCP服务 ip routing //启用三层交换机上的路由模块 Exit Vtp mode server //定义VTP工作模式为sever模式 Vtp domain centervtp //定义VTP域的名称为centervtp Vlan 2 name vlan2 //定义vlan并给vlan取名(如果不取名的话,vlan2的名字应该是vlan002) Vlan 3 name vlan3 Vlan 4 name vlan4 Vlan 5 name vlan5 Vlan 6 name vlan6 Vlan 7 name vlan7 Vlan 8 name vlan8 Vlan 9 name vlan9 Exit interface Port-channel 1 //进入虚拟的以太通道组1 Interface gigabitethernet 0/1 //进入模块0上的吉比特以太口1 channel-group 1 mode on //把这个接口放到快速以太通道组1中 Interface gigabitethernet 0/2 //同上channel-group 1 mode on port-channel load-balance src-dst-ip //定义快速以太通道组的负载均衡方式(依靠源和目的IP的方式)

华为交换机基本配置命令

华为交换机基本配置命令 一、单交换机VLAN划分 命令命令解释 system 进入系统视图 system-view 进入系统视图 quit 退到系统视图 undo vlan 20 删除vlan 20 sysname 交换机命名 disp vlan 显示vlan vlan 20 创建vlan(也可进入vlan 20) port e1/0/1 to e1/0/5 把端口1-5放入VLAN 20 中disp vlan 20 显示vlan里的端口20 int e1/0/24 进入端口24 port access vlan 20 把当前端口放入vlan 20 undo port e1/0/10 表示删除当前VLAN端口10 disp curr 显示当前配置 二、配置交换机支持TELNET system 进入系统视图 sysname 交换机命名 int vlan 1 进入VLAN 1

ip address 192.168.3.100 255.255.255.0 配置IP地址 user-int vty 0 4 进入虚拟终端 authentication-mode password (aut password) 设置口令模式 set authentication password simple 222 (set aut pass sim 222) 设置口令 user privilege level 3(use priv lev 3) 配置用户级别 disp current-configuration (disp cur) 查看当前配置 disp ip int 查看交换机VLAN IP配置 删除配置必须退到用户模式 reset saved-configuration(reset saved) 删除配置 reboot 重启交换机 三、跨交换机VLAN的通讯 在sw1上: vlan 10 建立VLAN 10 int e1/0/5 进入端口5 port access vlan 10 把端口5加入vlan 10 vlan 20 建立VLAN 20 int e1/0/15 进入端口15 port access vlan 20 把端口15加入VLAN 20 int e1/0/24 进入端口24 port link-type trunk 把24端口设为TRUNK端口 port trunk permit vlan all 同上 在SW2上:

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

【第一部分】交换机支持的命令: 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 ;设置登录口令xx switch#exit ;返回命令 3.交换机VLAN设置: switch#vlan database ;进入VLAN设置 switch(vlan)#vlan 2 ;建VLAN 2 switch(vlan)#no vlan 2 ;删vlan 2 switch(config)#int f0/1 ;进入端口1 switch(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模式

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

锐捷交换机、路由器常用命令EXEC模式: 用户模式switch> 交换机信息的查看,简单测试命令 特权模式switch# 查看、管理交换机配置信息,测试、调试 配置模式: 全局配置模式switch(config)# 配置交换机的整体参数 接口配置模式switch(config-if)# 配置交换机的接口参数 进入全局配置模式 Switch#c onfigure terminal Switch(config)#exit Switch# 进入接口配置模式 Switch(config)#interface fastethernet 0/1 Switch(config-if)#exit Switch(config)# 从子模式下直接返回特权模式 Switch(config-if)#end

Switch# 命令行其他功能 获得帮助 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

为交换机配置管理IP Switch (config)#interface vlan 1 Switch (config-if)#no shutdown Switch (config-if)#ip address 192.168.1.1 255.255.255.0 Switch (config-if)#end 配置文件的管理 保存配置 将当前运行的参数保存到flash 中用于系统初始化时初始化参数 Switch#copy running-config startup-config Switch#write memory Switch#write 删除配置 永久性的删除flash 中不需要的文件 使用命令delete flash:config.text 删除当前的配置:在配置命令前加no 例:switch(config-if)# no ip address 查看配置文件内容 Switch#show configure 查看保存在FLASH里的配置信息

C三层交换机配置命令

C三层交换机配置命令Prepared on 21 November 2021

H3C三层交换机配置命令 [Quidway]discur;显示当前配置[Quidway]displaycurrent-configuration;显示当前配置[Quidway]displayinterfaces;显示接口信息[Quidway]displayvlanall;显示路由信息[Quidway]displayversion;显示版本信息 [Quidway]superpassword;修改特权用户密码[Quidway]sysname;交换机命名 [Quidway]interfaceethernet0/1;进入接口视图[Quidway]interfacevlanx;进入接口视图[Quidway]iproute-static0.0.0[Quidway]rip;三层交换支持[Quidway]local-userftp增加用户名 [Quidway]user-interfacevty04;进入虚拟终端[S3026-ui-vty0-4]authentication-modepassword;设置口令模式[S3026-ui-vty0-4]setauthentication-modepasswordsimple222;设置口令[S3026-ui-vty0-4]userprivilegelevel3;用户级别 [Quidway]interfaceethernet0/1;进入端口模式[Quidway]inte0/1;进入端口模式[Quidway-Ethernet0/1]duplex{half|full|auto};配置端口工作状态[Quidway- Ethernet0/1]speed{10|100|auto};配置端口工作速率[Quidway-Ethernet0/1]flow-control;配置端口流控[Quidway-Ethernet0/1]mdi{across|auto|normal};配置端口平接扭接[Quidway-Ethernet0/1]portlink-type{trunk|access|hybrid};设置端口工作模式[Quidway- Ethernet0/1]portaccessvlan3;当前端口加入到VLAN[Quidway- Ethernet0/2]porttrunkpermitvlan{ID|All};设trunk允许的VLAN[Quidway- Ethernet0/3]porttrunkpvidvlan3;设置trunk端口的PVID[Quidway- Ethernet0/1]undoshutdown;激活端口[Quidway-Ethernet0/1]shutdown;关闭端口[Quidway-Ethernet0/1]quit;返回 [Quidway]vlan3;创建VLAN[Quidway-vlan3]portethernet0/1;在VLAN中增加端口[Quidway-vlan3]porte0/1;简写方式[Quidway-vlan3]portethernet0/1toethernet0/4;在VLAN中增加端口[Quidway-vlan3]porte0/1toe0/4;简写方式 [Quidway]monitor-port;指定镜像端口 [Quidway]portmirror;指定被镜像端口 [Quidway]portmirrorint_listobserving-portint_typeint_num;指定镜像和被镜像[Quidway]descriptionstring;指定VLAN描述字符[Quidway]description;删除VLAN描述字符[Quidway]displayvlan[vlan_id];查看VLAN设置 [Quidway]stp{enable|disable};设置生成树,默认关闭[Quidway]stppriority4096;设置交换机的优先级[Quidway]stproot{primary|secondary};设置为根或根的备份[Quidway- Ethernet0/1]stpcost200;设置交换机端口的花费 [Quidway]link-aggregatione0/1toe0/4ingress|both;端口的聚合[Quidway]undolink-aggregatione0/1|all;始端口为通道号 [SwitchA-vlanx]isolate-user-vlanenable;设置主vlan[SwitchA]isolate-user- vlansecondary;设置主vlan包括的子vlan[Quidway- Ethernet0/2]porthybridpvidvlan;设置vlan的pvid[Quidway- Ethernet0/2]porthybridpvid;删除vlan的pvid[Quidway- Ethernet0/2]porthybridvlanvlan_id_listuntagged;设置无标识的vlan如果包的vlanid与PVId一致,则去掉vlan信息.默认PVID=1。所以设置PVID为所属vlanid,设置可以互通的vlan 为untagged.

锐捷基本配置命令

S3750>enable 特权模式 S3750#configure terminal 全局模式 S3750(config)#hostname SW1 将交换机命名为SW1 SW1(config)#vlan 10 创建VLAN 10 SW1(config-vlan)#name 1 命名VLAN 10 为1 SW1(config-vlan)#exit 退出到上一级 SW1(config)#vlan 20 创建VLAN 20 SW1(config-vlan)#name 2命名VLAN 20 为2 SW1(config-vlan)#exit退出到上一级 SW1(config)#interface fastEthernet 0/1进入端口0/1 SW1(config-if)#no shutdown启用端口 SW1(config-if)#shutdown禁用端口 SW1(config-if)#exit退出到上一级 SW1(config)#interface range fastEthernet 0/2-5进入端口2-5端口SW1(config-if-range)#switchport mode access将端口配置为access 模式 SW1(config-if-range)#switchport access vlan 1 将端口划分给VLAN 1 SW1(config-if-range)#exit 退出到上一级 SW1(config)#interface range fastEthernet 0/6-10 进入6-10端口SW1(config-if-range)#switchport mode access 将端口配置为access模式

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

锐捷常用命令 交换机基本命令 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.254 S2150G(config)#interface range f 1/0/1-48,2/0/1-48 S2150G(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 10 S2126G(config-vlan)# name test10 !将Vlan 10命名为test10 S2126G(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)#exit S2126G(config)# interface range fastEthernet 0/2-3 , 0/5 S3550(config-if-range)# switch access vlan 10 S3550(config)# interface vlan 20 ! 创建虚拟接口vlan 20 S3550(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归属于AG1 S3550(config-if-range)#end S3550# show aggregateport 1 summary !显示聚合端口AG1摘要信息 S3550(config)# interface aggregatePort 1 !进入AG1接口模式 S3550(config-if)# switchport mode trunk !将端口设为tag vlan模式 S3550(config-if)# end S3550(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/2 S3550A (config-if)# spanning-tree port-priority 0 !设置F0/2的端口优先级为0 S2126A (config-if)# speed 10 SwitchA(config)# end SwitchA# 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的优先级为0 ACL配置 Switch(config)#access-list 1 permit 172.16.0.0 0.0.255.255 靠近目的 Switch(config)#interface ethernet 0

三层交换机详细配置实例(图)

三层交换机与路由器的配置实例(图解) 目的:学会使用三层交换与路由器让处于不同网段的网络相互通信 实验步骤:一:二层交换机的配置: 在三个二层交换机上分别划出两VLAN,并将二层交换机上与三层交换或路由器上的接线设置为trunk接口 二:三层交换机的配置: 1:首先在三层交换上划出两个VLAN,并进入VLAN为其配置IP,此IP将作为与他相连PC 的网关。 2:将与二层交换机相连的线同样设置为trunk接线,并将三层交换与路由器连接的线设置为路由接口(no switchsport) 3:将路由器和下面的交换机进行单臂路由的配置 实验最终结果:拓扑图下各个PC均能相互通信 交换机的配置命令:

SW 0: Switch> Switch>en Switch#conf Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 2 Switch(config-vlan)#exit Switch(config)#int f0/2 Switch(config-if)#switchport access vlan 2 Switch(config-if)#no shut Switch(config-if)#int f0/3 Switch(config-if)#switchport mode trunk %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)#exit Switch(config)# SW 1: Switch>en Switch#conf Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#int f0/2 Switch(config-if)#switchport access vlan 2 % Access VLAN does not exist. Creating vlan 2 Switch(config-if)#no shut Switch(config-if)#exit Switch(config)#int f0/3 Switch(config-if)#switchport mode trunk %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)# SW 2: Switch>en Switch#conf Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z.

锐捷交换机常用配置基础命令(实验用)

一、交换机基本配置 ? 交换机命名: 在项目实施的时候,建议为处于不同位置的交换机命名,便于记忆,可提高后期管理效率。 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表示为特权密码 ? 交换机配置管理IP switch (config)#interface vlan 1 //假设管理VLAN为VLAN 1 switch (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/25-28 Interface fastethernet 0/2 Switch(config-if)#medium-type fiber //把接口工作模式改为光口Switch(config-if)#medium-type copper //把接口工作模式改为电口? 默认情况下,接口是工作在电口模式 ? 在项目实施中,如果光纤模块指示灯不亮,工作模式是否正确也是故障原因之一。 1.2 接口速度/双工配置 命令格式: Switch(config)#interface interface-id //进入接口配置模式 Switch(config-if)#speed {10 | 100 | 1000 | auto } //设置接口的速率参数,或者设置为auto Switch(config-if)#duplex {auto | full | half} //设置接口的双工模式? 1000只对千兆口有效;

相关主题
文本预览
相关文档 最新文档