<s2>system-view
Enter system view, return user view with Ctrl+Z.
# 创建 vlan 10 和 20
[s2]vlan 10
[s2-vlan10]vlan 20
# display vlan
# 删除 vlan 10
# [s2-vlan20]quit
# [s2]undo vlan 10
# 设置 interface 为 access port
[s2]interface Eth0/0/1
[s2-Ethernet0/0/1]port li
[s2-Ethernet0/0/1]port link-ty
[s2-Ethernet0/0/1]port link-type access
# 将 vlan 10 绑定到 interface 0/0/1 上, 有两种方式:
# 第一种方式进入 vlan 10,绑定 port。
[s2]vlan 10
[s2-vlan10]port eth
[s2-vlan10]port Ethernet 0/0/1
# 第二种方式
[s2]interface Ethernet 0/0/1
[s2-Ethernet0/0/1]port default vlan 10
# 设置 interface 为 trunk port, pvid 为 1, 允许 vlan 10 和 20
[s2]interface Ethernet 0/0/3
[s2-Ethernet0/0/3]port link-type trunk
[s2-Ethernet0/0/3]port trunk pvid vlan 1
[s2-Ethernet0/0/3]port trunk allow-pass vlan 10 20
参考
华为配置文档:https://support.huawei.com/enterprise/en/doc/EDOC1100086556
vlan 接口相关参考:https://networkdirection.net/articles/network-theory/taggeduntaggedandnativevlans/