SW1:
system-view
Vlan 10
Vlan 20
Int g0/0/1
Port link-type access
Port default vlan 10
Int g0/0/2
Port link-type access
Port default vlan 20
Int g0/0/5
Port link-type trunk
Port trunk allow-pass vlan 10 20
Int g0/0/10
Port link-type trunk
Port trunk allow-pass vlan 10 20
SW2:
system-view
Vlan 10
Vlan 20
Int g0/0/3
Port link-type access
Port default vlan 10
Int g0/0/4
Port link-type access
Port default vlan 20
Int g0/0/10
Port link-type trunk
Port trunk allow-pass vlan 10 20
R1:
system-view
interface GigabitEthernet0/0/0.10
dot1q termination vid 10
ip address 192.168.10.1 255.255.255.0
arp broadcast enable
interface GigabitEthernet0/0/0.20
dot1q termination vid 20
ip address 192.168.20.1 255.255.255.0
arp broadcast enable