VLAN Subinterface Commands

This module provides command line interface (CLI) commands for configuring IEEE 802.1Q VLANs on the Cisco CRS RouterCisco ASR 9000 Series RouterCisco NCS 6000 Series Router.

To use commands of this module, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using any command, contact your AAA administrator for assistance.

The maximum VLAN limit that can be configured for a specific card is listed below:
Table 1. Maximum VLAN Limit per Slice for Below Cards

Card

VLAN MAX Limit per Slice

NC6-60X10GE-M-S 16260
NC6-10X100G-M-P 1884
NC6-10X100G-M-K 1884

dot1q native vlan

To assign the native VLAN ID of a physical interface trunking 802.1Q VLAN traffic, use the dot1q native vlan command in interface configuration mode. To remove the VLAN ID assignment, use the no form of this command.

dot1q native vlan vlan-id

Syntax Description

vlan-id

Trunk interface ID. Range is from 1 to 4094 inclusive (0 and 4095 are reserved).

Command Default

No default behavior or values

Command Modes

Interface configuration

Command History

Release

Modification

Release 3.0

This command was introduced.

Release 5.0.0

This command was introduced.

Usage Guidelines

The dot1q native vlan command defines the default, or native VLAN, associated with a 802.1Q trunk interface. The native VLAN of a trunk interface is the VLAN to which all untagged VLAN packets are logically assigned.


Note


The native VLAN cannot be configured on a subinterface of the trunk interface. The native VLAN must be configured with the same value at both ends of the link, or traffic can be lost or sent to the wrong VLAN.


Task ID

Task ID

Operations

vlan

read, write

Examples

The following example shows how to configure the native VLAN of a TenGigE0/2/0/4 trunk interface as 1. Packets received on this interface that are untagged, or that have an 802.1Q tag with VLAN ID 1, are received on the main interface. Packets sent from the main interface are transmitted without an 802.1Q tag.


RP/0/RP0RSP0/CPU0:router(config)# interface TenGigE 0/2/0/4
RP/0/RP0RSP0/CPU0:router(config-if)# dot1q native vlan 1
  

dot1q vlan

To assign a VLAN ID to a subinterface (or to modify the VLAN ID that is currently assigned to a subinterface), use the dot1q vlan command in subinterface configuration mode. To remove the VLAN ID assigned to a subinterface, use the no form of this command.


Note


Effective with Cisco IOS XR Release 3.7.2, the dot1q vlan command is replaced by the encapsulation dot1q command. See the encapsulation dot1q command for more information.


dot1q vlan vlan-id [vlan-id2 | any]

Syntax Description

vlan-id

ID of the subinterface. Range is from 1 to 4094 (0 and 4095 are reserved).

vlan-id2

(Optional) Identifies the host VLAN of a Q-in-Q VLAN pair. Replace vlan-id2 with a number that specifies the host VLAN. Range is from 1 to 4094.

any

(Optional) Identifies the host VLAN of a Q-in any VLAN pair.

Command Default

No default behavior or values

Command Modes

Subinterface configuration

Command History

Release

Modification

Release 3.0

This command was introduced.

Release 3.7.2

This command was introduced and was also replaced by the encapsulation dot1q command.

Release 5.0.0

This command was introduced.

Release 5.1.1

This command was introduced and was also replaced by the encapsulation dot1q command.

Usage Guidelines

The VLAN ID specifies where 802.1Q tagged packets are sent and received on a specified subinterface. An 802.1Q VLAN subinterface must have a configured VLAN ID to send and receive traffic; without a VLAN ID, the subinterface remains in the down state. All VLAN IDs must be unique among all subinterfaces configured on the same physical interface. To change a VLAN ID, the new VLAN must not already be in use on the same physical interface. To exchange VLAN IDs, you must remove the configuration information and reconfigure the ID for each device.


Note


The subinterface does not pass traffic without an assigned VLAN ID.



Note


The dot1q vlan command is is replaced by the encapsulation dot1q command. It is still available for backward-compatibility, but only for Layer 3 interfaces. The encapsulation dot1q command must be used going forward.


Task ID

Task ID

Operations

vlan

read, write

Examples

This example shows how to configure the VLAN ID and IP address on a subinterface:


RP/0/RP0RSP0/CPU0:router# configure
RP/0/RP0RSP0/CPU0:router(config)# interface TenGigE 0/2/0/4.1
RP/0/RP0RSP0/CPU0:router(config-subif)# dot1q vlan 10
RP/0/RP0RSP0/CPU0:router(config-subif)# ipv4 addr 10.0.0.1/24
   

This example shows how to configure the VLAN IDs for both VLANS in a single Q-in-Q attachment circuit (AC). In this case, incoming traffic must match both of the VLAN IDs before it is accepted by the subinterface:


RP/0/RP0RSP0/CPU0:router# configure
RP/0/RP0RSP0/CPU0:router(config)# interface TenGigE 0/2/0/4.1
RP/0/RP0RSP0/CPU0:router(config-subif)# dot1q vlan 10 20
   

This example shows how to configure the VLAN IDs for a Q-in-any AC. In this case, all incoming traffic must have two VLAN tags, where the outer VLAN ID matches the configured value, while the inner VLAN ID can be any value.


RP/0/RP0RSP0/CPU0:router# configure
RP/0/RP0RSP0/CPU0:router(config)# interface TenGigE 0/2/0/4.1 l2transport
RP/0/RP0RSP0/CPU0:router(config-subif)# dot1q vlan 10 any
   

interface (VLAN)

To create a VLAN subinterface, use the interface command in Global Configuration modeXR Config mode. To delete a subinterface, use the no form of this command.

interface type interface-path-id.subinterface [l2transport]

Syntax Description

type

Type of Ethernet interface on which you want to create a VLAN. Enter GigabitEthernet , TenGigE ,, or Bundle-Ether.

interface-path-id.subinterface

Physical interface or virtual interface followed by the subinterface path ID. Naming notation is interface-path-id.subinterface . The period in front of the subinterface value is required as part of the notation.

For more information about the syntax for the router, use the question mark (?) online help function.

l2transport

Enables Layer 2 transport port mode on the specified VLAN interface and enters Layer 2 transport configuration mode. The l2transport keyword creates the Vlan interface in L2 mode so that it can be used for L2VPNs and local switching.

Command Default

No default behavior or values

Command Modes

Global Configuration

Command History

Release

Modification

Release 3.0

This command was introduced.

Release 3.7.2

This command was introduced.

Release 5.0.0

This command was introduced.

Usage Guidelines

For the interface-path-id argument, use the following guidelines:

  • If specifying a physical interface, the naming notation is rack/slot/module/port. The slash between values is required as part of the notation. An explanation of each component of the naming notation is as follows:
    • rack : Chassis number of the rack.

    • slot : Physical slot number of the line card.

    • module : Module number. A physical layer interface module (PLIM) is always 0.

    • port : Physical port number of the interface.

  • If specifying an Ethernet bundle interface, the range is from 1 through 65535.

For the subinterface argument, the range is from 0 through 4095.

To configure a large number of subinterfaces, we recommend entering all configuration data before you commit the interface command.

To change an interface from Layer 2 to Layer 3 mode and back, you must delete the interface first and then re-configure it in the appropriate mode.


Note


A subinterface does not pass traffic without an assigned VLAN ID.


Task ID

Task ID

Operations

vlan

read, write

Examples

This example shows how to configure a VLAN subinterface on a 10-Gigabit Ethernet interface:


RP/0/RP0RSP0/CPU0:router(config)# interface TenGigE 0/0/0/1.2
RP/0/RP0RSP0/CPU0:router(config-subif)# dot1q vlan 1
RP/0/RP0RSP0/CPU0:router(config-subif)# ipv4 address 50.0.0.1/24
   

This example shows how to create a VLAN subinterface with Layer 2 transport port mode enabled, and enter Layer 2 transport configuration mode under that VLAN:


RP/0/RP0RSP0/CPU0:router(config)# interface GigabitEthernet 0/4/0/1.1
RP/0/RP0RSP0/CPU0:router(config-if-l2)#
   

show vlan interface

To display summarized information about VLAN subinterfaces, use the show vlan interface command in EXEC modeXR EXEC mode .


Note


Effective with Cisco IOS XR Release 5.1.1, theshow vlan interface command is replaced by the show ethernet tags command.

show vlan interface [type interface-path-id.subinterface | location instance]

Syntax Description

type

(Optional) Type of Ethernet interface whose VLAN information you want to display. Enter GigabitEthernet , TenGigE, or Bundle-Ether .

