6 Replies Latest reply: Oct 14, 2010 4:44 AM by MarkG RSS

    Subnet & Vlan Relationship


      Hi All,


      I'm aware about, that we can have one subnet par VLAN. But is it possible to have multiple Subnets par VLAN?






        • 1. Re: Subnet & Vlan Relationship

          hi Hardik


          i think there is nothing possible to have multi subnet in per vlan


          if we use VLSM to divided many subnets ,we must fix some gateway ,one gateway seems one vlan


          i don't be sure about my opinion ,


          many thanks



          • 2. Re: Subnet & Vlan Relationship
            Damian McCourt

            I think it's quite possible to do, but not recommended - this is something that confused me a bit when I read it too. A VLAN is a layer 2 arrangement, which is why it needs an SVI (or an actual router) to route packets to other vlans. So a vlan doesn't know or care about subnets, it will quite happily accept packets from any member port.


            I think what will happen is that if there are several subnets on the same vlan is that the cam tables are all going to have layer 2 routes for the various hosts, regardless of what layer 3 subnet they're on, so the packets will get routed regardless. Which is probaby why it's recommended to keep a single vlan per subnet.


            Anyone know if this is the case?

            • 3. Re: Subnet & Vlan Relationship

              Hi Guys,


              A VLAN it's defined as a single Broadcast domain (L2) you can have different L3 addressing (subnets) for host into the same VLAN or broadcast domain, however remember how the hosts obtain L2 information by using ARP. All the packets for different subnets will be sent to the default gateway in it's own subnet, so we need L3 routing a L3 interface to route packets between those hosts. Packets for the same subnet will obtain L2 info by using ARP.


              We can also have several several VLANs within a single L3 subnet in this case router's proxy ARP can route the packets between VLANs.


              That's my understanding.





              • 4. Re: Subnet & Vlan Relationship

                Hi Hardik,




                Yes, it is possible to have multiple subnets per vlan, but be careful unless you really understand what you're doing.  An example of such a configuration is the "ip address <ip> <netmask> secondary" interface configuration.  With this config, the switch will respond on both subnets on vlan66. You could just as easily put two routers on the same vlan and have each router on a separate subnet.




                interface Vlan66
                ip address secondary
                ip address




                Just be careful with secondary IP addresses as there are some subtle issues that can arise.  One such example as how routing protocols treat the secondary IP address.













                PS - I highly doubt this is a CCNA topic (I haven't checked).

                • 5. Re: Subnet & Vlan Relationship



                  so u mean u can key this command on one interface


                  i really don't know this command true meaning ,but i guess ,is it for any other application for one interface?such as VOIP,


                  do u test it ,one interface access per vlan ,but on this interface u do the setting ,set the second IP address ,can u reach other interface with the same vlan ,


                  the two subnets can communication freely ??


                  this is just my doubt ?


                  many thanks



                  • 6. Re: Subnet & Vlan Relationship

                    the two subnets can communication freely ??


                    this is just my doubt ?





                    Hi Matt,


                    Think about another example.  You can have an IPv4 subnet riding on the same vlan as an IPv6 subnet.  Similarly,  you'll have a IPv6 link-local subnet on the same vlan as your routable IPv6 address.


                    In all examples provided, you would still need some layer-3 routing between the various subnets for layer-3 communication to take place, but they can all coexist on the same layer-2 vlan.