vlan and subnet correspondence

Answered Question
Jan 8th, 2009
User Badges:
  • Bronze, 100 points or more

Hi every body!

I understand Cisco'S recommendation about one-to-one correspondence between vlan and ip subnet.


MY book says though it is not good pratice but one vlan can have more than one ip subnet.

For example two host h1 and h2 are connected to hub which is connected to multilayer switch.

sw f0/1------------hub----h1(1.1.1.1)

----h2(2.2.2.2)

sw' fo/1 is vlan 1.

h1 is in subnet 1.1.1.0/24

h2 is in subnet 2.2.2.0/24

Can we configur interface vlan 1 as 1.1.1.2 and also as 2.2.2.3?

I feel there is no way we can configure two ip address on single interface.


Then h1 can not communicate with h2 .

Let say h1 pings h2 which should be unsuccessful . Here is why:

1) h1 sends ping packet with destination mac= switch's vlan 1 interface.

2) sw receives the packet and finds its own mac address. Sw concludes this packet is meant for layer-3 switching.

3)Sw checks the destination subnet 2.2.2.0 in its routing table and find there is no match( that would be the case if my assumption about interface not having two ip address is correct).

sw simply drops the packet. The result is no communication between h1 and h2.

If my understanding is correct,then what is the point of recommendation by Cisco about one-to-one correspondence between vlan and ip subnet as having more than ip subnet per vlan would not result in communication between the hosts in vlan.


Any thoughts?

thanks a lot!


Correct Answer by Edison Ortiz about 8 years 4 months ago

Sarah,


As others have indicated you can use the secondary option when inserting the IP address under the SVI for additional IP subnets.


You may find this kind of configuration on production networks in the process of re-ipn'g the network.


To ping a device from one IP subnet to the other IP subnet in the same Layer2 Vlan, just use the same thought process as if they were in different Layer2 Vlans - that is, point their default gateway to the SVI in their respective IP subnet.


For instance,


2.2.2.0/24 will point to 2.2.2.3

1.1.1.0/24 will point to 1.1.1.2


HTH


__


Edison.

Correct Answer by glen.grant about 8 years 4 months ago

yup just use a secondary address on the same SVI , as far as I know there are no limitations on how many you can add , its just not good practice at all to have more than 1 or 2 , preferably 1 per SVI.

Correct Answer by mikegrous about 8 years 4 months ago

int vlan 1

ip add 2.2.2.3 255.255.255.0 secondary

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (3 ratings)
Loading.
Correct Answer
mikegrous Thu, 01/08/2009 - 18:04
User Badges:

int vlan 1

ip add 2.2.2.3 255.255.255.0 secondary

Correct Answer
glen.grant Thu, 01/08/2009 - 18:07
User Badges:
  • Purple, 4500 points or more

yup just use a secondary address on the same SVI , as far as I know there are no limitations on how many you can add , its just not good practice at all to have more than 1 or 2 , preferably 1 per SVI.

Correct Answer
Edison Ortiz Thu, 01/08/2009 - 18:33
User Badges:
  • Super Bronze, 10000 points or more
  • Hall of Fame,

    Founding Member

Sarah,


As others have indicated you can use the secondary option when inserting the IP address under the SVI for additional IP subnets.


You may find this kind of configuration on production networks in the process of re-ipn'g the network.


To ping a device from one IP subnet to the other IP subnet in the same Layer2 Vlan, just use the same thought process as if they were in different Layer2 Vlans - that is, point their default gateway to the SVI in their respective IP subnet.


For instance,


2.2.2.0/24 will point to 2.2.2.3

1.1.1.0/24 will point to 1.1.1.2


HTH


__


Edison.

Actions

This Discussion