Subnets on a layer 2/unmanaged switch
You can't do this with a layer 2 switch alone. It sounds like you want a "router on a stick" config.
Here is a visual representation:

Here is how to set it up and how it will function:
Create several sub interfaces on your router. In the picture the sub interfaces are Fe0/0.10 and Fe0/0.20. Both of these are virtual interfaces connected to Fe0/0.
Both of these sub interfaces will have its own unique IP and will pretty much act like a normal interface would do. You need one sub interface for each VLAN. On the switch you set the port connected to the virtual interfaces in trucking mode for the VLANs.
The other ports will be in access mode, and will only allow 1 VLAN each. in the picture above, the computer with the red wire and the computer with the green wire can not talk to each other directly through the switch. The packet will first have to go up to the router, get retagged with a different VLAN and then go down to the switch again. You can set special permissions to applying access lists on the sub interfaces if you want. For example you might want the red wired computer to be able to send files to the green one, but not vice versa.
All VLANs need their own subnet as well as their own subinterface on the router. Each subinterface needs an unique IP as well, and that is the IP you set as the default gateway.
So if you make 192.168.10.0 to a subnet, and include that in VLAN 10, then I suggest you make the sub interface Fe0/0.10 and set the IP (which will be the default gateway address) to 192.168.10.1.
I can make a packet tracer config file if you're interested. Then you could see the exact config (at least on Cisco equipment).
Hope this helped.

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now