拓扑:
LSW1:
vlan batch 10 20
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 20
AR1:
sysname AR1
#
vlan batch 10 20
#
interface GigabitEthernet0/0/1.10
dot1q termination vid 10
ip address 192.168.10.254 255.255.255.0
arp broadcast enable
#
interface GigabitEthernet0/0/1.20
dot1q termination vid 20
ip address 192.168.20.254 255.255.255.0
arp broadcast enable
PC1:
PC2:
测试pc1 ping 网关192.168.10.254成功:
测试pc1 ping PC2 192.168.20.1成功: