The experimental topology is as follows:
LSW5 layer 3 switch configuration:
#
sysname LSW5
#
vlan batch 10 20
#
dhcp enable
#
ip pool 1
gateway-list 192.168.1.254
network 192.168.1.0 mask 255.255.255.0
dns-list 8.8.8.8
#
ip pool 2
gateway-list 192.168.2.254
network 192.168.2.0 mask 255.255.255.0
dns-list 8.8.8.8
#
interface Vlanif10
ip address 192.168.1.254 255.255.255.0
dhcp select global
#
interface Vlanif20
ip address 192.168.2.254 255.255.255.0
dhcp select global
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
#
LSW6 layer 2 switch configuration:
#
sysname LSW6
#
vlan batch 10 20
#
interface Vlanif1
#
interface MEth0/0/1
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
#
interface Ethernet0/0/3
port link-type access
port default vlan 20
#
interface Ethernet0/0/4
port link-type trunk
port trunk allow-pass vlan 10 20
#
LSW7 layer 2 switch configuration:
#
sysname LSW7
#
vlan batch 10 20
#
interface Vlanif1
#
interface MEth0/0/1
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
#
interface Ethernet0/0/3
port link-type access
port default vlan 20
#
The screenshots of each PC are as follows, they all work.