You are connected to R1. Configure R1 and SW1 so that hosts in VLAN 10 (192.168.10.0/24) and VLAN 20 (192.168.20.0/24) can communicate via the router-on-a-stick setup. The current configuration has errors: the trunk port between SW1 and R1 has a native VLAN mismatch, VLAN 30 is not allowed on the trunk, and the subinterface encapsulation is incorrect. Correct these issues and enable inter-VLAN routing.
Hints
- •Check the native VLAN on both ends of the trunk: R1's subinterface .30 should use the native keyword.
- •Ensure VLAN 30 is allowed on the SW1 trunk; you may need to add it to the allowed list.
- •Enable ip routing globally on R1 to route between VLANs.
! R1 configure terminal interface GigabitEthernet0/0.30 encapsulation dot1Q 30 native exit interface GigabitEthernet0/0 no shutdown exit ip routing exit copy running-config startup-config
Why this answer
The native VLAN on SW1 is 99 but R1's physical interface defaults to VLAN 1, causing a mismatch. To fix this, R1's subinterface Gi0/0.30 must be set with encapsulation dot1Q 99 native, making R1's native VLAN 99 and matching SW1. VLAN 30 is not allowed on the trunk, preventing any traffic in that VLAN; it must be added to the trunk's allowed list on SW1.
After these corrections, inter-VLAN routing for VLANs 10 and 20 will function correctly.
Exam trap
Candidates often assume that setting a subinterface's encapsulation to 'dot1Q 30 native' will fix any mismatch, but the native VLAN ID must be explicitly aligned with the switch's native VLAN configuration.
Why the other options are wrong
The specific factual error: VLAN 30 must be allowed on the trunk for the router to receive and forward traffic for that VLAN.
The specific factual error: The native VLAN must match on both ends of the trunk; changing SW1 to VLAN 1 would not resolve the mismatch with R1's native VLAN 30.
The specific factual error: The trunk must allow all VLANs that need to be routed, including the native VLAN (30), otherwise the router cannot communicate with hosts in VLAN 30.