L2X Configuration

Configuration Hierarchy

The diagram illustrates the L2X configuration hierarchy.

L2X Configuration Hierarchy
Figure 1. L2X Configuration Hierarchy

Configuration Syntax and Commands

The following sections describe the L2X configuration syntax and commands.

Local L2X Configuration

The following sections describe the Local L2X unidirectional and bidirectional configurations.

Local L2X Ingress Configuration

This configuration enables local unidirectional L2X (Local Cross-Connect) on the same device.

Syntax:

set l2x name <name> [ingress | bi-directional] description <description>
set l2x name <name> [ingress | bi-directional] egress-vlan-encapsulation [802.1q | 802.1ad]
set l2x name <name> [ingress | bi-directional] egress-vlan-operation [single-vlan-add | single-vlan-delete | swap-outer-vlan]
set l2x name <name> [ingress | bi-directional] incoming-inner-vlan <incoming-inner-vlan>
set l2x name <name> [ingress | bi-directional] incoming-interface <incoming-interface>
set l2x name <name> [ingress | bi-directional] incoming-outer-vlan <incoming-outer-vlan>
set l2x name <name> [ingress | bi-directional] ingress-outer-vlan <ingress-outer-vlan>
set l2x name <name> [ingress | bi-directional] ingress-vlan-encapsulation [802.1q | 802.1ad]
set l2x name <name> [ingress | bi-directional] ingress-vlan-operation [single-vlan-add | single-vlan-delete | swap-outer-vlan]
set l2x name <name> [ingress | bi-directional] match-tp-id [802.1q | 802.1ad]
set l2x name <name> [ingress | bi-directional] match-type [match-any | match-untagged | match-inner-any | match-outer | match-outer-inner | match-service-label]
set l2x name <name> [ingress | bi-directional] outgoing-interface <outgoing-interface>
set l2x name <name> [ingress | bi-directional] outgoing-outer-vlan <outgoing-outer-vlan>
set l2x name <name> [ingress | bi-directional] statistics true

Attribute Description

<l2x-name>

Name of L2X

description <description>

(Optional) L2X description

egress-vlan-encapsulation <encapsulation>

(Optional) Egress VLAN encapsulation value. NOTE: This option can be configured only after ‘swap-outer-vlan’ configuration.

egress-vlan-operation <vlan-action>

(Optional) Outgoing VLAN operation

incoming-inner-vlan <vlan-id>

(Optional) Incoming inner VLAN

incoming-interface <incoming-interface>

Incoming physical interface name

incoming-outer-vlan <vlan-id>

(Optional) Incoming outer VLAN

ingress-outer-vlan <vlan-id>

(Optional) Outer VLAN at ingress side

ingress-vlan-encapsulation <encapsulation>

(Optional) Ingress VLAN encapsulation value. NOTE: This option can be configured only after ‘swap-outer-vlan’ configuration.

ingress-vlan-operation <vlan-action>

(Optional) VLAN operation on ingress side outer VLAN

match-type <match-type>

L2X match type

match-tp-id 802.1ad <tpid>

The option enables L2X to recognize and handle packets tagged with 0x88a8/0x8100 TPID, allowing interoperability with 802.1ad/802.1q encapsulated traffic.

outgoing-interface <outgoing-interface>

Outgoing physical interface name

outgoing-outer-vlan <vlan-id>

(Optional) Outgoing outer VLAN

statistics true

Enables (true) L2X statistics. Default: Disabled.
For information on guidelines and limitation L2X statistics, see the Guidelines and Limitations section.

Example: Local L2X Ingress Configuration with Port Match

The following configuration creates two local cross-connect (L2X) entries to forward traffic directly between the interfaces ifp-0/0/10 and ifp-0/0/11. One entry handles downstream traffic from ifp-0/0/10 to ifp-0/0/11, while the other handles upstream traffic in the reverse direction. The match-any option ensures that all ingress traffic on the specified interface is forwarded to the configured outgoing interface.

