VLAN

Manage virtual LANs

VLAN

Manage VLANs. This covers creating and deleting VLANs and setting their ports, the default VLAN, multicast flooding, per-VLAN and per-port VLAN settings, and the tables that pick or rewrite a frame’s VLAN: by MAC, protocol or IP subnet, VLAN translation, and VLAN tag actions.

Sub-command words are case-insensitive but must be typed in full; the capital letters in MulticastFlood are only cosmetic. proto is short for protocol, ip for ip4 and ctrl for control. Key=<value> options can be abbreviated to their capital letters, for example pbm= for PortBitMap and ubm= for UntagBitMap. VLAN numbers can be decimal or 0x hexadecimal.

vlan <id> on its own prints the settings of one VLAN (Current settings:, then the VRF, outer TPID, learning, IP and multicast controls, flood modes, class and so on). vlan <id> <Name>=<value> … changes them. The names include VRF, OuterTPID, LearnDisable, Ip4Disable, Ip6Disable, Ip4McastDisable, Ip6McastDisable, L3VrfGlobalDisable, MplsDisable, Cosq, CosqEnable, L2McastFloodMode, Ip4McastFloodMode, Ip6McastFloodMode and IfClass. Changing one setting this way may reset other VLAN settings the SAI made that this command does not know about.

Warning

Everything except the show and get forms changes VLAN state that SONiC manages, without telling SONiC. vlan clear deletes every VLAN, including those carrying SONiC’s router interfaces.

Unvalidated — Show the settings of VLAN 100

drivshell> vlan 100
vlan create <vid> [PortBitMap=<pbmp>] [UntagBitMap=<pbmp>]

Create a VLAN with member ports PortBitMap, of which UntagBitMap send untagged. It prints nothing on success. A VLAN number that is not a number gives ERROR: Malformed VLAN ID "<arg>". Unknown extra words are rejected. Changes switch state.

Hardware-validated — VLAN 100 untagged on ce1 and ce2

drivshell> vlan create 100 pbm=ce1,ce2 ubm=ce1,ce2; pvlan set ce1,ce2 100
vlan destroy <vid>

Delete one VLAN. Changes switch state.

Hardware-validated

drivshell> vlan destroy 100
vlan clear

Delete all VLANs except the default VLAN. See the warning above.

Unvalidated

drivshell> vlan clear
vlan add <vid> [PortBitMap=<pbmp>] [UntagBitMap=<pbmp>]

Add ports to an existing VLAN. With no options it only prints the defaults. Changes switch state.

Unvalidated

drivshell> vlan add 100 PortBitMap=xe1 UntagBitMap=xe1
vlan remove <vid> [PortBitMap=<pbmp>]

Remove ports from a VLAN. Changes switch state.

Unvalidated

drivshell> vlan remove 100 PortBitMap=xe1
vlan show [<vid>]

List all VLANs, or one, one line each, in the form vlan <vid> ports <names> (0x<bitmap>), untagged <names> (0x<bitmap>) <flood mode>, for example vlan 100       ports ce1-ce2 (0x…220), untagged ce1-ce2 (0x…220) MCAST_FLOOD_UNKNOWN. On Trident 3 the hex bitmaps are several hundred digits long. none means no ports. On a fresh switch VLAN 1 holds every port untagged, and VLAN 4095 exists with no ports. The built-in help shows no argument; the shell also accepts a VLAN number. Read-only.

Hardware-validated

drivshell> vlan show 100
vlan 100  ports ce1-ce2 (0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002020), untagged ce1-ce2 (0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002020) MCAST_FLOOD_UNKNOWN
vlan default [<vid>]

Print Default VLAN ID is <vid>, or set the default VLAN. Without a number this only reads.

Unvalidated

drivshell> vlan default
vlan MulticastFlood <vid> [<mode>]

Print vlan <vid> Multicast Flood Mode is <MODE>, or set the mode. When setting, <mode> is a number, not a name; the names printed start at MCAST_FLOOD_ALL for 0. Without a mode this only reads.

Unvalidated

drivshell> vlan multicastflood 100
vlan gport <add | delete | get | clear | show> <vid> [PortID=<gport>]

