当前位置:首页 > 华为 > 华为交换机配置

华为交换机配置

shiwaiuanyun2025年05月20日 09:56:09华为3
sys进入系统视图,vlan 10创建VLAN,int vlan 10配置接口,ip add 192.168.1.1 24设IP,port link-type access设端口模式,port default vlan 10加入VLAN,display vlan查看,save保存配置。(61字)

基础配置流程

  1. 登录设备

    华为交换机配置

    通过Console线连接交换机,使用终端工具(如Putty)登录,默认用户名/密码:admin/admin@huawei.com。

  2. 系统视图与命名

    <HUAWEI> system-view  # 进入系统视图
    [HUAWEI] sysname SW1  # 修改设备名称为SW1
  3. 配置管理IP

    华为交换机配置

    [SW1] interface vlanif 1  # 进入VLAN1接口
    [SW1-Vlanif1] ip address 192.168.1.1 24  # 配置IP和子网掩码
    [SW1-Vlanif1] quit
  4. 保存配置

    [SW1] save  # 保存当前配置到存储设备

VLAN配置

操作步骤 命令示例 说明
创建VLAN vlan 10 创建VLAN 10
批量创建VLAN vlan batch 20 to 30 批量创建VLAN 20-30
将端口加入VLAN port link-type access
port default vlan 10
设置端口为Access模式并加入VLAN10
配置Trunk端口 port link-type trunk
port trunk allow-pass vlan 10 20
允许VLAN 10和20通过Trunk端口

端口配置示例

[SW1] interface GigabitEthernet 0/0/1  # 进入端口GE0/0/1
[SW1-GigabitEthernet0/0/1] description Connect_to_PC  # 添加描述
[SW1-GigabitEthernet0/0/1] port link-type access      # 设为Access模式
[SW1-GigabitEthernet0/0/1] port default vlan 10       # 加入VLAN10
[SW1-GigabitEthernet0/0/1] undo shutdown              # 启用端口

链路聚合(Eth-Trunk)

  1. 创建Eth-Trunk组
    [SW1] interface eth-trunk 1  # 创建Eth-Trunk 1
    [SW1-Eth-Trunk1] trunkport GigabitEthernet 0/0/23 to 0/0/24  # 添加物理端口
    [SW1-Eth-Trunk1] port link-type trunk  # 配置为Trunk模式
    [SW1-Eth-Trunk1] port trunk allow-pass vlan all  # 允许所有VLAN通过

远程管理配置

  1. 开启SSH/Telnet

    [SW1] user-interface vty 0 4       # 进入虚拟终端
    [SW1-ui-vty0-4] authentication-mode aaa  # 启用AAA认证
    [SW1-ui-vty0-4] protocol inbound ssh  # 仅允许SSH登录(Telnet则用telnet)
    [SW1] aaa                          # 进入AAA视图
    [SW1-aaa] local-user admin password cipher Huawei@123  # 创建用户密码
    [SW1-aaa] local-user admin service-type ssh  # 绑定SSH服务
  2. 配置ACL限制访问

    华为交换机配置

    [SW1] acl 2000  # 创建基本ACL
    [SW1-acl-basic-2000] rule permit source 192.168.1.0 0.0.0.255  # 允许指定网段
    [SW1-acl-basic-2000] quit
    [SW1] user-interface vty 0 4
    [SW1-ui-vty0-4] acl 2000 inbound  # 应用ACL到VTY接口

相关问题与解答

问题1:如何恢复华为交换机的忘记密码?

解答

  1. 重启交换机,按Ctrl+B进入BootROM菜单。
  2. 选择“Clear Console Password”选项。
  3. 重启后通过Console登录(无密码),重新配置新密码。

问题2:VLAN间通信如何实现?

解答
需通过三层交换机或路由器配置VLAN间路由:

  1. 在三层交换机上为每个VLAN配置VLANIF接口IP。
  2. 启用IP路由功能:
    [SW1] ip routing  # 开启路由功能

版权声明:本文由环云手机汇 - 聚焦全球新机与行业动态!发布,如需转载请注明出处。

本文链接:https://uanyun.com/hua-wei/1747706169.html

分享给朋友:

“华为交换机配置” 的相关文章

华为手机报价2025年04月21日 23:00:37
华为mate402025年04月22日 02:23:52
华为mate50pro2025年04月22日 04:06:19
华为电脑管家2025年04月22日 05:36:14
华为freebuds52025年04月22日 07:40:16
华为手机助手2025年04月22日 20:33:03