构建拓扑图
配置PC机IP地址信息
PC1
PC2
PC3
配置LSW1
sys
[Huawei]un in en
[Huawei]vlan batch 10 20 30
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access #端口类型设置为access
[Huawei-GigabitEthernet0/0/2]port default vlan 10
[Huawei-GigabitEthernet0/0/2]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 20
[Huawei-GigabitEthernet0/0/3]int g0/0/4
[Huawei-GigabitEthernet0/0/4]port link-type access
[Huawei-GigabitEthernet0/0/4]port default vlan 30
[Huawei-GigabitEthernet0/0/4]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/1]q
[Huawei]sysname SW1
[SW1]q
save
配置路由器R1
sys
[Huawei]un in en
划分子接口
[Huawei]int g0/0/1.1
[Huawei-GigabitEthernet0/0/1.1]ip add 192.168.1.254 24
[Huawei-GigabitEthernet0/0/1.1]int g0/0/1.2
[Huawei-GigabitEthernet0/0/1.1]dot1q termination vid 10
[Huawei-GigabitEthernet0/0/1.1]int g0/0/1.2
[Huawei-GigabitEthernet0/0/1.2]ip add 192.168.2.254 24
[Huawei-GigabitEthernet0/0/1.2]dot1q termination vid 20
[Huawei-GigabitEthernet0/0/1.2]int g0/0/1.3
[Huawei-GigabitEthernet0/0/1.3]ip add 192.168.3.254 24
[Huawei-GigabitEthernet0/0/1.3]dot1q termination vid 30
开启ARP
[Huawei-GigabitEthernet0/0/1.3]arp broadcast enable
[Huawei-GigabitEthernet0/0/1.3]int g0/0/1.2
[Huawei-GigabitEthernet0/0/1.2]arp broadcast enable
[Huawei-GigabitEthernet0/0/1.2]int g0/0/1.1
[Huawei-GigabitEthernet0/0/1.1]arp broadcast enable
[Huawei-GigabitEthernet0/0/1.1]quit
[Huawei]sysname
[Huawei]sysname R1
[R1]q
save