Native VLAN: Welche Fehler gibt es?

Native VLAN

Attention: For the english version, click here!

Das Native VLAN kann das Netzwerk sicherer und effizienter machen. Gerade um Attacken, wie VLAN Hopping zu vermeiden, ist es auf den Trunk Ports essentiell. Daher empfehle ich zusätzlich auch den Artikel „VLAN Hopping: Was ist das und wie kann ich mich schützen?“ zu lesen Wenn es um die Konfiguration geht solltest du allerdings auch das Konzept dahinter verstehen und vor allem welche Auswirkungen das auf dein Netzwerk haben kann. Wenn du bisher noch nicht so fit im Thema VLANs bist, schaue hier und hier vorbei.

Das Native VLAN und das Default VLAN sind standardmäßig bei einem Cisco-Switch auf VLAN 1. Pakete, die keinen VLAN-Tag besitzen, also untagged sind, werden über VLAN 1 verschickt. Ports, die wiederrum nicht explizit einem anderen VLAN zugewiesen wurden, sind ebenfalls automatisch dem VLAN 1 (default vlan) zugehörig. Das VLAN 1 sollte ausschließlich für die systeminterne Kommunikation verwendet werden. Protokolle, wie Spanning Tree, CDP, etc. nutzen es zum Informationsaustausch zwischen den Netzwerkkomponenten. Mehr soll darüber auch gar nicht geschehen. Daher ist es wichtig ungenutzte Ports mit einem Dummy VLAN zu versehen und auf Trunk Ports ein Native VLAN zu konfigurieren.

Ein kleines Beispiel zum Native VLAN

Zur Vollständigkeit, hier noch ein kleines Beispiel, wie ein Native VLAN konfiguriert wird. Dabei ist Router1 über Port 51 mit Router2 auf Port 52 konfiguriert. Hierbei sehen wir gut, dass beide Seiten des Trunk Ports das Gleiche Native VLAN konfiguriert haben. Dies ist auch zwingend notwendig!

Switch1(config)# vlan 10
Switch1(config-vlan)# name Native-VLAN
Switch1(config-vlan)# exit

Switch1(config)#interface GigabitEthernet1/0/51
Switch1(config-if)#switchport mode trunk
Switch1(config-if)#switchport trunk allowed vlan 100,200,300
Switch1(config-if)#switchport trunk native vlan 10
Switch1(config-if)#no shutdown
Switch2(config)# vlan 10
Switch2(config-vlan)# name Native-VLAN
Switch2(config-vlan)# exit

Switch2(config)#interface GigabitEthernet1/0/52
Switch2(config-if)#switchport mode trunk
Switch2(config-if)#switchport trunk allowed vlan 100,200,300
Switch2(config-if)#switchport trunk native vlan 10
Switch2(config-if)#no shutdown

Fehlermeldungen, durch falsche Konfiguration

Ist das Native VLAN nicht korrekt auf beiden Seiten konfiguriert, kann es zu Fehlern kommen. Diese können ein ganzes Netzwerk lahm legen, daher sollte gewissenhaft dabei vorgegangen werden.

VLAN-Missmatch: Wenn das Native VLAN auf beiden Seiten des Trunk-Ports unterschiedlich konfiguriert ist, kann es zu einem VLAN-Missmatch kommen. Das bedeutet, dass das eine Ende des Trunk-Ports das Paket in einem anderen VLAN sieht, als das andere Ende des Trunk-Ports. Dies kann zu Fehlern in der Netzwerkkommunikation führen kann. Daher lohnt sich ein Blick in die Logs (show logging).

Mar 08 16:25:15.364 UTC: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet1/1 (169), with SW1 GigabitEthernet1/1 (1)

Ungetaggte Pakete werden nicht weitergeleitet: Wenn das Native VLAN nicht auf beiden Seiten des Trunk-Ports konfiguriert ist, werden ungetaggte Pakete, die über den Trunk-Port geschickt werden, nicht weitergeleitet. Das bedeutet, dass Geräte, die keine VLAN-Unterstützung haben, nicht mehr miteinander kommunizieren können. Wenn dies der Fall ist, siehst Du im Log Meldungen, die darauf hinweisen, dass bestimmte Geräte nicht mehr erreichbar sind.

Mar 08 16:25:15.364 UTC: %SPANTREE-2-RECV_PVID_ERR: Received BPDU with inconsistent peer vlan id 1 on GigabitEthernet1/0/13 VLAN100.
Mar 08 16:25:15.364 UTC: %SPANTREE-2-BLOCK_PVID_PEER: Blocking GigabitEthernet1/0/13 on VLAN0001. Inconsistent peer vlan.
Mar 08 16:25:15.364 UTC: %SPANTREE-2-BLOCK_PVID_LOCAL: Blocking GigabitEthernet1/0/13 on VLAN0100. Inconsistent local vlan.

Broadcast-Stürme: Wenn das Native VLAN auf beiden Seiten des Trunk-Ports nicht konfiguriert ist, kann es zu Broadcast-Stürmen kommen. Das bedeutet, dass Broadcast-Pakete im Netzwerk weitergeleitet werden und somit alle Geräte im Netzwerk beeinträchtigen können. Um zu sehen, ob es zu einem Broadcast-Sturm gekommen ist, solltest Du im Log nach Meldungen suchen, die auf eine hohe Netzwerkauslastung hinweisen.

Mar 08 15:59:14.943: %SW_MATM-4-MACFLAP_NOTIF: Host 448a.5b22.4c7d in vlan 2 is flapping between port Gi1/0/51 and port Gi1/0/25
Mar 08 15:59:17.725: %SW_MATM-4-MACFLAP_NOTIF: Host 902b.3478.4da5 in vlan 2 is flapping between port Gi1/0/51 and port Gi1/0/10

Es ist wichtig zu beachten, dass die genauen Fehlermeldungen je nach Gerätetyp und Betriebssystem variieren können. Trotz allem sind das wichtige Anzeichen, dass etwas mit der Konfiguration des Native VLANs im Netzwerk nicht stimmt.


Native VLAN: What are common errors?

The native VLAN can make the network more secure and efficient. Especially to avoid attacks such as VLAN hopping, the native VLAN on trunk ports is essential. Therefore, I also recommend reading the article „VLAN Hopping: What is it and how can I protect myself?“ Additionally, when it comes to configuration, you should also understand the concept behind it and, above all, the impact it can have on your network. If you are not yet familiar with VLANs, take a look here and here.

By default, the native VLAN and the default VLAN on a Cisco switch are set to VLAN 1. Packets without a VLAN tag, i.e., untagged packets, are sent over VLAN 1. Ports that have not been explicitly assigned to another VLAN are also automatically assigned to VLAN 1 (default VLAN). VLAN 1 should only be used for system-internal communication. Protocols such as Spanning Tree, CDP, etc., use it to exchange information between network components. That’s all that should happen with it. Therefore, it’s essential to assign unused ports a dummy VLAN and configure a native VLAN on trunk ports.

A small example

For completeness, here’s a small example of how to configure a native VLAN. Router1 is configured with Router2 via Port 51 and Port 52. We can see that both sides of the trunk port have configured the same native VLAN. This is absolutely necessary!

Switch1(config)# vlan 10
Switch1(config-vlan)# name Native-VLAN
Switch1(config-vlan)# exit

Switch1(config)#interface GigabitEthernet1/0/51
Switch1(config-if)#switchport mode trunk
Switch1(config-if)#switchport trunk allowed vlan 100,200,300
Switch1(config-if)#switchport trunk native vlan 10
Switch1(config-if)#no shutdown
Switch2(config)# vlan 10
Switch2(config-vlan)# name Native-VLAN
Switch2(config-vlan)# exit

Switch2(config)#interface GigabitEthernet1/0/52
Switch2(config-if)#switchport mode trunk
Switch2(config-if)#switchport trunk allowed vlan 100,200,300
Switch2(config-if)#switchport trunk native vlan 10
Switch2(config-if)#no shutdown

Reading the logfile

If the native VLAN is not correctly configured on both sides, errors can occur. These can cripple an entire network, so it’s important to proceed carefully.

VLAN mismatch: If the native VLAN is configured differently on both sides of the trunk port, a VLAN mismatch can occur. This means that one end of the trunk port sees the packet in a different VLAN than the other end of the trunk port. This can lead to errors in network communication. Therefore, it’s worth taking a look at the logs (show logging).

Mar 08 16:25:15.364 UTC: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet1/1 (169), with SW1 GigabitEthernet1/1 (1)

Untagged packets are not forwarded: If the native VLAN is not configured on both sides of the trunk port, untagged packets sent over the trunk port will not be forwarded. This means that devices that do not support VLANs can no longer communicate with each other. If this is the case, you will see log messages indicating that certain devices are no longer reachable.

Mar 08 16:25:15.364 UTC: %SPANTREE-2-RECV_PVID_ERR: Received BPDU with inconsistent peer vlan id 1 on GigabitEthernet1/0/13 VLAN100.
Mar 08 16:25:15.364 UTC: %SPANTREE-2-BLOCK_PVID_PEER: Blocking GigabitEthernet1/0/13 on VLAN0001. Inconsistent peer vlan.
Mar 08 16:25:15.364 UTC: %SPANTREE-2-BLOCK_PVID_LOCAL: Blocking GigabitEthernet1/0/13 on VLAN0100. Inconsistent local vlan.

Broadcast storms: If the native VLAN is not configured on both sides of the trunk port, broadcast storms can occur. This means that broadcast packets are forwarded in the network and can therefore affect all devices on the network. To see if a broadcast storm has occurred, you should look for log messages indicating high network utilization.

Mar 08 15:59:14.943: %SW_MATM-4-MACFLAP_NOTIF: Host 448a.5b22.4c7d in vlan 2 is flapping between port Gi1/0/51 and port Gi1/0/25
Mar 08 15:59:17.725: %SW_MATM-4-MACFLAP_NOTIF: Host 902b.3478.4da5 in vlan 2 is flapping between port Gi1/0/51 and port Gi1/0/10

It’s important to note that the exact error messages may vary depending on the device type and operating system. Nevertheless, these are important indications that something is wrong with the configuration in the network.

Start the discussion

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert