Network Design and Operations
A router is to be connected with a single link to an L2 switch that has VLAN 10 (192.168.10.0/24) and VLAN 20 (192.168.20.0/24), so that the two VLANs can communicate with each other. Which configuration is appropriate for this setup?
- AMake the switch port an access port in VLAN 10 and give the router interface a single IP address, 192.168.10.1
- BGive the hosts in VLAN 10 and VLAN 20 addresses from the same subnet so that they can communicate without going through the router
- CMake the switch port a trunk port, create a subinterface for each VLAN on the router, and configure each with its VLAN ID and the IP address that serves as that VLAN's default gateway (such as 192.168.10.1 and 192.168.20.1)
Show answer and explanation
Answer: C. Make the switch port a trunk port, create a subinterface for each VLAN on the router, and configure each with its VLAN ID and the IP address that serves as that VLAN's default gateway (such as 192.168.10.1 and 192.168.20.1)
Traffic between VLANs is relayed at the network layer by a router or L3 switch. To carry several VLANs over one link, the switch side is made a trunk port, and on the router one physical interface is split into a subinterface per VLAN, each configured with an 802.1Q VLAN ID and an IP address. The hosts in each VLAN use the address of their VLAN's subinterface as the default gateway. A packet from VLAN 10 to VLAN 20 goes up the link to the router and comes back down the same link with a different tag. This setup is called router on a stick; in networks with many devices, an L3 switch that routes inside the switch is generally used instead.
- A. Only VLAN 10 frames would reach the router, so hosts in VLAN 20 could not use it.
- B. Different VLANs are separate broadcast domains, so even with the same subnet, ARP would not reach across and the hosts could not communicate.
- C. Correct. With a trunk and subinterfaces, one link routes both VLANs.