# Decodificador de tag 802.1Q e calculadora de VLANs em trunk

> Decodifique uma tag 802.1Q ou o início de um frame: TPID, PCP com o tipo de tráfego, DEI e VID com os bits à vista, tags 802.1ad empilhadas e o EtherType que vem depois, com o nome da lista da IANA. Ou cole as linhas de trunk das duas pontas, na sintaxe do Cisco IOS XE, Junos, AOS-CX, RouterOS, Switch Engine, Fabric Engine, Arista EOS ou Huawei VRP, e veja quais VLANs passam, quais uma ponta descarta e onde as VLANs nativas não batem.

- Tool: https://ronutz.com/pt-BR/tools/vlan-tag-and-trunk-calculator
- Family: Redes

---

## O que faz

Uma VLAN (rede local virtual) mantém os frames dela separados dos de todas as outras VLANs, e num link que leva várias delas cada frame diz a que VLAN pertence com uma tag IEEE 802.1Q de quatro octetos. Esta ferramenta responde às duas perguntas que mais aparecem quando um trunk não se comporta, em dois modos:

- **Tag 802.1Q.** Cole em hexadecimal os octetos de uma tag, ou do início de um frame (MAC de destino, MAC de origem e depois as tags). A página mostra o TPID, o PCP, o DEI e o VID de cada tag com os 32 bits desenhados octeto a octeto, o tipo de tráfego do PCP e como ele se traduz nas quatro seleções de PCP, as tags empilhadas (Q-in-Q, 802.1ad) e o EtherType, o comprimento ou nenhum dos dois que vem em seguida, com o nome da lista da IANA.
- **VLANs no trunk.** Cole as linhas da porta trunk das duas pontas de um link, cada uma na sintaxe do seu fabricante: Cisco IOS XE, Juniper Junos, HPE Aruba AOS-CX, MikroTik RouterOS, Extreme Switch Engine, Extreme Fabric Engine, Arista EOS ou Huawei VRP, os oito fabricantes do curso de switches. A página mostra o que cada ponta leva, o que ela manda tagged e untagged e, VLAN a VLAN e nos dois sentidos, se um frame chega na mesma VLAN, cai em outra, é descartado ou depende de um comportamento que as páginas do fabricante lidas não descrevem.

Tudo é calculado no seu navegador.

## A tag: o que é lido

