OcNOS SP : Layer 2 Guide : Layer 2 Command Reference : Layer 2 Sub-interface Commands
Layer 2 Sub-interface Commands
This chapter is a reference for the Layer 2 sub-interface commands.
bridge-domain
Use this command to configure bridge-domain and attached sub-interfaces to it.
Use the no form of this command to remove the configured bridge-domain.
Command Syntax
bridge-domain <1-2147483647>
no bridge-domain <1-2147483647>
Parameters
 
Default
None
Command Mode
Configure mode
Applicability
This command was introduced in OcNOS version 3.0.
Example
(config)#bridge-domain 1
(config-bridge-domain)#interface xe10.1
(config-bridge-domain)#interface xe11.1
(config-bridge-domain)#exit
(config)#commit
clear mac address-table dynamic bridge-domain
Use this command to clear dynamically learned MAC address entries from bridge-domains. This command removes specific or all dynamic MAC entries by interface, MAC address, or bridge-domain ID, to force relearning or to reset Layer 2 forwarding behavior.
Command Syntax
clear mac address-table dynamic bridge-domain id <1-2147483647> (interface IFNAME | address MAC|)
clear mac address-table dynamic bridge-domain all
Parameters
 
Command Mode
Exec mode
Applicability
Introduced in OcNOS version 6.6.1.
Examples
Clear all dynamic MAC entries in bridge-domain 1:
OcNOS#clear mac address-table dynamic bridge-domain id 1
Clear MAC entries learned on interface xe1.1 in bridge-domain 1:
OcNOS#clear mac address-table dynamic bridge-domain id 1 interface xe1.1
Clear a specific MAC address from bridge-domain 1:
OcNOS#clear mac address-table dynamic bridge-domain id 1 address 0022.3344.5566
Clear all dynamic MAC entries across all bridge-domains:
OcNOS#clear mac address-table dynamic bridge-domain all
cross-connect
Use this command to create an AC-to-AC cross-connect between the L2 sub-interfaces. It creates a separate mode with endpoint1 and endpoint2 being L2 sub-interfaces. It is possible to bind L2 sub-interface to cross-connect only when encapsulation is configured on it.
Use the no form of this command to remove the given cross-connect.
Command Syntax
cross-connect <WORD> (interface <IFNAME>) (interface <IFNAME>) (description) (disable)
no cross-connect <WORD>
Parameters
WORD
XC name
IFNAME
AC interface name
description
Characters describing AC cross-connect
disable
disables the cross-connect
Default
None
Command Mode
Configure mode for cross-connect
Cross-connect mode for IFNAME, description and disable
Applicability
This command was introduced in OcNOS version 3.0.
Example
(config)#cross-connect c1
(config-xc)#interface xe1.1
(config-xc)#interface xe1.2
(config-xc)#description XC1
(config-xc)#disable
(config-xc)#exit
(config)#no cross-connect c1
(config)#
dot1ad ethertype
Use this command to configure the service-tpid value on parent port of a sub-interface. By this the tpid used for service tag for a sub-interface may be inherited from the one applied to parent interface.
Use no form of this command to revert the value to default.
Note:  
For any dot1ad sub-interface to be functional, dot1ad ethertype should be set to desired value as 0x88a8/0x9100/0x9200.
The dot1ad ethertype command is not allowed on MLAG interfaces. Instead, configure this command on a mapped LAG interface.
Command Syntax
dot1ad ethertype (0x8100 | 0x88a8 | 0x9100 | 0x9200)
no dot1ad ethertype
Parameters
0x8100
IEEE 802.1Q VLAN-tagged frame
0x88a8
IEEE 802.1ad Provider Bridging Service VLAN tag identifier (S-Tag)
0x9100
Supported for interoperability with legacy devices
0x9200
Supported for interoperability with legacy devices
Default
Default value is 0x8100
Command Mode
Interface mode
Applicability
This command was introduced in OcNOS version 3.0.
Example
(config)#interface xe1
(config-if)#dot1ad ethertype 0x9100
(config-if)#exit
(config)#interface xe1
(config-if)#no dot1ad ethertype
(config-if)#exit
encapsulation
Use this command to configure encapsulation-type for a Layer 2 sub-interface. With this command, a Layer 2 sub-interface can be configured as single-tagged with single/multiple VLANs or double-tagged, or default or untagged. Operational state of the Layer 2 sub-interface is DOWN before configuring the encapsulation and it becomes UP once the encapsulation is configured.
Use the no form of this command to remove the encapsulation.
Note:  
For encapsulation with a VLAN range in an inner tag or outer tag, overlapping VLANs either as a single value or a range will not be allowed under same parent port.
Y.1731 and CFM are not supported on the same physical port when sub-interfaces are configured with untagged encapsulation and default settings.
Command Syntax
encapsulation ((dot1q | dot1ad | default | untagged) (vlan-id | vlanid-range) (inner-dot1q (vlan-id | vlanid-range)))
no encapsulation ((dot1q | dot1ad | default | untagged) (vlan-id | vlanid-range) (inner-dot1q (vlan-id | vlanid-range)))
Parameters
dot1q
 
