Let;s say you have three VLAN’s, VLAN 10, 20, and 30.
On switch, you will need to create VLAN and name them, assign appropriate Interfaces to one of three VLAN’s, create logical VLAN interfaces and assign them an IP Address, and configure ONE interface – the one that connects to router – as trunk.
On router, you will need to configure sub-interfaces.
Below is sample config.
int vlan 10
ip address 10.10.10.1 255.255.255.0
int vlan 20
ip address 10.10.20.1 255.255.255.0
int vlan 30
ip address 10.10.30.1 255.255.255.0
int fast 0/1
switchport access vlan 10
int fast 0/5
switchport access vlan 20
int fast 0/10
switchport access vlan 30
int fa 0/24
switchport encapsulation dot1q
switchport mode trunk
ROUTER (Assuming you have switch port 0/24 connected to router port Gig0/1)
int g 0/1.10
encap dot1q 10
ip address 10.10.10.254 255.255.255.0
int gig 0/1.20
encap dot1q 20
ip address 10.10.20.254 255.255.255.0
int gig 0/1.30
encap dot1q 30
ip address 10.10.30.254 255.255.255.0
int g 0/1
The above will get your switch and router to talk. In addition, you will have to configre your router correctly for NAT to all three VLANs can access Internet.