If you really want to communicate different VLANs together. Please coonect a Router beyond the catalyst switch which is called Router-on-stick. If you are not using any router beyond the catalyst switch, you can club them into a single cisco device which is Layer 3 Catalyst switch.
Both those things are same & will work in a same manner. But on both devices, command will run in a differnt manner.
So here i’ll take a full configuration of the Router & L2 Switch whichone we have discussed in starting is Following as :
command on Router :
Router(config)#int fa0/1 ———————-select nterface.
Router(config-if)#no ip address
Router(config)#int fa0/1.1 ———————-create subinterface.
Router(config-subif)#encapsulation dot1q x ———————-x : is vlan no.
command on switch :
Switch(config)#int fa0/1 ———————-select nterface.
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk encapsulation dotq
I believe that is adequate information for you to configure inter VLAn routing between Router & L2 switch.
If you are facing any configuration problem in your network, please write me a mail on my mail id with network information.
Thanks & Regards,