比如这样配置:

system-view
interface gigabitethernet 1/0/1
port link-type trunk
port trunk pvid vlan 100


交换在接受数据包的时候,有可能接到没有打过标签的数据帧,比如pc发出的,或者是对方交换机untag过来的

所以这个时候的pvid在接收到一个没有打过标签的数据帧的时候,来决定是否放到哪个vlan中

如果使用 dis port vlan 可以看到所有的接口的默认的pvid

[Huawei]dis port vlan
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
Ethernet0/0/1           trunk        1     1
Ethernet0/0/2           hybrid       1     -                                   
Ethernet0/0/3           hybrid       1     -                                   
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     -                                   
GigabitEthernet0/0/2    hybrid       1     -

也就是说trunk接口或者hybrid接口都有可能受到没有打标签的数据

如果是trunk接口修改pvid可以使用 port trunk pvid 来修改,前提是vlan一定要存在,hybrid接口同样也可以修改自己的pvid

[Huawei-Ethernet0/0/1]port trunk pvid vlan ?
  INTEGER<1-4094>  VLAN ID

[Huawei-Ethernet0/0/1]port trunk pvid vlan 2
Error: The VLAN does not exist.

不管是access,trunk,hybrid,都是有pvid这个概念的:

[Huawei]dis port vlan
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
Ethernet0/0/1           trunk        30    1
Ethernet0/0/2           access       10    -                                   
Ethernet0/0/3           hybrid       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     -                                   
GigabitEthernet0/0/2    hybrid       1     -

1610192560-im5RR9NY1bf254e510cdfb2ce98d8096ac9f1306

这里的三个接口就是不同的接口类型,分别是trunk,access,hybrid,然后修改他们的对应的pvid

1610192561-53jPlrPief985623ba57b717c69f389b1477eb15

interface Ethernet0/0/1
 port link-type trunk
 port trunk pvid vlan 30
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 10
#
interface Ethernet0/0/3
 port hybrid pvid vlan 20
#