<Huawei>sys
[Huawei]sysname R1
[R1]int g0/0/0.10
[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10
//封装dot1q协议,该子接口对应vlan10
[R1-GigabitEthernet0/0/0.10]ip add 192.168.10.1 24
[R1-GigabitEthernet0/0/0.10]arp broadcast enable
//开启arp广播
[R1-GigabitEthernet0/0/0.10]interface g0/0/0.20
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.20]ip address 192.168.20.1 24
[R1-GigabitEthernet0/0/0.20]arp broadcast enable
<Huawei>sys
[Huawei]sysname sw1
[SW1]vlan batch 10 20
//创建vlan10 20
[SW1]int e0/0/1
[SW1-Ethernet0/0/1]port link-type access
//配置access链路
[SW1-Ethernet0/0/1]port default vlan 10
//接口划入vlan10
[SW1-Ethernet0/0/1]undo shutdown
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 20
[SW1-Ethernet0/0/2undo shutdown
[SW1-Ethernet0/0/2]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
//配置trunk链路
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
//设置放行所有vlan
[SW1-GigabitEthernet0/0/1]undo sh
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。