Several issues are involved in the operation of a VLAN:
Who can participate in each VLAN
How VLANs communicate among each other
How devices within different VLANs can communicate with one another
There are three ways a network device can be assigned to a VLAN: by port, Layer 2 (MAC) address, or Layer 3 (network) address. The type of VLAN determines how a device is assigned. In a port-based VLAN, for example, you assign each switch port to a VLAN. In MAC address-based VLANs, membership is defined by the source or destination MAC address. VLANs based on Layer 3 information use the protocol type, such as the Internet Protocol (IP), and the Layer 3 (network) address in determining which VLAN the device is a member of. ...