Manage VLAN membership by port ID, including virtual ports. show prints Virtual and physical ports defined for VLAN: <vid> and then <port> (tagged) or <port> (untagged) for each local port. get prints nothing and only fails if the port is not a member. PortID is required for add, delete and get. show and get are read-only. For a VLAN that does not exist the shell prints VLAN: ERROR: Entry not found, as in the first example, where VLAN 100 had not been created.

Hardware-validated

drivshell> vlan gport show 100
VLAN: ERROR: Entry not found

Failed to execute the diagnostic command. Error: Operation failed.

Hardware-validated — Members of a SONiC VLAN

drivshell> vlan gport show 902
Virtual and physical ports defined for VLAN: 902
   xe3 (untagged)
vlan policer <set | get> <vid> [POLICER=<policer>]

Attach a policer to a VLAN, or show which one is attached (Policer id=<x> is set in Vlan <x>; both numbers in hex). get is read-only. If the lookup fails, get prints `` Get Policer from Vlan <vid> failed`` with the VLAN number in hex (64 is VLAN 100) and does not report an error to the SAI front-end. In the example VLAN 100 does not exist, so it is not yet known whether Trident 3 supports VLAN policers at all.

Hardware-validated

drivshell> vlan policer get 100
 Get Policer from Vlan 64 failed

Hardware-validated — On a VLAN that exists

drivshell> vlan policer get 902
 Get Policer from Vlan 386 failed

The error message prints the VLAN ID in hexadecimal without a 0x prefix: 64 is VLAN 100 and 386 is VLAN 902. VLAN 100 does not exist on that switch, and VLAN 902 has no policer: SONiC does not use VLAN policers.

vlan protocol <add | delete | clear> PortBitMap=<pbmp> [Frame=<n>] [Ether=<n>] [VLan=<vid>] [Prio=<prio>]

Put untagged frames of a given frame type and Ethertype, received on the given ports, into VLan. Changes switch state.

Unvalidated

drivshell> vlan protocol add PortBitMap=xe1 Frame=1 Ether=0x0800 VLan=200 Prio=0
vlan mac <add | delete | clear> [MACaddress=<mac>] [VLan=<vid>] [Prio=<prio>] [Cng=<cng>]

Put untagged frames from a source MAC into a VLAN. Changes switch state.

Unvalidated

drivshell> vlan mac add MACaddress=00:11:22:33:44:55 VLan=200 Prio=0 Cng=0
vlan translate <On | Off | add | get | show | delete | clear> [Port=<port>] [OldVLan=<vid>] [NewVLan=<vid>] [Prio=<prio>] [Cng=<cng>]

Ingress VLAN translation. On/Off turn translation on or off. add, get, delete and clear manage entries keyed by port and old VLAN; get prints New Vlan ID = <vid>, Priority = <p>. show lists all entries. The built-in help shows vlan translate [On|Off] as if the word were optional; without a word the shell prints Missing translate subcommand. get and show are read-only. show prints one u = <unit>, modid = <m> port = <p>, old_vid = <v>, new_vid = <v>, prio = <p> line per entry, with the logical port number, and nothing when the table is empty.

The SAI uses translation entries itself: a SONiC switch has entries such as one for port 12 and VLAN 902, so clear removes SAI state.

Hardware-validated

drivshell> vlan translate show
u = 0, modid = 0 port = 12, old_vid = 902, new_vid = 0, prio = 0
vlan translate egress <add | get | show | delete | clear> [Port=<port>] [OldVLan=<vid>] [NewVLan=<vid>] [Prio=<prio>] [Cng=<cng>]

Egress VLAN translation entries. get and show are read-only. show prints nothing when there are none, as on a SONiC switch.

Hardware-validated

drivshell> vlan translate egress show
vlan translate dtag <add | get | show | delete | clear> [Port=<port>] [OldVLan=<vid>] [NewVLan=<vid>] [Prio=<prio>] [Cng=<cng>]

Translation entries that add an outer tag (double tagging). The built-in help omits delete and clear; the shell accepts them. get and show are read-only. On Trident 3 show lists the same entries as vlan translate show.

Hardware-validated

