HUAWEI 华为交换机 CE、S 操作命令

重点提示

CE系列交换机一定要提交配置 断电前 保存配置 display configuration candidate //CE系列查看未提交配置 commit //CE系列提交配置

初始配置

  1. 恢复出厂设置 reset saved-configuration
  2. 进入特权模式 sys
  3. 创建一个vlan 2020(如果存在就是进入 vlan 2020) vlan 2020
  4. 创建一个虚拟vlan端口 2020 interface vlanif 2020
  5. 给虚拟vlan 2020端口绑定 IP interface vlanif 2020 ip address 221.10.111.111 255.255.255.128
  6. 配置交换机流量转发网关 ip route-static 0.0.0.0 0.0.0.0 221.10.111.111
  7. 进入端口并配置端口为 trunk 并允许通过所有vlan interface GigabitEthernet 0/0/24 port link-type trunk port trunk allow-pass vlan all
  8. 进入 vlan 2020 把端口1-23端口加入到 vlan 2020 vlan 2020 port GigabitEthernet 0/0/1 to 0/0/23
  9. 开启 WEB 管理 http server enable
  10. 设置 console 口密码 user-interface console 0 set authentication password cipher Aa9929388(Aa9929388 为密码)
  11. 配置 WEB 管理密码,进入 authentication authorization accounting (验证 授权 用户),并设置为最高权限 Lv15 aaa local-user admin privilege level 15 local-user admin password irreversible-cipher Aa9929388 //修改密码

常用命令合集

  1. 根据MAC地址查询网口
    dis mac-add | in xxxx(MAC最后2组4位数)
  2. 根据MAC查询网口(New)
    dis mac-addree MAC地址

    MAC格式 xxxx-xxxx-xxxx

  3. 查看接口 vlan 上电 状态
    display vlan
  4. 查看接口01相关信息
    display interface GigabitEthernet 0/0/1
  5. 根据IP查询MAC
    disp arp | in 192.168.1.55
  6. 查看端口错包以及流量使用负载情况
    dis int bri | inc 1/0/1|1/0/2
  7. 新建用户(详细方法:https://www.qkeke.com/archives/2044.html)
    aaa
    local-user yonghuming password cipher 123456
    local-user yonghuming privilege level 15 //设置账户等级;CE系列最高是3
    (local-user xiaoke level 3) CE系列命令
    local-user yonghuming service-type telnet terminal ssh //开启登陆相关协议
    display current-configuration | include user //查看当前账户配置信息
  8. 验证配置
    display configuration candidate //CE系列查看未提交配置
    commit //CE系列提交配置 
  9. 查看当前路由表
    display ip routing-table //IPv4路由表
    display ipv6 routing-table//IPv6路由表
  10. 查看接口描述信息
    display interface description
  11. 查看接口运行状态和相关信息
    display interface Ethernet brief //带接口描述信息
    display interface brief //带错包
  12. 查看接口与IP相关的简要信息
    display ip interface brief
  13. 查看接口的统计信息
    display interface
  14. 查看接口的流量统计数
    display counters
  15. 查看错误报文的统计信息
    display counters error
  16. 查看接口的入方向或出方向流量速率
    display counters rate
  17.  查看接口和IP配置的相关信息
    display ip interface
  18. 查看接口光模块信息/光衰收发光功率
    dis interface 100GE1/0/0 transceiver verbose
  19. 清除指定接口的错包inErrors、outErrors统计信息
    reset interface counters 端口名

有关于IP的操作命令

  1. 根据互联地址,查询下发的IP路由;或根据下发的IP查询在哪些互联地址以及端口
    display current-configuration configuration | include 对端互联地址
  2. 根据端口查看互联IP地址
    display ip interface brief

排障

  1. 查看端口 drop 丢包(用于端口满载的丢包统计)
    dis qos queue statistics int 10GE1/0/1
THE END