需求描述
三层交换方式,实现,不同VLAN的主机的通信,主机A,可访问主机B
拓扑
配置SW1
<Huawei> <Huawei>system-view [Huawei]sysname SW1 [SW1]vlan batch 10 20 [SW1]int e0/0/1 [SW1-Ethernet0/0/1]port link-type access [SW1-Ethernet0/0/1]port default vlan 10 [SW1-Ethernet0/0/1]quit [SW1] [SW1]int e0/0/2 [SW1-Ethernet0/0/2]port link-type access [SW1-Ethernet0/0/2]port default vlan 20 [SW1-Ethernet0/0/2]quit [SW1] [SW1]int vlanif 10 [SW1-Vlanif10]ip addr 192.168.1.254 24 [SW1-Vlanif10]quit [SW1] [SW1]int vlanif 20 [SW1-Vlanif20]ip addr 192.168.2.254 24 [SW1-Vlanif20]quit [SW1]
配置PC-A
配置PC-B
测试验证
PC-A PC-B可以正常ping互相通