Example: Configuring Rewrite Rules on Transparent Mode Security Devices
This example shows how to configure rewrite rules on transparent mode devices to redefine IEEE 802.1 CoS values in outgoing packets.
Before you begin, configure a Layer 2 logical interface. See Example: Configuring Layer 2 Logical Interfaces on Security Devices.
In this example, you configure logical interface ge-1/0/3.0 as a trunk port that carries traffic for packets tagged with VLAN identifiers 200 through 390. You then configure the forwarding classes and create rewrite rule rw1 for IEEE 802.1 traffic. For outgoing packets in the forwarding class fc1 with low loss priority, the IEEE 802.1p priority bits are rewritten as 011. Finally, you apply the rewrite rule rw1 to interface ge-1/0/3.0.
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the  hierarchy level, and then enter commit from configuration mode.
The following example requires you to navigate various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To configure rewrite rules on transparent mode devices:
- Configure the logical interface as a Layer 2 trunk port.user@host# set interfaces ge-1/0/3 vlan-tagging unit 0 family ethernet-switching interface-mode trunk vlan members 200-390
- Configure the class of service.user@host# edit class-of-service
- Configure the forwarding classes.[edit class-of-service]user@host# set forwarding-classes queue 0 fc1user@host# set forwarding-classes queue 1 fc2user@host# set forwarding-classes queue 3 fc4user@host# set forwarding-classes queue 4 fc5user@host# set forwarding-classes queue 5 fc6user@host# set forwarding-classes queue 6 fc7user@host# set forwarding-classes queue 7 fc8user@host# set forwarding-classes queue 2 fc3
- Configure a rewrite rule.[edit class-of-service]user@host# set rewrite-rules ieee-802.1 rw1 forwarding-class fc1 loss-priority low code-point 011
- Apply the rewrite rule to the interface.[edit class-of-service]user@host# set interfaces ge-1/0/3 unit 0 rewrite-rules ieee-802.1 rw1
From configuration mode, confirm your configuration by entering the show interfaces ge-1/0/3 and show class-of-service commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.
If you are done configuring the device, enter commit from configuration mode.
To confirm that the configuration is working properly, perform this task:
Verifying Rewrite Rules on Transparent Mode Devices
Verify that the rewrite rule was configured on the transparent mode devices properly.
From configuration mode, enter the show interfaces ge-1/0/3 and show class-of-service commands.