Cisco學習筆記20071130

Cisco學習筆記20071130

VTP協定(VLAN Trunking Protocol):用來傳送和同步VLAN的資訊

Cisco-Switch預設所有的port都在VLAN1

IEEE 802.1Q : 用來辨識帶有VLAN資訊的 Frame

Trunk-port : 允許多個VLAN

Access-port : 只能有一個VLAN

Trunking: Switch 和 Switch 一定要跑 Trunk

VTP-Modes:

至少有一個角色叫Server 其它的叫Client , 會有一個VTP-Domain , VTP-password

傳送方式:Mutilcast

PS:  只有Server可以 add,delete,modify VLAN

PS: 當VLAN資料同步時,會帶一個數字revison , vtp-client 就會以這個數字來判斷是否要同步,只要有add,delete,modify VLAN,revison就加1

PS : VTP-mode 還有一個成員Transparent , 當Server 有修改VLAN資訊時,本身不會和Server同步,但他會加入VTP-domain,

      才會幫忙forward vlan資訊  

server : send,forward

clinet :forward

預設 毎個Switch 都是Server mode

advertisements 是VTP傳送出來的資料(只要有改變vlan就馬上送,若無的話就5分鐘送一次)

VTP Pruning 特性:

1.減少沒有必要的 flooding traffic(decreasewn unnecessary flooding traffic)

2.增加可用的頻寬 ( increase available bandwidth)

設定Switch-VTP-LAB:

cs4

VTP-domain : ICND

VTP-PASSWORD : ccna

步驟:

1. 先設定vtp-server (上圖第一層switch)

進入command

能用縮寫指令就用囉

Switch>en 

Switch#conf t

Switch(config)#hostname server  (設定switch 名稱為 server,指令和前一篇筆記的router相同)

server(config)#vtp domain mis (設定vtp domain ,指令執行後會有下面一段訊息)

Changing VTP domain name from NULL to mis

server(config)#vtp password mis (設定 vtp密碼,指令執行後會有下面一段訊息)

Setting device VLAN database password to mis

server(config)#vtp mode server

(設定vtp的角色為Server,指令執行後會有下面一段訊息,但因為預設cisco的switch都是server-mode所以訊系會說裝置已經是 server了)

Device mode already VTP SERVER

設定Server-switch f0/1 f0/2為trunk-port (switch & switch 必須走trunk)

server(config)#interface fastEthernet0/1

server(config-if)#switchport mode trunk

server(config-if)#interface fastEthernet0/2

server(config-if)#switchport mode trunk

查詢vtp 狀態

server#show vtp status ( 到特權模式執行該指令)
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 64
Number of existing VLANs : 5
VTP Operating Mode : Server  (確定角色為vtp-server)
VTP Domain Name : mis
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x63 0x8F 0xF3 0xC0 0x35 0x2F 0xC6 0xD0
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 0.0.0.0 (no valid interface found)

2. 設定vtp-client (上圖第二層2個switch)

設定SwitchA ,進入command

Switch>en 

Switch#conf t

Switch(config)#hostname SwitchA (設定switch 名稱為 SwitchA)

SwitchA(config)#vtp domain mis (設定vtp domain )

SwitchA(config)#vtp password mis (設定 vtp密碼)

設定switchA f0/1 為 access-port f0/2為trunk-port (switch 與 pc 必須走 access)

SwitchA(config)#interface fastEthernet0/1

SwitchA(config-if)#switchport mode access

SwitchA(config-if)#interface fastEthernet0/2

SwitchA(config-if)#switchport mode trunk

switchA#show vtp status
VTP Version : 2
Configuration Revision : 2
Maximum VLANs supported locally : 64
Number of existing VLANs : 6
VTP Operating Mode : Client (確定角色為vtp-client)
VTP Domain Name : mis
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x4D 0x09 0x37 0xD1 0xAD 0x1E 0xBC 0xA0
Configuration last modified by 0.0.0.0 at 3-1-93 00:16:22

設定SwitchB,進入command

Switch>en 

Switch#conf t

Switch(config)#hostname SwitchB (設定switch 名稱為 SwitchB)

SwitchB(config)#vtp domain mis (設定vtp domain )

SwitchB(config)#vtp password mis (設定 vtp密碼)

設定switchB f0/1 為 access-port f0/2為trunk-port (switch 與 pc 必須走 access)

SwitchB(config)#interface fastEthernet0/1

SwitchB(config-if)#switchport mode access

SwitchB(config-if)#interface fastEthernet0/2

SwitchB(config-if)#switchport mode trunk

switchB#show vtp status
VTP Version : 2
Configuration Revision : 2
Maximum VLANs supported locally : 64
Number of existing VLANs : 6
VTP Operating Mode : Client (確定角色為vtp-client)
VTP Domain Name : mis
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0x4D 0x09 0x37 0xD1 0xAD 0x1E 0xBC 0xA0
Configuration last modified by 0.0.0.0 at 3-1-93 00:16:22

3. 在VTP-Server 建立一個新的Vlan 4 名稱為 mis002

server(config)# vlan 4 (新增一個vlan ID 是4)

server(config-vlan)# name mis002 (取一個名稱為mis002)

server(config-vlan)#exit (離開)

查詢 vtp-domain vlan 狀態

server# sh vlan

VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active 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
3 mis001 active
4 mis002 active  (確實有剛才新增的vlan)
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
—- —– ———- —– —— —— ——– —- ——– —— ——
1 enet 100001 1500 – – – – – 0 0
3 enet 100003 1500 – – – – – 0 0
4 enet 100004 1500 – – – – – 0 0
1002 enet 101002 1500 – – – – – 0 0
1003 enet 101003 1500 – – – – – 0 0
1004 enet 101004 1500 – – – – – 0 0
1005 enet 101005 1500 – – – – – 0 0

再來就是去vtp-client SwitchA SwitchB 查詢Vlan狀態 應該也會同步更新喔

4. 設定SwitchA 的 f0/1 為 vlan 4

   SwitchA(config)# int f0/1

   SwitchA(config-if)# switchport access vlan 4 (用此指令設定)

   VLAN Name Status Ports
—- ——————————– ——— ——————————-
1 default active 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
3 mis001 active
4 mis002 active Fa0/1  (確定有將f0/1指令成vlan 4)
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
—- —– ———- —– —— —— ——– —- ——– —— ——
1 enet 100001 1500 – – – – – 0 0
3 enet 100003 1500 – – – – – 0 0
4 enet 100004 1500 – – – – – 0 0
1002 enet 101002 1500 – – – – – 0 0
1003 enet 101003 1500 – – – – – 0 0
1004 enet 101004 1500 – – – – – 0 0
1005 enet 101005 1500 – – – – – 0 0



本篇瀏覽人數: 6460
分類: Cisco篇。這篇內容的永久連結

在〈Cisco學習筆記20071130〉中有 6 則留言

  1. 初學者MIS表示:

    在switchA與switchB 好像忘記加入這行↓

    switchA/switchB(config)#vtp mode client

  2. 初學者MIS表示:

    想請問榮哥當MIS的感想是什麼,因為小弟剛入行想知道前輩們的想法。謝謝

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *