R1#show ip route | begin Gateway
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/24 is directly connected, Ethernet0/0.10
L 10.0.0.1/32 is directly connected, Ethernet0/0.10
20.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 20.0.0.0/24 is directly connected, Ethernet0/0.20
L 20.0.0.1/32 is directly connected, Ethernet0/0.20
SW1#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et0/3
10 VLAN10 active Et0/1
20 VLAN20 active Et0/2
SW1#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/0 on 802.1q trunking 1
Port Vlans allowed on trunk
Et0/0 10,20
Port Vlans allowed and active in management domain
Et0/0 10,20
Port Vlans in spanning tree forwarding state and not pruned
Et0/0 10,20
VLAN Tag 인식 및 게이트웨이 분리를 위해 Sub-Interface를 설정
2) Inter-VLAN 통신 확인
SW1의 Access Mode인 포트로 Import할 때, 포트에 설정한 10번 Tag를 Frame에 추가
SW1의 Trunk Mode인 포트로 Export할 때, 포트에 설정한 10번 Tag가 Frame에 존재하므로 Tag 유지
R1은 Frame에 존재하는 10번 Tag가 설정된 Sub-Interface가 있는지 확인하고 D-IP가 본인 Sub-Interface가 아님을 확인하고 라우팅 테이블에서 Longest Match Rule에 의해 매칭되는 Next-Hop(OIF)으로 Sub-Interface에 설정된 VLAN 20번 Tag를 붙이고 전송
SW1의 Trunk Mode인 포트로 Import할 때, 포트에 설정한 20번 Tag가 Frame에 존재하므로 Tag 유지