how to check vlans if they are in same or different subnet

Unanswered Question
Mar 23rd, 2008
User Badges:

IOS (tm) MSFC2 Software (C6MSFC2-JSV-M), Version 12.1(8b)E9,

sh ip int brief

Interface IP-Address OK? Method Status Protocol

Vlan3 YES NVRAM up up

Vlan4 YES NVRAM up up

Vlan7 YES manual up up

Vlan9 YES manual up up

Vlan12 YES manual up up

Vlan17 YES manual up up

Vlan100 unassigned YES NVRAM administratively down down

Vlan101 YES manual up up

Loopback0 YES NVRAM up

can anyone tell me how we can check if vlans are in same subnet or different

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (6 ratings)
Marcofbbr Sun, 03/23/2008 - 08:38
User Badges:

Probably I don't really understand what you are askyng....but try to copy and paste this command in your console

sh int | i Vlan|Internet address

mahesh18 Sun, 03/23/2008 - 08:52
User Badges:

Vlan3 is up, line protocol is up

Internet address is

Vlan4 is up, line protocol is up

Internet address is

Vlan7 is up, line protocol is up

Internet address is

Vlan9 is up, line protocol is up

Internet address is

Vlan12 is up, line protocol is up

Internet address is

Vlan17 is up, line protocol is up

Internet address is

Vlan100 is administratively down, line protocol is down

Vlan101 is up, line protocol is up

Internet address is

Internet address is

Istvan_Rabai Sun, 03/23/2008 - 08:45
User Badges:
  • Gold, 750 points or more

Hi Mahesh,

Issue the 'show ip route connected" command.

This will show you the subnets with masks for the vlan interfaces, and you can check which vlan interface belongs to which subnet.



mahesh18 Sun, 03/23/2008 - 08:56
User Badges:

sh ip route connected

C is directly connected, EOBC0/0 is variably subnetted, 748 subnets, 16 masks

C is directly connected, Vlan3

C is directly connected, Vlan4

C is directly connected, Loopback0

C is directly connected, Vlan17

C is directly connected, Vlan12

C is directly connected, Vlan9

C is directly connected, Vlan7 is subnetted, 1 subnets

C is directly connected, Vlan101

can u explain we what this mean

Istvan_Rabai Sun, 03/23/2008 - 10:38
User Badges:
  • Gold, 750 points or more

Hi Mahesh,

For example:

Interface vlan3 is in the subnet with a 28 bit long subnet mask.

The same way you can check the subnet for other vlan interfaces.

The good thing with the "show ip route connected" command is that you don't have to calculate the subnet from the ip address and mask of the vlan interface.

This shows you the subnets and masks directly.



glen.grant Sun, 03/23/2008 - 08:46
User Badges:
  • Purple, 4500 points or more

Just do a show runn and look at the layer 3 SVI's and see how they are masked adn that will tell you if they are in the same address range, they should not be . My guess by looking them is that they are connecting links with a /30 mask.

mahesh18 Sun, 03/23/2008 - 08:54
User Badges:

hi thanks for ur reply

can u explain me in deep what u mean?

mahesh18 Sun, 03/23/2008 - 09:20
User Badges:

thanks for ur reply

i need understanding on subnets

that link will help

Edison Ortiz Sun, 03/23/2008 - 09:00
User Badges:
  • Super Bronze, 10000 points or more
  • Hall of Fame,

    Founding Member

The switch won't allow you to enter overlapping subnets on different SVIs, therefore all the IP addresses you've listed are on different subnets.


interface Vlan840

ip address



interface Vlan841

ip address


Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#int vlan 840

Router(config-if)#no shut

Router(config-if)#int vlan 841

Router(config-if)#no shut overlaps with Vlan840

Vlan841: incorrect IP address assignment





mahesh18 Sun, 03/23/2008 - 09:16
User Badges:

thanks for ur reply

so vlan7,4 17 have subnet/30

so are these vlans in same subnet then

Mark Yeates Sun, 03/23/2008 - 18:49
User Badges:
  • Gold, 750 points or more

Your vlans are not on the same subnet. Your router will not allow you to have overlapping subnets.



This Discussion