set l2x name local_cross_connect_ds ingress
set l2x name local_cross_connect_ds ingress incoming-interface ifp-0/0/10
set l2x name local_cross_connect_ds ingress outgoing-interface ifp-0/0/11
set l2x name local_cross_connect_ds ingress match-type match-any
set l2x name local_cross_connect_us ingress
set l2x name local_cross_connect_us ingress incoming-interface ifp-0/0/11
set l2x name local_cross_connect_us ingress outgoing-interface ifp-0/0/10
set l2x name local_cross_connect_us ingress match-type match-any
{
  "rtbrick-config:l2x": {
    "name": [
      {
        "name": "local_cross_connect_ds",
        "direction": "ingress",
        "incoming-interface": "ifp-0/0/10",
        "outgoing-interface": "ifp-0/0/11",
        "match-type": "match-any"
      },
      {
        "name": "local_cross_connect_us",
        "direction": "ingress",
        "incoming-interface": "ifp-0/0/11",
        "outgoing-interface": "ifp-0/0/10",
        "match-type": "match-any"
      }
    ]
  }
}

Example: Local L2X Ingress VLAN Operations

This configuration defines a local Layer 2 cross-connect for traffic arriving on 'ifp-0/0/10' with outer VLAN 200, forwarding it to ifp-0/0/11. The match condition is based on the outer VLAN (match-outer), ensuring only VLAN 200 traffic is processed. A VLAN operation is applied to add a single outer VLAN tag 400 to the traffic before forwarding.

set l2x name local_cross_connect_ds ingress
set l2x name local_cross_connect_ds ingress incoming-interface ifp-0/0/10
set l2x name local_cross_connect_ds ingress incoming-outer-vlan 200
set l2x name local_cross_connect_ds ingress outgoing-interface ifp-0/0/11
set l2x name local_cross_connect_ds ingress match-type match-outer
set l2x name local_cross_connect_ds ingress ingress-vlan-operation single-vlan-add
set l2x name local_cross_connect_ds ingress ingress-outer-vlan 400
{
  "rtbrick-config:l2x": {
    "name": [
      {
        "name": "local_cross_connect_ds",
        "direction": "ingress",
        "incoming-interface": "ifp-0/0/10",
        "incoming-outer-vlan": 200,
        "outgoing-interface": "ifp-0/0/11",
        "match-type": "match-outer",
        "ingress-vlan-operation": "single-vlan-add",
        "ingress-outer-vlan": 400
      }
    ]
  }
}

This configuration sets up a local Layer 2 cross-connect for traffic received on ifp-0/0/10 with outer VLAN 100, forwarding it to ifp-0/0/11 based on outer VLAN matching. On ingress, the outer VLAN tag is removed (single-vlan-delete), and on egress, the VLAN tag is re-added using a swap operation with VLAN 100 and '802.1ad' encapsulation. This configuration rewrites the VLAN tag while maintaining service delimitation using the specified TPID.

set l2x name local_cross_connect_ds ingress incoming-interface ifp-0/0/10
set l2x name local_cross_connect_ds ingress incoming-outer-vlan 100
set l2x name local_cross_connect_ds ingress outgoing-interface ifp-0/0/11
set l2x name local_cross_connect_ds ingress egress-vlan-operation swap-outer-vlan
set l2x name local_cross_connect_ds ingress outgoing-outer-vlan 100
set l2x name local_cross_connect_ds ingress egress-vlan-encapsulation 802.1ad
set l2x name local_cross_connect_ds ingress match-type match-outer
set l2x name local_cross_connect_ds ingress ingress-vlan-operation single-vlan-delete
set l2x name local_cross_connect_ds ingress match-tp-id 802.1ad
{
  "rtbrick-config:l2x": {
    "name": [
      {
        "name": "local_cross_connect_ds",
        "direction": "ingress",
        "incoming-interface": "ifp-0/0/10",
        "incoming-outer-vlan": 100,
        "outgoing-interface": "ifp-0/0/11",
        "egress-vlan-operation": "swap-outer-vlan",
        "outgoing-outer-vlan": 100,
        "egress-vlan-encapsulation": "802.1ad",
        "match-type": "match-outer",
        "ingress-vlan-operation": "single-vlan-delete",
        "match-tp-id": "802.1ad"
      }
    ]
  }
}

api  To access the RESTCONF API that corresponds to this CLI, click here.

Local L2X Bidirectional Configuration

This configuration enables redirecting traffic incoming (ingress) on a particular interface to another interface and vice versa on the same hardware device.

Syntax:

