cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
433
Views
0
Helpful
3
Replies

vlan and subnet correspondence

sarahr202
Level 5
Level 5

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!

3 Accepted Solutions

Accepted Solutions

mikegrous
Level 3
Level 3

int vlan 1

ip add 2.2.2.3 255.255.255.0 secondary

View solution in original post

glen.grant
VIP Alumni
VIP Alumni

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.

View solution in original post

Edison Ortiz
Hall of Fame
Hall of Fame

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.

View solution in original post

3 Replies 3

mikegrous
Level 3
Level 3

int vlan 1

ip add 2.2.2.3 255.255.255.0 secondary

glen.grant
VIP Alumni
VIP Alumni

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.

Edison Ortiz
Hall of Fame
Hall of Fame

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.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco