![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/81cd0197b8b21097a8aea8c746c7ca7f.png#pic_center)
[Huawei]int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]ip address 192.168.1.254 24
[Huawei-GigabitEthernet0/0/0.1]int g0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]ip address 192.168.2.254 24
[Huawei-GigabitEthernet0/0/0.1]int g0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]dot1q termination vid 20
[Huawei-GigabitEthernet0/0/0.2]int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]dot1q termination vid 10
[Huawei]int g0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]arp broadcast enable
[Huawei-GigabitEthernet0/0/0.2]int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]arp broadcast enable
[Huawei]vlan batch 10 20
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type a
[Huawei]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type a
[Huawei]vlan 10
[Huawei-vlan10]port g0/0/2
[Huawei-vlan10]vlan 20
[Huawei-vlan20]port g0/0/3
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/ca6df1de38404a898d3dc3ae70552aa4.png#pic_center)