锐捷交换机配置命令大全1

交换机

  >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~1515为最高权限级别;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/1F0/2F0/5F0/7F0/8F0/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 , 优先级值小为高。优先级可选值为040968192,……,为4096的倍数。交换机默认值为32768