LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Same subnet VLAN question? (https://www.linuxquestions.org/questions/linux-networking-3/same-subnet-vlan-question-698924/)

NaCo 01-21-2009 01:08 PM

Same subnet VLAN question?
 
Hello community,

If I have a manageable layer 2 switch and I create 2 VLANs on the same subnet(eg: 172.16.10.0/24) connecting VLAN1 on switch port 1 and VLAN2 on switch port 2.

Each VLAN will have 8 hosts connected to its corresponding switch port using a hub:

VLAN1 host IP range: 172.16.10.2-172.16.10.10
VLAN2 host IP range: 172.16.10.20-172.16.10.28

If I am correct, the switch should have two collision domains(which is basically the main concept of VLANs) and should identify which MAC address is found on what VLAN (which MAC is in what switch port).



Questions:

If host 172.16.10.2 sends an ARP broadcast asking:

Who has 172.16.10.20? tell 172.16.10.2

1.-How will the switch react to such broadcast?

2.-If this broadcast gets isolated only to VLAN1,
could communication among VLAN1 and VLAN2 be accomplished with out a default-gateway/router nor a layer 3 switch?

3.-Does host 172.16.10.20 will only get a unicast from the switch?

I wish I had the right lab at home but I don't, being this the reason of this post.

I will appreciate any help.

Thank you
Angel.

anomie 01-21-2009 06:56 PM

Quote:

Originally Posted by NaCo
VLAN1 host IP range: 172.16.10.2-172.16.10.10
VLAN2 host IP range: 172.16.10.20-172.16.10.28
...
If host 172.16.10.2 sends an ARP broadcast asking:

Who has 172.16.10.20? tell 172.16.10.2

1.-How will the switch react to such broadcast?

The switch should keep layer 2 traffic between the two VLANs segregated. So the ARP request should go unanswered.

You could easily confirm this with tcpdump (or perhaps management tools on your switch?).

Quote:

Originally Posted by NaCo
2.-If this broadcast gets isolated only to VLAN1,
could communication among VLAN1 and VLAN2 be accomplished with out a default-gateway/router nor a layer 3 switch?

A layer 3 switch is doing routing, so in the context of your question it might as well be a router. I don't know of a way for different networks to communicate without a path to traverse between them.

baldy3105 01-24-2009 10:55 AM

A VLAN is a broadcast domain, i.e. it defines the extent to which broadcasts and unknown unicast macs are flooded.

Any broadcast sent to vlan 1 will remain in vlan 1. You can bridge between Vlan1 and 2, but what would be the point? you might just as well assign all ports to the same Vlan. The exception I suppose is that you could implement filtering between vlans by going via an external bridge. It's a lot of assing around for little gain. If you have a vlan capable switch but no router, you could use a linux box to route between the two.

To connect the two vlans you would normally use a router, this could be physical or virtual, i.e. a L3 switch, but its routing either way you look at it.

Obviously you would not be able to route between the IP ranges in your example as they are not valid subnets. In reality to cater for the number of devices you have listed you would need to use network 172.16.10.0 255.255.255.224 which gives you 14 hosts 1-14, and 172.16.10.16 255.255.255.224 which gives you 14 hosts 17-30.

NaCo 01-24-2009 11:21 AM

Thank you.
 
I realized a made a huge error. I was setting the same subnets for two VLANs, which is equally to having two physical subnets with the same IP range.

baldy3105, as you mention, a better approach is to have classless subnets.


All times are GMT -5. The time now is 11:40 AM.