set l2x name <name> bi-directional match-type [match-any | match-untagged | match-inner-any | match-outer | match-outer-inner | match-service-label]
set l2x name <name> bi-directional incoming-interface <incoming-interface>
set l2x name <name> bi-directional outgoing-interface <outgoing-interface>
set l2x name <name> bi-directional description <description>
set l2x name <name> bi-directional egress-vlan-encapsulation [802.1q| 802.1ad]
set l2x name <name> bi-directional incoming-inner-vlan <incoming-inner-vlan>
set l2x name <name> bi-directional incoming-outer-vlan <incoming-outer-vlan>
set l2x name <name> bi-directional ingress-outer-vlan <ingress-outer-vlan>
set l2x name <name> bi-directional ingress-vlan-encapsulation <*802.1q* | 802.1ad>
set l2x name <name> bi-directional outgoing-outer-vlan <outgoing-outer-vlan>
set l2x name <name> bi-directional statistics true

Attribute Description

match-type <match-type>

Match types with which traffic can be matched.

incoming-interface <incoming-interface>

Incoming interface is where the traffic originates from.

outgoing-interface <outgoing-interface>

Outgoing interface where the traffic is going to.

description <description>

(Optional) L2X description

egress-vlan-encapsulation <encapsulation>

(Optional) Egress VLAN encapsulation

incoming-inner-vlan <vlan-id>

(Optional) Incoming inner VLAN

incoming-outer-vlan <vlan-id>

(Optional) Incoming outer VLAN

ingress-outer-vlan <vlan-id>

(Optional) Outer VLAN at ingress side

ingress-vlan-encapsulation <encapsulation>

(Optional) Ingress VLAN encapsulation

outgoing-outer-vlan <vlan-id>

(Optional) Outgoing outer VLAN

statistics true

Enables bi-directional traffic statistics collection for this L2X connection. When set to true, the system collects and reports statistics for both directions of traffic.

Example: Local L2X Bidirectional Configuration

This configuration creates a bidirectional local Layer 2 cross-connect between interfaces ifp-0/0/10 and ifp-0/0/11. It forwards traffic in both directions without requiring separate ingress entries for each path. The match-type 'match-untagged' ensures that only untagged traffic is matched and cross-connected between the interfaces.

set l2x name local_bidi bi-directional
set l2x name local_bidi bi-directional incoming-interface ifp-0/0/10
set l2x name local_bidi bi-directional outgoing-interface ifp-0/0/11
set l2x name local_bidi bi-directional match-type match-untagged
{
  "rtbrick-config:l2x": {
    "name": [
      {
        "name": "local_bidi",
        "direction": "bi-directional",
        "incoming-interface": "ifp-0/0/10",
        "outgoing-interface": "ifp-0/0/11",
        "match-type": "match-untagged"
      }
    ]
  }
}

Local L2X VLAN Operation Configuration

This configuration enables VLAN operations for both ingress and egress traffic on a particular interface to another interface and vice versa on the same hardware device.

Syntax:

set l2x name <name> ingress [egress-vlan-operation | ingress-vlan-operation] [single-vlan-add | single-vlan-delete | swap-outer-vlan]

Attribute Description

<l2x-name>

Name of the l2x.

single-vlan-add

Adds a single VLAN tag to the packet.

single-vlan-delete

Removes a single VLAN tag from the packet.

swap-outer-vlan

Replaces the outer VLAN tag with a new one.

Remote L2X Configuration

The following sections describe the remote L2X configurations.

Remote L2X Ingress Configuration

This configuration enables the remote L2X ingress side.

Syntax:

set l2x name <name> ingress match-type [match-any| match-untagged | match-inner-any| match-outer | match-outer-inner | match-service-label]
set l2x name <name> ingress incoming-interface <incoming-interface>
set l2x name <name> ingress ingress-vlan-operation [single-vlan-add | single-vlan-delete | swap-outer-vlan]
set l2x name <name> ingress ingress-outer-vlan <ingress-outer-vlan>
set l2x name <name> ingress ingress-vlan-encapsulation [802.1q | 802.1ad]
set l2x name <name> ingress nexthop4 <nexthop4>
set l2x name <name> ingress nexthop6 <nexthop6>
set l2x name <name> ingress lookup-instance <lookup-instance>
set l2x name <name> ingress lookup-afi [ipv4 | ipv6 | mpls]
set l2x name <name> ingress lookup-safi [labeled-unicast | multicast | unicast]
set l2x name <name> ingress service-label <service-label>
set l2x name <name> ingress statistics true

Attribute Description

match-type <match-type>

Match types with which traffic can be matched. The 'match-type' option includes match-any, match-inner-any, match-outer, match-outer-inner, match-service-label, and match-untagged. For more details, see the Match Type Options section.

incoming-interface <incoming-interface>

Incoming interface is where the traffic originates from.

