Please fallowfollow my configuration and try
Router(config)#iint 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
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 Configure the trunk Port in the switch interface connectiingconnected to the router so that vlan 10, Vlan20, Vlan30,Vlan40 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
Switch(config)# int 0/1 #switch Port trunk #switch trunk allowed vlan all #no shutdown` Create access ports as per your requirements, for example example, below
Switch (config)#int 0/2 #switchport mode access #switch Port access vlan10 #no shutdown /please connect this interface to end devices/
Switch (config)#int 0/2 #switchport mode access #switch Port access vlan10 #no shutdown /*please connect this interface to end devices*/ Create vlansVLANs 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
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 ....