close
VTP是一種讓多台Switch可自動同步VLAN設定的通訊協定,目的是要管理整個網路環境的VLAN,維持一致性,我們可以新增、刪除、重新命名VLAN,然後將設定同步到VTP網域中其他Switch。
VTP是Cisco的專利,所以網路中的Switch是使用Cisco的Switch才能使用VTP的功能。
VTP Mode
Server Mode:可新增、刪除、修改VLAN,並同步更新到網域內的VTP Client,設定檔存放於NVRam。
Client Mode:只能被動接收、轉送VTP Server的VLAN Database,Client Mode無法對VLAN進行修改,設定檔不存放於NVRam。
Transparent Mode:Transparent Mode可新增、刪除、修改VLAN,但其結果只會記錄在本機的VLAN Database中,不會同步到VTP Domain的其他設備,但如接收到VTP Server的異動資訊時,會將資料轉送給其他Switch,設定檔存放於NVRam。
VTP是使用Trunk Port傳輸資料,所以Switch必需要設定Trunk Port才可傳送VTP資料。
設定VTP Domain及VTP Password
VTPServer(config)#vtp domain vtplab.com #設定VTP domain
Changing VTP domain name from NULL to vtplab.com
VTPServer(config)#vtp password vtppassword #設定VTP password
Setting device VLAN database password to vtppassword
VTPServer(config)#end #切換回enable模式
VTPServer#show vtp status #查看VTP狀態
VTP Version : 2
Configuration Revision : 3
Maximum VLANs supported locally : 255
Number of existing VLANs : 5
VTP Operating Mode : Server #預設是Server Mode
VTP Domain Name : vtplab.com #已加入VTP Doamin
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x7C 0xF7 0x91 0x96 0xD1 0xC4 0xF1 0xEA
Configuration last modified by 0.0.0.0 at 3-1-93 00:12:28
Local updater ID is 0.0.0.0 (no valid interface found)
VTP Server 與 VTP Client 要互相溝通,前題是 VTP Domain 與 VTP Password 必需相同。
設定VTP Client加入VTP Domain
VTPClient1(config)#vtp domain vtplab.com #設定VTP domain Domain name already set to vtplab.com. VTPClient1(config)#vtp password vtppassword Setting device VLAN database password to vtppassword #設定VTP password VTPClient1(config)#vtp mode client #設定為Client mode Setting device to VTP CLIENT mode. VTPClient2(config)#vtp domain vtplab.com #設定VTP domain Domain name already set to vtplab.com. VTPClient2(config)#vtp password vtppassword Setting device VLAN database password to vtppassword #設定VTP password VTPClient2(config)#vtp mode client #設定為Client mode Setting device to VTP CLIENT mode. VTPClient3(config)#vtp domain vtplab.com #設定VTP domain Domain name already set to vtplab.com. VTPClient3(config)#vtp password vtppassword Setting device VLAN database password to vtppassword #設定VTP password VTPClient3(config)#vtp mode client #設定為Client mode Setting device to VTP CLIENT mode. VTPTransparent(config)#vtp mode transparent #設定為Transparent mode Setting device to VTP TRANSPARENT mode.
VTP設定完成後Server端會將VLAN Database同步至Client端,但在設定為Transparent mode的Switch只會將收到的資料轉送,而不寫入自己的VLAN Database中。
在Server端建立VLAN VTPServer(config)#vlan 10 #建立VLAN 10 VTPServer(config-vlan)#vlan 30 #建立VLAN 30 VTPServer(config-vlan)#vlan 50 #建立VLAN 50 VTPServer(config-vlan)#end #切換至enable模式 %SYS-5-CONFIG_I: Configured from console by console VTPServer#show vlan brief #查看Server端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/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22 10 VLAN0010 active 30 VLAN0030 active 50 VLAN0050 active #VLAN已建立 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VTPClient1#show vlan brief #查看Client1 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/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22 10 VLAN0010 active 30 VLAN0030 active 50 VLAN0050 active #VLAN已同步 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VTPClient2#show vlan brief #查看Client2 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/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22, Fa0/23 10 VLAN0010 active 30 VLAN0030 active 50 VLAN0050 active #VLAN已同步 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VTPTransparent#show vlan brief #查看Transparent mode Switch 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/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22 20 VLAN0020 active 40 VLAN0040 active 60 VLAN0060 active 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active #VLAN未被同步 VTPClient3#show vlan brief #查看Client3 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/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22, Fa0/23 10 VLAN0010 active 30 VLAN0030 active 50 VLAN0050 active #VLAN已同步 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active VTPTransparent(config)#vlan 20 #建立VLAN 20 VTPTransparent(config)#vlan 40 #建立VLAN 40 VTPTransparent(config)#vlan 60 #建立VLAN 60 VTPTransparent(config)#end #切換至enable模式 %SYS-5-CONFIG_I: Configured from console by console VTPTransparent#show vlan brief #查看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/9, Fa0/10, Fa0/11, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22 20 VLAN0020 active 40 VLAN0040 active 60 VLAN0060 active 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active #Transparent mode Switch 可自行設定VLAN VTPClient1(config)#vlan 70 #建立VLAN 70 VTP VLAN configuration not allowed when device is in CLIENT mode. #Client mode無法自己行設定VLAN
VTP僅能同步VLAN,VLAN中所指定的Port無法一起同步,還是得自行指定。
show vtp status 欄位說明
VTP Version : 2 #可支緩最高的VTP版本(不是目前執行的版本),如顯示是2的話,即支緩1-2版。 Configuration Revision : 0 #VLAN Database的版本流水號,更新VLAN Database後此流水號就會加1。 Maximum VLANs supported locally : 255 #本機最大支緩的VLAN數目。 Number of existing VLANs : 8 #本機現在VLAN總數。 VTP Operating Mode : Transparent #本機VTP Mode VTP Domain Name : vtplab.com #VTP Domain VTP Pruning Mode : Disabled #VTP Pruning Mode是否啟用 VTP V2 Mode : Enabled #VTP V2是否啟用 VTP Traps Generation : Disabled #VTP Traps是否啟用 MD5 digest : 0xA4 0x2A 0x63 0x88 0x8D 0xE3 0x05 0x51 Configuration last modified by 0.0.0.0 at 3-1-93 00:23:13
文章標籤
全站熱搜
留言列表