Bridging Support Over Layer2 Sub Interface
This chapter contains examples of configuring Bridging Support Over Layer2 Subinterfaces.
To support ELAN service between sub-interfaces, Bridge domain is being used to switch the traffics between sub interfaces. Bridge-domain supports Learn and Forward mechanism. BUM traffic will be flooded in bridge-domain and known unicast will be forwarded based on L2 FDB table lookup.
Topology
Bridging support over L2 subinterface
Configure L2 Subinterface and Bridge Domain
#configure terminal | Enter configure mode. |
(config)#interface xe1 | Enter interface mode |
(config-if)#dot1ad ethertype 0x88a8 | Configure interface with tpid value as 88a8 |
(config-if)#interface xe1.1 switchport | Creates a L2 sub-interface as xe1.1 |
(config-if)#encapsulation dot1q 10 | Configure the encapsulation as dot1q matching vlan 10 |
(config-if)#exit | Exit interface mode. |
(config)#interface xe2 | Enter interface mode |
(config-if)#dot1ad ethertype 0x88a8 | Configure interface with tpid value as 88a8 |
(config-if)#interface xe2.1 switchport | Creates a L2 sub-interface as xe2.1 |
(config-if)#encapsulation dot1q 10 | Configure the encapsulation as dot1q matching vlan 10 |
(config-if)#exit | Exit interface mode. |
(config)#bridge-domain 1 | Create bridge-domain with the id 1 |
(config-bridge-domain)#interface xe1.1 | Attach interface xe1.1 |
(config-bridge-domain)#interface xe2.1 | Attach interface xe2.1 |
(config-bridge-domain)#exit | Exit interface mode. |
(config)#commit | Commit the transaction. |
Configure L2 Subinterface (Double-Push) and attach to Bridge Domain
#configure terminal | Enter configure mode. |
(config)#interface xe1.1 switchport | Creates a L2 sub-interface as xe1.1 |
(config-if)#encapsulation untagged | Configure the encapsulation as untagged |
(config-if)#rewrite push 0x8100 200 inner-dot1q 200 | Configure rewrite push with inner vlan 200 and outer vlan 200 |
(config-if)#exit | Exit interface mode |
(config)#interface xe2.1 switchport | Creates a L2 sub-interface as xe2.1 |
(config-if)#encapsulation dot1ad 200 inner-dot1q 200 | Configure the encapsulation with inner vlan 200 and outer vlan 200 |
(config-if)#exit | Exit interface mode |
(config)#bridge-domain 1 | Create bridge-domain with the id 1 |
(config-bridge-domain)#interface xe1.1 | Attach interface xe1.1 |
(config-bridge-domain)#interface xe2.1 | Attach interface xe2.1 |
(config-bridge-domain)#exit | Exit interface mode. |
(config)#commit | Commit the transaction. |
Configure L2 Subinterface (Double-Pop) attach to Bridge Domain
#configure terminal | Enter configure mode. |
(config)##interface xe1.1 switchport | Creates a L2 sub-interface as xe1.1 |
(config-if)#encapsulation untagged | Configure the encapsulation as untagged |
(config-if)#exit | Exit interface mode |
(config)#interface xe2.1 switchport | Creates a L2 sub-interface as xe2.1 |
(config-if)#encapsulation dot1ad 200 inner-dot1q 200 | Configure the encapsulation with inner vlan 200 and outer vlan 200 |
(config-if)#rewrite pop-2tag | Configure rewrite pop-2tag |
(config-if)#exit | Exit interface mode |
(config)#bridge-domain 1 | Create bridge-domain with the id 1 |
(config-bridge-domain)#interface xe1.1 | Attach interface xe1.1 |
(config-bridge-domain)#interface xe2.1 | Attach interface xe2.1 |
(config-bridge-domain)#exit | Exit interface mode. |
(config)#commit | Commit the transaction. |
Creating a Subinterface with Encapsulation
Single encapsulation as dot1q with vlan range
#configure terminal
(config)#interface xe1.100 switchport
(config-if)#encapsulation dot1q 100-200
Single encapsulation as dot1ad with vlan range
#configure terminal
(config)#interface xe1.100 switchport
(config-if)#encapsulation dot1ad 100-200
Double encapsulation as dot1q
#configure terminal
(config)#interface xe1.100 switchport
(config-if)#encapsulation dot1q 10 inner-dot1q 10
Double encapsulation as dot1ad
#configure terminal
(config)#interface xe1.200 switchport
(config-if)#encapsulation dot1ad 20 inner-dot1q 20
Encapsulation as default
#configure terminal
(config)#interface xe1.101 switchport
(config-if)#encapsulation default
Encapsulation as untagged
#configure terminal
(config)#interface xe1.102 switchport
(config-if)#encapsulation untagged
Rewrite with push
#configure terminal
(config)#interface xe1.1 switchport
(config-if)#encapsulation dot1q 10
(config-if)#rewrite push 0x8100 100
(config-if)#interface xe2.2 switchport
(config-if)#encapsulation dot1q 100 inner-dot1q 10
(config-if)#exit
(config)#bridge-domain 1
(config-xc)#interface xe1.1
(config-xc)#interface xe2.1
Note: At interface xe1.1, for incoming traffic "rewrite push" will add VLAN as 100 with TPID values 8100.
Note: At interface xe1.1, for outgoing traffic "rewrite push" will pop the VLAN.
Rewrite with translate
#configure terminal
(config)#interface xe1
(config-if)#dot1ad ethertype 0x9100
(config-if)#interface xe1.1 switchport
(config-if)#encapsulation dot1ad 200
(config-if)#rewrite translate 1-to-1 0x9100 100
(config-if)#interface xe2
(config-if)#dot1ad ethertype 0x9100
(config-if)#interface xe2.2 switchport
(config-if)#encapsulation dot1ad 100
(config-if)#exit
(config)#bridge-domain 1
(config-xc)#interface xe1.1
(config-xc)#interface xe2.1
Note: At interface xe1.10, for incoming traffic "rewrite translate" will update VLAN as 100 with TPID values 9100.
Note: At interface xe1.10, for outgoing traffic "rewrite translate" will update VLAN as 200 with TPID values 9100.
Rewrite with pop
#configure terminal
(config)#interface xe1.1 switchport
(config-if)#encapsulation dot1q 100
(config-if)#rewrite pop
(config-if)#interface xe2.2 switchport
(config-if)#encapsulation untagged
(config-if)#exit
(config)#bridge-domain 1
(config-xc)#interface xe1.1
(config-xc)#interface xe2.1
Note: At interface xe1.1, for incoming traffic "rewrite pop" will pop the VLAN.
Note: At interface xe1.1, for outgoing traffic "rewrite pop" will add VLAN as 100 with TPID values 8100.
Note: Push, pop and translate rewrite operations are supported with TPID values 8100/88a8/9100/9200 as symmetric operation.
No subinterfaces
#configure terminal
(config)#interface xe1
(config-if)#no subinterfaces
Note: no Subinterfaces will remove all the Subinterfaces.
Note: Same physical interface will support both L2 and L3 subinterfaces.
Verification commands
#show bridge-domain
Bridge Id interfaces Status
--------------+----------------+----------------+-------
1 xe1.1 UP
xe2.1 UP
1. Command to display the learned MAC entries of bridge domain
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 dynamic bridge-domain all
Bridge MAC Address Type Ports
------+---------------+---------+---------+
1 0022.3344.5566 dynamic xe1.1
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 dynamic bridge-domain address 0022.3344.5566
Bridge MAC Address Type Ports
------+---------------+---------+---------+
1 0022.3344.5566 dynamic xe1.1
2. Command to clear the learned MAC entries
OcNOS#clear mac address-table dynamic bridge-domain id 1
OcNOS#clear mac address-table dynamic bridge-domain id 1 interface xe1.1
OcNOS#clear mac address-table dynamic bridge-domain id 1 address 0022.3344.5566
OcNOS#clear mac address-table dynamic bridge-domain all
OcNOS#sh mac address-table dynamic bridge-domain id 1
Bridge MAC Address Type Ports
------+---------------+---------+---------+