Cisco IOS Internal VLANs
Небольшая заметка о том, что происходит «под капотом» MLS (Multi Layer Switch) Cisco при создании routed интерфейсов.
В MLS интерфейс может находиться в одном из двух режимов:
- «switchport»
- «routed interface» или «no switchport»
При переводе интерфейса в последний, коммутатор позволяет присвоить ip address непосредственно порту и использовать его как интерфейс маршрутизатора.
Однако это всего лишь абстракция. Вот что происходит «под капотом» MLS при переводе интерфейса в режим «no switchport»:
- коммутатор создает VLAN
- коммутатор добавляет интерфейс в этот VLAN в режиме access. Это будет единственный интерфейс, принадлежащий данному VLAN
- коммутатор создает SVI (Switch Virtual Interface) для выбранного VLAN и присваивает указанный ip address данному SVI
Фактически следующие две конфигурации почти идентичны*:
*если у коммутатора больше нет ни одного access интерфейса, принадлежащего VLAN 100, и VLAN 100 не разрешен ни на одном из trunk интерфейсов.
Возьмем в качестве примера коммутатор с минимальной стартовой конфигурацией. Все интерфейсы находятся в режиме switchport и принадлежат VLAN 1:
Переведем интерфейс Ethernet 0/0 в routed режим:
VLAN, который создается при переводе интерфейса в routed режим не виден в обычной БД VLAN:
Но его можно увидеть среди «Internal VLANs»:
Потенциальная проблема такого поведения коммутатора
Поскольку теперь VLAN ID 1006 занят под Internal VLAN для интерфейса Ethernet0/0, не получится создать VLAN с таким же ID, а значит SW1 не сможет коммутировать трафик в этом VLAN:
Однако у этой проблемы есть довольно простое решение:
- нужно выключить L3-интерфейс (shutdown), при этом Internal VLAN ID освободится
- далее создаем VLAN с нужным ID
- включаем L3-интерфейс ( no shutdown), коммутатор займет следующий свободный VLAN ID из Extended диапазона
Как выбирается VLAN ID для L3 интерфейса
В стартовой конфигурации любого коммутатора есть следующая строка:
Это означает, что коммутатор использует первый свободный VLAN ID из Extended диапазона: 1006 — 4094.
Поскольку в нашем примере VLAN ID 1006 занят, а VLAN 1007 используется для L3 интерфейса Ethernet0/0, то если перевести еще один интерфейс в режим routed, коммутатор выделит для него VLAN ID 1008:
Теперь создадим VLAN 1009, и после этого переведем еще один интерфейс в routed режим, поскольку VLAN 1009 занят, коммутатор использует следующий свободный VLAN для L3 интерфейса — 1010:
Некоторые платформы позволяют изменить политику выбора номеров для Internal VLAN, хотя большинство устройств поддерживают только один вариант — ascending:
Что происходит при создании L3 Port-channel
Для каждого member интерфейса выделяется свой Internal VLAN ID, для самого Port-channel интерфейса выделяется еще один Internal VLAN ID:
Если после этого выключить и заново включить Port-channel интерфейс (при этом то же самое происходит и со всеми member интерфейсами), то соответствие интерфейсов и Internal VLAN ID может измениться:
Cisco IOS Internal VLANs
Небольшая заметка о том, что происходит "под капотом" MLS (Multi Layer Switch) Cisco при создании routed интерфейсов.
В MLS интерфейс может находиться в одном из двух режимов:
- "switchport"
- "routed interface" или "no switchport"
При переводе интерфейса в последний, коммутатор позволяет присвоить ip address непосредственно порту и использовать его как интерфейс маршрутизатора.
Однако это всего лишь абстракция. Вот что происходит "под капотом" MLS при переводе интерфейса в режим "no switchport":
- коммутатор создает VLAN
- коммутатор добавляет интерфейс в этот VLAN в режиме access. Это будет единственный интерфейс, принадлежащий данному VLAN
- коммутатор создает SVI (Switch Virtual Interface) для выбранного VLAN и присваивает указанный ip address данному SVI
Фактически следующие две конфигурации почти идентичны*:
*если у коммутатора больше нет ни одного access интерфейса, принадлежащего VLAN 100, и VLAN 100 не разрешен ни на одном из trunk интерфейсов.
Возьмем в качестве примера коммутатор с минимальной стартовой конфигурацией. Все интерфейсы находятся в режиме switchport и принадлежат VLAN 1:
Переведем интерфейс Ethernet 0/0 в routed режим:
VLAN, который создается при переводе интерфейса в routed режим не виден в обычной БД VLAN:
Но его можно увидеть среди "Internal VLANs":
Потенциальная проблема такого поведения коммутатора
Поскольку теперь VLAN ID 1006 занят под Internal VLAN для интерфейса Ethernet0/0, не получится создать VLAN с таким же ID, а значит SW1 не сможет коммутировать трафик в этом VLAN:
Однако у этой проблемы есть довольно простое решение:
- нужно выключить L3-интерфейс (shutdown), при этом Internal VLAN ID освободится
- далее создаем VLAN с нужным ID
- включаем L3-интерфейс ( no shutdown), коммутатор займет следующий свободный VLAN ID из Extended диапазона
Как выбирается VLAN ID для L3 интерфейса
В стартовой конфигурации любого коммутатора есть следующая строка:
Это означает, что коммутатор использует первый свободный VLAN ID из Extended диапазона: 1006 — 4094.
Поскольку в нашем примере VLAN ID 1006 занят, а VLAN 1007 используется для L3 интерфейса Ethernet0/0, то если перевести еще один интерфейс в режим routed, коммутатор выделит для него VLAN ID 1008:
Теперь создадим VLAN 1009, и после этого переведем еще один интерфейс в routed режим, поскольку VLAN 1009 занят, коммутатор использует следующий свободный VLAN для L3 интерфейса — 1010:
Некоторые платформы позволяют изменить политику выбора номеров для Internal VLAN, хотя большинство устройств поддерживают только один вариант — ascending:
Что происходит при создании L3 Port-channel
Для каждого member интерфейса выделяется свой Internal VLAN ID, для самого Port-channel интерфейса выделяется еще один Internal VLAN ID:
Если после этого выключить и заново включить Port-channel интерфейс (при этом то же самое происходит и со всеми member интерфейсами), то соответствие интерфейсов и Internal VLAN ID может измениться:
Cisco ‘vLAN Internal Usage’
While working on a recent Campus LAN refresh solution I came across the issue where I needed to allocate a vLAN that was in a reserved internal range of the switch. The switch was a Catalyst 6880 but I believe the same goes for all ‘recent’ Cisco switches. Essentially the switch will allocate a series of Extended range vLANs for internal for specific functions such as when a routed port is created (‘no switchport’ command) or VRF.
Attempting to allocate a port in this range returns an error
By default, I believe all switches allocate the internal vLANs in an ascending manner from vLAN 1006 upwards but some switches allow this allocation to be reconfigured in a descending manner. I came across this first a few years back on the 7600 platform but it hasn’t raised its head in the following years. The recommendation from Cisco is with an ascending policy to allocate user vLANs as close to 4094 as possible to reduce the likelihood of conflict in the future.
My customer already had vLAN 4015 configured across their old campus LAN Catalyst switching (VSS enabled Catalyst 6500, Sup720-10G, 12.2(33)SXJ3) and due to the migration plan I needed to maintain the use of this vLAN.
The Catalyst 6880 is one such switch that allows the descending policy which is configured using the ‘vlan internal allocation policy’ command.
If you change the allocation policy you’ll need to reload the switch to allow it to re-callocate the vLANID’s.
Use a ‘show vlan’ command to display the vLANs configured on your switch plus those that are reserved such as 1002 to 1005.
the following is a snippet of the output but note that as well as the vLANs you have defined the output also lists the ‘reserved’ vLANs 1002 -1005.
However, what the output doesn’t show is the reserved internal vLANs. For that we have to use the ‘show vlan internal usage’ command
In summary, its best to avoid allocating vLANs in any design incorporating Cisco Catalyst switches within the range 3900-4100 as regardless of the internal policy you are asking for problems.
Vlan internal allocation policy ascending cisco что это
This chapter describes how to configure VLANs in Cisco IOS Software Release 12.2SX..
Understanding VLANs
VLAN Overview
A VLAN is a group of end stations with a common set of requirements, independent of physical location. VLANs have the same attributes as a physical LAN but allow you to group end stations even if they are not located physically on the same LAN segment.
VLANs are usually associated with IP subnetworks. For example, all the end stations in a particular IP subnet belong to the same VLAN. Traffic between VLANs must be routed. LAN port VLAN membership is assigned manually on an port-by-port basis.
VLAN Ranges
Note You must enable the extended system ID to use 4096 VLANs (see the "Understanding the Bridge ID" section on page 22-2).
Cisco IOS Software Release 12.2SX supports 4096 VLANs in accordance with the IEEE 802.1Q standard. These VLANs are organized into several ranges; you use each range slightly differently. Some of these VLANs are propagated to other switches in the network when you use the VLAN Trunking Protocol (VTP). The extended-range VLANs are not propagated, so you must configure extended-range VLANs manually on each network device.
Table 17-1 describes the VLAN ranges.
The following information applies to VLAN ranges:
•Layer 3 LAN ports, WAN interfaces and subinterfaces, and some software features use internal VLANs in the extended range. You cannot use an extended range VLAN that has been allocated for internal use.
•To display the VLANs used internally, enter the show vlan internal usage command. With earlier releases, enter the show vlan internal usage and show cwan vlans commands.
•You can configure ascending internal VLAN allocation (from 1006 and up) or descending internal VLAN allocation (from 4094 and down).
•You must enable the extended system ID to use extended range VLANs (see the "Understanding the Bridge ID" section on page 21-2).
Configurable VLAN Parameters
Note•Ethernet VLAN 1 uses only default values.
•Except for the VLAN name, Ethernet VLANs 1006 through 4094 use only default values.
•You can configure the VLAN name for Ethernet VLANs 1006 through 4094.
You can configure the following parameters for VLANs 2 through 1001:
•VLAN name
•VLAN type (Ethernet, FDDI, FDDI network entity title [NET], TrBRF, or TrCRF)
•VLAN state (active or suspended)
•Security Association Identifier (SAID)
•Bridge identification number for TrBRF VLANs
•Ring number for FDDI and TrCRF VLANs
•Parent VLAN number for TrCRF VLANs
•Spanning Tree Protocol (STP) type for TrCRF VLANs
Understanding Token Ring VLANs
The following section describes the two Token Ring VLAN types supported on network devices running VTP version 2:
•Token Ring TrBRF VLANs
•Token Ring TrCRF VLANs
Note Cisco IOS Software Release 12.2SX does not support Inter-Switch Link (ISL)-encapsulated Token Ring frames. In VTP server mode, you can configure Token Ring VLANs from the switch.
Token Ring TrBRF VLANs
Token Ring Bridge Relay Function (TrBRF) VLANs interconnect multiple Token Ring Concentrator Relay Function (TrCRF) VLANs in a switched Token Ring network (see Figure 17-1). The TrBRF can be extended across a network devices interconnected via trunk links. The connection between the TrCRF and the TrBRF is referred to as a logical port.
Figure 17-1 Interconnected Token Ring TrBRF and TrCRF VLANs
For source routing, the switch appears as a single bridge between the logical rings. The TrBRF can function as a source-route bridge (SRB) or a source-route transparent (SRT) bridge running either the IBM or IEEE STP. If an SRB is used, you can define duplicate MAC addresses on different logical rings.
The Token Ring software runs an instance of STP for each TrBRF VLAN and each TrCRF VLAN. For TrCRF VLANs, STP removes loops in the logical ring. For TrBRF VLANs, STP interacts with external bridges to remove loops from the bridge topology, similar to STP operation on Ethernet VLANs.
To accommodate IBM System Network Architecture (SNA) traffic, you can use a combination of SRT and SRB modes. In a mixed mode, the TrBRF determines that some ports (logical ports connected to TrCRFs) operate in SRB mode while other ports operate in SRT mode
Token Ring TrCRF VLANs
Token Ring Concentrator Relay Function (TrCRF) VLANs define port groups with the same logical ring number. You can configure two types of TrCRFs in your network: undistributed and backup.
TrCRFs typically are undistributed, which means each TrCRF is limited to the ports on a single network device. Multiple undistributed TrCRFs on the same or separate network devices can be associated with a single parent TrBRF (see Figure 17-2). The parent TrBRF acts as a multiport bridge, forwarding traffic between the undistributed TrCRFs.
Note To pass data between rings located on separate network devices, you can associate the rings to the same TrBRF and configure the TrBRF for an SRB.
Figure 17-2 Undistributed TrCRFs

By default, Token Ring ports are associated with the default TrCRF (VLAN 1003, trcrf-default), which has the default TrBRF (VLAN 1005, trbrf-default) as its parent. In this configuration, a distributed TrCRF is possible (see Figure 17-3), and traffic is passed between the default TrCRFs located on separate network devices if the network devices are connected through an ISL trunk.
Figure 17-3 Distributed TrCRF

Within a TrCRF, source-route switching forwards frames based on either MAC addresses or route descriptors. The entire VLAN can operate as a single ring, with frames switched between ports within a single TrCRF.
You can specify the maximum hop count for All-Routes and Spanning Tree Explorer frames for each TrCRF. When you specify the maximum hop count, you limit the maximum number of hops an explorer is allowed to traverse. If a port determines that the explorer frame it is receiving has traversed more than the number of hops specified, it does not forward the frame. The TrCRF determines the number of hops an explorer has traversed by the number of bridge hops in the route information field.
If the ISL connection between network devices fails, you can use a backup TrCRF to configure an alternate route for traffic between undistributed TrCRFs. Only one backup TrCRF for a TrBRF is allowed, and only one port per network device can belong to a backup TrCRF.
If the ISL connection between the network devices fails, the port in the backup TrCRF on each affected network device automatically becomes active, rerouting traffic between the undistributed TrCRFs through the backup TrCRF. When the ISL connection is reestablished, all but one port in the backup TrCRF is disabled. Figure 17-4 illustrates the backup TrCRF.
Figure 17-4 Backup TrCRF