IEEE802.1Q VLAN-tagged packets
dot1ad
 
IEEE802.1ad VLAN-tagged packets
default
IEEE default packets
untagged
IEEE untagged packets
vlan-id
VLAN identifier <2-4094>
vlanid-range
VLAN ID range(s): 2-5 10 or 2-5 7-19
inner-dot1q
Inner-VLAN for double-tagged
Default
None
Command Mode
Interface mode
Applicability
This command was introduced in OcNOS version 3.0.
Inner-VLAN range support was introduced in OcNOS version 4.1.
Multiple encapsulation on a L2 sub-interface introduced in OcNOS version 5.0.
The no form of this command with parameters introduced in OcNOS version 5.0.
Example
(config)#interface xe1.1 switchport
(config-if)#encapsulation dot1q 10
(config-if)#ex
(config)#interface xe1.2 switchport
(config-if)#encapsulation dot1ad 11
(config-if)#ex
(config)#interface xe1.3 switchport
(config-if)#encapsulation default
(config-if)#ex
(config)#interface xe1.4 switchport
(config-if)#encapsulation untagged
(config-if)#ex
(config)#interface xe1.5 switchport
(config-if)#encapsulation dot1q 15-20
(config-if)#ex
(config)#interface xe1.6 switchport
(config-if)#encapsulation dot1ad 21-25
(config-if)#ex
(config)#interface xe1.7 switchport
(config-if)#encapsulation dot1q 100 inner-dot1q 10
(config-if)#ex
(config)#interface xe1.8 switchport
(config-if)#encapsulation dot1ad 200 inner-dot1q 20
(config-if)#ex
(config)#interface xe1.9 switchport
(config-if)#encapsulation dot1ad 300 inner-dot1q 100-200
(config-if)#ex
(config)#interface xe1.10 switchport
(config-if)#encapsulation dot1q 3999
(config-if)#encapsulation dot1ad 3998
(config-if)#ex
(config)#interface xe1.10 switchport
(config-if)#no encapsulation
(config-if)#ex
(config)#interface xe1.1 switchport
(config-if)#no encapsulation dot1q 10
(config-if)#ex
(config)#interface xe1.2 switchport
(config-if)#no encapsulation dot1ad 11
(config-if)#ex
(config)#interface xe1.3 switchport
(config-if)#no encapsulation default
(config-if)#ex
(config)#interface xe1.4 switchport
(config-if)#no encapsulation untagged
(config-if)#ex
(config)#interface xe1.5 switchport
(config-if)#no encapsulation dot1q 15-20
(config-if)#ex
(config)#interface xe1.6 switchport
(config-if)#no encapsulation dot1ad 21-25
(config-if)#ex
(config)#interface xe1.7 switchport
(config-if)#no encapsulation dot1q 100 inner-dot1q 10
(config-if)#ex
(config)#interface xe1.8 switchport
(config-if)#no encapsulation dot1ad 200 inner-dot1q 20
(config-if)#ex
(config)#interface xe1.9 switchport
(config-if)#no encapsulation dot1ad 300 inner-dot1q 100-200
(config-if)#ex
 
 
 
interface switchport
Use this command to configure a L2 sub-interface. An L2 sub-interfaces makes it possible for a logical interface to be created on an Ethernet physical interface as well as on dynamic/static LAG interfaces to handle one slice of its resource. The supported method for this resource slicing is vlan credential based which can be a single tagged or double-tagged or untagged or default along with encapsulation types as either dot1q or dot1ad.
Use no form of this command to unconfigure a sub-interface.
Command Syntax
interface IFNAME.SUBINTERFACE_ID switchport
no interface IFNAME.SUBINTERFACE_ID
Parameters
IFNAME
Interface name, such as xe1, po1 or sa1
SUBINTERFACE_ID
 
