Actually to access internet from VLANs you need to configure NAT, but only some Cisco layer 3 switches (i.e 6500,6000 and 5500) supports NAT. That's why for the cisco layer 3 switches which don't support NAT in that case we can apply dynamic routing protocol (EIGRP) both in cisco layer 3 switch and in the router to access internet. The common problem is VLAN 1 can access internet but other VLANs can't access internet, in this case if you apply EIGRP routing in both Cisco router and in cisco layer 3 switch then the router and other VLANs will access each other through dynamically detecting the VLAN 1 interface IP address.
The whole process has been precisely described in the following youtube video:
Configure VLAN | Allow VLANs to Access Internet
https://www.youtube.com/channel/UCmZZ2BNGXQH1HPS3uIVnr7A?sub_confirmation=1
Cisco Router Configuration:
configure terminal
interface gigabitEthernet 0/0
no shutdown
ip address dhcp
exit
interface gigabitEthernet 0/1
ip address 192.168.2.1 255.255.255.0
no shutdown
exit
ip dhcp pool mainuser
network 192.168.2.0 /24
default-router 192.168.2.1
dns-server 8.8.8.8
exit
ip route 0.0.0.0 0.0.0.0 192.168.1.1
interface gigabitEthernet 0/0
ip nat outside
exit
interface gigabitEthernet 0/1
ip nat inside
exit
ip access-list standard 1
permit any
exit
ip nat inside source list 1 interface gigabitEthernet 0/0 overload
exit
Applying Dynamic Routing EIGRP in Cisco Router:
router eigrp 10
network 192.168.2.0 255.255.255.0
exit
Configuration in Switch part:
enable
configure terminal
vlan 10
name hr
exit
vlan 20
name it
exit
interface range fastEthernet 0/13-18
switchport mode access
switchport access vlan 10
no shutdown
exit
interface range fastEthernet 0/19-24
switchport mode access
switchport access vlan 20
exit
interface vlan 10
ip address 192.168.3.1 255.255.255.0
exit
interface vlan 20
ip address 192.168.4.1 255.255.255.0
exit
Applying Inter VLAN Routing in Cisco Switch:
configure terminal
ip routing
exit
Applying Static Routing in Cisco Switch to Cisco Default Router:
ip route 0.0.0.0 0.0.0.0 192.168.2.1
exit
Applying Dynamic Routing EIGRP in Cisco Router:
configure terminal
router eigrp 10
network 192.168.3.0 255.255.255.0
network 192.168.4.0 255.255.255.0
network 192.168.2.0 255.255.255.0
exit
https://www.youtube.com/watch?v=-JeubKTW8-w