O formato da tag está na cláusula 9 do [IEEE P802.1ad/D2.4](https://www.ieee802.org/1/files/public/docs2004/802-1-ad-D2-4.pdf), o rascunho público do IEEE 802.1 de 2004 que traz o texto do 802.1Q com as emendas. É um rascunho não aprovado, e a edição atual, a 802.1Q-2022, consta como "Active Standard" na [IEEE Standards Association](https://standards.ieee.org/ieee/802.1Q/10323/), mas não é pública; a ferramenta lê o rascunho pelo layout e pelas tabelas que o 802.1Q manteve, e lê junto o [módulo YANG de tipos](https://raw.githubusercontent.com/YangModels/yang/main/standard/ieee/published/802.1/ieee802-dot1q-types.yang) atual do IEEE (revisão de 2023-10-26).

- **TPID**, dois octetos: 0x8100 é a C-TAG, "An 802.1Q Customer VLAN, using the 81-00 EtherType", e 0x88A8 a S-TAG, "An 802.1Q Service VLAN, using the 88-A8 EtherType originally introduced in 802.1ad, and incorporated into 802.1Q (2011)" (YANG de tipos). O 0x9100 também é lido como tag, só porque a [página de bridging da Juniper](https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/topics/topic-map/bridging-and-vlans.html) diz que "Junos OS switches support the TPID value 0x9100 for Q-in-Q"; ele não é um tipo de tag do 802.1Q, a lista da IANA não o nomeia, e a página avisa que lê o TCI dele com o layout do 802.1Q só com base nessa página. Nenhum outro valor é lido como tag.
- **TCI**, dois octetos: o PCP nos três primeiros bits, depois um bit e depois o VID de 12 bits (P802.1ad/D2.4, Figura 9-1). O PCP fica no primeiro octeto, então cada campo de dois octetos é lido com o primeiro octeto como o mais significativo: a ordem big-endian, a ordem de bytes da rede, que o [artigo sobre big-endian e little-endian](https://ronutz.com/pt-BR/learn/big-endian-and-little-endian) explica.
- **PCP**, de 0 a 7. Na seleção default, 8P0D, o PCP *n* é a prioridade *n*; uma porta configurada com 7P1D, 6P2D ou 5P3D lê alguns valores como outra prioridade ou como elegíveis para descarte (Tabela 6-5), e a página mostra as quatro. O tipo de tráfego é o que a Tabela G-2 dá para a prioridade: 1 Background (BK), 0 Best Effort (BE), 2 Excellent Effort (EE), 3 Critical Applications (CA), 4 Video (VI), 5 Voice (VO), 6 Internetwork Control (IC), 7 Network Control (NC). O Background fica no 1 de propósito: "the value 1 effectively communicates a lower priority than 0", o 1 vale menos que o 0 (Anexo G.4). O [guia de QoS do AOS-CX](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.14/HTML/qos_4100i-6000-6100/Content/Chp_Overview/end-to-end-qos-beh.htm) da HPE Aruba traz os mesmos oito hoje.
- **DEI**, um bit. O [modelo de bridge](https://raw.githubusercontent.com/YangModels/yang/main/standard/ieee/published/802.1/ieee802-dot1q-bridge.yang) atual do IEEE o chama de Drop Eligible Indicator: com use-dei em True a porta marca o frame como elegível para descarte; senão, "the DEI shall be transmitted as zero and ignored on receipt", sai zerado e é ignorado ao receber. Na C-TAG de 2004 esse mesmo bit era o CFI, o Canonical Format Indicator (seção 9.6); na S-TAG ele sempre foi o DE (seção 9.7).
- **VID**, de 0 a 4095. A Tabela 9-2 dá significado a três valores: 0 é "The null VLAN ID", uma tag que "contains only priority information"; 1 é "The default PVID value used for classifying frames on ingress"; FFF (4095) é "Reserved for implementation use" e não pode ser "transmitted in a tag header". A faixa vlanid do YANG é de 1 a 4094, e a Juniper também reserva 0 e 4095 ("VLAN ID 0 is reserved for tagging the priority of frames", [802.1Q VLAN IDs](https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/topics/concept/ethernet-802-1q-vlan-id-by-interface-type.html)). Um frame priority-tagged cai no PVID da porta que recebe, "the VLAN-ID assigned to untagged frames or Priority-tagged frames received on this port" ([IEEE8021-Q-BRIDGE-MIB](https://www.ieee802.org/1/files/public/MIBs/IEEE8021-Q-BRIDGE-MIB-202211080000Z.mib)).

**Tags empilhadas.** As tags se repetem até aparecer um tipo que não é TPID (no máximo oito). O provider bridging coloca a S-TAG por fora e a C-TAG do cliente por dentro ("the MSDU of the associated frame can contain a Customer VLAN tag", seção 9.7), então a página avisa quando há uma S-TAG dentro de uma C-TAG, e quando há duas C-TAGs seguidas, o que não é empilhamento 802.1ad e é também o formato do caso de double tagging que o [artigo de VLAN](https://ronutz.com/pt-BR/learn/vlans-and-8021q-trunking) descreve.

**Depois das tags.** [RFC 9542](https://www.rfc-editor.org/rfc/rfc9542.txt) (BCP 141, que substitui a RFC 7042), seção 3: os EtherTypes "are equal to or larger than 0x0600", um comprimento "must ... be less than 0x5DD, or it could be mistaken as an EtherType", e "the LLC encapsulation EtherType 0x8870" pode ocupar o lugar de um comprimento. Por isso 0x0000 a 0x05DC é lido como comprimento (um frame IEEE 802.3 com LLC em seguida), 0x05DD a 0x05FF como nenhum dos dois, e o resto como EtherType, com o nome que a [lista da IANA](https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xml) dá (última atualização em 2024-11-03; quando duas linhas se sobrepõem, vale a mais estreita). A IANA avisa que a lista "is contributed unverified information" e que a IEEE Registration Authority mantém a lista pública; um valor que a IANA não lista aparece como não listado, nunca chutado.

**Endereços.** Quando os octetos começam num MAC de destino, a página mostra os dois endereços com o bit M da RFC 9542 ("If it is a one, the address is groupcast (multicast or broadcast)") e o bit X (local), seção 2.1.1, marca os endereços de documentação da RFC 9542 (00-00-5E-00-53-00 a -FF, 01-00-5E-90-10-00 a -FF, seção 2.1.4) e avisa quando um endereço de origem está com o bit M ligado.

**Onde os octetos começam.** No modo automático, octetos que começam com 0x8100, 0x88A8 ou 0x9100 são lidos como tag, e qualquer outra coisa com 14 octetos ou mais como o início de um frame, e a página diz qual escolheu; as outras duas opções forçam um ou outro (um MAC de destino pode começar com 81-00).

## Trunks: o que as linhas de cada fabricante significam

Cole as linhas da porta trunk como o switch mostra; linhas que não tratam das VLANs do trunk aparecem como não lidas. Uma lista simples como `10,20,30-40` também serve. As regras de cada fabricante vêm da documentação dele, lida em 8 de novembro de 2026:

- **Cisco IOS XE** (Catalyst 9300; [VLAN trunks, 17.18](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/configuration_guide/vlan/b_1718_vlan_9300_cg/configuring_vlan_trunks.html) e a [referência de comandos do 17.18](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/command_reference/b_1718_9300_cr/vlan_commands.html), lidas num navegador porque o site da Cisco recusa leituras automáticas; a [referência de comandos do 17.17](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-17/command_reference/b_1717_9300_cr/vlan_commands.html), lida via WebFetch). `switchport trunk allowed vlan` aceita "all | none | [add | remove | except]vlan-atom [,vlan-atom...]"; all "specifies all VLANs from 1 to 4094. This is the default"; "Do not enter any spaces between comma-separated VLAN parameters or in hyphen-specified ranges", sem espaços na lista; a forma no "resets the list to the default list". `switchport trunk native vlan` define a VLAN nativa "for sending and receiving untagged traffic", "VLAN 1 is the default native VLAN ID on the port", e "If a packet has a VLAN ID that is the same as the sending-port native VLAN ID, the packet is sent without a tag"; a lista de permitidas são as VLANs que "receive and send traffic on this interface in tagged format". As VLANs 1002 a 1005 são "reserved for Token Ring and FDDI VLANs" e o equipamento "does not forward FDDI, FDDI-Net, TrCRF, or TrBRF traffic" ([VLANs, 17.18](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/configuration_guide/vlan/b_1718_vlan_9300_cg/configuring_vlans.html)); a página avisa quando elas estão na lista.
- **Juniper Junos com ELS** ([bridging e VLANs](https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/topics/topic-map/bridging-and-vlans.html); [Ethernet Switching User Guide](https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/multicast-l2.pdf), 23 de setembro de 2026). `vlan members` aceita uma VLAN ou várias entre `[` e `]`, por ID, por faixa (`members 120-130`) ou por nome; linhas `set` seguidas vão somando membros (o próprio exemplo do guia termina em `members [ 1 sales support ]`), e os nomes são resolvidos pelas linhas `set vlans NOME vlan-id N` coladas junto. `native-vlan-id` define a VLAN nativa. Sem ele, um trunk "recognizes untagged control packets, but it does not recognize untagged data packets", e a interface lógica "must be configured with the same VLAN ID as the native VLAN ID", então uma VLAN nativa que não é membro não recebe nada untagged. `members all` é recusado: as páginas lidas não dizem quais VLANs ele representa no ELS.
- **HPE Aruba AOS-CX** (Layer 2 Bridging Guide do 10.16: [vlan trunk allowed](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.16/HTML/l2_bridging_6300-6400/Content/Chp_vlans/vlan_cmds/vla-tru-all.htm), lida via WebFetch e num navegador, [vlan trunk native](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.16/HTML/l2_bridging_6300-6400/Content/Chp_vlans/vlan_cmds/vla-tru-nat.htm) e [vlan trunk native tag](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.16/HTML/l2_bridging_6300-6400/Content/Chp_vlans/vlan_cmds/vla-tru-nat-tag.htm), lidas num navegador porque o site recusa leituras automáticas; os endereços da referência de comandos citados antes para as duas páginas de native agora respondem 404 Not Found). A lista é "a single ID, or a series of IDs separated by commas (2, 3, 4), dashes (2-4), or both (2-4,6)"; all é "all the VLANs currently configured on the switch and any new VLANs that are configured in the future", que a ferramenta conta como 1 a 4094 e avisa. "By default, VLAN ID 1 is assigned as the native VLAN ID", e definir uma VLAN nativa faz o switch rodar `vlan trunk allowed all`, então "To only allow specific VLANs on the trunk, issue the vlan trunk allowed command specifying only specific VLANs" depois dela. Uma lista depois de all substitui o all; uma lista depois de outra lista soma ("Multiple VLAN IDs can be assigned"), que é a leitura que a ferramenta faz das duas páginas. `no vlan trunk allowed` remove VLANs, e quando sai a última o trunk "will trunk all the VLANs currently defined on the switch". Com `vlan trunk native ... tag`, "Incoming packets that are untagged are dropped except for BPDUs" e "Egress packets are tagged". Uma VLAN nativa fora da lista de permitidas não é levada: o próprio exemplo da página de native é "Assigning native VLAN ID 20 to trunk interface 1/1/2 and then removing it from the list of allowed VLANs. (Only allow VLAN 10 on the trunk.)"
- **MikroTik RouterOS** ([manual 7.24, bridge VLAN filtering](https://manual.mikrotik.com/docs/7.24/bridging-and-switching/)). O `vlan-ids` de cada entrada da bridge VLAN table ("vlan-ids=100-115,120,122,128-130") com `tagged=` ou `untagged=` torna a porta membro tagged ou untagged; o `pvid` (default 1) "specifies which VLAN the untagged ingress traffic is assigned to"; com o frame-types no default, admit-all, a porta é "automatically added as untagged" no seu PVID; `frame-types=admit-only-vlan-tagged` na porta aceita só frames tagged. A ferramenta lê cada entrada colada como uma que lista a porta trunk, e avisa quando a porta sai untagged em várias VLANs, o que o RouterOS desaconselha.
- **Extreme Switch Engine** ([referências de comandos 33.7.1](https://documentation.extremenetworks.com/Switch%20Engine%20v33.7.1%20Command%20References/downloads/Switch_Engine_33_7_1_Command_References.pdf)). `configure vlan NOME|ID add ports ... tagged|untagged` ("Default: Untagged."), `delete ports`, e os nomes vindos de `create vlan NOME tag N` (tags de 2 a 4094: "tag 1 is assigned to the default VLAN, and tag 4095 is assigned to the management VLAN"). A VLAN Default "initially contains all ports" e "is untagged on all ports". "Untagged ports can only be a member of a single VLAN", e com `configure vlan untagged-ports auto-move` no default, inform, um add untagged tira a porta da VLAN untagged antiga com um aviso; com o auto-move em off a ferramenta recusa a linha, como o switch faria.
- **Extreme Fabric Engine** ([user guide 9.4](https://documentation.extremenetworks.com/Fabric%20Engine%20v9.4%20User%20Guide/fe_9.4_ug_revacdev/content/documents/Switch_Operating_Systems/VOSS_and_Fabric_Engine/fabric_engine_user_guide/adding_or_removing_ports_in_a_vlan.shtml), [referências de comandos 9.4](https://documentation.extremenetworks.com/Fabric%20Engine%20v9.4%20Command%20References/downloads/Fabric_Engine_9_4_Command_References.pdf)). `vlan members add|remove` aceita um VLAN ID, de 1 a 4059: "the system reserves VLAN IDs 4060 to 4094 for internal use", e também de 3500 a 3998 com os boot flags vrf-scaling e spbm-config-mode. `default-vlan-id` e `untag-port-default-vlan` ("Untags the default VLAN for the port", desligado por default) formam a VLAN nativa.

- **Arista EOS** ([EOS 4.37.0F User Manual, Virtual LANs](https://www.arista.com/en/um-eos/eos-virtual-lans-vlans), lido num navegador porque o site recusa leituras automáticas). No modo trunk, "The interface may be a member of multiple VLANs, as configured by the switchport trunk allowed vlan command" e "Untagged traffic is associated with the interface's native VLAN"; o modo default é access, e a ferramenta lê as linhas coladas como as de uma porta trunk e avisa quando falta o `switchport mode trunk`. `switchport trunk allowed vlan` aceita uma lista ("Valid v_range formats include number, range, or comma-delimited list of numbers and ranges"), `add`, `remove`, `except`, `all` ou `none`; "By default, interfaces handle tagged traffic for all VLANs", e as formas no e default voltam a all. `switchport trunk native vlan` aceita uma VLAN ("The default native VLAN for all interfaces is VLAN 1"), cujos frames saem untagged, a não ser que o egress priority tagging mande "priority tagged Ethernet frames in place of untagged frames"; as formas no e default dele "restore vlan 1 as the trunk mode native VLAN". Com `tag`, a "interface drops all untagged frames"; o manual não diz se os frames da própria VLAN nativa saem tagged nesse caso, então uma VLAN nativa que está na lista de permitidas fica como não confirmada nesse sentido. Uma VLAN nativa fora da lista de permitidas é lida como não levada, e a página diz em que isso se apoia: não numa frase do manual, mas no próprio exemplo da Arista, cuja lista 6-10 mostra "Trunking Native Mode VLAN: 1 (inactive)" onde outros exemplos mostram "1 (default)".
- **Huawei VRP** (S5700 e S6700 V200R025C00: a [referência de comandos, VLAN Configuration Commands](https://support.huawei.com/enterprise/en/doc/EDOC1100514211/834147df/vlan-configuration-commands), e o [guia de configuração de Ethernet Switching, Adding and Removing VLAN Tags](https://support.huawei.com/enterprise/en/doc/EDOC1100514531/f9b8a34a/adding-and-removing-vlan-tags), os dois lidos num navegador porque o site recusa leituras automáticas). `port link-type trunk` faz da porta um trunk (o default é negotiation-desirable, negotiation-auto no S5736-S). `port trunk allow-pass vlan` aceita VLAN IDs separados por espaços, `to` para uma faixa, no máximo dez itens por comando, ou `all` ("Adds a trunk interface to all VLANs"); "If you run the port trunk allow-pass vlan command multiple times in the same interface view, the interface is added to all the specified VLANs", ou seja, as linhas se somam, e a forma undo as remove. "By default, a trunk interface is in VLAN 1." `port trunk pvid vlan` define a VLAN default (default 1; uma linha posterior a substitui, e a forma undo "restores the default VLAN of a trunk interface to the default setting"), mas "does not add the trunk interface to the default VLAN": "A trunk interface forwards frames with the default VLAN ID only after it is added to the default VLAN using the port trunk allow-pass vlan command". A Tabela 4-2 do guia dá o resto: um frame untagged recebe o ID da VLAN default e é transmitido quando essa VLAN é permitida, descartado quando não é; um frame tagged só é aceito quando a VLAN dele é permitida; na saída, os frames da VLAN default saem untagged e as outras VLANs permitidas saem tagged. "If a specified VLAN does not exist, the configuration does not take effect": a ferramenta não vê quais VLANs existem num switch, então conta todas as VLANs que as linhas citam e avisa. `port trunk allow-pass only-vlan` é recusado com o motivo: ele "configures VLANs allowed by the interface that is configured as a trunk interface through LNP negotiation", depois de `port link-type negotiation`, e a ferramenta lê trunks estáticos.

## Trunks: como as duas pontas são comparadas

Para cada VLAN de 1 a 4094 e em cada sentido, a ponta que envia manda a VLAN untagged quando ela é a VLAN nativa (untagged) daquela ponta, tagged quando ela está na lista da ponta, e não manda nos outros casos. Um frame tagged cai na VLAN que a tag indica quando a ponta que recebe leva essa VLAN, e é descartado quando não leva. Um frame untagged cai na VLAN nativa da ponta que recebe, o PVID dela (a definição do MIB do IEEE citada acima): na mesma VLAN quando as duas nativas batem, em outra quando não batem, e em lugar nenhum numa ponta que descarta frames de dados untagged (Junos sem VLAN nativa, AOS-CX com VLAN nativa tagged, Arista com `native vlan tag`, RouterOS aceitando só frames tagged) ou cuja VLAN nativa não é levada (abaixo).

O resultado lista as VLANs que chegam na mesma VLAN nos dois sentidos, as que vão só de A para B ou só de B para A, as que caem em outra VLAN e as não confirmadas, depois uma tabela com as faixas de VLANs de mesmo destino e a leitura de cada ponta, linha por linha.

**VLAN nativa divergente.** Quando as duas pontas colocam frames untagged em VLANs diferentes, a página avisa com o alerta da Cisco: se a VLAN nativa de uma ponta é diferente da outra, "spanning-tree loops might result"; "Make sure the native VLAN for an IEEE 802.1Q trunk is the same on both ends".

**Uma VLAN nativa fora da lista de permitidas.** É a armadilha clássica, e os fabricantes lidos não dizem todos a mesma coisa. No AOS-CX ela não é levada (o exemplo da página de native, acima); no Arista EOS a ferramenta a lê como não levada a partir do exemplo de saída da Arista; no Huawei VRP os frames da VLAN default só são encaminhados "only after it is added to the default VLAN"; no Junos a interface "must be configured with the same VLAN ID as the native VLAN ID". Nessas pontas nada passa untagged, e a página avisa no topo, além de na leitura da ponta.

**Não confirmado, nunca chutado.** No Cisco IOS XE e no Fabric Engine, as páginas lidas não dizem se essa VLAN nativa é levada: a referência de comandos e o guia de VLAN do 17.18 da Cisco, em todas as frases sobre a VLAN nativa, só dizem que a lista vale para o tráfego "in tagged format" e que a VLAN nativa serve para "sending and receiving untagged traffic". A página marca essa VLAN como não confirmada, diz por quê e sugere colocá-la na lista. O mesmo vale para frames untagged que chegam numa porta do Switch Engine sem VLAN untagged, numa porta do Fabric Engine com o untag-port-default-vlan desligado, e para a forma como uma VLAN nativa permitida sai de uma porta Arista com `native vlan tag`. O veredito só fica verde quando toda VLAN enviada passa nos dois sentidos na própria VLAN e não há nenhum aviso.

## O que recusa, e por quê

- **Modo tag**: texto que não é hexadecimal, número ímpar de dígitos, mais de 128 octetos ou 4.000 caracteres, mais de oito tags, uma tag cortada, um início de frame com menos de 14 octetos, octetos forçados a começar num TPID que não é TPID e um início desconhecido.
- **Modo trunk**: VLAN 0 ("The null VLAN ID ... shall not be configured") e 4095 (reservada, Tabela 9-2), IDs acima de 4094 ou com zeros à esquerda, faixas invertidas, itens vazios na lista, espaços dentro de uma lista da Cisco ou do AOS-CX, IDs do Fabric Engine a partir de 4060 e listas nos comandos de uma VLAN só dele, `default-vlan-id 0` (a faixa permite, mas a referência não diz o que significa), opções do Fabric Engine que as páginas não descrevem, nomes de VLAN não resolvidos, uma VLAN do Switch Engine criada sem tag mas adicionada como tagged, tags fora de 2 a 4094, uma VLAN do RouterOS tagged e untagged ao mesmo tempo na porta, uma porta Arista ou Huawei que não é trunk (`switchport mode access`, `port link-type hybrid` e afins), uma lista da Arista com espaços, uma lista da Huawei com vírgulas ou hífens, mais de dez itens ou um `to` sem a segunda VLAN, o `port trunk allow-pass only-vlan` da Huawei (um comando para trunks negociados por LNP), uma ponta sem linha de trunk, uma ponta com mais de 64 linhas, 256 caracteres por linha ou 4.000 caracteres, e um fabricante desconhecido.

## Exemplos resolvidos

Os Exemplos são o lab de VLAN do capítulo 2.3 do curso aberto [LAN Switch Operations and Maintenance](https://ronutz.com/pt-BR/materials/lan-switch-operations-and-maintenance), o bloco MODERN CLI B12: VLAN 10 USERS, 20 VOICE e 99 MGMT tagged no trunk, 999 como VLAN nativa, e os frames usam os endereços de documentação da RFC 9542.

- **Tag**: `00 00 5e 00 53 01 00 00 5e 00 53 02 81 00 a0 14 08 00` é um frame de 00-00-5E-00-53-02 para 00-00-5E-00-53-01 com uma C-TAG de TCI 0xA014: PCP 5 (101, Voice), DEI 0, VID 20, a VLAN VOICE do lab; depois vem o EtherType 0x0800, que a lista da IANA descreve como "Internet Protocol version 4 (IPv4)". Em 7P1D, 6P2D e 5P3D o mesmo PCP 5 vira prioridade 4.
- **Atalhos**: uma S-TAG com VID 100 por fora de uma C-TAG com VID 10, depois IPv6; uma tag de prioridade (VID 0, PCP 5, depois ARP); o VID 4095; o TPID 0x9100 do Junos; e um frame para um endereço de grupo de documentação cujo campo de tipo é 0x002E, um comprimento de 46 octetos.
- **Trunk**: a ponta Cisco do lab (`switchport trunk allowed vlan 10,20,99`, `switchport trunk native vlan 999` e `switchport trunk allowed vlan add 999`) contra a ponta Junos (`vlan members [ USERS VOICE MGMT ]` resolvido para 10, 20 e 99, `native-vlan-id 999` e `vlan members 999`). As VLANs 10, 20 e 99 chegam tagged na mesma VLAN nos dois sentidos, e a 999 untagged.
- **O lab em outros dois fabricantes**: as linhas do Switch Engine (o add untagged da NATIVE999 tira a porta da Default com o aviso do auto-move) contra as do RouterOS: 10, 20, 99 e 999 chegam todas na mesma VLAN nos dois sentidos. O mesmo vale para as linhas da Arista (`switchport trunk native vlan 999` e depois `allowed vlan add 999`) contra as da Huawei (`port trunk pvid vlan 999`, `port trunk allow-pass vlan 999` e `undo port trunk allow-pass vlan 1`).
- **A armadilha, em quatro fabricantes**: dois atalhos mantêm as linhas do lab sem a 999 na lista de permitidas. Cisco contra AOS-CX: 10, 20 e 99 passam, e a 999 fica não confirmada na ponta Cisco e não é levada na ponta AOS-CX. Arista contra Huawei: 10, 20 e 99 passam, e a 999 não passa em nenhum dos dois sentidos: não é levada na ponta Arista (pelo exemplo de saída da Arista) e não é encaminhada na ponta Huawei (o PVID nunca entrou com allow-pass). Os dois vereditos ficam em amarelo.
- **Uma divergência**: uma ponta Cisco com VLAN nativa 1 contra uma ponta AOS-CX com VLAN nativa 10, as duas permitindo 1, 10 e 20: a VLAN 20 passa; os frames untagged da VLAN 1 que saem da Cisco caem na VLAN 10, e os frames untagged da VLAN 10 que saem do AOS-CX caem na VLAN 1.

## O que não faz

Ela lê linhas de configuração, não um switch em operação: supõe que toda VLAN citada existe nos dois switches, que o link está up e é trunk nas duas pontas, e que nada mais (pruning, spanning tree, registro de VLAN com MVRP) tira uma VLAN. Ela não negocia trunking (DTP), não segue uma VLAN por mais de um link, não traduz VLANs nem lê um arquivo de captura inteiro: cole os primeiros octetos de um frame. O [laboratório de trunk](https://ronutz.com/pt-BR/learn/vlans-and-8021q-trunking) do artigo de VLAN acompanha um frame pelo trunk passo a passo.

## Compartilhar resultado

Embaixo do veredito, **Compartilhar resultado** monta um link para esta página, só quando você aperta, que leva depois do `#` os octetos como foram digitados (`input`, e `start` quando não é automático) no modo tag, ou `mode=trunk` com o fabricante e as linhas das duas pontas como foram digitados (`avendor`, `aconfig`, `bvendor`, `bconfig`) no modo trunk. Os campos do outro modo não vão no link. O popover acrescenta um alerta: os octetos de um frame incluem dois endereços MAC, que identificam equipamentos, e as linhas de trunk trazem nomes de interface e de VLAN, que descrevem uma rede privada.

A [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) (seção 3.5, lida em 2026-11-08) diz que o fragmento é "separated from the rest of the URI prior to a dereference", ou seja, esses valores não vão para o servidor quando o link é aberto; eles ficam na barra de endereço e no histórico de quem abre, e qualquer pessoa com o link consegue lê-los.

- **Tamanho.** Um link leva no máximo 16.384 caracteres, o limite que o site usa para todo valor depois do `#`.
- **Abrir um link.** O modo e os campos dele são preenchidos como se tivessem sido digitados (um start ausente vale automático), o outro modo mantém os valores, e a página calcula. Um link com modo, start ou fabricante desconhecido (um fabricante é um dos oito ids listados em API), um campo do outro modo, um campo vazio ou ausente, ou um valor acima dos limites é ignorado. Aceitos ou não, os valores saem do endereço da página na hora, sem nenhuma requisição.

## Procedência

O motor é aritmética de bits, uma consulta a tabela e aritmética de conjuntos, sem relógio, sem rede e sem aleatoriedade. Ele vem com 176 golden vectors (conjunto `vlan-tag-and-trunk-calculator-golden-2026-11-08b`): 71 calculados (33 leituras de tag e 38 comparações de trunk, Exemplos e atalhos incluídos), 46 que fixam as frases que carregam as regras e as faixas da tabela de destinos, 51 recusas e 8 corpos de API. Todo valor esperado calculado foi obtido por uma implementação separada em Python, não rodando este motor: um parser hexadecimal e uma aritmética de bits próprios, uma leitura própria do XML da IANA, as Tabelas 6-5 e G-2 redigitadas por PCP, e um parser próprio por fabricante com conjuntos do Python para a aritmética das VLANs. Uma conferência de cada um dos 1.687 campos dele contra o motor não achou nenhuma diferença.

## API

O mesmo motor responde em `/api/v1/vlan-tag-and-trunk-calculator` na API HTTP do site; o contrato está na [página da API](https://ronutz.com/pt-BR/api), que também diz se este site serve a API.

- **Requisição.** Um objeto JSON. Tag: `{"mode": "tag", "input": "81 00 a0 14 08 00"}`, com `start` (`auto`, `tpid` ou `mac`) opcional. Trunk: `{"mode": "trunk", "a": {"vendor": "cisco-ios-xe", "config": "switchport trunk allowed vlan 10,20"}, "b": {"vendor": "aruba-aos-cx", "config": "vlan trunk allowed 10,20"}}`; os fabricantes são `cisco-ios-xe`, `juniper-junos`, `aruba-aos-cx`, `mikrotik-routeros`, `extreme-switch-engine`, `extreme-fabric-engine`, `arista-eos` e `huawei-vrp`.
- **Resposta, tag.** `mode`, `start`, `startAuto`, `octets`, `hex`, `destination` e `source` (`hex`, `colon`, `group`, `local`, `documentation`, ou null), `tags` (cada uma: `index`, `offset`, `tpid`, `kind`, `name`, `tci`, `bits`, `pcp`, `pcpBits`, `acronym`, `trafficType`, `decodings`, `dei`, `vid`, `vidHex`, `vidBits`, `vidMeaning`, `notes`), `next` (`value`, `number`, `kind`, `name`, `text`, ou null), `after`, `verdict`, `warnings` e `notes`.
- **Resposta, trunk.** `mode`, `a` e `b` (cada uma: `end`, `vendor`, `vendorName`, `allowed`, `allowedCount`, `allowedText`, `tagged`, `taggedText`, `untaggedOut`, `untaggedIn`, `untaggedInVlan`, `native`, `nativeConfirmed`, `allConfigured`, `read`, `notRead`, `warnings`, `notes`), `carried`, `carriedCount`, `carriedText`, `aOnly`, `aOnlyText`, `bOnly`, `bOnlyText`, `crossed`, `crossedText`, `unconfirmed`, `unconfirmedText`, `rows` (cada uma: `from`, `to`, `ab` e `ba` com `as`, `outcome` e `into`), `nativeMismatch`, `verdict`, `warnings` e `notes`. As listas de VLANs vêm como faixas `[menor, maior]` e como texto do tipo `10,20,30-40`.
- **Erros.** HTTP 400, `invalid_input`, com a mensagem do motor em inglês, por exemplo `End B, line 2: port trunk allow-pass only-vlan applies only to an interface negotiated as a trunk: ...`.

## Fontes

- [IEEE P802.1ad/D2.4, Provider Bridges, rascunho não aprovado de emenda ao IEEE Std 802.1Q, 27 de setembro de 2004](https://www.ieee802.org/1/files/public/docs2004/802-1-ad-D2-4.pdf) (lido em 2026-11-08): cláusula 9, Figura 9-1, Tabelas 9-1, 9-2, 6-5 e G-2, Anexo G.4
- [IEEE 802.1, módulo YANG ieee802-dot1q-types, revisão de 2023-10-26](https://raw.githubusercontent.com/YangModels/yang/main/standard/ieee/published/802.1/ieee802-dot1q-types.yang) (lido em 2026-11-08): c-vlan, s-vlan, vlanid, vlan-index-type, priority-type, pcp-selection-type
- [IEEE 802.1, módulo YANG ieee802-dot1q-bridge, revisão de 2023-10-26](https://raw.githubusercontent.com/YangModels/yang/main/standard/ieee/published/802.1/ieee802-dot1q-bridge.yang) (lido em 2026-11-08): pvid, use-dei
- [IEEE 802.1, IEEE8021-Q-BRIDGE-MIB, LAST-UPDATED 2022-11-08](https://www.ieee802.org/1/files/public/MIBs/IEEE8021-Q-BRIDGE-MIB-202211080000Z.mib) (lido em 2026-11-08): ieee8021QBridgePvid
- [IEEE Standards Association, IEEE 802.1Q-2022](https://standards.ieee.org/ieee/802.1Q/10323/) (lido em 2026-11-08): Active Standard
- [RFC 9542, IANA Considerations and IETF Protocol and Documentation Usage for IEEE 802 Parameters, abril de 2024](https://www.rfc-editor.org/rfc/rfc9542.txt) (lida em 2026-11-08): seções 2.1.1, 2.1.4 e 3; BCP 141, substitui a RFC 7042, sem substituição nem atualização ([índice de RFCs](https://www.rfc-editor.org/rfc-index.xml), lido no mesmo dia)
- [IANA, IEEE 802 Numbers, Ethertypes, última atualização em 2024-11-03](https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xml) (lido em 2026-11-08)
- [HPE Aruba Networking, AOS-CX 10.14 Quality of Service Guide, End-to-end QoS behavior](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.14/HTML/qos_4100i-6000-6100/Content/Chp_Overview/end-to-end-qos-beh.htm) (lido em 2026-11-08 via WebFetch)
- [Juniper Networks, Bridging and VLANs](https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/topics/topic-map/bridging-and-vlans.html) e [802.1Q VLAN IDs and Ethernet Interface Types](https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/topics/concept/ethernet-802-1q-vlan-id-by-interface-type.html) (lidos em 2026-11-08)
- [Juniper Networks, Ethernet Switching User Guide, publicado em 2026-09-23](https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/multicast-l2.pdf) (lido em 2026-11-08)
- [Cisco, Catalyst 9300 IOS XE 17.18 VLAN Configuration Guide, Configuring VLAN Trunks](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/configuration_guide/vlan/b_1718_vlan_9300_cg/configuring_vlan_trunks.html) (lido em 2026-11-08 via WebFetch, e de novo num navegador em 2026-11-08: o site recusa leituras automáticas) e [Configuring VLANs](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/configuration_guide/vlan/b_1718_vlan_9300_cg/configuring_vlans.html) (lido em 2026-11-08 via WebFetch), atualizados em 31 de julho de 2025
- [Cisco, Catalyst 9300 IOS XE 17.18 Command Reference, VLAN Commands: switchport trunk](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/command_reference/b_1718_9300_cr/vlan_commands.html) (lido num navegador em 2026-11-08: o site recusa leituras automáticas)
- [Cisco, Catalyst 9300 IOS XE 17.17 Command Reference, VLAN Commands](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-17/command_reference/b_1717_9300_cr/vlan_commands.html) (lido em 2026-11-08 via WebFetch)
- [HPE Aruba Networking, AOS-CX 10.16 Layer 2 Bridging Guide, vlan trunk allowed](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.16/HTML/l2_bridging_6300-6400/Content/Chp_vlans/vlan_cmds/vla-tru-all.htm) (lido em 2026-11-08 via WebFetch, e de novo num navegador em 2026-11-08: o site recusa leituras automáticas)
- [HPE Aruba Networking, AOS-CX 10.16 Layer 2 Bridging Guide, vlan trunk native](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.16/HTML/l2_bridging_6300-6400/Content/Chp_vlans/vlan_cmds/vla-tru-nat.htm) e [vlan trunk native tag](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.16/HTML/l2_bridging_6300-6400/Content/Chp_vlans/vlan_cmds/vla-tru-nat-tag.htm) (lidos num navegador em 2026-11-08: o site recusa leituras automáticas)
- [Arista Networks, EOS 4.37.0F User Manual, Virtual LANs (VLANs)](https://www.arista.com/en/um-eos/eos-virtual-lans-vlans) (lido num navegador em 2026-11-08: o site recusa leituras automáticas)
- [Huawei, S5700 and S6700 V200R025C00 Command Reference, VLAN Configuration Commands](https://support.huawei.com/enterprise/en/doc/EDOC1100514211/834147df/vlan-configuration-commands) (lido num navegador em 2026-11-08: o site recusa leituras automáticas)
- [Huawei, S5700 and S6700 V200R025C00 Configuration Guide - Ethernet Switching, Adding and Removing VLAN Tags](https://support.huawei.com/enterprise/en/doc/EDOC1100514531/f9b8a34a/adding-and-removing-vlan-tags) (lido num navegador em 2026-11-08: o site recusa leituras automáticas): Tabela 4-2
- [MikroTik, RouterOS Manual 7.24, Bridging and Switching](https://manual.mikrotik.com/docs/7.24/bridging-and-switching/) (lido em 2026-11-08)
- [Extreme Networks, Switch Engine v33.7.1 Command References](https://documentation.extremenetworks.com/Switch%20Engine%20v33.7.1%20Command%20References/downloads/Switch_Engine_33_7_1_Command_References.pdf) (lido em 2026-11-08): páginas 1569, 1605, 1608 e 1782
- [Extreme Networks, Fabric Engine v9.4 User Guide, Add or Remove Ports in a VLAN](https://documentation.extremenetworks.com/Fabric%20Engine%20v9.4%20User%20Guide/fe_9.4_ug_revacdev/content/documents/Switch_Operating_Systems/VOSS_and_Fabric_Engine/fabric_engine_user_guide/adding_or_removing_ports_in_a_vlan.shtml) e [Command References](https://documentation.extremenetworks.com/Fabric%20Engine%20v9.4%20Command%20References/downloads/Fabric_Engine_9_4_Command_References.pdf) (lidos em 2026-11-08)
- [RFC 3986, Uniform Resource Identifier (URI): Generic Syntax](https://www.rfc-editor.org/rfc/rfc3986) (lida em 2026-11-08): seção 3.5, o fragmento, que leva os valores de um link de Compartilhar resultado

## Standards and references

- [IEEE P802.1ad/D2.4, Provider Bridges (unapproved draft amendment to IEEE Std 802.1Q, 27 September 2004): clause 9 and Tables 9-1, 9-2, 6-5 and G-2](https://www.ieee802.org/1/files/public/docs2004/802-1-ad-D2-4.pdf) - the tag: TPID then TCI (PCP bits 8 to 6, then CFI in a C-TAG or DE in an S-TAG, then the 12-bit VID); C-TAG 81-00; VID 0 the null VLAN ID, 1 the default PVID, FFF reserved and never transmitted; the PCP decoding under 8P0D, 7P1D, 6P2D and 5P3D; the traffic type of each priority; the S-TAG outside the C-TAG
- [IEEE 802.1, ieee802-dot1q-types YANG module, revision 2023-10-26: c-vlan (81-00), s-vlan (88-A8), vlanid 1..4094, vlan-index-type, priority-type, pcp-selection-type](https://raw.githubusercontent.com/YangModels/yang/main/standard/ieee/published/802.1/ieee802-dot1q-types.yang) - the two tag types and their EtherTypes as 802.1Q has them today; the VLAN ID range; values 0 and 4095 not permitted as VLAN indices; the four PCP selections
- [IEEE 802.1, ieee802-dot1q-bridge YANG module, revision 2023-10-26: pvid (default 1) and use-dei](https://raw.githubusercontent.com/YangModels/yang/main/standard/ieee/published/802.1/ieee802-dot1q-bridge.yang) - the Drop Eligible Indicator in the VLAN tag, used only when use-dei is True and otherwise transmitted as zero and ignored on receipt; the PVID, "the primary (default) VID assigned to a specific Bridge Port", default 1
- [IEEE 802.1, IEEE8021-Q-BRIDGE-MIB (LAST-UPDATED 2022-11-08): ieee8021QBridgePvid](https://www.ieee802.org/1/files/public/MIBs/IEEE8021-Q-BRIDGE-MIB-202211080000Z.mib) - the PVID is "the VLAN-ID assigned to untagged frames or Priority-tagged frames received on this port": the rule by which an untagged frame lands in the receiver's native VLAN
- [IEEE Standards Association, IEEE 802.1Q-2022, Bridges and Bridged Networks: Active Standard](https://standards.ieee.org/ieee/802.1Q/10323/) - 802.1Q-2022 is the current, active edition; its full text is not public, which is why the public draft, YANG and MIB are read
- [RFC 9542, IANA Considerations and IETF Protocol and Documentation Usage for IEEE 802 Parameters, April 2024 (BCP 141; obsoletes RFC 7042): sections 2.1.1, 2.1.4 and 3](https://www.rfc-editor.org/rfc/rfc9542.txt) - the M (group) and X (local) bits; the documentation MAC addresses; EtherTypes 0x0600 and above, lengths below 0x05DD, 0x8870 for LLC encapsulation; tags followed by another tag, an EtherType or an LSAP
- [IANA, IEEE 802 Numbers: Ethertypes (last updated 2024-11-03)](https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xml) - the 216 rows packed in ethertypes.ts, shown as IANA publishes them; IANA's caveat that the list is contributed and unverified and that the IEEE Registration Authority keeps the public list
- [HPE Aruba Networking, AOS-CX 10.14 Quality of Service Guide (4100i, 6000, 6100), End-to-end QoS behavior: CoS and traffic type (read via WebFetch)](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.14/HTML/qos_4100i-6000-6100/Content/Chp_Overview/end-to-end-qos-beh.htm) - the same eight traffic types for CoS 0 to 7 as the draft's Table G-2, and "CoS 1 is deliberately set as the lowest CoS"
- [Juniper Networks, Bridging and VLANs (Junos OS, Layer 2 networking): VLAN IDs, TPIDs, native VLAN on switches with ELS](https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/topics/topic-map/bridging-and-vlans.html) - VLAN IDs 0 and 4095 reserved by Junos; the TPID 0x9100 for Q-in-Q; an ELS trunk does not recognize untagged data packets without native-vlan-id, and the logical interface must be a member of the native VLAN; vlan members by name or ID
- [Juniper Networks, 802.1Q VLAN IDs and Ethernet Interface Types](https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/topics/concept/ethernet-802-1q-vlan-id-by-interface-type.html) - "VLAN ID 0 is reserved for tagging the priority of frames"
- [Juniper Networks, Ethernet Switching User Guide (Junos OS), published 2026-09-23: vlan members ranges and set adding to the members](https://www.juniper.net/documentation/us/en/software/junos/multicast-l2/multicast-l2.pdf) - vlan members 120-130 and members 500-501 (ranges); successive set lines adding to members [ 1 sales support ]
- [Cisco, VLAN Configuration Guide, Cisco IOS XE 17.18.x (Catalyst 9300 Switches), Configuring VLAN Trunks, updated 31 July 2025 (read via WebFetch; read again in a browser on 2026-11-08: the site refuses automated reads)](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/configuration_guide/vlan/b_1718_vlan_9300_cg/configuring_vlan_trunks.html) - all VLANs allowed by default; no spaces in the list; VLAN 1 the default VLAN on all trunk ports, removable, management traffic continues; native VLAN 1 by default, untagged traffic forwarded in it, sent untagged on egress; the mismatch warning; nothing, in any sentence on the native VLAN, about a native VLAN left out of the allowed list
- [Cisco, VLAN Configuration Guide, Cisco IOS XE 17.18.x (Catalyst 9300 Switches), Configuring VLANs, updated 31 July 2025 (read via WebFetch)](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/configuration_guide/vlan/b_1718_vlan_9300_cg/configuring_vlans.html) - VLAN IDs 1002 to 1005 reserved for Token Ring and FDDI VLANs, not forwarded by the device; VLAN 1 the default VLAN
- [Cisco, Command Reference, Cisco IOS XE 17.18.x (Catalyst 9300 Switches), VLAN Commands: switchport trunk (read in a browser on 2026-11-08: the site refuses automated reads)](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-18/command_reference/b_1718_9300_cr/vlan_commands.html) - the allowed list is the VLANs that "receive and send traffic on this interface in tagged format"; the native VLAN is for "sending and receiving untagged traffic"; VLAN 1 the default native VLAN; every VLAN list includes all VLANs by default; a packet of the native VLAN "is sent without a tag"; no sentence on a native VLAN left out of the allowed list
- [Cisco, Command Reference, Cisco IOS XE 17.17.x (Catalyst 9300 Switches), VLAN Commands: switchport trunk (read via WebFetch)](https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9300/software/release/17-17/command_reference/b_1717_9300_cr/vlan_commands.html) - the vlan-list format all | none | [add | remove | except] vlan-atom[,vlan-atom...]; all is 1 to 4094 and the default; the no forms; the native VLAN default 1; the allowed list is for traffic in tagged format
- [HPE Aruba Networking, AOS-CX 10.16 Layer 2 Bridging Guide (6300/6400): vlan trunk allowed (read via WebFetch; read again in a browser on 2026-11-08: the site refuses automated reads)](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.16/HTML/l2_bridging_6300-6400/Content/Chp_vlans/vlan_cmds/vla-tru-all.htm) - the VLAN-LIST format; all meaning every VLAN configured on the switch, now and later; multiple VLAN IDs assigned; the no form removing; the last VLAN removed trunking all VLANs
- [HPE Aruba Networking, AOS-CX 10.16 Layer 2 Bridging Guide (6300/6400): vlan trunk native (read in a browser on 2026-11-08: the site refuses automated reads)](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.16/HTML/l2_bridging_6300-6400/Content/Chp_vlans/vlan_cmds/vla-tru-nat.htm) - native VLAN 1 by default; setting it runs vlan trunk allowed all; a later allowed list keeps only the VLANs it names; the no form returns to VLAN 1; the example "Assigning native VLAN ID 20 to trunk interface 1/1/2 and then removing it from the list of allowed VLANs. (Only allow VLAN 10 on the trunk.)": a native VLAN left out of the allowed list is not carried
- [HPE Aruba Networking, AOS-CX 10.16 Layer 2 Bridging Guide (6300/6400): vlan trunk native tag (read in a browser on 2026-11-08: the site refuses automated reads)](https://arubanetworking.hpe.com/techdocs/AOS-CX/10.16/HTML/l2_bridging_6300-6400/Content/Chp_vlans/vlan_cmds/vla-tru-nat-tag.htm) - untagged incoming packets dropped except BPDUs; egress packets tagged
- [MikroTik, RouterOS Manual 7.24: Bridging and Switching, Bridge VLAN Filtering](https://manual.mikrotik.com/docs/7.24/bridging-and-switching/) - vlan-ids lists (100-115,120); tagged and untagged ports of the bridge VLAN table; pvid 1 by default; frame-types admit-all by default, and a port that admits untagged frames added as untagged for its PVID; VLANs missing from the table dropped; several untagged VLANs on one port warned against
- [Extreme Networks, Switch Engine v33.7.1 Command References: configure vlan add ports (p. 1569), configure vlan tag (p. 1605), configure vlan untagged-ports auto-move (p. 1608), create vlan (p. 1782)](https://documentation.extremenetworks.com/Switch%20Engine%20v33.7.1%20Command%20References/downloads/Switch_Engine_33_7_1_Command_References.pdf) - tagged or untagged ports, untagged by default; one untagged VLAN a port; Default (tag 1) untagged on all ports; tags 2 to 4094 (4095 for the management VLAN); auto-move inform by default
- [Extreme Networks, Fabric Engine v9.4 User Guide: Add or Remove Ports in a VLAN](https://documentation.extremenetworks.com/Fabric%20Engine%20v9.4%20User%20Guide/fe_9.4_ug_revacdev/content/documents/Switch_Operating_Systems/VOSS_and_Fabric_Engine/fabric_engine_user_guide/adding_or_removing_ports_in_a_vlan.shtml) - vlan members add and remove with one VLAN ID, 1 to 4059; 4060 to 4094 reserved for internal use, and 3500 to 3998 with the vrf-scaling and spbm-config-mode boot flags; VLAN 1 the default VLAN
- [Extreme Networks, Fabric Engine v9.4 Command References: default-vlan-id (p. 139), untag-port-default-vlan (p. 345), encapsulation dot1q](https://documentation.extremenetworks.com/Fabric%20Engine%20v9.4%20Command%20References/downloads/Fabric_Engine_9_4_Command_References.pdf) - default-vlan-id 0 to 4059; untag-port-default-vlan untags the default VLAN, disabled by default; encapsulation dot1q enables tagging
- [Arista Networks, EOS 4.37.0F User Manual, Virtual LANs (VLANs): switchport mode, switchport trunk allowed vlan, switchport trunk native vlan (read in a browser on 2026-11-08: the site refuses automated reads)](https://www.arista.com/en/um-eos/eos-virtual-lans-vlans) - trunk mode: "Untagged traffic is associated with the interface's native VLAN"; default mode access; allowed vlan v_range ("number, range, or comma-delimited list of numbers and ranges"), add, all, except, none, remove, all by default ("interfaces handle tagged traffic for all VLANs"), no and default restoring all; native vlan default 1, the no and default forms "restore vlan 1 as the trunk mode native VLAN", native traffic leaving untagged unless egress priority tagging sends "priority tagged Ethernet frames in place of untagged frames"; tag ("tag interface drops all untagged frames"; nothing on the native VLAN's egress then, so an allowed native VLAN is not confirmed); the example output "Trunking Native Mode VLAN: 1 (inactive)" for an allowed list of 6-10, read as not carried
- [Huawei, S5700 and S6700 V200R025C00 Command Reference, VLAN Configuration Commands: port link-type, port trunk allow-pass vlan, port trunk pvid vlan (read in a browser on 2026-11-08: the site refuses automated reads)](https://support.huawei.com/enterprise/en/doc/EDOC1100514211/834147df/vlan-configuration-commands) - port link-type default negotiation-desirable (negotiation-auto on the S5736-S); allow-pass vlan { vlan-id1 [ to vlan-id2 ] }&<1-10> | all ("Adds a trunk interface to all VLANs"), cumulative across lines, the undo form removing; allow-pass only-vlan for a trunk negotiated through LNP only (prerequisite port link-type negotiation); "By default, a trunk interface is in VLAN 1"; a VLAN that does not exist does not take effect (said, not modelled); pvid vlan 1 to 4094, default 1, the latest line winning, the undo form restoring the default, forwarded "only after it is added to the default VLAN using the port trunk allow-pass vlan command"
- [Huawei, S5700 and S6700 V200R025C00 Configuration Guide - Ethernet Switching, VLAN Configuration, Adding and Removing VLAN Tags: Table 4-2 (read in a browser on 2026-11-08: the site refuses automated reads)](https://support.huawei.com/enterprise/en/doc/EDOC1100514531/f9b8a34a/adding-and-removing-vlan-tags) - a trunk port: an untagged frame takes the default VLAN ID and is transmitted when that VLAN is permitted, discarded when it is denied; a tagged frame accepted only when its VLAN is permitted; on egress the default VLAN's frames leave untagged when permitted, other permitted VLANs tagged
- [RFC Editor, RFC index (XML): the current status of RFC 9542 and RFC 7042](https://www.rfc-editor.org/rfc-index.xml) - RFC 9542 (BCP 141) obsoletes RFC 7042 and is neither obsoleted nor updated

## Related reading

- [Bit menos e mais significativo: numeração e ordem dos bits](https://ronutz.com/pt-BR/learn/least-and-most-significant-bit.md): Cada bit de um número binário tem um peso: o bit menos significativo vale 1, e o mais significativo vale mais que todos e, em complemento de dois, carrega o sinal. O que é significância, por que LSB e MSB às vezes querem dizer bytes, as três maneiras como os documentos numeram os bits (LSB 0, MSB 0 e a partir de 1) e o mesmo campo lido das três maneiras, a ordem em que os bits viajam na Ethernet, numa UART, no PPP, no I2C e no SPI, endereços MAC canônicos e com os bits invertidos, máscaras, shifts, paridade e CRCs refletidos, os bugs que uma ordem errada causa, e três casos deste site: o PortState da Huawei impresso com o bit 1 primeiro, os bits I/G e U/L de um endereço MAC, e as flags do header DNS.
- [O frame Ethernet campo a campo: do preâmbulo ao FCS, a tag 802.1Q e os tamanhos que importam](https://ronutz.com/pt-BR/learn/the-ethernet-frame-field-by-field.md): Todo frame Ethernet segue a mesma sequência curta de campos: um preâmbulo que prepara o receptor, dois endereços, um campo que indica um tamanho ou um tipo, o payload e um checksum. O que cada campo leva, por que o mínimo é de 64 octetos e o máximo de 1518, onde fica a tag 802.1Q e o que ela carrega, e por que os jumbo frames não fazem parte do padrão.
- [Redundância de camada 2: LAG, MLAG e spanning tree](https://ronutz.com/pt-BR/learn/layer-2-redundancy-lag-mlag-and-spanning-tree.md): Na camada 2, um link redundante ou é bloqueado pelo spanning tree ou é agrupado pelo link aggregation, e um agrupamento que termina em dois switches precisa de um par que concorde sobre quem ele é. Os números por trás da convergência do STP e do RSTP, as proteções que impedem loops, o link aggregation entre dois chassis na documentação de cinco fabricantes, o empilhamento e o virtual chassis, o DRNI do IEEE e o multihoming EVPN como a resposta padronizada. Depois de ler, você consegue prever como cada desenho falha, calcular os timers de cada um e saber o que testar antes de confiar nele.
- [VLAN hopping: switch spoofing, double tagging e os ajustes de trunk que fecham os dois](https://ronutz.com/pt-BR/learn/vlan-hopping-switch-spoofing-and-double-tagging.md): A fronteira de uma VLAN se apoia em três decisões que o switch toma sobre cada frame: a que VLAN o frame pertence, que portas aceitam tags e que VLAN atravessa um trunk sem tag. O VLAN hopping ataca cada uma delas. Esta parte explica as regras de classificação do IEEE 802.1Q de onde vêm essas decisões, percorre o switch spoofing com a tabela de negociação de trunk e o double tagging com o frame escrito byte a byte em cada switch, passa pela VLAN de voz e pelo bypass com VLAN 0 dos filtros de camada 2, de 2022, e reúne os ajustes que fecham cada caminho, a partir dos guias dos fabricantes, da orientação de hardening da NSA e do checklist da DISA. Ao final, você consegue calcular uma tag à mão, prever se um frame atravessa a fronteira de uma VLAN, dizer por que o double tagging é de mão única e auditar um trunk e uma porta de acesso pelos ajustes que importam.
- [VLANs e trunking 802.1Q: tagged, untagged, VLAN nativa e VLAN de voz](https://ronutz.com/pt-BR/learn/vlans-and-8021q-trunking.md): Uma VLAN divide uma rede de switches em várias redes que não escutam os broadcasts umas das outras, e o 802.1Q é o que permite a um único cabo levar muitas delas ao mesmo tempo. Portas de acesso e portas trunk nos termos do próprio padrão, a VLAN nativa e o mismatch que coloca a rede em loop, os ataques de VLAN hopping e as configurações que os impedem, a VLAN de voz por trás de todo telefone IP de mesa e por que o tráfego entre VLANs sempre precisa de um roteador.