sub-interface identifier <1-2000>
switchport
L2 sub-interface
Default
None
Command Mode
Configure mode
Applicability
This command was introduced in OcNOS version 3.0.
Example
(config)#interface xe1.1 switchport
(config-if)#exit
(config)#no interface xe1.1
(config)#interface po1.1 switchport
(config-if)#exit
(config)#no interface po1.1
(config)#interface sa1.1 switchport
(config-if)#exit
(config)#no interface sa1.1
(config)#exit
#
mac address IFNAME
Use this command to add a static MAC address entry to a Layer 2 sub-interface-based bridge-domain. The MAC address is either forwarded to a specific sub-interface or denied from it. This command controls traffic forwarding at the MAC level within a bridge-domain.
Use the no parameter of this command to remove the configured static MAC address.
Command Syntax
mac XXXX.XXXX.XXXX (deny | forward) IFANME
no mac XXXX.XXXX.XXXX
Parameters
 
Command Mode
Bridge Domain mode
Applicability
Introduced in OcNOS version 6.6.1.
Examples
Configure a static MAC forwarding rule and a deny rule on a Bridge-Domain:
OcNOS(config)#bridge-domain 1
OcNOS(config-bridge-domain)#mac 0001.0001.0002 forward xe1.2
OcNOS(config-bridge-domain)#mac 0001.0001.0003 deny xe1.3
OcNOS(config-bridge-domain)#exit
OcNOS(config)#exit
OcNOS#show running-config bridge-domain
!
bridge-domain 1
interface xe1.2
interface xe1.3
mac 0001.0001.0002 forward xe1.2
mac 0001.0001.0003 deny xe1.3
!
!
 
To remove the static entry:
OcNOS(config-bridge-domain)#no mac 0001.0001.0002
no subinterfaces
Use this command to remove all the sub-interfaces of any type (layer 2 or layer 3) created under a parent port.
Command Syntax
no subinterfaces
Parameters
None
Command Mode
Interface mode
Applicability
This command was introduced in OcNOS version 3.0.
Example
(config)#interface xe1
(config-if)#no subinterfaces
(config-if)#exit
rewrite
Use this command to manipulate the VLAN tags in the incoming packet. Supported operations are PUSH, DOUBLE PUSH, POP, DOUBLE POP and TRANSLATE on the VLAN tag with any of this ethertype - 8100/ 88a8/ 9100/ 9200.
Use the no form of this command to unconfigure rewrite.
Command Syntax
rewrite translate (( 1-to-1 | 2-to-1 ) (dot1q|dot1ad|VALUE) VLAN_RANGE2 | ( 1-to-2 | 2-to-2 ) (dot1q|dot1ad|VALUE) VLAN_RANGE2 (dot1q|VALUE) VLAN_RANGE2 )
rewrite (pop | pop-2tag | push (dot1q|dot1ad|VALUE) VLAN_RANE2 (inner-dot1q <1-4095>|) )
no rewrite
Parameters
pop
Pop the outer VLAN ID (VID) before service transmission.
push
Push a VLID before service transmission.
translate
Translate the outer VID
1-to-1
Translates the outermost tag to another tag
1-to-2
Translates the outermost tag to two tags (is translate & push)
2-to-1
Translates the outermost two tags to another tag
2-to-2
Translates the outermost two tags to two other tags
dot1q
IEEE 802.1Q VLAN-tagged packets.
dot1ad
IEEE 802.1ad VLAN-tagged packets
VALUE
Set service TPID value as 0x8100/0x88a8/0x9100/0x9200
VLAN_RANE2
Service VLAN ID
inner-dot1q <1-4095>
 
Push inner-VLAN ID for double-tagged.
pop-2tag
Pop both the outer VID and inner VID.
Command Mode
Interface mode
Applicability
This command was introduced in OcNOS version 3.0.
Example
(config)#interface xe1.1 switchport
(config-if)#rewrite pop
(config-if)#exit
 
(config)#interface xe1.2 switchport
(config-if)#rewrite push 9100 3
(config-if)#exit
 
(config)#interface xe1.10 switchport
(config-if)#rewrite translate 9200 4
(config-if)#exit
 
(config)#interface xe1.10 switchport
(config-if)#rewrite push 0x8100 200 inner-dot1q 300
(config-if)#exit
 