interface-path-id .subinterface

Physical interface or virtual interface followed by the subinterface path ID. Naming notation is interface-path-id.subinterface . The period in front of the subinterface value is required as part of the notation.

For more information about the syntax for the router, use the question mark (?) online help function.

location instance

(Optional) Displays VLAN subinterfaces on a particular port. The instance argument is entered in the rack/slot/module/port notation.

Command Default

No default behavior or values

Command Modes

EXECXR EXEC

Command History

Release

Modification

Release 3.0

This command was introduced.

Release 5.0.0

This command was introduced.

Release 5.1.1

This command was replaced with show ethernet tags command.

Usage Guidelines

For the interface-path-id argument, use the following guidelines:

  • If specifying a physical interface, the naming notation is rack/slot/module/port. The slash between values is required as part of the notation. An explanation of each component of the naming notation is as follows:
    • rack : Chassis number of the rack.

    • slot : Physical slot number of the line card.

    • module : Module number. A physical layer interface module (PLIM) is always 0.

    • port : Physical port number of the interface.

  • If specifying an Ethernet bundle interface, the range is from 1 through 65535.

For the subinterface argument, the range is from 0 through 4095.

Enter the show vlan interface command without including any of the optional parameters to display summarized information about all VLANs configured on the router.

Task ID

Task ID

Operations

vlan

read

Table 2. show vlan interface Field Descriptions

Field

Description

interface

VLAN subinterface.

encapsulation

Encapsulation of the VLAN subinterface. Currently, this is always 802.1Q.

Outer VLAN

VLAN ID currently assigned to the subinterface. Range is from 1 to 4094 (or blank if no VLAN ID has been assigned).

2nd VLAN

VLAN ID currently assigned to the second subinterface in a pair. Range is from 1 to 4094 (or blank if no VLAN ID has been assigned). For Q-in-any VLANS, this field shows “Any.”

Service

Service currently assigned to the VLAN. Possible services are L2 and L3.

MTU

Maximum transmission unit (MTU) value configured for the specified VLAN, in bytes.

LineP state

Displays the line protocol state of the VLAN interface. Possible states: up, down, admin-down. The line protocol state reflects whether a VLAN ID is configured or not.

show vlan tags

To display VLAN tagging allocation information, use the show vlan tags command in EXEC modeXR EXEC mode.

show vlan tags [type interface-path-id | location node-id]

Syntax Description

type

Displays VLAN tagging information for a specific bundle type.

Note

 

Use the show interfaces command with the Bundle-Ether , GigabitEthernet or TenGigE keyword to see a list of all Ethernet bundles currently configured on the router.

interface-path-id

Physical interface or virtual interface.

Note

 

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (? ) online help function.

location node-id

Displays VLAN tagging information for a specific node. The node-id argument is entered in the rack/slot/module notation.

Command Default

Enter the command without any of the optional keywords or arguments to display tagging allocation information for all VLANS configured on the router.

Command Modes

EXECXR EXEC

Command History

Release

Modification

Release 3.0

This command was introduced.

Release 5.0.0

This command was introduced.

Usage Guidelines

For the interface-path-id argument, use the following guidelines:

  • If specifying a physical interface, the naming notation is rack/slot/module/port. The slash between values is required as part of the notation. An explanation of each component of the naming notation is as follows:
    • rack : Chassis number of the rack.

    • slot : Physical slot number of the line card.

    • module : Module number. A physical layer interface module (PLIM) is always 0.

    • port : Physical port number of the interface.

  • If specifying an Ethernet bundle interface, the range is from 1 through 65535.

Task ID

Task ID

Operations

vlan

read

Examples

The following example shows how to display VLAN tagging allocation information for a router:


RP/0/RP0RSP0/CPU0:router(config-subif)# show vlan tags l2protocol  cdp drop 

Interface           Outer  2nd   Service  MTU    LineP
                    VLAN   VLAN                  State
Gi0/1/5/0.1           10         L3        1518  up
Gi0/1/5/0.2           20         L3        1518  up
Gi0/1/5/0.3           30         L3        1518  up
   
Table 3. show vlan tags Field Descriptions

Field

Description

Outer Vlan

The first (outermost) 802.1Q VLAN ID. This field is empty if no VLAN ID is configured. An asterisk (*) indicate the native VLAN.

2nd Vlan

