Create a VLAN

Create a VLAN by port, protocol, or SPBM. Optionally, you can choose to assign the VLAN a name and color.

Assign an IP address to the VLAN. You can also assign a MAC-offset value that allows you to manually change the default MAC address.

Procedure

  1. Enter Global Configuration mode:

    enable

    configure terminal

  2. Create a VLAN by specifying one of the following VLAN types:
    1. Create a VLAN by port:

      vlan create <2-4059> [name WORD<0–64>] type port-mstprstp <0–63> [color <0–32>]

    2. Create a VLAN using a user-defined protocol and specify the frame encapsulation header type:

      vlan create <2-4059> [name WORD<0–64>] type protocol-mstprstp <0–63> ipv6 [color <0–32>]

    3. Create an SPBM B-VLAN:

      vlan create <2-4059> [name WORD<0–64>] type spbm-bvlan [color <0–32>]

  3. Optional: Associate a CVLAN I-SID to the platform VLAN.

    vlan i-sid <1-4059> <1-16777215> [force]

  4. Log on to the VLAN Interface Configuration mode for the VLAN ID:

    interface VLAN <1-4059>

  5. Assign an IP address to a VLAN:

    ip address {<A.B.C.D/X>|<A.B.C.D> <A.B.C.D>} [dvr-one-ip]

  6. Optional: Specify the MAC-offset value:

    ip address <A.B.C.D/X>|<A.B.C.D> <A.B.C.D> dvr-one-ip <MAC-offset>

Example

Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#vlan create 2 type port-mstprstp 0 color 4
Switch:1(config)#vlan i-sid 2 100
Switch:1(config)#interface vlan 2
Switch:1(config-if)#ip address 192.0.2.0/24 dvr-one-ip

Variable Definitions

The following table defines parameters for the vlan create command.

Variable

Value

<2-4059>

Specifies the VLAN ID in the range of 2 to 4059. VLAN ID 1 is the default VLAN and you cannot create or delete VLAN ID 1. By default, the system reserves VLAN IDs 4060 to 4094 for internal use. On switches that support the vrf-scaling and spbm-config-mode boot configuration flags, if you enable these flags, the system also reserves VLAN IDs 3500 to 3998.

name WORD<0-64>

Specifies the VLAN name. The name attribute is optional.

type port-mstprstp <0-63> [color <0-32>]

Creates a VLAN by port:

  • <0-63> is the STP instance ID from 0 to 63.

  • color <0-32> is the color of the VLAN in the range of 0 to 32.

Note:

MSTI instance 62 is reserved for SPBM if SPBM is enabled on the switch.

type pvlan-mstprstp <0-63> [color <0-32>]

Creates a private VLAN by port:

  • <0-63> is the STP instance ID from 0 to 63.

  • color <0-32> is the color of the VLAN in the range of 0 to 32.

type protocol-mstprstp <0–63> ipv6

Creates a VLAN by protocol:

  • <0–63> is the STP instance ID.

  • color <0-32> is the color of the VLAN in the range of 0 to 32.

type spbm-bvlan

Creates a SPBM B-VLAN.

The following table defines parameters for the ip address command.

Variable

Value

<A.B.C.D/X>|<A.B.C.D> <A.B.C.D>

Specifies the IP address and subnet mask in the format A.B.C.D/X or A.B.C.D A.B.C.D.

dvr-one-ip

Specifies that the IP address will be used as the DvR gateway IP address and will be used by all other DvR Controllers for the DvR VLAN subnet.

<MAC-offset>

Specifies a number by which to offset the MAC address from the chassis MAC address. This ensures that each IP address has a different MAC address. If you omit this variable, a unique MAC offset is automatically generated. Different hardware platforms support different ranges. To see which range is available on the switch, use the CLI command completion Help.

The following table defines parameters for the vlan i-sid command.

Variable

Value

<1-4059>

Specifies the VLAN ID.

Specifies the VLAN ID in the range of 1 to 4059. By default, VLAN IDs 1 to 4059 are configurable and the system reserves VLAN IDs 4060 to 4094 for internal use. On switches that support the vrf-scaling and spbm-config-mode boot configuration flags, if you enable these flags, the system also reserves VLAN IDs 3500 to 3998. VLAN ID 1 is the default VLAN and you cannot create or delete VLAN ID 1.

<0-16777215>

Specifies the service instance identifier (I-SID). You cannot use I-SID 0x00ffffff. The system reserves this I-SID to advertise the virtual BMAC in an SMLT dual-homing environment.

This value is the same for the primary and secondary VLANs.

force

Specifies the software must replace the existing VLAN-to-I-SID mapping, if one exists.