Please follow my configuration and try
Router(config) #int gigabit Ethernet 0/0/0 #no ip address #no 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 the trunk Port in the switch interface connected to the router so that vlan 10, Vlan20, Vlan30, and Vlan40 traffic will flow from the router towards the 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 the above configuration...