<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]vlan 200
[Huawei-vlan200]
[Huawei]vlan 200
[Huawei-vlan200]management-vlan
[Huawei-vlan200]quit
[Huawei]interface Vlanif 200
[Huawei-Vlanif200]ip address 192.168.200.254 24
[Huawei-Vlanif200]quit
[Huawei]
[Huawei]interface GigabitEthernet 0/0/24
[Huawei-GigabitEthernet0/0/24]port link-type trunk
[Huawei-GigabitEthernet0/0/24]port trunk allow-pass vlan 200
[Huawei-GigabitEthernet0/0/24]quit
[Huawei]
[Huawei]telnet server enable #//Telnet出厂时是关闭的,需要开启
Info: The Telnet server has been enabled.
[Huawei]user-interface vty 0 4 #//Telnet常用于设备管理员登录,推荐使用AAA认证
[Huawei-ui-vty0-4]protocol inbound telnet
[Huawei-ui-vty0-4]authentication-mode aaa
[Huawei-ui-vty0-4]idle-timeout 15
[Huawei-ui-vty0-4]quit
[Huawei]aaa
[Huawei-aaa]local-user admin password cipher admin # //配置管理员Telnet登录交换机的用户名和密码。用户名不区分大小写,密码区分大小写
[Huawei-aaa]local-user admin privilege level 15 #//将管理员的账号权限设置为15(最高)
[Huawei-aaa]local-user admin service-type telnet
[Huawei-aaa]
<Huawei>tel
<Huawei>telnet 192.168.200.254
Trying 192.168.200.254 ...
Press CTRL+K to abort
Connected to 192.168.200.254 ...
Login authentication
Username:admin
Password:
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2022-08-19 00:50:57.
<Huawei>
配置业务vlan10、vlan20、vlan30
[Huawei]vlan batch 10 20 30
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]interface Vlanif 10
[Huawei-Vlanif10]ip address 192.168.10.1 24
[Huawei-Vlanif10]quit
[Huawei]interface Vlanif 20
[Huawei-Vlanif20]ip address 192.168.20.1 24
[Huawei-Vlanif20]quit
[Huawei]interface Vlanif 30
[Huawei-Vlanif30]ip address 192.168.30.1 24
[Huawei-Vlanif30]quit
[Huawei]port-group 1
[Huawei-port-group-1]group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/5
[Huawei-port-group-1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/3]port link-type trunk
[Huawei-GigabitEthernet0/0/4]port link-type trunk
[Huawei-GigabitEthernet0/0/5]port link-type trunk
[Huawei-port-group-1]port trunk allow-pass vlan 10
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
[Huawei-GigabitEthernet0/0/3]port trunk allow-pass vlan 10
[Huawei-GigabitEthernet0/0/4]port trunk allow-pass vlan 10
[Huawei-GigabitEthernet0/0/5]port trunk allow-pass vlan 10
[Huawei-port-group-1]quit
[Huawei]port-gr
[Huawei]port-group 2
[Huawei-port-group-2]group-member GigabitEthernet 0/0/6 to GigabitEthernet 0/0/1
0
[Huawei-port-group-2]port link-type trunk
[Huawei-GigabitEthernet0/0/6]port link-type trunk
[Huawei-GigabitEthernet0/0/7]port link-type trunk
[Huawei-GigabitEthernet0/0/8]port link-type trunk
[Huawei-GigabitEthernet0/0/9]port link-type trunk
[Huawei-GigabitEthernet0/0/10]port link-type trunk
[Huawei-port-group-2]port trunk allow-pass vlan 20
[Huawei-GigabitEthernet0/0/6]port trunk allow-pass vlan 20
[Huawei-GigabitEthernet0/0/7]port trunk allow-pass vlan 20
[Huawei-GigabitEthernet0/0/8]port trunk allow-pass vlan 20
[Huawei-GigabitEthernet0/0/9]port trunk allow-pass vlan 20
[Huawei-GigabitEthernet0/0/10]port trunk allow-pass vlan 20
[Huawei-port-group-2]quit
[Huawei]port-group 3
[Huawei-port-group-3]group-member GigabitEthernet 0/0/11 to GigabitEthernet 0/0/
15
[Huawei-port-group-3]port link-type trunk
[Huawei-GigabitEthernet0/0/11]port link-type trunk
[Huawei-GigabitEthernet0/0/12]port link-type trunk
[Huawei-GigabitEthernet0/0/13]port link-type trunk
[Huawei-GigabitEthernet0/0/14]port link-type trunk
[Huawei-GigabitEthernet0/0/15]port link-type trunk
[Huawei-port-group-3]port trunk allow-pass vlan 30
[Huawei-GigabitEthernet0/0/11]port trunk allow-pass vlan 30
[Huawei-GigabitEthernet0/0/12]port trunk allow-pass vlan 30
[Huawei-GigabitEthernet0/0/13]port trunk allow-pass vlan 30
[Huawei-GigabitEthernet0/0/14]port trunk allow-pass vlan 30
[Huawei-GigabitEthernet0/0/15]port trunk allow-pass vlan 30
[Huawei-port-group-3]quit
[Huawei]
[Huawei]interface GigabitEthernet 0/0/23
[Huawei-GigabitEthernet0/0/23]port link-type tr
[Huawei-GigabitEthernet0/0/23]port link-type trunk
[Huawei-GigabitEthernet0/0/23]port trunk allow-pass vlan 10 20 30
[Huawei-GigabitEthernet0/0/23]
[Huawei]interface GigabitEthernet 0/0/22
[Huawei-GigabitEthernet0/0/22]port link-type trunk all
[Huawei-GigabitEthernet0/0/22]port trunk allow-pass vlan 10 20 30
[Huawei-GigabitEthernet0/0/22]
[Huawei]vlan batch 10 20 30
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-port-group-link-tr]port trunk allow-pass vlan 10 20 30
[Huawei-port-group-link-tr]
[Huawei]interface Ethernet0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 10
[Huawei-Ethernet0/0/2]
[Huawei]vlan batch 10 20 30
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-port-group-link-tr]port trunk allow-pass vlan 10 20 30
[Huawei-port-group-link-tr]
[Huawei]interface Ethernet0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 10
[Huawei-Ethernet0/0/2]
Hybrid特性是华为交换机的专有特性,该特性为局域网的搭建提供了更多的灵活性和安全性。
1.Access类型端口:只能属于1个VLAN,一般用于连接计算机端口;
2.Trunk类型端口:可以允许多个VLAN通过,可以接收和发送多个VLAN 报文,一般用于交换机与交换机相关的接口。
3.Hybrid类型端口:可以允许多个VLAN通过,可以接收和发送多个VLAN 报文,可以用于交换机的间连接也可以用于连接用户计算机。
[Huawei]interface Ethernet0/0/1
[Huawei-Ethernet0/0/1]dis this
#
interface Ethernet0/0/1
#
return
[Huawei-Ethernet0/0/1]pori
[Huawei-Ethernet0/0/1]port
[Huawei-Ethernet0/0/1]port lin
[Huawei-Ethernet0/0/1]port link-hy
[Huawei-Ethernet0/0/1]port link-ty
[Huawei-Ethernet0/0/1]port link-type h
[Huawei-Ethernet0/0/1]port link-type hybrid
[Huawei-Ethernet0/0/1]port h
[Huawei-Ethernet0/0/1]port hybrid un
[Huawei-Ethernet0/0/1]port hybrid untagged v
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 30
[Huawei-Ethernet0/0/1]port
[Huawei-Ethernet0/0/1]port hy
[Huawei-Ethernet0/0/1]port hybrid p
[Huawei-Ethernet0/0/1]port hybrid pvid vlan 30
[Huawei-Ethernet0/0/1]quit
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30
#
return
[Huawei-GigabitEthernet0/0/1]undo port trunk allow-pass vlan 10 20 30
[Huawei-GigabitEthernet0/0/1]port link-type hybrid
[Huawei-GigabitEthernet0/0/1]port l
[Huawei-GigabitEthernet0/0/1]port hybrid tagged vlan 10 20 30
[Huawei-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
port hybrid tagged vlan 10 20 30
#
return
[Huawei-GigabitEthernet0/0/1]
[Huawei]display port vlan
Port Link Type PVID Trunk VLAN List
-------------------------------------------------------------------------------
Ethernet0/0/1 hybrid 1 -
Ethernet0/0/2 access 10 -
Ethernet0/0/3 access 20 -
Ethernet0/0/4 hybrid 1 -
Ethernet0/0/5 hybrid 1 -
Ethernet0/0/6 hybrid 1 -
Ethernet0/0/7 hybrid 1 -
Ethernet0/0/8 hybrid 1 -
Ethernet0/0/9 hybrid 1 -
Ethernet0/0/10 hybrid 1 -
Ethernet0/0/11 hybrid 1 -
Ethernet0/0/12 hybrid 1 -
Ethernet0/0/13 hybrid 1 -
Ethernet0/0/14 hybrid 1 -
Ethernet0/0/15 hybrid 1 -
Ethernet0/0/16 hybrid 1 -
Ethernet0/0/17 hybrid 1 -
Ethernet0/0/18 hybrid 1 -
Ethernet0/0/19 hybrid 1 -
Ethernet0/0/20 hybrid 1 -
Ethernet0/0/21 hybrid 1 -
Ethernet0/0/22 hybrid 1 -
GigabitEthernet0/0/1 hybrid 1 10 20 30
GigabitEthernet0/0/2 trunk 1 1 10 20 30