drivshell> vlan translate dtag show
u = 0, modid = 0 port = 12, old_vid = 902, new_vid = 0, prio = 0
vlan translate range <add | get | delete | clear | show> [Port=<port>] [OldVLanLo=<vid>] [OldVLanHi=<vid>] [NewVLan=<vid>] [Prio=<prio>] [Cng=<cng>]

Translation entries for a range of old VLANs. The help spells the low bound OldVlanLo; option names are not case-sensitive, so that works. get and show are read-only. show prints nothing when there are no range entries, as on a SONiC switch.

Hardware-validated

drivshell> vlan translate range show
vlan ip4 <add | delete | clear> [IPaddr=<ip>] [NetMask=<mask>] [VLan=<vid>] [Prio=<prio>] [Cng=<cng>]

Put untagged frames from an IPv4 source subnet into a VLAN. Changes switch state.

Unvalidated

drivshell> vlan ip4 add IPaddr=10.0.0.0 NetMask=255.0.0.0 VLan=200 Prio=0 Cng=0
vlan ip6 <add | delete | clear> [IPaddr=<ip6>] [prefiX=<len>] [VLan=<vid>] [Prio=<prio>]

The IPv6 version of vlan ip4. prefiX can be written px. Changes switch state.

Unvalidated

drivshell> vlan ip6 add IPaddr=2001:db8:: prefiX=32 VLan=200 Prio=0
vlan control [<name> [<value>]]

Show or set switch-wide VLAN controls. With no name every control is printed with its value. The names are dropunknown, preferip4, prefermac, shared, sharedid and preferegresstranslate. Without a value this only reads.

Trident 3 does not have shared and sharedid; they show - and Feature unavailable. The name preferegresstranslate is too long for its column, so its value is printed straight after it (preferegresstranslate0). On a SONiC switch dropunknown is 1.

Hardware-validated

drivshell> vlan control
dropunknown         1
preferip4           0
prefermac           1
shared              -     Feature unavailable
sharedid            -     Feature unavailable
preferegresstranslate0
vlan port [<pbmp> [<name> [<value>]]]

Show or set per-port VLAN controls. For each port it prints Vlan Control on Port=<name> and then each control and its value. Names include translateingress, translateegress, translateingressmissdrop, translateegressmissdrop, lookupmac, lookupip, useinnerpri, useouterpri, verifyoutertpid and outertpidselect. The built-in help writes the first argument as <port>|all; any port list works. Without a value this only reads. In the example, a SONiC PortChannel member, ingress and egress translation are enabled and packets that miss the ingress translation table are dropped (translateingressmissdrop 1). Controls that Trident 3 lacks, such as useouterpri, show - and Feature unavailable.

Hardware-validated

drivshell> vlan port xe1

Vlan Control on Port=xe1
preferip4                     0
prefermac                     1
translateingress              1
translateingressmissdrop      1
translateegress               1
translateegressmissdrop       0
translateegressmissuntagdrop  0
translateegressmissuntag      0
lookupmac                     1
lookupip                      1
useinnerpri                   0
useouterpri                   -   Feature unavailable
verifyoutertpid               0
outertpidselect               0
translatekeyfirst             8
translatekeysecond            8
vlan innertag [<pbmp>] [Priority=<prio>] [Cfi=<cfi>] [Vlan=<vid>]

Show or set the inner tag a port adds. Unless all three options are given, it prints Port=<name>, Priority=<p>, CFI=<c>, VLAN=<v> for each port. The built-in help shows the port as required; it is optional and defaults to all ports. Read-only unless all three options are given.

Hardware-validated

drivshell> vlan innertag xe1
Port=xe1, Priority=0, CFI=0, VLAN=0
vlan action port [egress] default <add | get> Port=<port> [OuterVlan=<vid>] [InnerVlan=<vid>] [Prio=<prio>] [<Dt|Ot|It|Ut><Outer|Inner>[Prio]=<action>]

Set or show the default VLAN tag actions of a port, at ingress or (with egress) at egress. Each action is Add, Delete, Replace or None. A wrong name prints the list of valid ones. The Dt, Ot, It and Ut prefixes are for double-tagged, outer-tagged, inner-tagged and untagged frames. get prints Port <n>: New OVLAN=…, New IVLAN=…, New Prio=… and one line each for DT:, OT:, IT: and UT:, then the policer. <n> is the logical port number (Port 10 for xe1 in the example), not the name. get is read-only.

Hardware-validated

drivshell> vlan action port default get Port=xe1
Port 10: New OVLAN=1, New IVLAN=0, New Prio=0
  DT: Outer=None     OuterPrio=Replace  Inner=None     InnerPrio=None
  OT: Outer=None     OuterPrio=Replace  Inner=None
  IT: Outer=Add      Inner=None         InnerPrio=None
  UT: Outer=Add      Inner=None
  Policer=0x0
vlan action mac <add | get | delete | clear> [MACaddress=<mac>] [OuterVlan=<vid>] [InnerVlan=<vid>] [Prio=<prio>] [<action options>]

VLAN tag actions chosen by source MAC. get is read-only. For a MAC without an entry it prints Error: Entry not found; SONiC installs no MAC-based entries.

Hardware-validated

drivshell> vlan action mac get MACaddress=00:11:22:33:44:55
Error: Entry not found

Failed to execute the diagnostic command. Error: Operation failed.
vlan action protocol add PortBitMap=<pbmp> Frame=<n> Ether=<n> [OuterVlan=<vid>] [InnerVlan=<vid>] [Prio=<prio>] [<action options>]

VLAN tag actions chosen by frame type and Ethertype. Changes switch state.

Unvalidated

drivshell> vlan action protocol add PortBitMap=xe1 Frame=1 Ether=0x88cc OuterVlan=300 OtOuter=Replace
vlan action ip4 add IPaddr=<ip> NetMask=<mask> [OuterVlan=<vid>] [InnerVlan=<vid>] [Prio=<prio>] [<action options>]

VLAN tag actions chosen by IPv4 source subnet. vlan action ip6 add takes prefiX instead of NetMask. Changes switch state.

Unvalidated

drivshell> vlan action ip4 add IPaddr=10.0.0.0 NetMask=255.0.0.0 OuterVlan=200 UtOuter=Add
vlan action translate <add | delete | get | show> [Port=<port>] [KeyType=<key>] [OldOuterVlan=<vid>] [OldInnerVlan=<vid>] [OuterVlan=<vid>] [InnerVlan=<vid>] [Prio=<prio>] [Policer=<policer>] [<action options>]

VLAN translation with tag actions. KeyType is Double, Outer, Inner, OuterTag, InnerTag, PortDouble, PortOuter or Policer. A wrong name prints the valid ones. show lists all entries. get and show are read-only. A SONiC switch has SAI entries here (see vlan translate); do not change them.

Hardware-validated

drivshell> vlan action translate show
Port=12, Modid=0, KeyType=PortOuter, OldOuterVlan=902, OldInnerVlan=--
  DT: Outer=None     OuterPrio=None     Inner=None     InnerPrio=None
  OT: Outer=Delete   OuterPrio=Replace  Inner=None
  IT: Outer=Delete   Inner=None         InnerPrio=Delete
  UT: Outer=Replace  Inner=None
  Policer=0x0
vlan action translate range <add | delete | get | clear | show> [Port=<port>] [OuterVlanLo=<vid>] [OuterVlanHi=<vid>] [InnerVlanLo=<vid>] [InnerVlanHi=<vid>] [<action options>]

VLAN translation with tag actions for VLAN ranges. get and show are read-only. show prints nothing when there are none.

Hardware-validated

drivshell> vlan action translate range show
vlan action translate egress <add | delete | get | show> [PortClass=<class>] [OldOuterVlan=<vid>] [OldInnerVlan=<vid>] [<action options>]

Egress VLAN translation with tag actions, keyed by port class. get and show are read-only. show prints nothing when there are none.

Hardware-validated

drivshell> vlan action translate egress show

Built-in help

