VLAN and Subnet – Understanding Their Relationship

ipv4vlan

Many have pointed out that a VLAN can hold one or more subnets. If your default gateway for this subnet is on a router or a L3 switch then how could there be more than one default gateway in a VLAN configuration? On a router you map each subinterface to a VLAN and give it an IP and you can't have two subinterfaces with the same VLAN. On a L3 switch you give the VLAN interface an IP and that acts as the default gateway; you can't give it two IPs. So, how would one go about including two subnets in one VLAN?

Best Answer

You can use secondary addressing to add another subnet onto a SVI, this is not recommended but can be used if you really need it.

Current configuration : 190 bytes
!
interface Vlan45
 ip address 2.3.4.5 255.255.255.0 secondary
 ip address 3.4.5.6 255.255.255.0 secondary
 ip address 4.5.6.7 255.255.255.0 secondary
 ip address 1.2.3.4 255.255.255.0
end
Related Topic