Interfaces and Hardware Component Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Releases

PDF

Interfaces and Hardware Component Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Releases

Configure 802.1Q VLAN subinterfaces

Want to summarize with AI?

Log in

This topic describes how to configure 802.1Q VLAN subinterfaces on the Cisco 8000 Series Router by setting the Layer 2 encapsulation and assigning an IP address to the subinterface.


Use this procedure to configure 802.1Q VLAN subinterfaces. To remove these subinterfaces, see Remove an 802.1Q VLAN subinterface.

Note
  • You can programmatically configure and retrieve the VLAN interfaces and subinterfaces parameters using openconfig-vlan.yang OpenConfig data model. To get started with using data models, see the Programmability Configuration Guide for Cisco 8000 Series Routers.

  • The OpenConfig VLAN data model uses structured vlan/match containers to represent VLAN matching. The vlan-id leaf supports only a single VLAN value and does not represent VLAN lists or ranges. See the OpenConfig model documentation for details.

Procedure

1.

Enter global configuration mode.

Example:

Router# configure
2.

Enter subinterface configuration mode and specify the interface type, location, and subinterface number.

Example:

Router(config)# interface TenGigE 0/2/0/4.10
  • Replace the interface-path-id argument with one of the following instances:

  • Physical Ethernet interface instance, or with an Ethernet bundle instance. Naming notation is rack/slot/module/port , and a slash between values is required as part of the notation.

  • Ethernet bundle instance. Range is from 1 through 65535.

  • Replace the subinterface argument with the subinterface value. Range is from 0 through 4095.

  • Naming notation is interface-path-id.subinterface , and a period between arguments is required as part of the notation.

3.

Set the Layer 2 encapsulation of the interface.

Example:

Router(config-subif)# encapsulation dot1q 100
Note

The dot1q vlan command is replaced by the encapsulation dot1q command on the Cisco 8000 Series Router. It is still available for backward-compatibility, but only for Layer 3 interfaces.

4.

Assign an IP address and subnet mask to the subinterface.

Example:

Router(config-subif)# ipv4 address 178.18.169.23/24
  • Replace ip-address with the primary IPv4 address for the interface.

  • Replace mask with the mask for the associated IP subnet. The network mask can be specified in either of two ways:

  • The network mask can be a four-part dotted decimal address. For example, 255.0.0.0 indicates that each bit equal to 1 means that the corresponding address bit belongs to the network address.

  • The network mask can be indicated as a slash (/) and number. For example, /8 indicates that the first 8 bits of the mask are ones, and the corresponding bits of the address are network address.

5.

Save the configuration.

Example:

Router(config-subif)# exit
Router(config)# commit

Use the commit command to save the configuration changes to the running configuration file and remain within the configuration session. When you issue the end command, the system prompts you to commit changes.

6.

Verify the configuration using the show interfaces command.

Example:

Router# show interfaces fourHundredGigE 0/5/0/1.100 brief

               Intf       Intf        LineP              Encap  MTU        BW
               Name       State       State               Type (byte)    (Kbps)
--------------------------------------------------------------------------------
      FH0/5/0/1.100        up        up             802.1Q  1518  400000000

Router# show interfaces brief location 0/5/CPU0 | include 802.1Q
      FH0/5/0/1.100        up        up             802.1Q  1518  400000000