You can configure rewrite operations to stack (push), remove (pop), or rewrite (swap) tags on single-tagged frames and dual-tagged frames. If a port is not tagged, rewrite operations are not supported on any logical interface on that port.
You can configure the following VLAN rewrite operations:
You configure VLAN rewrite operations for logical interfaces in the input VLAN map for incoming frames and in the output VLAN map for outgoing frames. To configure the input VLAN map, include the input-vlan-map statement:
-
input-vlan-map {
- ...interface-specific configuration...
- }
To configure the output VLAN map, include the output-vlan-map statement:
-
output-vlan-map {
- ...interface-specific configuration...
- }
You can include both statements at the following hierarchy levels:
The type of VLAN rewrite operation permitted depends upon whether the frame is single-tagged or dual-tagged. Table 49 shows supported rewrite operations and whether they can be applied to single-tagged frames or dual-tagged frames. The table also indicates the number of tags being added or removed during the operation.
Table 49: Rewrite Operations on Not Tagged, Single-Tagged, and Dual-Tagged Frames
The rewrite operations push and push-push can be valid in certain circumstances on frames that are not tagged. For example, a single-tagged logical interface (interface 1) and a dual-tagged logical interface (interface 2) have the following configurations:
Interface 1
- [edit interfaces interface-name unit logical-unit-number]
-
input-vlan-map {
-
pop;
- }
-
output-vlan-map {
-
push;
- }
Interface 2
- [edit interfaces interface-name unit logical-unit-number]
-
input-vlan-map {
-
pop-pop;
- }
-
output-vlan-map {
-
push-push;
- }
When a frame is received on the interface as a result of the input-vlan-map operation, the frame is not tagged. As it goes out of the second interface, the output-vlan-map operation push-push is applied to it. The resulting frame will be dual-tagged at the logical interface output.
Depending on the VLAN rewrite operation, you configure the rewrite operation for the interface in the input VLAN map, the output VLAN map, or in both the input VLAN map and the output VLAN map. Table 50 shows what rewrite operation combinations you can configure. “None” means that no rewrite operation is specified for the VLAN map.
Table 50: Applying Rewrite Operations to VLAN Maps
As well as knowing if the VLAN rewrite operation is valid, and whether it is applied to the input VLAN map or the output VLAN map, you must also know whether the rewrite operation requires you to include statements to configure the inner and outer TPIDs and inner and outer VLAN IDs in the input VLAN map or output VLAN map. For information about configuring inner and outer TPIDs and inner and outer VLAN IDs, see Configuring Inner and Outer TPIDs and VLAN IDs.