VLAN间路由-单臂路由
将交换机和路由器之间的链路配置为Trunk链路,并且在路由器上创建子接口以支持VLAN路由。
设备规划表
SWA配置
[SWA]vlan batch 2 3
[SWA]interface GigabitEthernet0/0/1
[SWA-GigabitEthernet0/0/1]port link-type trunk
[SWA-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 3
[SWA-GigabitEthernet0/0/1]interface GigabitEthernet0/0/2
[SWA-GigabitEthernet0/0/2]port link-type access
[SWA-GigabitEthernet0/0/2]port default vlan 2
[SWA-GigabitEthernet0/0/2]interface GigabitEthernet0/0/3
[SWA-GigabitEthernet0/0/3]port link-type access
[SWA-GigabitEthernet0/0/3]port default vlan 3
PTA配置
[RTA]interface GigabitEthernet0/0/1.2
[RTA-GigabitEthernet0/0/1.2]dot1q termination vid 2
[RTA-GigabitEthernet0/0/1.2]ip address 192.168.2.254 24
[RTA-GigabitEthernet0/0/1.2]arp broadcast enable
[RTA]interface GigabitEthernet0/0/1.3
[RTA-GigabitEthernet0/0/1.3]dot1q termination vid 3
[RTA-GigabitEthernet0/0/1.3]ip address 192.168.3.254 24
[RTA-GigabitEthernet0/0/1.3]arp broadcast enable
验证
主机A与主机B之间可以互ping通