To connect different VLANs, a layer 3 device is needed, either a router or a layer 3 switch. The first method is by using a single router through one interface. This technique is called router on a stick. The drawback of this technique is that a collision domain will occur because it only uses one interface.
There are 2 trunking protocols that are commonly used:
- ISL = cisco proprietary, works on ethernet, token ring and FDDI, adds a tag of 30 bytes on the frame and tags all VLAN traffic.
- IEEE 802.11Q (dot1q) = open standard, only works on ethernet, adds a tag of 4 bytes on the frame.

Create a topology like the one above and configure VLAN10 and VLAN20 as in the previous lab. Add 1 router. Since only 1 interface is used, a sub-interface must be created to serve as the VLAN gateway. The port on SW1 connected to the router must be set to trunk mode.
Router(config)#interface FastEthernet0/0.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 10.10.10.1 255.255.255.0
Router(config-subif)#interface FastEthernet0/0.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 20.20.20.1 255.255.255.0Check the interface with the show ip int brief command.
Router#sh ip int br
Interface IP-Address OK? Method Status
Protocol
FastEthernet0/0 unassigned YES unset up up
FastEthernet0/0.10 10.10.10.1 YES manual up up
FastEthernet0/0.20 20.20.20.1 YES manual up up
FastEthernet0/0.30 30.30.30.30 YES manual up up
FastEthernet0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
Router#Now ping between different VLANs.
PC>ping 20.20.20.21
Pinging 20.20.20.21 with 32 bytes of data:
Request timed out.
Reply from 20.20.20.21: bytes=32 time=1ms TTL=127
Reply from 20.20.20.21: bytes=32 time=0ms TTL=127
Reply from 20.20.20.21: bytes=32 time=0ms TTL=127
Ping statistics for 20.20.20.21:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
PC>tracert 20.20.20.21
Tracing route to 20.20.20.21 over a maximum of 30 hops:
1 30 ms 0 ms 0 ms 10.10.10.1
2 0 ms 0 ms 0 ms 20.20.20.21
Trace complete.
Router#sh ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 10.10.10.10 4 0000.0C1B.0D20 ARPA
FastEthernet0/0.10
Internet 20.20.20.21 3 0060.7092.05A9 ARPA
FastEthernet0/0.20
Internet 30.30.30.1 1 0001.C7AE.3D52 ARPA
FastEthernet0/0.30
Router#


