拓扑如下图所示:
具体配置:
SW1: int vlan 10 ip-subnet-vlan 1 ip 192.168.1.0 255.255.255.0 int vlan 20 ip-subnet-vlan 1 ip 192.168.2.0 255.255.255.0 nterface Ethernet0/0/1 port link-type trunk port trunk allow-pass vlan 2 to 4094 interface Ethernet0/0/2 port link-type hybrid port hybrid untagged vlan 2 to 4094 ip-subnet-vlan enable interface Ethernet0/0/3 port link-type hybrid port hybrid untagged vlan 2 to 4094 ip-subnet-vlan enable SW2: int vlan 10 ip-subnet-vlan 1 ip 192.168.1.0 255.255.255.0 int vlan 20 ip-subnet-vlan 1 ip 192.168.2.0 255.255.255.0 nterface Ethernet0/0/1 port link-type trunk port trunk allow-pass vlan 2 to 4094 interface Ethernet0/0/2 port link-type hybrid port hybrid untagged vlan 2 to 4094 ip-subnet-vlan enable interface Ethernet0/0/3 port link-type hybrid port hybrid untagged vlan 2 to 4094 ip-subnet-vlan enable