The second 802.1Q VLAN ID. This field reports “any” for a Q-in-Any service. If no VLAN ID is configured, then this field is empty.

Service

Service currently assigned to the subinterface. Can be Layer 2 (L2) or Layer 3 (L3).

MTU

Maximum transmission unit (MTU) value configured for the specified VLAN, in bytes.

LineP state

Displays the state of the VLAN interface. Possible states: up, down, admin-down.

show vlan trunks

To display information about VLAN trunks, use the show vlan trunks command in EXEC modeXR EXEC mode

show vlan trunks [brief] [location node-id] [type interface-path-id] [summary]

Syntax Description

type

(Optional) Type of Ethernet interface whose VLAN trunk information you want to display. Possible Ethernet types are GigabitEthernet , TenGigE , or Bundle-Ether.

interface-path-id

(Optional) Physical interface or virtual interface.

Note

 

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (? ) online help function.

brief

(Optional) Displays a short summary output.

summary

(Optional) Displays a summarize output.

Note

 

The summary option can be specified only if the trunk interface is not specified.

location node-id

(Optional) Displays VLAN trunk information for a specific node. The node-id is expressed in the rack/slot/module notation.

Note

 

For more information about the syntax for the router, use the question mark (? ) online help function.

Command Default

No default behavior or values

Command Modes

EXECXR EXEC

Command History

Release

Modification

Release 3.0

This command was introduced.

Release 5.0.0

This command was introduced.

Usage Guidelines

For the interface-path-id argument, use the following guidelines:

  • If specifying a physical interface, the naming notation is rack/slot/module/port. The slash between values is required as part of the notation. An explanation of each component of the naming notation is as follows:
    • rack : Chassis number of the rack.

    • slot : Physical slot number of the line card.

    • module : Module number. A physical layer interface module (PLIM) is always 0.

    • port : Physical port number of the interface.

  • If specifying a virtual interface, the number range varies, depending on interface type.

The show vlan trunks command provides summary information about VLAN trunk interfaces. It is used to determine the number of configured subinterfaces and verify the state of the subinterfaces.

Task ID

Task ID

Operations

vlan

read

Examples

The following is sample output from the show vlan trunks command:


RP/0/RP0RSP0/CPU0:router# show vlan trunks  

GigabitEthernet0/4/0/0 is up
  Outer VLAN tag format is Dot1Q (0x8100)
  L3 Encapsulations: Ether, 802.1Q
    Sub-interfaces: 2
      2 are up
      Single tag sub-interfaces: 2
    No native VLAN Id
  L2 Encapsulations: 802.1Q
    VLAN ACs: 1
      1 are up
      Single tag ACs: 1
   
Table 4. show vlan trunks summary Field Descriptions

Field

Description

Outer VLAN tag format

The first (outermost) 802.1Q VLAN Id.

  • This field is empty if no VLAN ID is configured.
  • An asterisk (*) indicates that a native VLAN is configured.

L3 Encapsulations

VLAN encapsulations currently used for terminated Layer 3traffic. Possible Layer 3 encapsulations are as follows:

  • Nat – A Native VLAN is configured.
  • Q – One or more sub-interfaces are configured with either 0 or 1 802.1Q VLAN tags.
  • 2Q – One or more sub-interfaces have been configured with two 802.1Q VLAN tags.

Sub-interfaces

The number of subinterfaces configured on the main Ethernet interface, and the current state of those subinterfaces. Possible states are up, down, and admin-down.

Note

 

The number of Down and Admin-down subinterfaces is only reported only if that number is greater than 0.

Single tag sub-interfaces:

Number of sub-interfaces configured with a single 802.1Q tag.

Note

 

The number of sub-interfaces is displayed only if that number is greater than 0.

No native VLAN Id

Indicate that a native VLAN ID is not configured on this interface.

L2 Encapsulations:

VLAN encapsulations currently used for terminated L2 traffic. Possible Layer 2 encapsulations are as follows:

  • Q – One or more single 802.1Q tag ACs are configured.
  • 2Q – One or more double 802.1Q tag ACs have been configured.
  • Qany – One or more double 802.1Q tag ACs have been configured that have a wildcard “any” innertag.

VLAN ACs

Number of ACs currently configured under the specified interface.

Single tag ACs

Note

 

The number of sub-interfaces sub-interfaces configured with a single 802.1Q tag is displayed only if that number is greater than 0.