单臂路由
最后配置形成的拓扑图
SW1
system-view
sysname SW1
vlan bat 10 20 30
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 10
interface GigabitEthernet 0/0/3
port link-type access
port default vlan 20
interface GigabitEthernet 0/0/4
port link-type access
port default vlan 30
interface GigabitEthernet 0/0/1
#设置连接方式为trunk
port link-type trunk
#允许所有的vlan通过
port trunk allow-pass vlan all
quit
AR1
system-view
sysname R1
interface GigabitEthernet 0/0/0.1
ip address 192.168.1.254 24
dot1q termination vid 10
# 开启广播功能
arp broadcast enable
interface GigabitEthernet 0/0/0.2
ip address 192.168.2.254 24
#设置Vlan的ID
dot1q termination vid 20
arp broadcast enable
interface GigabitEthernet 0/0/0.3
ip address 192.168.3.254 24
dot1q termination vid 30
arp broadcast enable
运行命令截图