本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
檢視VLAN資訊
本檔案將說明Catalyst交換器如何維護特別計畫中的VLAN資訊, vlan.dat
檔案。
思科建議您瞭解以下主題:
Cisco Catalyst 交換器
本文中的資訊係根據以下軟體和硬體版本:
運行Cisco IOS®軟體版本12.1(26)E1的Cisco Catalyst 6500交換機
運行Cisco IOS軟體版本12.1(22)EA9的Cisco Catalyst 2950交換機
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
本文件也適用於以下硬體和軟體版本:
執行Cisco IOS的Cisco Catalyst 6000、4500、4000系列交換器。
Cisco Catalyst 3750、3750E、3560、3560E、3550、2970、2960、2955、2950和2940系列交換器。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
執行Cisco IOS軟體版本的Cisco Catalyst交換器會將VLAN資訊保留在一個名為vlan.dat 的特殊檔案中。 本檔案將討論此檔案的用途以及管理檔案的方式。
CatOS中的VLAN或VTP配置更改會在更改後立即寫入NVRAM。相反,除非您發出copy run start命令,否則Cisco IOS軟體不會將配置更改儲存到NVRAM。
VTP客戶端和伺服器系統要求將來自其他VTP伺服器的VTP更新立即儲存到NVRAM中,無需使用者干預。預設的CatOS操作滿足VTP更新要求,但Cisco IOS軟體更新模型需要替代的更新操作。為此,在Catalyst交換機的Cisco IOS軟體中引入了VLAN資料庫,作為立即儲存VTP客戶端和伺服器的VTP更新的方法。此VLAN資料庫是NVRAM中名為vlan.dat檔的單獨檔案。
啟動期間,交換器會比較vlan.dat檔案中的內容和startup-config中的組態,判斷是否必須使用vlan.dat或startup-config中的組態。在交換機啟動配置檔案中儲存VTP模式、域名和VLAN配置並重新啟動交換機時,VTP和VLAN配置會按照以下條件進行選擇:
如果VLAN資料庫和配置檔案將VTP模式顯示為透明,並且VTP域名匹配,則忽略VLAN資料庫。使用啟動配置檔案中的VTP和VLAN配置。VLAN資料庫修訂版號在VLAN資料庫中保持不變。
如果啟動VTP模式是伺服器模式,或者啟動VTP模式或域名與VLAN資料庫不匹配,則系統會根據VLAN資料庫資訊(如vlan.dat檔案)選擇前1005個VLAN的VTP模式和VLAN配置。從交換機配置檔案配置大於1005的VLAN。
如果沒有vlan.dat檔,或無法讀取vlan.dat,交換器會使用以下特徵啟動:
屬性 | 預設值 |
---|---|
VTP模式 | 伺服器 |
VTP域名 | (無名稱/空) |
VLAN | 1,1002-1005 |
預設情況下,VLAN資料庫檔名是 vlan.dat
.
您可以使用 vtp file
命令重新命名檔案。您不能使用 vtp file
命令載入新資料庫。您只能使用它來重新命名儲存現有資料庫的檔案。
此示例說明如何指定儲存VTP配置的IFS檔案系統檔案:
Switch(config)#vtp file vtpconfig
Setting device to store VLAN database at filename vtpconfig.
Switch(config)#
交換器可以存取單獨儲存在NVRAM中的vlan.dat。可從其位置複製vlan.dat檔案以進行備份。儲存vlan.dat檔案的記憶體位置名稱因裝置而異。在您發出SWIFT產品指南之前,請先參閱相應的產品文檔 copy
指令。
在Cisco Catalyst 6500/6000系列交換機中, const_nvram:
.與Catalyst 4500/4000交換器類似, cat4000_flash:
. 在Cisco Catalyst 29xx系列和Cisco Catalyst 35xx、3750系列中,它稱為flash:。
Cat6K-Cisco IOS#dir const_nvram:
Directory of const_nvram:/ 1 -rwx 856 <no date> vlan.dat 129004 bytes total (128148 bytes free)
為了顯示儲存在二進位制vlan.dat檔案中的所有VLAN配置、VLAN ID、名稱等,您必須發出 show vlan
指令。
可以使用 show vtp status
指令。
VLAN資訊和VTP資訊不顯示在 show running-config
命令輸出,當交換機處於VTP伺服器/客戶端模式時。這是交換器的正常行為。
Switch#show run | include vlan vlan internal allocation policy ascending Switch# Switch#show run | include vtp Switch#
處於VTP透明模式的交換機顯示VLAN和VTP配置 show running-config
命令輸出,因為此資訊也儲存在配置文本檔案中。
Switch#show run | include vlan vlan internal allocation policy ascending vlan 1 tb-vlan1 1002 tb-vlan2 1003 vlan 20-21,50-51 vlan 1002 tb-vlan1 1 tb-vlan2 1003 vlan 1003 tb-vlan1 1 tb-vlan2 1002 vlan 1004 vlan 1005 Switch#show run | include vtp vtp domain cisco vtp mode transparent
完成以下步驟即可重設執行Cisco IOS軟體的Cisco Catalyst交換器上的VLAN組態。
在以下示例中,Cisco Catalyst 6500交換機處於VTP客戶端模式。若要重設VLAN資訊,您必須移除vlan.dat檔,然後重新載入交換器。
發出 show vtp status
和 show vlan
命令來確定原始VTP/VLAN資訊。
Cat6K-IOS#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 1005 Number of existing VLANs : 12 VTP Operating Mode : Client VTP Domain Name : Cisco123 VTP Pruning Mode : Enabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0xDF 0xCE 0x47 0x0B 0xD0 0x3F 0xEA 0x18 Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00 Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface found) Cat6K-IOS#
Cat6K-IOS#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa3/11, Fa3/16 5 VLAN0005 active Fa3/1 10 VLAN0010 active Fa3/5 20 Management_Vlan active Fa3/7, Fa3/9, Fa3/24 30 SW-3_PCs_Vlan active 40 SW-1_PCs_Vlan active 50 IP_Phone_Voice_Vlan active 60 Guest_Fail_Vlan active 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 5 enet 100005 1500 - - - - - 0 0 10 enet 100010 1500 - - - - - 0 0 !--- Rest of the output elided.
確認vlan.dat檔案的狀態。
Cat6K-IOS#dir const_nvram: Directory of const_nvram:/ 1 -rw- 976 <no date> vlan.dat 129004 bytes total (128028 bytes free) Cat6K-IOS#
備註:記憶體中的 vlan.dat 檔案儲存位置會依裝置而有所不同。有關詳細資訊,請參閱本文檔中的檔名和位置部分。
從NVRAM中刪除vlan.dat檔案。
註:從NVRAM中刪除檔案之前,建議備份該檔案。如需程式,請參閱VLAN.dat檔的備份和還原一節。
Cat6K-IOS#delete const_nvram:vlan.dat
Delete filename [vlan.dat]?
Delete const_nvram:vlan.dat? [confirm]
Cat6K-IOS#dir const_nvram:
Directory of const_nvram:/
1 -rw- 0 <no date> vlan.dat
129004 bytes total (129004 bytes free)
Cat6K-IOS#
請注意,vlan.dat檔案的大小為零(0)。
重新載入交換器。
Cat6K-IOS#reload Proceed with reload? [confirm] !--- Rest of the output no displayed.
交換器啟動後,確認VLAN資訊是否設為預設值。有關預設值的詳細資訊,請參閱交換機啟動期間部分中的表。
Cat6K-IOS#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 1005 Number of existing VLANs : 5 VTP Operating Mode : Server VTP Domain Name : VTP Pruning Mode : Disabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0x57 0xCD 0x40 0x65 0x63 0x59 0x47 0xBD Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00 Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface found)
Cat6K-IOS#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa3/11, Fa3/16 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs ------------------------------------------------------------------------------ Primary Secondary Type Ports ------- --------- ----------------- ------------------------------------------ Cat6K-IOS#
Cat6K-IOS#dir const_nvram: Directory of const_nvram:/ 1 -rw- 0 <no date> vlan.dat 129004 bytes total (129004 bytes free) Cat6K-IOS#
此時,可以通過兩種方式觸發VTP VLAN配置更改:
裝置上的使用者配置(CLI/SNMP)
來自同一VTP域中其他裝置的VTP更新
這意味著即使交換機最初處於客戶端模式,僅應用另一個儲存的配置不會將其設定回客戶端模式。為了將交換機返回到客戶端模式,網路管理員需要在全域性配置模式下使用vtp mode client命令手動配置系統。
如果不慎刪除了 vlan.dat 檔案而交換器重新載入,則交換器上原本可用的 VLAN 會全部遺失。VLAN 資訊會存在於交換器中,直到交換器重新載入為止。
完成以下步驟以復原 vlan.dat 檔案:
發出 show vlan 命令以確認 VLAN 資訊的可用性。
Switch#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4 Fa0/5, Fa0/6, Fa0/7, Fa0/8 Fa0/10, Fa0/11, Fa0/12, Gi0/1 Gi0/2 10 VLAN0010 active 11 VLAN0011 active 20 VLAN0020 active 21 VLAN0021 active 30 VLAN0030 active 31 VLAN0031 active 40 VLAN0040 active 41 VLAN0041 active 50 Vlan50 active 100 100thVLAN active
如果交換器位於VTP 伺服器或處於透明模式,請對 VLAN 資料庫進行任何修改。
對於 VLAN 資料庫的修改可為以下任何一種:
建立任何 VLAN。
刪除任何 VLAN。
修改任何現有VLAN的屬性。
如果交換器處於 VTP 用戶端模式,請在任何相同網域的 VTP 伺服器對 VLAN 資料庫進行修改。
Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 50 Switch(config-vlan)#name 50thVLAN Switch(config-vlan)#end Switch#
對VLAN資料庫進行任何更改後,交換機將自動建立vlan.dat檔案。
發出 show flash: 命令,以驗證是否已建立 vlan.dat 檔案。
Switch#show flash: Directory of flash:/ 2 -rwx 5 Mar 01 1993 00:04:47 private-config.text 3 -rwx 2980487 Mar 02 1993 06:08:14 c2950-i6q4l2-mz.121-19.EA1a.bin 4 -rwx 1156 Mar 01 1993 01:51:27 vlan.dat 16 -rwx 1014 Mar 01 1993 00:04:47 config.text 6 drwx 4096 Mar 02 1993 03:49:26 html 7 -rwx 3121383 Mar 02 1993 03:47:52 c2950-i6q4l2-mz.121-22.EA9.bin 7741440 bytes total (65536 bytes free)
備註:記憶體中的 vlan.dat 檔案儲存位置會依裝置而有所不同。有關更多資訊,請參見檔名和位置部分。
要備份vlan.dat檔案的網路管理員,特別是對於VTP伺服器系統。其 vlan.dat
可以備份檔案到與任何其他檔案相同的位置(bootflash、disk0:、bootdisk:、tftp:、ftp:等)。雖然檔案可以複製到任何位置,但只能從NVRAM中讀取。
若要對組態執行完整備份,請將vlan.dat檔與組態一起包含在備份中。接下來,如果整個交換器或Supervisor Engine模組都需要更換,則網路管理員必須上傳以下兩個檔案才能還原完整的組態:
其 vlan.dat
檔案
組態檔
這也對運行狀態切換(SSO)時的雙Supervisor環境產生影響。由於檔案與檔案的同步僅可用於NVRAM,因此,如果vlan.dat位於非NVRAM位置(例如bootflash:),則主用和備用管理引擎之間不能進行vlan.dat檔案同步。相反,當備用SP收到新的VLAN資料時,它可以將配置寫入備用vlan.dat。
最後,如果儲存的vlan.dat應用於已引導的系統,則必須在新應用的vlan.dat配置生效之前重新載入系統。
發出show vtp status和show vlan 命令以確定原始VTP/VLAN資訊。
Cat6K-IOS#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 1005 Number of existing VLANs : 12 VTP Operating Mode : Client VTP Domain Name : Cisco123 VTP Pruning Mode : Enabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0xDF 0xCE 0x47 0x0B 0xD0 0x3F 0xEA 0x18 Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00 Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface found) Cat6K-IOS# Cat6K-IOS#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa3/11, Fa3/16 5 VLAN0005 active Fa3/1 10 VLAN0010 active Fa3/5 20 Management_Vlan active Fa3/7, Fa3/9, Fa3/24 30 SW-3_PCs_Vlan active 40 SW-1_PCs_Vlan active 50 IP_Phone_Voice_Vlan active 60 Guest_Fail_Vlan active 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 5 enet 100005 1500 - - - - - 0 0 10 enet 100010 1500 - - - - - 0 0 !--- Rest of the output elided.
確認vlan.dat檔案的狀態。
Cat6K-IOS#dir const_nvram: Directory of const_nvram:/ 1 -rw- 976 <no date> vlan.dat 129004 bytes total (128028 bytes free) Cat6K-IOS#
備註:記憶體中的 vlan.dat 檔案儲存位置會依裝置而有所不同。有關更多資訊,請參見檔名和位置部分。
備份現有的vlan.dat檔案。
Cat6K-IOS#copy const_nvram:vlan.dat bootflash:vlan.dat Destination filename [vlan.dat]? 976 bytes copied in 0.516 secs (1891 bytes/sec) Cat6K-IOS#show bootflash: -#- ED ----type---- --crc--- -seek-- nlen -length- ---------date/time--------- n ame 1 .. image C32839CA 2349AC 30 1788204 May 31 2006 18:15:50 +00:00 c 6msfc2-boot-mz.121-13.E17.bin 2 .. unknown 1D1450E8 234DFC 8 976 Dec 01 2008 01:43:18 +00:00 v lan.dat 13414916 bytes available (1789436 bytes used)
從NVRAM中刪除vlan.dat檔案。
Cat6K-IOS#delete const_nvram:vlan.dat
Delete filename [vlan.dat]?
Delete const_nvram:vlan.dat? [confirm]
Cat6K-IOS#dir const_nvram:
Directory of const_nvram:/
1 -rw- 0 <no date> vlan.dat
129004 bytes total (129004 bytes free)
Cat6K-IOS#
重新載入交換器。
Cat6K-IOS#reload Proceed with reload? [confirm] !--- Rest of the output elided.
重新載入後驗證VTP/VLAN資訊的重設。
Cat6K-IOS#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 1005 Number of existing VLANs : 5 VTP Operating Mode : Server VTP Domain Name : VTP Pruning Mode : Disabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0x57 0xCD 0x40 0x65 0x63 0x59 0x47 0xBD Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00 Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface found)
請注意,現有VLAN的數量已從12個減少到5個,而且域現在為空而不是Cisco123。
Cat6K-IOS#dir const_nvram: Directory of const_nvram:/ 1 -rw- 0 <no date> vlan.dat 129004 bytes total (129004 bytes free) Cat6K-IOS#
將儲存的vlan.dat檔複製到NVRAM。
Cat6K-IOS#copy bootflash:vlan.dat const_nvram:vlan.dat Destination filename [vlan.dat]? 976 bytes copied in 0.688 secs (1419 bytes/sec) Cat6K-IOS# Cat6K-IOS#dir const_nvram: Directory of const_nvram:/ 1 -rw- 976 <no date> vlan.dat 129004 bytes total (128028 bytes free) Cat6K-IOS#
檢查VTP狀態是否有任何變化。不會有任何改動,因為vlan.dat檔在交換器開機時是只讀的。若要使變更生效,請重新載入交換器。
Cat6K-IOS#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 1005 Number of existing VLANs : 5 VTP Operating Mode : Server VTP Domain Name : VTP Pruning Mode : Disabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0x57 0xCD 0x40 0x65 0x63 0x59 0x47 0xBD Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00 Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface found) Cat6K-IOS#
重新載入交換器。
Cat6K-IOS#reload Proceed with reload? [confirm] !--- Rest of the output elided.
交換器啟動後,確認VLAN/VTP資訊是否正確復原。
Cat6K-IOS#show vtp status VTP Version : 2 Configuration Revision : 0 Maximum VLANs supported locally : 1005 Number of existing VLANs : 12 VTP Operating Mode : Server VTP Domain Name : Cisco123 VTP Pruning Mode : Enabled VTP V2 Mode : Disabled VTP Traps Generation : Disabled MD5 digest : 0xDF 0xCE 0x47 0x0B 0xD0 0x3F 0xEA 0x18 Configuration last modified by 172.16.5.12 at 11-16-07 03:23:56 Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface found) Cat6K-IOS#
Cat6K-IOS#show vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa3/11, Fa3/16 5 VLAN0005 active Fa3/1 10 VLAN0010 active Fa3/5 20 Management_Vlan active Fa3/7, Fa3/9, Fa3/24 30 SW-3_PCs_Vlan active 40 SW-1_PCs_Vlan active 50 IP_Phone_Voice_Vlan active 60 Guest_Fail_Vlan active 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 5 enet 100005 1500 - - - - - 0 0 10 enet 100010 1500 - - - - - 0 0 20 enet 100020 1500 - - - - - 0 0 !--- Rest of the the output not shown.
Archive Management應用程式維護Resource Manager Essentials(RME)所管理裝置的vlan.dat檔案的活動存檔。它使您能夠執行以下任務:
獲取和歸檔裝置配置(包括vlan.dat檔案)
搜尋並生成歸檔資料包告
比較和標籤配置(包括vlan.dat檔案)
有關「歸檔管理」應用程式的更多資訊,請參閱歸檔配置和使用歸檔管理管理它們。
RME套件是CiscoWorks LAN Management Solution(LMS)的一部分,LMS是CiscoWorks系列產品中的捆綁包之一。它是一種企業網路管理解決方案。RME是基於Web的強大應用套件,為思科交換機、接入伺服器和路由器提供網路管理解決方案。
有關RME及其應用的詳細資訊,請參閱RME Essentials。
Supervisor引擎冗餘不支援非預設VLAN資料檔名或位置。請勿在具有冗餘Supervisor引擎的交換機上輸入vtp file file_name 命令。
安裝冗餘Supervisor Engine之前,輸入no vtp file 命令以返回預設配置。
在路由處理器備援(RPR+)冗餘中,Supervisor引擎冗餘不支援在VLAN資料庫模式下輸入的配置。使用具有RPR+冗餘的全域性配置模式。
在SSO中,從活動SP到備用SP的NVRAM vlan.dat檔案同步仍然完成,因此,如果在VLAN記錄同步的中間發生切換,則備用可以通過載入二進位制檔案從NVRAM中恢復。由於檔案到檔案的同步僅可用於NVRAM,因此如果二進位制檔案位於非NVRAM位置(如bootflash:),則無法在活動與備用之間進行vtp二進位制配置檔案同步。實際上,如果vlan.dat不在NVRAM中,則在備用啟動期間,備用Supervisor無法聯機。必須在活動Supervisor上顯示錯誤消息,要求使用者將vlan.dat位置更改為NVRAM。
修訂 | 發佈日期 | 意見 |
---|---|---|
2.0 |
29-Jun-2023 |
重新認證 |
1.0 |
19-Dec-2008 |
初始版本 |