VLAN Default Configuration
Tables 17-2 through 17-6 show the default configurations for the different VLAN media types.
VLAN Configuration Guidelines and Restrictions
When creating and modifying VLANs in your network, follow these guidelines and restrictions:
•Supervisor engine redundancy does not support nondefault VLAN data file names or locations. Do not enter the vtp file file_name command on a switch that has a redundant supervisor engine.
•Before installing a redundant supervisor engine, enter the no vtp file command to return to the default configuration.
•RPR+ redundancy (see Chapter 6, "Configuring RPR Supervisor Engine Redundancy") does not support a configuration entered in VLAN database mode. Use global configuration mode with RPR+ redundancy.
•You can configure extended-range VLANs only in global configuration mode. You cannot configure extended-range VLANs in VLAN database mode. See the «VLAN Configuration Options» section.
•Before you can create a VLAN, the switch must be in VTP server mode or VTP transparent mode. For information on configuring VTP, see Chapter 16, "Configuring VTP."
•The VLAN configuration is stored in the vlan.dat file, which is stored in nonvolatile memory. You can cause inconsistency in the VLAN database if you manually delete the vlan.dat file. If you want to modify the VLAN configuration or VTP, use the commands described in this guide and in the Cisco IOS Software Releases 12.2SX Command References publication.
•To do a complete backup of your configuration, include the vlan.dat file in the backup.
•The Cisco IOS end command is not supported in VLAN database mode.
•You cannot enter Ctrl-Z to exit VLAN database mode.
•Cisco IOS Software Release 12.2SX does not support Token Ring or FDDI media. The switch does not forward FDDI, FDDI-Net, TrCRF, or TrBRF traffic, but it can propagate the VLAN configuration through VTP.
•In VTP server mode, you can configure FDDI and Token Ring VLANs from the switch.
•You must configure a TrBRF before you configure the TrCRF (the parent TrBRF VLAN you specify must exist).
•In a Token Ring environment, the logical interfaces (the connection between the TrBRF and the TrCRF) of the TrBRF are placed in a blocked state if either of these conditions exists:
–The TrBRF is running the IBM STP, and the TrCRF is in SRT mode.
–The TrBRF is running the IEEE STP, and the TrCRF is in SRB mode.
Configuring VLANs
Note VLANs support a number of parameters that are not discussed in detail in this section. For complete information, see the Cisco IOS Software Releases 12.2SX Command References publication.
VLAN Configuration Options
VLAN Configuration in Global Configuration Mode
If the switch is in VTP server or transparent mode (see the "Configuring VTP" section on page 16-6), you can configure VLANs in global and config-vlan configuration modes. When you configure VLANs in global and config-vlan configuration modes, the VLAN configuration is saved in the vlan.dat files. To display the VLAN configuration, enter the show vlan command.
If the switch is in VLAN transparent mode, use the copy running-config startup-config command to save the VLAN configuration to the startup-config file. After you save the running configuration as the startup configuration, use the show running-config and show startup-config commands to display the VLAN configuration.
Note•When the switch boots, if the VTP domain name and the VTP mode in the startup-config file and vlan.dat files do not match, the switch uses the configuration in the vlan.dat file.
•You can configure extended-range VLANs only in global configuration mode. You cannot configure extended-range VLANs in VLAN database mode.
VLAN Configuration in VLAN Database Mode
Note You cannot configure extended-range VLANs in VLAN database mode. You can configure extended-range VLANs only in global configuration mode. RPR+ redundancy does not support configuration entered in VLAN database mode. Use global configuration mode with RPR+ redundancy.
If the switch is in VTP server or transparent mode, you can configure VLANs in the VLAN database mode. When you configure VLANs in VLAN database mode, the VLAN configuration is saved in the vlan.dat files. To display the VLAN configuration, enter the show vlan command.
You use the interface configuration command mode to define the port membership mode and add and remove ports from a VLAN. The results of these commands are written to the running-config file, and you can display the file by entering the show running-config command.
VLAN Locking
Release 12.2(33)SXH and later releases support the VLAN locking feature, which provides an extra level of verification to ensure that you have configured the intended VLAN.
When VLAN locking is enabled, you need to specify the VLAN name when you change a port from one VLAN to another. This feature affects switchport commands (in interface configuration mode) that specify the VLANs or private VLANs for access and trunk ports.
For additional information about how to configure access and trunk ports with VLAN locking enabled, see the "Configuring LAN Interfaces for Layer 2 Switching" section on page 13-6.
For additional information about how to configure ports in private VLANs with VLAN locking enabled, see the "Configuring Private VLANs" section on page 18-11.
By default, the VLAN locking is disabled. To enable VLAN locking, perform this task:
Creating or Modifying an Ethernet VLAN
User-configured VLANs have unique IDs from 1 to 4094, except for reserved VLANs (see Table 17-1). Enter the vlan command with an unused ID to create a VLAN. Enter the vlan command for an existing VLAN to modify the VLAN (you cannot modify an existing VLAN that is being used by a Layer 3 port or a software feature).
See the «VLAN Default Configuration» section for the list of default parameters that are assigned when you create a VLAN. If you do not specify the VLAN type with the media keyword, the VLAN is an Ethernet VLAN.
To create or modify a VLAN, perform this task:
When you create or modify an Ethernet VLAN, note the following information:
•RPR+ redundancy does not support a configuration entered in VLAN database mode. Use global configuration mode with RPR+ redundancy.
•Because Layer 3 ports and some software features require internal VLANs allocated from 1006 and up, configure extended-range VLANs starting with 4094.
•You can configure extended-range VLANs only in global configuration mode. You cannot configure extended-range VLANs in VLAN database mode.
•Layer 3 ports and some software features use extended-range VLANs. If the VLAN you are trying to create or modify is being used by a Layer 3 port or a software feature, the switch displays a message and does not modify the VLAN configuration.
When deleting VLANs, note the following information:
•You cannot delete the default VLANs for the different media types: Ethernet VLAN 1 and FDDI or Token Ring VLANs 1002 to 1005.
•When you delete a VLAN, any LAN ports configured as access ports assigned to that VLAN become inactive. The ports remain associated with the VLAN (and inactive) until you assign them to a new VLAN.
This example shows how to create an Ethernet VLAN in global configuration mode and verify the configuration: