Please fallow my configuration and try
Router(config)#iint gigabit Ethernet 0/0/0 #no ip address #ni shutdown Router(config)# int gigabit Ethernet 0/0/0.10 #ip address x.x.x.x x.x.x.x #encapusation dot1q 10 #no shut Router(config)#int gigabit ethernet 0/0/0.20 #encapsulation dot1q 20 #ip address x.x.x.x x.xx.x #no shutdown Router (config)#int gigabit ethernet 0/0/0.30 #encapsulation dot1q 30 #ip address x.x.x.x x.x.x.x #no shutdown Router(config)# int gigabit Ethernet 0/0/0.40 #encapsulation dot1q 40 #ip address x.x.x.x x.x.x.x #no shutdown
In layer2 switch configuration
Configure trunk Port in switch interface connectiing to router so that vlan 10, Vlan20, Vlan30,Vlan40 traffic will flow from router towards switch from this trunk Port
Switch(config)# int 0/1 #switch Port trunk #switch trunk allowed vlan all #no shutdown
Create access ports as per your requirements for example below
Switch (config)#int 0/2 #switchport mode access #switch Port access vlan10 #no shutdown /please connect this interface to end devices/
Create vlans in this switch
Switch(config)#vlan 10 #name finances Switch(config)#vlan 20 #name account Switch(config)#vlan30 #name operation Switch(config)# Vlan40 #name hr
Try above configuration ....