VTP(Vlan Trunking Protocol)

VTPèCisco為了讓不同的Switch自動同步Vlan的協定。

我們為了讓整個網路環境的Vlan能夠一致,無論我們是在新增、修改、刪除Vlan,都能夠將所修改的內容自動同步到其他台的Switch

 

基本上VTP Domain裡面的Switch有三種模式:

  1. 1.      Server Modeè可修改Vlan,並可將其修改資料同步到VTP Client
  2. 2.      Client Modeè無法修改Vlan,只可接收VTP ServerVlan資料。
  3. 3.      Transparent Modeè可修改自身Vlan資料,但自身Vlan資料不會與其他Switch作同步。可接收VTP Server的資料,將其轉送至VTP Client

 

 

要先指定一台Switch當作VTP Server,其餘的Switch當作VTP Client

設定VTP Server,定義VTP Domain

VTP-Server(config)#vtp domain VTPDomainName

Changing VTP domain name from NULL to VTPDomainName

VTP-Server(config)#vtp mode server

Device mode already VTP SERVER.

設定VTP Client

VTP-Client1(config)#vtp domain VTPDomainName

Changing VTP domain name from NULL to VTPDomainName

VTP-Client1(config)#vtp mode client

Setting device to VTP CLIENT mode

設定VTP Transparent

VTP-Trans1(config)#vtp domain VTPDomainName

Changing VTP domain name from NULL to VTPDomainName

VTP-Trans1(config)#vtp mode transparent

Setting device to VTP TRANSPARENT mode

 

若要使用VTP來同步Vlan必須將連結端口設為Trunk Mode

VTP-Server(config)#int range fastethernet 0/1-4

VTP-Server(config-if-range)#switchport mode trunk

VTP-Server(config-if-range)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up

VTP Domain的名稱必須要相同,如果不相同在設定Trunk時會顯示名稱錯誤訊息。

這樣就完成了VTP Domain的設定,接著檢查一下是否可以同步。

VTP Server上設定VLAN10VLAN20

VTP-Server(config)#vlan 10

VTP-Server(config-vlan)#vlan 20

VTP Client上檢查是否有VLAN10VLAN20

VTP-Client1#show vlan brief

 

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

1    default                          active    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, Fa0/24, Gig1/1

                                                Gig1/2

10   VLAN0010                         active   

20   VLAN0020                         active   

1002 fddi-default                     active   

1003 token-ring-default               active   

1004 fddinet-default                  active   

1005 trnet-default                    active   

檢查經由VTP Transparent所轉送的VTP Client資料是否同步。

記得VTP Transparent連結後端VTP Client的端口也要設定為Trunk ModeScreenHunter_03 Feb. 19 07.55  

創作者介紹
創作者 林作倉 的頭像
林作倉

林作倉

林作倉 發表在 痞客邦 留言(0) 人氣()