Configuring a Layer 2 Virtual Switch
A Layer 2 virtual switch, which isolates a LAN segment with its spanning-tree protocol instance and separates its VLAN ID space, filters and forwards traffic only at the data link layer. Each VLAN consists of a set of logical ports that participate in Layer 2 learning and forwarding. A virtual switch represents a Layer 2 network.
Two main types of interfaces are used in virtual switch hierarchies:
- Layer 2 logical interface—This type of interface uses the VLAN-ID as a virtual circuit identifier and the scope of the VLAN-ID is local to the interface port. This type of interface is often used in service-provider-centric applications.
- Access or trunk interface—This type of interface
uses a VLAN-ID with global significance. The access or trunk interface
is implicitly associated with VLANs based on VLAN membership. Access
or trunk interfaces are typically used in enterprise-centric applications.
Note: The difference between access interfaces and trunk interfaces is that access interfaces can be part of one VLAN only and the interface is normally attached to an end-user device (packets are implicitly associated with the configured VLAN). In contrast, trunk interfaces multiplex traffic from multiple VLANs and usually interconnect switches.
To configure a Layer 2 virtual switch, include the following statements:
To enable a virtual switch, you must specify virtual-switch as the instance-type.
The VLANs that are specified with the vlan-id statement are included in the virtual switch.
You can configure other optional VLAN parameters in the virtual switch.