Usages:
      vlan create <id> [PortBitMap=<pbmp> UntagBitMap=<pbmp>]
                                           - Create a VLAN
      vlan destroy <id>                    - Destroy a VLAN
      vlan clear                           - Destroy all VLANs
      vlan add <id> [PortBitMap=<pbmp> UntagBitMap=<pbmp>]
                                           - Add port(s) to a VLAN
      vlan remove <id> [PortBitMap=<pbmp>] - Remove ports from a VLAN
      vlan gport add <id> [PortID=<gport_id>
                                           - Add gport to a VLAN
      vlan gport delete <id> [PortID=<gport_id>
                                           - Delete gport from a VLAN
      vlan gport get <id> [PortID=<gport_id>
                                           - Check if gport belongs to a VLAN
      vlan gport clear <id>
                                           - Delete all ports from a VLAN
      vlan gport show <id>
                                           - Show all ports in a VLAN
      vlan MulticastFlood <id>  [Mode]     - Multicast flood setting
      vlan show                            - Display all VLANs
      vlan default [<id>]                  - Show or set the default VLAN
      vlan protocol add PortBitMap=<pbmp> Frame=<N> Ether=<N>
            VLan=<vlanid> Prio=<prio>
      vlan protocol delete PortBitMap=<pbmp> Frame=<N> Ether=<N>
      vlan protocol clear PortBitMap=<pbmp>
      vlan policer set <id> POLICER=<policer>
      vlan policer get <id>
      vlan mac add MACaddress=<address> VLan=<vlanid> Prio=<prio>
            Cng=<cng>
      vlan mac delete MACaddress=<address>
      vlan mac clear
      vlan translate [On|Off]
      vlan translate add Port=<port> OldVLan=<vlanid> NewVLan=<vlanid>
            Prio=<prio> Cng=<cng>
      vlan translate get Port=<port> OldVLan=<vlanid>
      vlan translate show              - Shows all vlan translations
      vlan translate delete Port=<port> OldVLan=<vlanid>
      vlan translate clear
      vlan translate egress add Port=<port> OldVLan=<vlanid> NewVLan=<vlanid>
            Prio=<prio> Cng=<cng>
      vlan translate egress get Port=<port> OldVLan=<vlanid>
      vlan translate egress show  - Shows all vlan egress translations
      vlan translate egress delete Port=<port> OldVLan=<vlanid>
      vlan translate egress clear
      vlan translate dtag add Port=<port> OldVLan=<vlanid> NewVLan=<vlanid>
            Prio=<prio> Cng=<cng>
      vlan translate dtag get Port=<port> OldVLan=<vlanid>
      vlan translate dtag show     - Shows all double tagged vlans
      vlan translate range add Port=<port> OldVLanHi=<vlanid>
            OldVlanLo=<vlanid> NewVLan=<vlanid> Prio=<prio> Cng=<cng>
      vlan translate range get Port=<port> OldVLanHi=<vlanid>
            OldVlanLo=<vlanid>
      vlan translate range delete Port=<port> OldVLanHi=<vlanid>
            OldVlanLo=<vlanid>
      vlan translate range clear
      vlan translate range show
      vlan ip4 add IPaddr=<ip-address> NetMask=<ip-addr> VLan=<vlanid>
            Prio=<prio> Cng=<cng>
      vlan ip4 delete IPaddr=<ip-address> NetMask=<ip-addr>
      vlan ip4 clear
      vlan ip6 add IPaddr=<ip-address> prefiX=<prefix> VLan=<vlanid>
            Prio=<prio>
      vlan ip6 delete IPaddr=<ip-address> prefiX=<prefix>
      vlan ip6 clear
      vlan control [<name> [<value>]]
      vlan port [<port>|all [<name> [<value>]]]
      vlan innertag <port> Priority=<priority> CFI=<cfi> VLan=<vlanid>
      vlan <id> [<name>=<value>]         - Set/Get per VLAN property
      vlan action port default add Port=<port> OuterVlan=<vlanid>
            InnerVlan=<vlanid> Prio=<prio> DtOuter=<action>
            DtOuterPrio=<action> DtInner=<action> DtInnerPrio=<action>
            OtOuter=<action> OtOuterPrio=<action> OtInner=<action>
            OtOuter=<action> ItOuter=<action> ItInner=<action>
            ItInnerPrio=<action> UtOuter=<action> UtInner=<action>
            - Add port default VLAN tag with actions.
              Valid actions are { Add, Delete, Replace, None }
      vlan action port default get Port=<port>
            - Get port default VLAN tag actions
      vlan action port egress default add Port=<port> OuterVlan=<vlanid>
            InnerVlan=<vlanid> Prio=<prio> DtOuter=<action>
            DtOuterPrio=<action> DtInner=<action> DtInnerPrio=<action>
            OtOuter=<action> OtOuterPrio=<action> OtInner=<action>
            OtOuter=<action> ItOuter=<action> ItInner=<action>
            ItInnerPrio=<action> UtOuter=<action> UtInner=<action>
            - Add port egress VLAN tag with actions.
              Valid actions are { Add, Delete, Replace, None }
      vlan action port egress default get Port=<port>
            - Get port egress VLAN tag actions
      vlan action mac add MACaddress=<address> OuterVlan=<vlanid>
            InnerVlan=<vlanid> Prio=<prio> DtOuter=<action>
            DtOuterPrio=<action> DtInner=<action> DtInnerPrio=<action>
            OtOuter=<action> OtOuterPrio=<action> OtInner=<action>
            OtOuter=<action> ItOuter=<action> ItInner=<action>
            ItInnerPrio=<action> UtOuter=<action> UtInner=<action>
            - Add MAC-based VLAN tag with actions
              Valid actions are { Add, Delete, Replace, None }
      vlan action mac get MACaddress=<address>
            - Get MAC-based VLAN tag actions
      vlan action mac delete MACaddress=<address>
            - Delete MAC-based VLAN tag actions
      vlan action mac clear
            - Delete all MAC-based VLAN tag actions
      vlan action protocol add PortBitMap=<pbmp> Frame=<N> Ether=<N>
            OuterVlan=<vlanid> InnerVlan=<vlanid> Prio=<prio>
            DtOuter=<action> DtOuterPrio=<action> DtInner=<action>
            DtInnerPrio=<action> OtOuter=<action> OtOuterPrio=<action>
            OtInner=<action> OtOuter=<action> ItOuter=<action>
            ItInner=<action> ItInnerPrio=<action> UtOuter=<action>
            UtInner=<action>
            - Add protocol-based VLAN tag with actions.
              Valid actions are { Add, Delete, Replace, None }
      vlan action ip4 add IPaddr=<ip-address> NetMask=<ip-addr>
            OuterVlan=<vlanid> InnerVlan=<vlanid> Prio=<prio>
            DtOuter=<action> DtOuterPrio=<action> DtInner=<action>
            DtInnerPrio=<action> OtOuter=<action> OtOuterPrio=<action>
            OtInner=<action> OtOuter=<action> ItOuter=<action>
            ItInner=<action> ItInnerPrio=<action> UtOuter=<action>
            UtInner=<action>
            - Add IP4-based VLAN tag with actions.
              Valid actions are { Add, Delete, Replace, None }
      vlan action ip6 add IPaddr=<ip-address> prefiX=<prefix>
            OuterVlan=<vlanid> InnerVlan=<vlanid> Prio=<prio>
            DtOuter=<action> DtOuterPrio=<action> DtInner=<action>
            DtInnerPrio=<action> OtOuter=<action> OtOuterPrio=<action>
            OtInner=<action> OtOuter=<action> ItOuter=<action>
            ItInner=<action> ItInnerPrio=<action> UtOuter=<action>
            UtInner=<action>
            - Add IP6-based VLAN tag with actions.
              Valid actions are { Add, Delete, Replace, None }
      vlan action translate add Port=<port> KeyType=<key>
            OldOuterVlan=<vlanid> OldInnerVlan=<vlanid> DtOuter=<action>
            OuterVlan=<vlanid> InnerVlan=<vlanid> Prio=<prio>
            DtOuter=<action> DtOuterPrio=<action> DtInner=<action>
            DtInnerPrio=<action> OtOuter=<action> OtOuterPrio=<action>
            OtInner=<action> OtOuter=<action> ItOuter=<action>
            ItInner=<action> ItInnerPrio=<action> UtOuter=<action>
            UtInner=<action> Policer=<policer>
            - Add VLAN tag translation with actions.
              Valid actions are { Add, Delete, Replace, None }
              Valid key types are { Double, Outer, Inner, OuterTag,
              InnerTag, PortDouble, PortOuter, Policer }
      vlan action translate delete Port=<port> KeyType=<key>
            OldOuterVlan=<vlanid> OldInnerVlan=<vlanid>
            - Delete VLAN tag translation actions.
      vlan action translate get Port=<port> KeyType=<key>
            OldOuterVlan=<vlanid> OldInnerVlan=<vlanid>
            - Get VLAN tag translation actions.
      vlan action translate show
            - Show all VLAN tag translation actions.
      vlan action translate range add Port=<port>
            OuterVlanLo=<vlanid> OuterVlanHi=<vlanid>
            InnerVlanLo=<vlanid> InnerVlanHi=<vlanid>
            OuterVlan=<vlanid> InnerVlan=<vlanid> Prio=<prio>
            DtOuter=<action> DtOuterPrio=<action> DtInner=<action>
            DtInnerPrio=<action> OtOuter=<action> OtOuterPrio=<action>
            OtInner=<action> OtOuter=<action> ItOuter=<action>
            ItInner=<action> ItInnerPrio=<action> UtOuter=<action>
            UtInner=<action>
            - Add VLAN tag range translation with actions.
              Valid actions are { Add, Delete, Replace, None }
      vlan action translate range delete Port=<port>
            OuterVlanLo=<vlanid> OuterVlanHi=<vlanid>
            InnerVlanLo=<vlanid> InnerVlanHi=<vlanid>
            - Delete VLAN tag translation range actions.
      vlan action translate range get Port=<port>
            OuterVlanLo=<vlanid> OuterVlanHi=<vlanid>
            InnerVlanLo=<vlanid> InnerVlanHi=<vlanid>
            - Get VLAN tag translation range actions.
      vlan action translate range clear
            - Delete all VLAN tag translation range actions.
      vlan action translate range show
            - Show all VLAN tag translation range actions.
      vlan action translate egress add PortClass=<class>
            OldOuterVlan=<vlanid> OldInnerVlan=<vlanid> DtOuter=<action>
            OuterVlan=<vlanid> InnerVlan=<vlanid> Prio=<prio>
            DtOuter=<action> DtOuterPrio=<action> DtInner=<action>
            DtInnerPrio=<action> OtOuter=<action> OtOuterPrio=<action>
            OtInner=<action> OtOuter=<action> ItOuter=<action>
            ItInner=<action> ItInnerPrio=<action> UtOuter=<action>
            UtInner=<action>
            - Add VLAN tag egress translation with actions.
              Valid actions are { Add, Delete, Replace, None }
      vlan action translate egress delete PortClass=<class>
            OldOuterVlan=<vlanid> OldInnerVlan=<vlanid>
            - Delete VLAN tag egress translation actions.
      vlan action translate egress get PortClass=<class>
            OldOuterVlan=<vlanid> OldInnerVlan=<vlanid>
            - Get VLAN tag egress translation actions.
      vlan action translate egress show

Further reading

bcmsh.md (published as https://kamelnetworks.github.io/sonic/bcmsh.html), SDK-6.5.20 HSDK Getting Started Guide (GS-SDK6520-R), plus SDK-6.5.20/21/22 Release Notes (RN-SDK65xx-R), OpenBCM sdk-6.5.27/rc: rc.soc, config.bcm, td3_sanity.soc, cmd_td3_tr514_lr.soc, tr51/tr517_bcm56870_a0.soc, bcm_diag_info.soc …, SDK-6.5.20..6.5.27 Resolved-Issues-Improvements.xlsx (7 files), ASIC-level Shell Access (Open NX-OS), Cisco Nexus 9000 Series NX-OS Troubleshooting Guide, Release 9.3(x) – Troubleshooting VLANs, H3C S12500-F系列交换机 Probe命令参考(R100x系列)-6W100, BCM-SDK命令的使用.pdf, bcm cmd, 交换芯片Helix4 L2 L3功能验证, 【交换芯片】硬件调测使用场景下的BMC交换常用命令说明, Edgecore AS5610-52X reverse engineering: Cumulus 2.5 baseline captures.