ingress-vlan-operation <ingress-vlan-action>

(Optional) VLAN operation on ingress side outer VLAN

ingress-outer-vlan <vlan-id>

(Optional) Outer VLAN at ingress side

ingress-vlan-encapsulation <encapsulation>

(Optional) Ingress VLAN encapsulation value

nexthop4/nexthop6 <nexthop>

Next-Hop address

lookup-instance <lookup-instance>

(Optional) Instance name

lookup-afi <lookup-afi>

(Optional) AFI value: IPv4, IPv6, and MPLS.

lookup-safi <lookup-safi>

(Optional) SAFI value: safi values are unicast, labeled-unicast, and multicast.

service-label <service_label>

Service label value.

For details on the supported label ranges, see the Static, System, and Dynamic Label Ranges section in the Platform Guide.

statistics true

Enables bi-directional traffic statistics collection for this L2X connection. When set to true, the system collects and reports statistics for both directions of traffic.

Example: Remote L2X Ingress Configuration with Port Match

This configuration defines a remote Layer 2 cross-connect for traffic arriving on ifp-0/0/10, forwarding it towards a remote endpoint using the next-hop 198.51.100.44. The forwarding decision is performed via the default routing instance using IPv4 labeled-unicast lookup, with service label 10000 applied for MPLS-based transport. The match-type 'match-any' ensures that all incoming traffic on the interface is processed by this cross-connect.

set l2x name remote_l2x ingress incoming-interface ifp-0/0/10
set l2x name remote_l2x ingress nexthop4 198.51.100.44
set l2x name remote_l2x ingress lookup-instance default
set l2x name remote_l2x ingress lookup-afi ipv4
set l2x name remote_l2x ingress lookup-safi labeled-unicast
set l2x name remote_l2x ingress service-label 10000
set l2x name remote_l2x ingress match-type match-any
{
  "rtbrick-config:l2x": {
    "name": [
      {
        "name": "remote_l2x",
        "direction": "ingress",
        "incoming-interface": "ifp-0/0/10",
        "nexthop4": "198.51.100.44",
        "lookup-instance": "default",
        "lookup-afi": "ipv4",
        "lookup-safi": "labeled-unicast",
        "service-label": 10000,
        "match-type": "match-any"
      }
    ]
  }
}

Example: Remote L2X Ingress Configuration with VLAN match

This configuration defines a remote Layer 2 cross-connect for double-tagged traffic received on ifp-0/0/10 with outer VLAN 100 and inner VLAN 200. The traffic is matched using match-outer-inner and forwarded to a remote endpoint via next-hop 198.51.100.44 using IPv4 labeled-unicast lookup in the default instance. A service label 10000 is applied to enable MPLS-based transport of the matched traffic.

set l2x name remote_l2x ingress incoming-interface ifp-0/0/10
set l2x name remote_l2x ingress incoming-outer-vlan 100
set l2x name remote_l2x ingress incoming-inner-vlan 200
set l2x name remote_l2x ingress nexthop4 198.51.100.44
set l2x name remote_l2x ingress lookup-instance default
set l2x name remote_l2x ingress lookup-afi ipv4
set l2x name remote_l2x ingress lookup-safi labeled-unicast
set l2x name remote_l2x ingress service-label 10000
set l2x name remote_l2x ingress match-type match-outer-inner
{
  "rtbrick-config:l2x": {
    "name": [
      {
        "name": "remote_l2x",
        "direction": "ingress",
        "incoming-interface": "ifp-0/0/10",
        "incoming-outer-vlan": 100,
        "incoming-inner-vlan": 200,
        "nexthop4": "198.51.100.44",
        "lookup-instance": "default",
        "lookup-afi": "ipv4",
        "lookup-safi": "labeled-unicast",
        "service-label": 10000,
        "match-type": "match-outer-inner"
      }
    ]
  }
}

Example: Remote L2X Ingress VLAN operations

This configuration defines a remote Layer 2 cross-connect for double-tagged traffic received on ifp-0/0/10 with outer VLAN 100 and inner VLAN 200, using 'match-outer-inner' for classification. The matched traffic has one VLAN tag removed on ingress (single-vlan-delete) before being forwarded to the remote endpoint via next-hop 198.51.100.44 using IPv4 labeled-unicast lookup. A service label 10000 is applied to carry the traffic over MPLS.

