Configuration Guide Vol. 1


26.8.2 Configuring MAC VLAN

The following explains how to set a MAC VLAN. It includes an example for setting the MAC address belonging to MAC VLANs and VLANs by configuration. For details about linkage with IEEE802.1X, see Configuration Vol.2" "7 IEEE802.1X Configuration and Operation.

The figure below shows example settings for Switch 1. Port 1/0/1 is set for MAC VLAN 10. Port 1/0/2 is set for MAC VLANs 10 and 20, and port 1/0/3 is set for MAC VLAN 20. Note that terminal D, for which no MAC address is registered, is connected to port 1/0/3.

Figure 26-10 Examples of configuring MAC VLANs

[Figure Data]

<Structure of this section>

(1) Creating MAC VLAN and Registering MAC Addresses

Points to note

The example below shows how to create a MAC VLAN. When a VLAN is created, a VLAN ID and the mac-based parameter are specified.

As shown here, the MAC address belonging to the VLAN is also set. Register terminal A to C in each VLAN. Because communication with the MAC VLAN is not permitted for terminal D, it is not registered.

Command examples

  1. (config)# vlan 10 mac-based

    (config-vlan)# name MACVLAN10

    Creates VLAN 10 as a MAC VLAN. This command switches to VLAN configuration mode.

  2. (config-vlan)# mac-address 0012.e200.0001

    (config-vlan)# mac-address 0012.e200.0002

    (config-vlan)# exit

    Registers terminal A (0012.e200.0001) and terminal B (0012.e200.0002) for MAC VLAN 10.

  3. (config)# vlan 20 mac-based

    (config-vlan)# name MACVLAN20

    (config-vlan)# mac-address 0012.e200.0003

    Creates VLAN 20 as a MAC VLAN, and registers terminal C (0012.e200.0003) for MAC VLAN 20.

Notes

When MAC addresses are registered for MAC VLANs, the same MAC address cannot be registered for multiple VLANs.

(2) Configuring MAC Ports

Points to note

The MAC port set for distinguishing VLANs by source MAC address for the MAC VLAN handles untagged frames.

Command examples

  1. (config)# interface range gigabitethernet 1/0/1-2

    Switches ports 1/0/1 and 1/0/2 to Ethernet interface configuration mode.

  2. (config-if-range)# switchport mode mac-vlan

    (config-if-range)# exit

    Sets ports 1/0/1 and 1/0/2 for the MAC port. VLANs are registered dynamically for ports 1/0/1 and 1/0/2 by the Layer 2 authentication functionality.

  3. (config)# interface gigabitethernet 1/0/3

    (config-if)# switchport mode mac-vlan

    (config-if)# switchport mac vlan 20

    Sets port 1/0/3 as a MAC port. Also, set VLAN 20.

Notes

The switchport mac vlan command does not add to the previous configuration. Instead, it replaces the settings in the specified <vlan id list>. To add and remove VLANs for ports on which protocol VLANs are already running, use the switchport mac vlan add command and switchport mac vlan remove command.

(3) Configuring Trunk Ports

Points to note

Even for MAC VLANs, trunk ports are set to handle tagged frames, and VLANs are set for this trunk port.

Command examples

  1. (config)# interface gigabitethernet 1/0/4

    Switches to Ethernet interface configuration mode for ports 1, 0, and 4.

  2. (config-if)# switchport mode trunk

    (config-if)# switchport trunk allowed vlan 10,20

    Sets port 1/0/4 as a trunk port. Then, sets VLAN 10 and VLAN 20.