导航:首页 > 程序命令 > 锐捷交换机保存命令

锐捷交换机保存命令

发布时间:2024-02-09 10:55:19

⑴ 锐捷交换机保存配置是哪条命令

保存在交换机上所做的配置
SwitchA# running-config startup-config ! 保存交换机配置
或:
SwitchA# write memory

⑵ 关于锐捷交换机配置

交换机基本操作

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 fastEther 0/1

Switch(config-if)#exit

Switch(config)#

从子模式下直接返回特权模式

Switch(config-if)#end

Switch#

交换机操作帮助特点:

1.支持命令简写(按TAB键将命令补充完整)

2.在每种操作模式下直接输入“?”显示该模式下所有的命令

3.命令空格 “?”显示命令参数并对其解释说明

4.字符“?”显示以该字符开头的命令

5.命令历史缓存: (Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令

6.错误提示信息

交换机显示命令:

显示交换机硬件及软件的信息 Switch#show version

显示当前运行的配置参数 Switch#show running-config

显示保存的配置参数 Switch#show configure

常用交稿仔换机EXEC命令

将当前运行的配置参数复制到flash:Switch#write memory

Building configuration...

[OK]

Switch#

清空flash中的配置参数:Switch#delete flash:config.text

Switch#

交换机重新启动:Switch#reload

System configuration has been modified. Save? [yes/no]:n

Proceed with reload? [confirm]

配置交换机主机名:Switch(config)#hostname S2126G

S2126G(config)#

配置交换机口令:

1、 配置交换机的登陆密码

S2126G(config)#enable secret level 1 0 star

“0”表示输入的是明文形式的口令

2、 配置交换机的特权密码

S2126G(config)#enable secret level 15 0 Star

“0”表示输入的是明文形式的口令

常用交换机配置命令:

1、为交换机分配管理IP地址

S2126G(config)#interface vlan 1

S2126G(config-if)#ip address {IP address} {IP submask}[secondary]

2、将接口启用

S2126G(config-if)#no shutdown

3、将接口关闭

S2126G(config-if)#shutdown

4、配置接口速率

S2126G(config-if)#speed [10|100|auto]

5、配置接口双工模式

S2126G(config-if)#plex [auto|full|half

显示接口状态:S2126G#show interfaces

测定目的端的可达性:S2126G>ping {IP address}

从TFTP服务器下载配置参数:S2126G# tftp startup-config

管理交换机MAC地址表:

1、查看MAC地址表

S2126G#show mac-address-table

2、配置MAC地址表记录的生存时间(缺省为300秒)

S2126G(config)#mac-address-table aging-time <10-1000000>

3、查看MAC地址表记录的生存时间

S2126G#show mac-address-table aging-time

VLAN的配置:

1.添加一个VLAN

S2126G(config)#vlan <1-4094>

S2126G(config-vlan)#

2.为VLAN命名(可选)

S2126G(config-vlan)#name

将交换机端口分配到VLAN

1.配置Port VLAN

Switch(config-if)#switchport access vlan <1-4094>

2.配置Tag VLAN

Switch(config-if)#switchport mode trunk

1).配置本地(native)VLAN

Switch(config-if)#switchport trunk native vlan <1-4094>

2).从主干链路中清除VLAN

Switch(config-if)#switchport trunk allowed vlan except

注:VLAN1不可被清除

VLAN的验证:

1.显示全部的VLAN:Switch#show vlan

2.显示单独的VLAN :Switch#show vlan id <1-4094>

将VLAN信息保存到flash中:Switch#write memory

从flash中清除VLAN信息:Switch#delete flash:vlan.dat

RSTP的配置:

1.启用生成树:S2126G(config)#spanning-tree

2.配置交换机优先级:S2126G(config)#spanning-tree priority <0-61440>

“0”或“4096”的倍数(RSTP BPDU该值后12bit全0)

3.配置交换机端口优先级:S2126G(config-if)#spanning-tree port-priority <0-240>

“0”或“16”的倍数(RSTP BPDU该值后4bit全0)

4、生成树hello时间的配置(由Root决定):S2126G(config)#spanning-tree hello-time <1-10>

5、生成树的验证:Switch#show spanning-tree

Switch#show spanning-tree interface <接口名称> <接口编号>

以上用于锐捷交换机的。

交换机配置命令集>Enable 进入特权模式

#ExIT 返回上一级操作模式

#End 返回到特权模式

#write memory 或 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管理)、tel-server(远程登陆)等查看信息

#show running-config 查看当前生效的配置信息

#show interface fastether 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 fastether 0/1 switchport 查看某一端口模式(如F 0/1)

#show aggregateport 1 summary 查看聚合端口AG1的信息

#show spanning-tree 查看生成树配置信息

#show spanning-tree interface fastether 0/1 查看该端口的生成树状态

#show port-security 查看交换机的端口安全配置信息

#show port-security address 查看地址安全绑定配置信息

#show ip access-lists listname 查看名为listname的列表的配置信息

#show access-lists端口的基本配置

(config)#Interface fastether 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)#plex 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的倍数。

交换机默认值为32768VLAN的基本配置

(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使用,例如,使用Tel的方式登录的IP地址

(config-if)# no shutdown 启用该端口端口安全

(config)# interface fastether 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 fastether 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)# work 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)# work 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 拒绝源地址为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-包含)

:端口号,可使用名称或具体编号

可以使用的协议名称(或编号)和端口名称(或编号)请打?查询。

(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进行允许通过处理。

⑶ 思科交换机的配置命令和锐捷交换机、华为交换机之间可以通用吗

思科与锐捷的命令差异不大,与华为的命令就是单词不一样,但是同一个意思的单词像 show 与 display
用户模式:r1> enable 到特权模式
特权模式下:
disable 退出到用用户模式,但是不屏显
Show version 查看系统 硬件 软件信息版本
Show running-configuration 查看路由器中正在运行(RAM中)的配置 简写 sh run,断电会丢失
show starting-configuration 查看NVRAM中的配置信息。配置在这里面断电不会丢失
running-config startup-config 将RAM中的配置保存到NVRAM中
r1#write 保存配置文件到 startup-config 里
Show interfaces 接口 查看相应的接口
Show cdp neighbors 查看所有连接到这个接口的路由器信息 cdp=思科发现协议
Show cdp neighbors detail 查看连接到这个接口设备的更详细信息
r1#sh ip interface brief 查看接口状态
r1#show history 显示最近使用的命令
r1#reload 重新启动路由器
r1#erase nvram 清除nvram里面的文件
r1#erase startup-config 功能一样清除启动文件

全局模式下:r1# configure terminal 简写conf t 到全局模式
r1(config)#
hostname 名字 为路由器命名 注意:名字不可以有空格
no ip domain-lookup 取消域名解析查找
ip default-gateway 配置网关
r1(config)#router rip 进入路由配置模式
r1(config-if)#intterface f0/0.1 进入F0的子接口
r1(config)#interface loopback 0 进入环卫口
r1(config)#line console 0 进入console口
r1(config)#line vty 0 进入VTY 0口
r1(config-if)#ip address 为端口配置IP地址

R1(config)#line console 0
R1(config-line)#exec-timeout 0 0 设置不超时 组织会话退出

R1(config)#no ip domain-lookup 禁止域名解析

R1(config)#line con 0
R1(config-line)#logging synchronous 同步输入命令(正在输入命令时被上一条提示信息覆盖,输入此命令可以不受干扰)
R1(config)#banner motd # 输入你想说的话 类似于刚开进入IOS 提醒 声明 警告界面一样 #退出输入界面

实验配置预先配置:
1.Router(config)#line console 0
Router(config-line)#exec-timeout 0 0 设置不超时

2. Router(config)#ip domain-lookup 禁止域名解析

3. Router(config)#line con 0
Router(config-line)#logging synchronous 同步输入命令

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

一、华为交换机基础配置命令

1、创建vlan:

//用户视图,也就是在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、将端口加入到vlan中:

[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] quit

3、将多个端口加入到VLAN中

system-view

[Quidway]vlan 10

[Quidway-vlan10]port GigabitEthernet 1/0/0 to 1/0/29 //将0到29号口加入到vlan10中

[Quidway-vlan10]quit

4、交换机配置IP地址

[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] quit

5、配置默认网关:

[Quidway]ip route-static 0.0.0.0 0.0.0.0 119.167.200.89 //配置默认网关。

6、 交换机保存设置和重置命令

save //保存配置信息

reset saved-configuration //重置交换机的配置

reboot //重新启动交换机

7、交换机常用的显示命令

用户视图模式下:

display current-configuration //显示现在交换机正在运行的配置明细

display device //显示各设备状态

display interface ? //显示个端口状态,用?可以查看后边跟的选项

display version //查看交换机固件版本信息

display vlan ? // 查看vlan的配置信息

8、恢复交换机出厂设置

reset saved-configuration //重置交换机的配置

二、H3C交换机的基本配置

我们先来了解下h3c的配置命令与功能,都是常用的,基本上大部分网络配置都少不了这些命令。

1、基本配置

//用户直行模式提示符,用户视图

system-view //进入配置视图

[H3C] sysname xxx //设置主机名成为xxx这里使用修改特权用户密码

2、用户配置

system-view

[H3C]super password H3C //设置用户分级密码

[H3C]undo superpassword //删除用户分级密码

[H3C]localuser bigheap 1234561 //Web网管用户设置,1为管理级用户

[H3C]undo localuser bigheap //删除Web网管用户

[H3C]user-interface aux 0 //只支持0

[H3C-Aux]idle-timeout 250 //设置超时为2分50秒,若为0则表示不超时,默认为5分钟

[H3C-Aux]undoidle-timeout //恢复默认值

[H3C]user-interface vty 0 //只支持0和1

[H3C-vty]idle-timeout 250 //设置超时为2分50秒,若为0则表示不超时,默认为5分钟

[H3C-vty]undoidle-timeout //恢复默认值

[H3C-vty]set authentication password123456 //设置telnet密码,必须设置

[H3C-vty]undo set authenticationpassword //取消密码

[H3C]displayusers //显示用户

[H3C]displayuser-interface //用户界面状态

3、vlan配置

[H3C]vlan 2 //创建VLAN2

[H3C]undo vlanall //删除除缺省VLAN外的所有VLAN,缺省VLAN不能被删除

[H3C-vlan2]port Ethernet 0/4 to Ethernet0/7 //将4到7号端口加入到VLAN2中,此命令只能用来加access端口,不能用来增加trunk或者hybrid端口

[H3C-vlan2]port-isolate enable //打开VLAN内端口隔离特性,不能二层转发,默认不启用该功能

[H3C-Ethernet0/4]port-isolate uplink-portvlan 2 //设置4为VLAN2的隔离上行端口,用于转发二层数据,只能配置一个上行端口,若为trunk,则建议允许所有VLAN通过,隔离不能与汇聚同时配置

[H3C]display vlan all //显示所有VLAN的详细信息

[H3C]user-group 20 //创建user-group 20,默认只存在user-group 1

[H3C-UserGroup20]port Ethernet 0/4 toEthernet 0/7 //将4到7号端口加入到VLAN20中,初始时都属于user-group 1中

[H3C]display user-group 20 //显示user-group 20的相关信息

四、交换机ip配置

[H3C]vlan 20 //创建vlan

[H3C]management-vlan 20 //管理vlan

[H3C]interface vlan-interface 20 //进入并管理vlan20

[H3C]undo interface vlan-interface 20 //删除管理VLAN端口

[H3C-Vlan-interface20]ip address192.168.1.2 255.255.255.0 //配置管理VLAN接口静态IP地址

[H3C-Vlan-interface20]undo ipaddress //删除IP地址

[H3C-Vlan-interface20]ip gateway 192.168.1.1 //指定缺省网关(默认无网关地址)

[H3C-Vlan-interface20]undo ip gateway

[H3C-Vlan-interface20]shutdown //关闭接口

[H3C-Vlan-interface20]undo shutdown //开启

[H3C]display ip //显示管理VLAN接口IP的相关信息

[H3C]display interface vlan-interface20 //查看管理VLAN的接口信息

debugging ip //开启IP调试功能

undo debugging ip

5、DHCP客户端配置

[H3C-Vlan-interface20]ip address dhcp-alloc // 管理VLAN接口通过DHCP方式获取IP地址

[H3C-Vlan-interface20]undo ip address dhcp-alloc // 取消

[H3C]display dhcp //显示DHCP客户信息

debugging dhcp-alloc //开启DHCP调试功能

undo debugging dhcp-alloc

6、端口配置

[H3C]interface Ethernet0/3 //进入端口

[H3C-Ethernet0/3]shutdown //关闭端口

[H3C-Ethernet0/3]speed 100 //速率可为10,100,1000和auto(缺省)

[H3C-Ethernet0/3]plexfull //双工,可为half,full和auto,光口和汇聚后不能配置

[H3C-Ethernet0/3]flow-control //开启流控,默认为关闭

[H3C-Ethernet0/3]broadcast-suppression 20 //设置抑制广播百分比为20%,可取5,10,20,100,缺省为100,同时组播和未知单播也受此影响

[H3C-Ethernet0/3]loopback internal //内环测试

[H3C-Ethernet0/3]port link-type trunk //设置链路的类型为trunk

[H3C-Ethernet0/3]port trunk pvid vlan 20 //设置20为该trunk的缺省VLAN,默认为1(trunk线路两端的PVID必须一致)

[H3C-Ethernet0/3]port access vlan 20 //将当前access端口加入指定的VLAN

[H3C-Ethernet0/3]port trunk permit vlanall //允许所有的VLAN通过当前的trunk端口,可多次使用该命令

[H3C-Ethernet0/3]mdiauto //设置以太端口为自动监测,normal为直通线,across为交叉线

[H3C]link-aggregation Ethernet 0/1 toEthernet 0/4 //将1-4口加入汇聚组,1为主端口,两端需要同时配置,设置了端口镜像以及端口隔离的端口无法汇聚

[H3C]undo link-aggregation Ethernet 0/1 //删除该汇聚组

[H3C]link-aggregation mode egress

⑸ 华为、H3C、锐捷交换机配置命令大全

对于 华为、H3C、锐捷 交换机的命令配置,三家交换机的配置命令容易弄混,经常在实际项目配置中出错,因此,本期我把这三家交换机的基础配置命令显示在这里,大家可以分别来看下他们的命令有什么不同。

为了让大家更加清楚,每行代码都有解释。

一、华为交换机基础配置命令

1、创建vlan:

//用户视图,也就是在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、将端口加入到vlan中:

[Quidway] interface GigabitEthernet2/0/ // (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] quit //退出

3、将多个端口加入到VLAN中

system-view

[Quidway]vlan 10

[Quidway-vlan10]port GigabitEthernet 1/0/0 to 1/0/29 //将0到29号口加入到vlan10中

[Quidway-vlan10]quit

4、交换机配置IP地址

[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] quit

5、配置默认网关:

[Quidway]ip route-static 0.0.0.0 0.0.0.0 119.167.200.89 //配置默认网关。

6、 交换机保存设置和重置命令

save //保存配置信息

reset saved-configuration //重置交换机的配置

reboot //重新启动交换机

7、交换机常用的显示命令

用户视图模式下:

display current-configuration //显示现在交换机正在运行的配置明细

display device //显示各设备状态

display interface ? //显示个端口状态,用?可以查看后边跟的选项

display version //查看交换机固件版本信息

display vlan ? // 查看vlan的配置信息

8、恢复交换机出厂设置

reset saved-configuration //重置交换机的配置

二、H3C交换机的基本配置

我们先来了解下h3c的配置命令与功能,都是常用的,基本上大部分网络配置都少不了这些命令。

1、基本配置

//用户直行模式提示符,用户视图

system-view //**进入配置视图**

[H3C] sysname xxx //设置主机名成为xxx这里使用修改特权用户密码

2、用户配置

system-view

[H3C]super password H3C //设置用户分级密码

[H3C]undo superpassword //删除用户分级密码

[H3C]localuser bigheap 1234561 //Web网管用户设置,1为管理级用户

[H3C]undo localuser bigheap //删除Web网管用户

[H3C]user-interface aux 0 //只支持0

[H3C-Aux]idle-timeout 250 //设置超时为2分50秒,若为0则表示不超时,默认为5分钟

[H3C-Aux]undoidle-timeout //恢复默认值

[H3C]user-interface vty 0 //只支持0和1

[H3C-vty]idle-timeout 250 //设置超时为2分50秒,若为0则表示不超时,默认为5分钟

[H3C-vty]undoidle-timeout //恢复默认值

[H3C-vty]set authentication password123456 //设置telnet密码,必须设置

[H3C-vty]undo set authenticationpassword //取消密码

[H3C]displayusers //显示用户

[H3C]displayuser-interface //用户界面状态

3、vlan配置

[H3C]vlan 2 //创建VLAN2

[H3C]undo vlanall //删除除缺省VLAN外的所有VLAN,缺省VLAN不能被删除

[H3C-vlan2]port Ethernet 0/4 to Ethernet0/7 //将4到7号端口加入到VLAN2中,此命令只能用来加access端口,不能用来增加trunk或者hybrid端口

[H3C-vlan2]port-isolate enable //打开VLAN内端口隔离特性,不能二层转发,默认不启用该功能

[H3C-Ethernet0/4]port-isolate uplink-portvlan 2 //设置4为VLAN2的隔离上行端口,用于转发二层数据,只能配置一个上行端口,若为trunk,则建议允许所有VLAN通过,隔离不能与汇聚同时配置

[H3C]display vlan all //显示所有VLAN的详细信息

[H3C]user-group 20 //创建user-group 20,默认只存在user-group 1

[H3C-UserGroup20]port Ethernet 0/4 toEthernet 0/7 //将4到7号端口加入到VLAN20中,初始时都属于user-group 1中

[H3C]display user-group 20 //显示user-group 20的相关信息

4、交换机ip配置

[H3C]vlan 20 //创建vlan

[H3C]management-vlan 20 //管理vlan

[H3C]interface vlan-interface 20 //进入并管理vlan20

[H3C]undo interface vlan-interface 20 //删除管理VLAN端口

[H3C-Vlan-interface20]ip address192.168.1.2 255.255.255.0 //配置管理VLAN接口静态IP地址

[H3C-Vlan-interface20]undo ipaddress //删除IP地址

[H3C-Vlan-interface20]ip gateway 192.168.1.1 //指定缺省网关(默认无网关地址)

[H3C-Vlan-interface20]undo ip gateway

[H3C-Vlan-interface20]shutdown //关闭接口

[H3C-Vlan-interface20]undo shutdown //开启

[H3C]display ip //显示管理VLAN接口IP的相关信息

[H3C]display interface vlan-interface20 //查看管理VLAN的接口信息

debugging ip //开启IP调试功能

undo debugging ip

5、DHCP客户端配置

[H3C-Vlan-interface20]ip address dhcp-alloc // 管理VLAN接口通过DHCP方式获取IP地址

[H3C-Vlan-interface20]undo ip address dhcp-alloc // 取消

[H3C]display dhcp //显示DHCP客户信息

debugging dhcp-alloc //开启DHCP调试功能

undo debugging dhcp-alloc

6、端口配置

[H3C]interface Ethernet0/3 //进入端口

[H3C-Ethernet0/3]shutdown //关闭端口

[H3C-Ethernet0/3]speed 100 //速率可为10,100,1000和auto(缺省)

[H3C-Ethernet0/3]plexfull //双工,可为half,full和auto,光口和汇聚后不能配置

[H3C-Ethernet0/3]flow-control //开启流控,默认为关闭

[H3C-Ethernet0/3]broadcast-suppression 20 //设置抑制广播百分比为20%,可取5,10,20,100,缺省为100,同时组播和未知单播也受此影响

[H3C-Ethernet0/3]loopback internal //内环测试

[H3C-Ethernet0/3]port link-type trunk //设置链路的类型为trunk

[H3C-Ethernet0/3]port trunk pvid vlan 20 //设置20为该trunk的缺省VLAN,默认为1(trunk线路两端的PVID必须一致)

[H3C-Ethernet0/3]port access vlan 20 //将当前access端口加入指定的VLAN

[H3C-Ethernet0/3]port trunk permit vlanall //允许**所有的VLAN通过当前的trunk端口,可多次使用该命令

[H3C-Ethernet0/3]mdiauto //设置以太端口为自动监测,normal为直通线,across为交叉线

[H3C]link-aggregation Ethernet 0/1 toEthernet 0/4 //将1-4口加入汇聚组,1为主端口,两端需要同时配置,设置了端口镜像以及端口隔离的端口无法汇聚

[H3C]undo link-aggregation Ethernet 0/1 //删除该汇聚组

[H3C]link-aggregation mode egress //配置端口汇聚模式为根据目的MAC地址进行负荷分担,可选为 ingress,egress和both,缺省为both

[H3C]monitor-port Ethernet 0/2 //将该端口设置为镜像端口,必须先设置镜像端口,删除时必须先删除被镜像端口,而且它们不能同在一个端口,该端口不能在汇聚组中,设置新镜像端口时,新取代旧,被镜像不变

[H3C]mirroring-port Ethernet 0/3 toEthernet 0/4 both //将端口3和4设置为被镜像端口,both为同时监控接收和发送的报文,inbound表示仅监控接收的报文,outbound表示仅监控发送的报文

[H3C]display mirror

[H3C]display interface Ethernet 0/3

resetcounters //清除所有端口的统计信息

[H3C]display link-aggregation Ethernet0/3 //显示端口汇聚信息

[H3C-Ethernet0/3]virtual-cable-test //诊断该端口的电路状况

7、qos优先级配置

QoS配置步骤:设置端口的优先级,设置交换机信任报文的优先级方式,队列调度,端口限速

[H3C-Ethernet0/3]priority 7 //设置端口优先级为7,默认为0

[H3C]priority-trustcos //设置交换机信任报文的优先级方式为cos(802.1p优先级,缺省值),还可以设为dscp方式

[H3C]queue-scheler hq-wrr 2 4 6 8 //设置队列调度算法为HQ-WRR(默认为WRR),权重为2,4,6,8

[H3C-Ethernet0/3]line-rate inbound 29 //将端口进口速率限制为2Mbps,取1-28时,速率为rate*8*1024/125,即64,128,192...1.792M;

29-127时,速率为(rate-27)*1024,即2M,3M,4M...100M。

[H3C]displayqueue-scheler //显示队列调度模式及参数

[H3C]displaypriority-trust //显示优先级信任模式

三、锐捷交换机基础命令配置

连接上交换机后,肯定是需要进行命令配置,我们来看下基础命令配置。

1、准备命令

>Enable //进入特权模式

#Exit //返回上一级操作模式

#End //返回到特权模式

# 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(远程登陆)等

2、查看信息

#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 //查看某一端口模式(如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的列表的配置信息

3、端口的基本配置

(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)#plex full //配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应)

(config-if)#no shutdown //开启该端口

(config-if)#switchport access vlan 10 //将该端口划入VLAN10中,用于VLAN

(config-if)#switchport mode trunk //将该端口设为trunk模式,可选模式为access , trunk

(config-if)#port-group 1 //将该端口划入聚合端口AG1中,用于聚合端口

4、聚合端口的创建

(config)# interface aggregateport 1 //创建聚合接口AG1

(config-if)# switchport mode trunk //配置并保证AG1为 trunk 模式

(config)#int f0/23-24

(config-if-range)#port-group 1 //将端口(端口组)划入聚合端口AG1中

5、生成树

配置多生成树协议:

switch(config)#spanning-tree //开启生成树协议

switch(config)#spanning-tree mst configuration //建立多生成树协议

switch(config-mst)#name ruijie //命名为ruijie

switch(config-mst)#revision 1 //设定校订本为1

switch(config-mst)#instance 0 vlan 10,20 //建立实例0

switch(config-mst)#instance 1 vlan 30,40 //建立实例1

switch(config)#spanning-tree mst 0 priority 4096 //设置优先级为4096

switch(config)#spanning-tree mst 1 priority 8192 //设置优先级为8192

switch(config)#interface vlan 10

switch(config-if)#vrrp 1 ip 192.168.10.1 //此为vlan 10的IP地址

switch(config)#interface vlan 20

switch(config-if)#vrrp 1 ip 192.168.20.1 //此为vlan 20的IP地址

switch(config)#interface vlan 30

switch(config-if)#vrrp 2 ip 192.168.30.1 //此为vlan 30的IP地址(另一三层交换机)

switch(config)#interface vlan 40

switch(config-if)#vrrp 2 ip 192.168.40.1 //此为vlan 40的IP地址(另一三层交换机)

6、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 //启用该端口

7、端口安全

(config)# interface fastethernet 0/1 //进入一个端口

(config-if)# switchport port-security //开启该端口的安全功能

a、配置最大连接数限制

(config-if)# switchport port-secruity maxmum 1 //配置端口的最大连接数为1,最大连接数为128
(config-if)# switchport port-secruity violation shutdown
//配置安全违例的处理方式为shutdown,可选为protect (当安全地址数满后,将未知名地址丢弃)、restrict(当违例时,发送一个Trap通知)、shutdown(当违例时将端口关闭,并发送Trap通知,可在全局模式下用errdisable recovery来恢复)

b、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地址注意用小写)

8、三层路由功能(针对三层交换机)

(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

9、三层交换机路由协议

(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为骨干区域)

可以明显看出,三家命令大同小异,其实华为与H3C更加类似。

⑹ 锐捷交换机(S2320G-P为例)配置命令

  1. 为交换机分配管理IP地址

    S2126G(config)#interfacevlan1

    S2126G(config-if)#ipaddress{IPaddress}{IPsubnetmask}[secondary]

  2. 将接口启用

    S2126G(config-if)#noshutdown

  3. 将接口关闭

    S2126G(config-if)#shutdown

  4. 配置接口速率

    S2126G(config-if)#speed[10|100|auto]

  5. 配置接口双工模式

    S2126G(config-if)#plex[auto|full|half]

⑺ 求锐捷三层交换机常用命令

交换机配置命令类别命令格式命令含义基本配置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# 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)# plex 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设置粘性学习特性能够学到的地址数
太多命令了 打不完上去啊

阅读全文

与锐捷交换机保存命令相关的资料

热点内容
画世界的app叫什么 浏览:824
vc6编译时显示无法执行 浏览:546
java动态初始化数组 浏览:637
概率论与数理统计答案pdf 浏览:681
得物app上面的鞋为什么这么贵 浏览:909
如何从爱思服务器注销游戏账号 浏览:944
幼儿编程教育培训多少钱 浏览:406
经常生气有什么东西能解压 浏览:903
代理服务器地址和端口可以怎么填 浏览:65
unity5手游编译模型 浏览:268
安卓无人机app源码 浏览:811
pl1编程语言 浏览:801
台达plc编程换算指令大全 浏览:176
手机上的编程游戏 浏览:110
服务器密码机有什么用 浏览:479
dos磁盘命令 浏览:957
单片机cpu52的功能 浏览:693
opc服务器怎么开发 浏览:375
觅喜是个什么app 浏览:405
加密cd机 浏览:948