Pruebas con tags en
port-trunk con VLAN nativa
Fecha: 15 de julio y 17 de agosto del 2021
Escenario
Este laboratorio sale a partir de un comportamiento supuestamente “extraño” en un enlace de fibra (el medio no viene al caso
salvo que es ethernet) con varias VLANs y en el que se termina encontrando que una VLAN en particular en un extremo está
etiquetada (tagueada o tagged) y en el otro no (native/untagged/sin taguear/pvid).
Solucionando el problema y desconociendo el motivo de la mala configuración nos ponemos a estudiar que pasa si recibimos
una VLAN tagueada y en un port que la espera sin taguear.
Escenario inicial:
En el escenario incial tenemos todo sin etiquetar, incluida la cascada entre los switches, que podría estar en modo access pero
no tendría sentido el lab, además de que podrían existir otras VLANs que por simplicidad no mencionamos.
1.- Verificamos conectividad:
C:\>ping 192.168.110.10
Haciendo ping a 192.168.110.10 con 32 bytes de datos:
Respuesta desde 192.168.110.10: bytes=32 tiempo=1ms TTL=255
Respuesta desde 192.168.110.10: bytes=32 tiempo=5ms TTL=255
Respuesta desde 192.168.110.10: bytes=32 tiempo=2ms TTL=255
Respuesta desde 192.168.110.10: bytes=32 tiempo=3ms TTL=255
2.- Pasamos a tagged uno de los extremos:
Switch#conf
t
Enter configuration commands, one per
line. End with CNTL/Z.
Switch(config)#int gi1/0/24
Switch(config-if)#no sw trunk native vlan 110
Switch(config-if)#end
Switch#
Donde en el tag tenemos:
Tag protocol identifier (TPID)
A 16-bit
field set to a value of 0x8100 in
order to identify the frame as an IEEE
802.1Q-tagged frame. This field is located at
the
same position as the EtherType field in untagged frames, and is thus used to
distinguish the frame from untagged frames.
Priority code point (PCP)
A 3-bit field which refers to
the IEEE 802.1p class of service and maps to the frame priority level. Different PCP values can
be used to prioritize different
classes of traffic.
Drop eligible indicator (DEI)
A 1-bit field. (formerly
CFI[b]) May be used separately or in conjunction with PCP to indicate frames
eligible to be dropped in
the presence of congestion.
VLAN identifier (VID)
A 12-bit
field specifying the VLAN to which the frame belongs. The values of 0 and 4095
(0x000 and 0xFFF in hexadecimal)
are
reserved. All other values may be used as VLAN identifiers, allowing up to 4094
VLANs.
3.- Limpiamos tabla de MAC:
Switch#clear
mac address-table dyn
Switch#
4.- Verificamos conectividad:
C:\>ping 192.168.110.10
Haciendo ping a 192.168.110.10 con 32 bytes de datos:
Tiempo de espera agotado para esta solicitud.
Tiempo de espera agotado para esta solicitud.
Tiempo de espera agotado para esta solicitud.
Tiempo de espera agotado para esta solicitud.
5.- Verificamos tabla de MAC:
Switch#sh
mac add dynamic
Mac Address Table
-------------------------------------------
Vlan
Mac Address Type Ports
----
----------- -------- -----
110 0855.313b.aa8d DYNAMIC Gi1/0/1
110 e86a.64dc.e2f5 DYNAMIC Gi1/0/24 (vemos la MAC en la VLAN 110)
Total Mac Addresses for this criterion: 3
Switch#
6.- Entonces analicemos que sucede:
El switch recibe una trama con la VLAN 110 tagged, aunque la espara nativa, no la descarta sino que solo le quita la
etiqueta y la reenvía al port correspondiente al host destino.
El host destino recibe la trama, la acepta y procesa en capas superiores, responde sin etiquetar y el switch al reenviar
por el puerto trunk también lo hará sin etiquetar, el switch destino la recibirá pero la reenviará en la VLAN nativa que
corresponde al trunk, nunca alcanzá el host destino.
Lo mas probable que en el switch encontremos unos mensajes similares a este:
%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN
mismatch discovered on GigabitEthernet0/24 (110),
with Switch-B GigabitEthernet0/24 (1).
También es probable y si tenemos una topología 100% Cisco es que spanning-tree bloquee por inconsistencias de VLAN nativa.
%SPANTREE-SP-2-RECV_PVID_ERR: Received BPDU
with inconsistent peer vlan id 1 on GigabitEthernet0/24 VLAN110
Switch#sh
spanning-tree
---omitido---
Gi0/24 Desg
BKN *4 128.1282
P2p *PVID_Inc
---omitido---
Switch#
Pero si tenemos una topología multi-vendor (diferentes marcas de equipos y por lo tanto diferentes versiones de STP) puede
que estos mensajes y bloqueos no existan.
7.- Pruebas con un equipo 3com:
Veamos con otra marca, este lab sale a partir del comportamiento “raro” de un switch HP/Aruba (ex 3com).
Probamos con un 3com 4800 porque es el que tengo para pruebas y además el set de comandos es similar al A5500.
7.1 Configuramos un port:
[4800G]int gi1/0/24
[4800G-GigabitEthernet1/0/24]port link-type trunk
[4800G-GigabitEthernet1/0/24]port trunk permit vlan 1 110
Please
wait... Done.
[4800G-GigabitEthernet1/0/24]quit
7.2.- Verificamos en la tabla de MAC:
[4800G]disp mac-add
MAC ADDR
VLAN ID STATE PORT INDEX AGING TIME(s)
0855-313b-aa8d 110
Learned
GigabitEthernet1/0/24 AGING
e86a-64dc-e2f5
110 Learned GigabitEthernet1/0/24 AGING
--- 3 mac address(es)
found ---
[4800G]
7.3.- Cambiamos a VLAN nativa:
[4800G-GigabitEthernet1/0/24]port trunk pvid vlan 110 (esto es similar al native vlan de
Cisco)
[4800G-GigabitEthernet1/0/24]
<4800G>
7.4.- Verificamos:
Respuesta desde 192.168.110.1: bytes=32 tiempo=2ms TTL=255
Respuesta desde 192.168.110.1: bytes=32 tiempo=2ms TTL=255
Tiempo de espera agotado para esta solicitud. (aplicamos cambios y deja de responder el host)
Tiempo de espera agotado para esta solicitud.
Por lo tanto el comportamiento en un 3com 4800 es el mismo a un Cisco 2960.
8.- Detalle en un equipo HP 5200AS:
Este es el caso que dio lugar al laboratorio: en un equipo HP A5500 verificamos que:
- si la trama llega sin etiquetar, se devuelve sin etiquetar
- si la trama llega etiquetada en la VLAN 110, se devuelve etiquetada.
8.1.- Verificamos versión:
[HP-A5500]disp version
HP Comware Platform Software
Comware Software, Version 5.20, Release 2208P01
Copyright (c) 2010-2011 Hewlett-Packard
Development Company, L.P.
HP A5500-24G-SFP EI Switch with 2 Interface Slots
uptime is 8 weeks, 1 day, 19 hours, 31 minutes
HP A5500-24G-SFP EI Switch with 2 Interface
Slots with 1 Processor
256M
bytes SDRAM
32768K bytes Flash Memory
Hardware Version is REV.C
CPLD Version is 002
Bootrom Version is 707
[SubSlot 0] 24SFP+8GE Hardware Version is REV.C
[SubSlot 1] 2 CX4 Hardware Version is REV.A
8.2.- Verificamos configuración del port:
[HP-A5500]disp curr int gi1/0/15
#
interface GigabitEthernet1/0/24
port link-mode bridge
port link-type trunk
port trunk permit vlan 1 110
port trunk pvid vlan 110 (native VLAN 110)
#
return
[HP-A5500]
Port link type:
You can
configure the link type of a port as access, trunk, or hybrid. The link types
use the following VLAN tag handling methods:
• An access
port belongs to only one VLAN and sends traffic untagged. It is usually used to
connect a terminal device unable to
identify
VLAN tagged-packets or when separating different VLAN members is unnecessary.
• A trunk port can carry multiple VLANs to
receive and send traffic for them. Except traffic from the port VLAN ID (PVID),
traffic sent
through a
trunk port will be VLAN tagged. Usually, ports that connect network devices are
configured as trunk ports.
• Like a trunk
port, a hybrid port can carry multiple VLANs to receive and send traffic for
them. Unlike a trunk port, a hybrid port allows
traffic of
all VLANs to pass through VLAN untagged. You can configure a port connected to
a user terminal as a hybrid port.
PVID
By default,
VLAN 1 is the PVID for all ports. You can configure the PVID for a port as
required.
When you
configure the PVID on a port, use the following guidelines:
• An access
port can join only one VLAN. The VLAN to which the access port belongs is the
PVID of the port. The PVID of the access
port
changes along with the VLAN to which the port belongs.
• A trunk or
hybrid port can join multiple VLANs. You can configure a PVID for the port.
• You can use
a nonexistent VLAN as the PVID for a hybrid or trunk port but not for an access
port.
After you use
the undo vlan command to remove the VLAN that an access port resides in, the
PVID of the port changes to VLAN 1.
The removal of
the VLAN specified as the PVID of a trunk or hybrid port, however, does not
affect the PVID setting on the port.
When you configure a PVID, follow these guidelines:
• HP
recommends that you set the same PVID ID for local and remote ports.
• Make sure
that a port is assigned to its PVID. Otherwise, when the port receives frames
tagged with the PVID or untagged frames
(including protocol packets such as MSTP BPDUs), the port
filters out these frames.
The following table shows how ports of different link types handle
frames:
Fuente: techlibrary.hpe.com
8.3.- Verificamos configuración en el otro extremo:
SG-350#sh
runn int gi25
interface GigabitEthernet25
description Uplink AS-5500
spanning-tree link-type point-to-point
switchport mode trunk
switchport trunk allowed vlan 1,110
SG-350#
SG-350#sh
vlan
Created by: D-Default, S-Static, G-GVRP,
R-Radius Assigned VLAN, V-Voice VLAN
Vlan
Name Tagged Ports UnTagged Ports Created by
-------------------------------------------------------------------------------------------
1 1 gi1-10,gi14-28, DV
110 Vlan110 gi1,gi13,gi25,27-28 gi26 S (por lo tanto el link al AS5500 es tagged)
SG-350#
8.4.- Buscamos una MAC en la VLAN 110:
SG-350#sh
mac add vlan 110
Flags: I - Internal usage VLAN
Aging time is 300 sec
Vlan Mac Address Port Type
------------ --------------------- ----------
----------
110
00:07:5f:8f:1e:a7 gi26
dynamic (recibe MAC por VLAN 110 untagged)
SG-350#
8.5.- La buscamos en el AS-5500:
[HP-A5500]disp mac-add int gi1/0/15
MAC ADDR
VLAN ID STATE PORT INDEX AGING TIME(s)
0007-5f8f-1ea7 110 Learned GigabitEthernet1/0/15 AGING (recibe MAC por VLAN 110 tagged)
--- 46 mac
address(es) found ---
[HP-A5500]
8.6.- Verificamos a que IP corresponde:
[HP-A5500]disp arp | inc 0007-5f8f-1ea7
Type: S-Static D-Dynamic
IP Address MAC Address VLAN ID Interface Aging Type
10.110.0.47
0007-5f8f-1ea7 110 GE1/0/15 15 D
[HP-A5500]
8.7.- Verificamos conectividad:
[HP-A5500]ping
10.110.0.47
PING
10.110.0.47: 56 data
bytes, press CTRL_C to break
Reply from 10.110.0.47: bytes=56 Sequence=1 ttl=64 time=5 ms (si hay respuesta es porque la trama
Reply from 10.110.0.47: bytes=56 Sequence=2 ttl=64 time=4 ms se transmite tagged por el
port 15)
Reply
from 10.110.0.47: bytes=56 Sequence=3 ttl=64 time=4 ms
[HP-A5500]
9.- Resumen:
Las cascadas en trunk entre switches pueden ser fáciles de configurar y de solucionar, pero un error por mínimo
que sea puede generar un buen rato de troubleshooting.
Otro lab sobre este tema: https://www.vilarrasa.com.ar/native_vlan.htm
(2021) What
tag do you want from me ?
Rosario, Argentina