Segue a configuração do modo trunk na porta do switch que o router está conectado.
switch(config)#inter f0/0
switch(config-if)#switchport mode trunk
switch(config-if)#switchport trunk allowed vlan 10
switch(config-if)#switchport trunk allowed vlan add 20
Vamos configurar as sub-interfaces e endereçamento IP no Router para que ele consiga rotear os pacotes entre as VLAN’s.
Interface fastethernet0/0
no shutdown
exit
interface fastethernet0/0.1
encapsulation dot1q 1 native
ip address 192.168.1.1 255.255.255.0
interface fastethernet0/0.10
encapsulation dot1q 10
ip address 192.168.5.1 255.255.255.0
interface fastethernet0/0.20
encapsulation dot1q 20
ip address 192.168.6.1 255.255.255.0
r_vlan#