Hi @Fayyaz reeham ,
You could do this using the VTP protocol to avoid creating all the vlan in each switch and the router-on-a-stick technique to route the vlan in the router.
For VTP, you could use the switch closest to the router:
s(config) #vtp domain ccna
s(config) #vtp mode server
Then you create all the vlan of your topology:
s(config) #vlan 10
s(config-vlan) #name vlan10
s(config-vlan) #exit
s(config) #vlan 20
s(config-vlan) #name vlan20
s(config-vlan) #exit
You must make sure to leave all the ports that connect the switches in trunk mode
In the other switches, you only have to configure them in client mode:
s(config) #vtp domain ccna
s(config) #vtp mode client
This will ensure that all the vlan created on the switch server is copied to the client switches
In the router, you must leave up the interface that connects to the switch and create subinterfaces, then encapsulate the subinterfaces with the tag of each vlan:
The port of the switch that connect to the router must be in trunk mode too.
r(config)#interface f0/0
r(config-if)#no shut
r(config-if)#interface f0/0.10
r(config-subif)#encap dot 10
r(config-subif)#ip add <ip> <mask>
r(config-if)#interface f0/0.20
r(config-subif)#encap dot 20
r(config-subif)#ip add <ip> <mask>
I hope this is useful for you
Regards