Contents
802.1Q VLAN Subinterface Commands on the Cisco IOS XR Software
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.
Syntax Description
Command History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
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
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/0/CPU0:router(config)# interface TenGigE 0/2/0/4 RP/0/0/CPU0:router(config-if)# dot1q native vlan 1dot1q 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.
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 History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
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.
Task ID
Examples
The following example shows how to configure the VLAN ID and IP address on a subinterface:
RP/0/0/CPU0:router# configure RP/0/0/CPU0:router(config)# interface TenGigE 0/2/0/4.1 RP/0/0/CPU0:router(config-subif)# dot1q vlan 10 RP/0/0/CPU0:router(config-subif)# ipv4 addr 10.0.0.1/24The following 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/0/CPU0:router# configure RP/0/0/CPU0:router(config)# interface TenGigE 0/2/0/4.1 RP/0/0/CPU0:router(config-subif)# dot1q vlan 10 20The following 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/0/CPU0:router# configure RP/0/0/CPU0:router(config)# interface TenGigE 0/2/0/4.1 l2transport RP/0/0/CPU0:router(config-subif)# dot1q vlan 10 anyRelated Commands
Command
Description
Assigns the native VLAN ID of a physical interface trunking 802.1Q VLAN traffic.
Displays statistics for all interfaces configured on the router or for a specific node.
Displays summarized information about VLAN subinterfaces.
Displays VLAN tagging allocation information.
interface (VLAN)
To create a VLAN subinterface, use the interface command in global configuration mode. To delete a subinterface, use the no form of this command.
interface type interface-path-id.subinterface [l2transport]
no 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, FastEthernet, 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 History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
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:
- 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
Examples
The following example shows how to configure a VLAN subinterface on a 10-Gigabit Ethernet interface:
RP/0/0/CPU0:router(config)# interface TenGigE 0/0/0/1.2 RP/0/0/CPU0:router(config-subif)# dot1q vlan 1 RP/0/0/CPU0:router(config-subif)# ipv4 address 50.0.0.1/24The following 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/0/CPU0:router(config)# interface GigabitEthernet 0/4/0/1.1 RP/0/0/CPU0:router(config-if-l2)#show vlan interface
To display summarized information about VLAN subinterfaces, use the show vlan interface command in EXEC mode.
Syntax Description
type
(Optional) Type of Ethernet interface whose VLAN information you want to display. Enter GigabitEthernet, TenGigE, FastEthernet, 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 History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
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:
- 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
Table 1 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
Syntax Description
type
Displays VLAN tagging information for a specific bundle type.
Note Use the show interfaces command with the Bundle-Ether, FastEthernet, 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 History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
For the interface-path-id argument, use the following guidelines:
Task ID
Examples
The following example shows how to display VLAN tagging allocation information for a router:
RP/0/0/CPU0:router(config-subif)# show vlan tagsl2protocol 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 2 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
Syntax Description
type
(Optional) Type of Ethernet interface whose VLAN trunk information you want to display. Possible Ethernet types are GigabitEthernet, TenGigE , FastEthernet, 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 History
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
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:
- 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
Examples
The following is sample output from the show vlan trunks command:
RP/0/0/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 3 show vlan trunks summary Field Descriptions Field
Description
Outer VLAN tag format
The first (outermost) 802.1Q VLAN Id.
L3 Encapsulations
VLAN encapsulations currently used for terminated Layer 3traffic. Possible Layer 3 encapsulations are as follows:
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:
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.