(config)#interface xe1.1 switchport
(config-if)#rewrite pop-2tag
(config-if)#exit
(config)#interface xe1.1 switchport
(config-if)#no rewrite
(config-if)#ex
 
show bridge-domain
Use this command to display bridge-domain ID.
Command Syntax
show bridge-domain (<1-2147483647>|)
Parameters
Default
Default
Command Mode
Exec mode
Applicability
This command was introduced in OcNOS version 3.0.
Example
OcNOS#show bridge-domain
 
Bridge Id interfaces Status
----------+----------------+-----------
1 xe10.1 UP
xe11.1 UP
OcNOS#
 
show cross-connect
Use this command to display the cross-connected sub-interfaces along with their status and total number of cross-connects configured in the system.
Command Syntax
show cross-connect (WORD|)
Parameters
WORD
(Optional) Specifies the cross-connect name.
Default
None
Command Mode
Exec mode
Applicability
This command was introduced in OcNOS version 3.0.
Example
#show cross-connect
cross-connect status
XC name Ep1 Ep2 Status
-----------------------------+----------------+----------------+-------
c1 xe1.1 xe1.2 UP
-----------------------------+----------------+----------------+-------
AC cross-connect summary
Total : 1
Up : 1
Down : 0
#show cross-connect c1
cross-connect status
XC name Ep1 Ep2 Status
-----------------------------+----------------+----------------+-------
c1 xe1.1 xe1.2 UP
-----------------------------+----------------+----------------+-------
 
 
show mac address-table bridge-domain
Use this command to display MAC address entries, either dynamically learned or statically configured, associated with bridge domains. This command helps verify how MAC addresses are mapped to sub-interfaces or bridge-domain IDs.
Command Syntax
show mac address-table (dynamic | static) bridge-domain {interface IFNAME |address MAC | (id <1-2147483647> | all)}
Parameters
 
Command Mode
Exec mode
Applicability
Introduced in OcNOS version 6.6.1.
Examples
Display MAC entries in a specific bridge-domain (ID 1):
OcNOS#show mac address-table dynamic bridge-domain id 1
Bridge MAC Address Type Ports
------- --------------- -------- --------
1 0022.3344.5566 dynamic xe1.1
 
OcNOS#show mac address-table static bridge-domain id 1
Bridge MAC Address Type Ports
------+---------------+---------+---------+
1 0000.0100.0001 static sa1.1
 
Display MAC entries for all bridge-domains:
OcNOS#show mac address-table dynamic bridge-domain all
 
Bridge MAC Address Type Ports
------+---------------+---------+---------+
 
1 0000.0100.0001 static xe1.1
2 0010.9400.0002 static xe2.1
 
OcNOS#show mac address-table static bridge-domain all
Bridge MAC Address Type Ports
------+---------------+---------+---------+
100 0000.0100.0001 static sa1.1
100 0000.0100.0002 static sa2.1
 
Display MAC entries learned on a specific interface:
OcNOS#show mac address-table dynamic bridge-domain interface xe1.1
Bridge MAC Address Type Ports
------- --------------- -------- --------
1 0022.3344.5566 dynamic xe1.1
 
OcNOS#show mac address-table static bridge-domain interface sa1.1
Bridge MAC Address Type Ports
------+---------------+---------+---------+
100 0000.0100.0001 static sa1.1
 
Display MAC entries learned on a specific MAC address:
OcNOS#show mac address-table dynamic bridge-domain address 0022.3344.5566
Bridge MAC Address Type Ports
------+---------------+---------+---------+
1 0022.3344.5566 dynamic xe1.1
 
OcNOS#show mac address-table static bridge-domain address 0000.0100.0001
Bridge MAC Address Type Ports
------+---------------+---------+---------+
100 0000.0100.0001 static sa1.1
 
 
Table 10-31: show mac address-table dynamic bridge-domain output fields
Field
Description
Bridge
Bridge-Domain ID. Identifies the Layer 2 broadcast domain in which the MAC address is learned.
MAC Address
The 48-bit MAC address (in HHHH.HHHH.HHHH format) learned within the bridge-domain.
Type
Indicates how the MAC address was learned. In this output, it is typically dynamic or static.
Ports
The interface or sub-interface (e.g., xe1.1) where the MAC address was learned. If the MAC is reachable via multiple ports (in case of EVPN or port aggregation), multiple interfaces may be listed.