# 拓撲圖

# 基礎配置
## MS1:
~~~
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname MS1
MS1(config)#no logging console //禁止 console 口的日志,以免干擾你在控制臺的操作
MS1(config)#interface fastEthernet 0/1
MS1(config-if)#switchport trunk encapsulation dot1q
MS1(config-if)#switchport mode trunk
MS1(config)#interface fastEthernet 0/2
MS1(config-if)#switchport trunk encapsulation dot1q
MS1(config-if)#switchport mode trunk
MS1(config)#vtp mode server
Device mode already VTP SERVER.
MS1(config)#vtp domain test
Changing VTP domain name from NULL to test
MS1(config)#vtp password 123
Setting device VLAN database password to 123
~~~
## SW1:
~~~
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW1
SW1(config)#no logging console
SW1(config)#interface fastEthernet 0/2
SW1(config-if)#switchport mode trunk
SW1(config)#vtp mode client
Setting device to VTP CLIENT mode.
SW1(config)#vtp domain test
Changing VTP domain name from NULL to test
SW1(config)#vtp password 123
Setting device VLAN database password to 123
~~~
## SW2:
~~~
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW2
SW2(config)#no logging console
SW2(config)#interface fastEthernet 0/1
SW2(config-if)#switchport mode trunk
SW2(config)#interface fastEthernet 0/2
SW2(config-if)#switchport mode trunk
SW2(config)#vtp mode transparent
Setting device to VTP TRANSPARENT mode.
SW2(config)#vtp domain test
Changing VTP domain name from NULL to test
SW2(config)#vtp password 123
Setting device VLAN database password to 123
~~~
## SW3:
~~~
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW3
SW3(config)#no logging console
SW3(config)#interface fastEthernet 0/1
SW3(config-if)#switchport mode trunk
SW3(config)#vtp mode client
Setting device to VTP CLIENT mode.
SW3(config)#vtp domain test
Changing VTP domain name from NULL to test
SW3(config)#vtp password 123
Setting device VLAN database password to 123
~~~
## SW4:
~~~
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW4
SW4(config)#no logging console
SW4(config)#interface fastEthernet 0/1
SW4(config-if)#switchport mode trunk
SW4(config)#interface fastEthernet 0/2
SW4(config-if)#switchport mode trunk
SW4(config)#vtp mode transparent
Setting device to VTP TRANSPARENT mode.
SW4(config)#vtp domain test1
Changing VTP domain name from NULL to test1
SW4(config)#vtp password 456
Setting device VLAN database password to 456
~~~
# 實驗測試
* 在 MS1(server)**創建**,**刪除**和**命名** vlan 的操作會同步到 SW1(client)和 SW3(client), 但不會同步到 SW2(transparent)和 SW4(transparent)
### 注意
* vtp 僅同步創建,刪除和命名 vlan,不會同步配置的 ip 地址
* vtp transparent 模式的域名可以與 server 模式域名不同,但 client 模式域名必須與 server 模式域名及密碼保持一致,否則不會同步 vlan 信息。