The configuration I want to achieve is for learning reasons, in Cisco packet tracer, not a real-life scenario:
I have one router and two switches connected to them. Each switch has multiple computers connected to them, some of which are in one VLAN, some are in another VLAN. If I understand correctly, computers in the same VLAN should also be in the same subnetwork, but this is unachievable, because trying this configuration results in an error (on the router):
interface g0/0.5
encapsulation dot1q 5
ip address [ip of vlan 5] 255.255.255.0
interface g0/0.10
encapsulation dot1q 10
ip address [ip of vlan 10] 255.255.255.0
Then I did this for g0/1
interface, too, which resulted in an error. Is what I'm trying to do possible at all? If yes, what did I do wrong and how do I fix it (besides putting the computers of VLAN 5 under switch 1 and putting the computers of VLAN 10 under switch two)?