Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Two subnets in one VLAN.

I'm just practicing VLANs.

I created two subnets in VLAN1. And while trying to enable communication between the devices in both subnets, i configured Fa0/0 interface of router as 10.0.1.254/24 (But as i expected it didn't enabled communication). I believe i'm missing something.

Can someone please help me in this ?

two subnets in vlan1.PNG

Regards,

Chandu

Regards, Chandu
Everyone's tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Super Silver

Two subnets in one VLAN.

Chandu

One of the things that you need to keep in mind when thinking about this environment is that a VLAN defines a broadcast domain. So if there is 1 VLAN then there is 1 broadcast domain.

We  typically think of subnets in a similar way. We tend to assume that a  subnet corresponds to a broadcast domain, and that is the way that it is  usually implemented. But not always. And you have created an exception  to that normal expectation.

When we think about a subnet corresponding to a broadcast domain then it is true that to communicate between subnets (between broadcast domains) you must have a router or other layer 3 device to route between subnets. But in this case there is a single VLAN and a single broadcast domain. This means that any host in the VLAN will receive broadcasts from every other host in the VLAN. So if 10.0.1.1 sends an arp request then 10.0.2.3 will receive the request and can send a response which 10.0.1.1 will receive. So any host in your network can communicate with any other host in your network - no router is required.

So the question becomes will 10.0.1.1 send an arp request for 10.0.2.3? And the answer is that it depends on how host 10.0.1.1 and 10.0.2.3 are configured. There are a couple of options in configuring the hosts so that they will arp for each other. And the suggestion from John about configuring secondary addresses would also probably work.

HTH

Rick

6 REPLIES
New Member

Two subnets in one VLAN.

I know that i can make the subnet to /22 to enable communication. But i don't want to do like that..

Is there any other way to enable communication between two networks in one VLAN.

Regards,

Chandu

Regards, Chandu

Two subnets in one VLAN.

There's not a way to have two different subnets in a single vlan without routing some way for it. You can do the /22 as you stated, or you can put a secondary ip address on the vlan interface:

int vlan 1

ip addres 192.168.1.1 255.255.255.0

ip address 192.168.2.1 255.255.255.0 secondary

A vlan is a logically segmented network, so when you have an ip address on the svi, that's the subnet that svi will support. If it sees traffic from a different subnet come in on that vlan, the switch/router will drop the traffic.

HTH,
John

*** Please rate all useful posts ***

HTH, John *** Please rate all useful posts ***
Hall of Fame Super Silver

Two subnets in one VLAN.

Chandu

One of the things that you need to keep in mind when thinking about this environment is that a VLAN defines a broadcast domain. So if there is 1 VLAN then there is 1 broadcast domain.

We  typically think of subnets in a similar way. We tend to assume that a  subnet corresponds to a broadcast domain, and that is the way that it is  usually implemented. But not always. And you have created an exception  to that normal expectation.

When we think about a subnet corresponding to a broadcast domain then it is true that to communicate between subnets (between broadcast domains) you must have a router or other layer 3 device to route between subnets. But in this case there is a single VLAN and a single broadcast domain. This means that any host in the VLAN will receive broadcasts from every other host in the VLAN. So if 10.0.1.1 sends an arp request then 10.0.2.3 will receive the request and can send a response which 10.0.1.1 will receive. So any host in your network can communicate with any other host in your network - no router is required.

So the question becomes will 10.0.1.1 send an arp request for 10.0.2.3? And the answer is that it depends on how host 10.0.1.1 and 10.0.2.3 are configured. There are a couple of options in configuring the hosts so that they will arp for each other. And the suggestion from John about configuring secondary addresses would also probably work.

HTH

Rick

New Member

Two subnets in one VLAN.

Chandu

Each VLAN represents only one subnet, so when you say VLAN it is the logical meaning of a subnet ID, so let me give another definition.

10.1.1.0/24 (VLAN 1)

10.1.2.0/24 (VLAN 2)

So, for example, Subnets 10.1.1.0/24 and 10.1.2.0/24 can't be on the same VLAN, they have to be in 2 different VLANs, and to enable communication between different VLANs, there are 3 options.

a) Router on a stick: by configuring one FastEthernet Router port with sub interface commands:

Router(config)#interface FastEthernet 0/0

Router(config-if)#no ip address

Router(config-if)#no shutdown

Router(config-if)#exit

Router(config)#interface FastEthernet 0/0.1

Router(config-if)#encapsulation dot1q "VLAN-ID" (for this example write only "1")

Router(config-if)#ip address 10.1.1.254 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#exit

Router(config)#interface FastEthernet 0/0.2

Router(config-if)#encapsulation dot1q "VLAN-ID" (for this example write only "2")

Router(config-if)#ip address 10.1.2.254 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#exit

b) Using a separate Router FastEthernet interface per VLAN and this option is not practical:

Router(config)#interface FastEthernet 0/0

Router(config-if)#ip address 10.1.1.254 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#exit

Router(config)#interface FastEthernet 0/1

Router(config-if)#ip address 10.1.2.254 255.255.255.0

Router(config-if)#no shutdown

Router(config-if)#exit

c)Using a MultiLayer Switch with inter vlan commands:

Switch(config)#interface vlan 1

Switch(config-if)#ip address 10.1.1.254 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#exit

Switch(config)#interface vlan 2

Switch(config-if)#ip address 10.1.2.254 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#exit

Switch(config)#ip routing (to enable routing on the MultiLayer Switch)

Regards, Khaled Omar "Please don't forget to rate useful posts"
New Member

Two subnets in one VLAN.

Rick,

Thanks for the info. Do you've any doc or link related to configuring arp request on hosts ?

Regards,

Chandu

Regards, Chandu
Hall of Fame Super Silver

Two subnets in one VLAN.

Chandu

You are welcome. I do not have any convenient references or documents about configuring a host to arp for "remote" addresses. I believe that it probably varies by platform OS and sometimes perhaps by version of OS.

This is an interesting discussion about what is possible. I would also like to make a point about the difference between what we "could" do and what we "should" do. The other responses in this discussion have all come from the perspective that there should be a one to one relationship between vlan and subnet. And this is usually the better way to do it. But your question is about what we could do, and the answer is that we could have 2 subnets on the same vlan and they be able to communicate.

HTH

Rick

7146
Views
13
Helpful
6
Replies
CreatePlease login to create content