set l2x name remote_l2x ingress incoming-interface ifp-0/0/10
set l2x name remote_l2x ingress incoming-outer-vlan 100
set l2x name remote_l2x ingress incoming-inner-vlan 200
set l2x name remote_l2x ingress nexthop4 198.51.100.44
set l2x name remote_l2x ingress lookup-instance default
set l2x name remote_l2x ingress lookup-afi ipv4
set l2x name remote_l2x ingress lookup-safi labeled-unicast
set l2x name remote_l2x ingress service-label 10000
set l2x name remote_l2x ingress match-type match-outer-inner
set l2x name remote_l2x ingress ingress-vlan-operation single-vlan-delete
{
  "rtbrick-config:l2x": {
    "name": [
      {
        "name": "remote_l2x",
        "direction": "ingress",
        "incoming-interface": "ifp-0/0/10",
        "incoming-outer-vlan": 100,
        "incoming-inner-vlan": 200,
        "nexthop4": "198.51.100.44",
        "lookup-instance": "default",
        "lookup-afi": "ipv4",
        "lookup-safi": "labeled-unicast",
        "service-label": 10000,
        "match-type": "match-outer-inner",
        "ingress-vlan-operation": "single-vlan-delete"
      }
    ]
  }
}

Remote L2X Egress Configuration

This configuration enables the remote L2X egress side.

Syntax:

set l2x name <name> egress outgoing-interface <outgoing-interface>
set l2x name <name> egress egress-vlan-operation [single-vlan-add | single-vlan-delete | swap-outer-vlan]
set l2x name <name> egress egress-outer-vlan <egress-outer-vlan>
set l2x name <name> egress egress-vlan-encapsulation [802.1q | 802.1ad]
set l2x name <name> egress service-label <service-label>
set l2x name <name> egress statistics true

Attribute Description

match-type <match-type>

Match types with which traffic can be matched. The 'match-type' option includes match-any, match-inner-any, match-outer, match-outer-inner, match-service-label, and match-untagged. For more details, see the Match Type Options section.

outgoing-interface <outgoing-interface>

Interface where traffic is going to.

service-label <service_label>

Service label value.

For details on the supported label ranges, see the Static, System, and Dynamic Label Ranges section in the Platform Guide.

nexthop4/nexthop6 <nexthop>

Next-Hop address

lookup-instance <lookup-instance>

(Optional) Instance name

lookup-afi <lookup-afi>

(Optional) AFI value: IPv4, IPv6, and MPLS.

lookup-safi <lookup-safi>

(Optional) SAFI value: safi values are unicast, labeled-unicast, and multicast.

egress-vlan-operation <vlan-action>

(Optional) Outgoing VLAN operation.

outgoing-outer-vlan <vlan-id>

(Optional) Outgoing outer VLAN.

statistics true

Enables bi-directional traffic statistics collection for this L2X connection. When set to true, the system collects and reports statistics for both directions of traffic.

Example: Remote L2X Egress Configuration

This configuration defines the egress handling for a remote Layer 2 cross-connect with service label 10000. Traffic received over MPLS with the matching service label is decapsulated and forwarded to the local interface ifp-0/0/11. This enables proper termination of the remote L2X service on the device.

set l2x name remote_l2x egress
set l2x name remote_l2x egress service-label 10000
set l2x name remote_l2x egress outgoing-interface ifp-0/0/11
{
  "rtbrick-config:l2x": {
    "name": [
      {
        "name": "remote_l2x",
        "direction": "egress",
        "service-label": 10000,
        "outgoing-interface": "ifp-0/0/11"
      }
    ]
  }
}

Example: Local L2X Egress Configuration with VLAN Operation

This configuration defines the egress handling for a remote Layer 2 cross-connect with service label 10000, forwarding traffic to ifp-0/0/11. Upon egress, a VLAN tag 400 is added to the traffic using single-vlan-add. This ensures the decapsulated MPLS traffic is properly VLAN-tagged before being transmitted on the outgoing interface.

set l2x name remote_l2x egress service-label 10000
set l2x name remote_l2x egress outgoing-interface ifp-0/0/11
set l2x name remote_l2x egress egress-vlan-operation single-vlan-add
set l2x name remote_l2x egress outgoing-outer-vlan 400
{
  "rtbrick-config:l2x": {
    "name": [
      {
        "name": "remote_l2x",
        "direction": "egress",
        "service-label": 10000,
        "outgoing-interface": "ifp-0/0/11",
        "egress-vlan-operation": "single-vlan-add",
        "outgoing-outer-vlan": 400
      }
    ]
  }
}