Description

This article explains the requirements in order to use the vlan-rewrite statement in the configuration.

Symptoms

While configuring the vlan-rewrite statement, the following error might be observed.

[edit interfaces ae3 unit 0 family ethernet-switching vlan-rewrite]
     translate 3414 { ... }
+    translate 10 1779;
+    translate 20 1779;

[edit interfaces ae3 unit 0 family ethernet-switching vlan-rewrite]
 'translate 10'
  Ambiguous to-vlan-id statement present
error: configuration check-out failed

Solution

Translate a VLAN ID (the from-vlan-id) in an incoming packet to another VLAN ID (the to-vlan-id) that you have configured on an interface. The device does the corresponding translation in reverse at egress.

 

You can configure VLAN translation with the vlan-rewrite translate statement as follows:

 

  • Only on trunk mode interfaces.
  • The to-vlan-id is a VLAN you configure on the device with the specified interface as a member of that VLAN.
  • The from-vlan-id and to-vlan-id VLAN IDs can have values between 1 and 4094.


An example configuration -
 

root@switch# show interfaces ae3 unit 0 
family ethernet-switching {
  interface-mode trunk;
  vlan {
    members vlan771;
  }
  vlan-rewrite {
    translate 100 771;
    translate 101 771;
    translate 102 771;
  }
}

Modification History

2024-04-20 : Article Created
20-04-2024: Validated the article and done minor changes.

Related Information

https://www.juniper.net/documentation/us/en/software/junos/cli-reference/topics/ref/statement/vlan-rewrite-edit-interfaces.html