Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Stacking and Rewriting VLAN Tags for the Layer 2 Wholesale Solution

Stacking and rewriting VLAN tags allows you to use an additional (outer) VLAN tag to differentiate between routers in the Layer 2 wholesale network. A frame can be received on an interface, or it can be internal to the system (as a result of the input-vlan-map statement).

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 single-action VLAN rewrite operations:

  • pop—Remove a VLAN tag from the top of the VLAN tag stack. The outer VLAN tag of the frame is removed.

  • push—Add a new VLAN tag to the top of the VLAN stack. An outer VLAN tag is pushed in front of the existing VLAN tag.

  • swap—Replace the inner VLAN tag of the incoming frame with a user-specified VLAN tag value.

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.

You can include both the input-vlan-map and output-vlan-map statements at the [edit dynamic-profiles profile-name interface “$junos-interface-ifd-name” unit ” $junos-interface-unit] hierarchy level.

The type of VLAN rewrite operation permitted depends upon whether the frame is single-tagged or dual-tagged. Table 1 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 1: Rewrite Operations on Single-Tagged and Dual-Tagged Frames

Rewrite Operation

Single-Tagged

Dual-Tagged

Number of Tags

pop

Yes

Yes

– 1

push

Yes

Yes

+1

swap

Yes

Yes

0

Depending on the VLAN rewrite operation, you configure the rewrite operation for the interface in the input VLAN map, the output VLAN map, or both. Table 2 shows what rewrite operation combinations you can configure. “None” means that no rewrite operation is specified for the VLAN map.

Table 2: Applying Rewrite Operations to VLAN Maps

Input VLAN Map

Output VLAN Map

none

push

pop

swap

none

Yes

No

No

Yes

push

No

No

Yes

No

pop

No

Yes

No

No

swap

Yes

No

No

Yes

To configure the input VLAN map:

Note:

You configure the input-vlan-map statement only when there is a need either to push an outer tag on a single-tagged subscriber packet or to modify the outer tag in a subscriber dual-tagged packet.

  1. Include the input-vlan-map statement.
  2. Specify the action that you want the input VLAN map to take.
  3. Include the vlan-id statement along with the $junos-vlan-map-id dynamic variable.

To configure the output VLAN map:

Note:

You configure the output-vlan-map statement only when there is a need to either pop or modify the outer tag found in a dual-tagged packet meant for the subscriber.

  1. Include the output-vlan-map statement.

  2. Specify the action that you want the output VLAN map to take.

You must know whether the VLAN rewrite operation is valid and 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 tag protocol identifiers (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.