目錄
??VTP技術(shù)
??以太網(wǎng)通道配置
??sw1配置
??sw2配置
??VTP工作原理
??VTP模式
??VTP通告
??VTP的版本
??VTP修改編號
??VTP通告類型
??VTP修剪
??VTP前置
??VTP配置命令
??VTP實(shí)例
??TCP/IP總結(jié)
?? ? ??博客主頁:大蝦好吃嗎的博客
? ? ???專欄地址:網(wǎng)絡(luò)專欄
VTP技術(shù)
????????這個(gè)技術(shù)是Cisco的私有協(xié)議,在網(wǎng)絡(luò)的核心之間,需要兩條鏈路能夠?qū)崿F(xiàn)負(fù)載均衡,提高鏈路帶寬、并能夠相互備份。這時(shí)就需要了解EthernetChannel,它通過捆綁多條以太網(wǎng)鏈路來提高鏈路帶寬,并運(yùn)行一種機(jī)制,將多個(gè)以太網(wǎng)端口捆綁成一個(gè)邏輯鏈路。以太網(wǎng)通道最多可以捆綁八條物理鏈路,其中物理鏈路可以使雙絞線也是可以是光纖的。
以太網(wǎng)通道遵循以下規(guī)則。
1. 參與捆綁的端口必須是同一個(gè)VLAN,或把它們配置為中繼端口。
2. 端口配置的是中繼模式,那么兩端都應(yīng)配置為相同的中繼模式。所需要的端口支持相同的VLAN范圍,,如果VLAN許可范圍不一致,則端口不屬于以太網(wǎng)通道。
3. 所有參與綁定的端口物理配置必須相同,應(yīng)有同樣的速度和雙工模式。
以太網(wǎng)通道配置
sw1配置
Switch(config)#int r f0/1 - 2
Switch(config-if-range)#channel-group 1 mode on
sw2配置
Switch(config)#int r f0/1 - 2
Switch(config-if-range)#channel-group 1 mode on
注:channel-group 后面的1是組號(1-6)
查看
Switch#show etherchannel summary
Flags: D - down ? ? ? P - in port-channel
? ? ? I - stand-alone s - suspended
? ? ? H - Hot-standby (LACP only)
? ? ? R - Layer3 ? ? S - Layer2
? ? ? U - in use ? ? f - failed to allocate aggregator
? ? ? u - unsuitable for bundling
? ? ? w - waiting to be aggregated
? ? ? d - default port
?
?
Number of channel-groups in use: 1
Number of aggregators: ? ? ? ? ? 1
?
Group Port-channel Protocol ? Ports
------+-------------+-----------+----------------------------------------------
?
1 ? ? Po1(SU) ? ? ? ? ? - ? ? Fa0/1(P) Fa0/2(P)
VTP工作原理
????????VTP(VLAN Trunking Protocol,虛擬局域網(wǎng)中繼協(xié)議),通過VTP協(xié)議,交換機(jī)之間可以相互傳遞VLAN信息,從而實(shí)現(xiàn)VLAN的統(tǒng)一配置和統(tǒng)一管理。VTP是一種消息協(xié)議,它使用第二層幀,在交換機(jī)之間傳遞信息,被稱為VTP通過。有了VTP就可以在一臺交換機(jī)上集中修改VLAN配置,所做的修改會(huì)自動(dòng)傳播到網(wǎng)絡(luò)中的其他交換機(jī)上,從而實(shí)現(xiàn)VLAN配置的一致性。
????????實(shí)現(xiàn)該功能的前提是這些交換機(jī)都在同一個(gè)VTP域中。
????????VTP域也稱為VLAN管理域,有一個(gè)以上共享VTP域名的相互連接的交換機(jī)組成。
配置VTP域的要求如下:
每臺交換機(jī)使用相同的VTP域名,并且是相鄰的。
在交換機(jī)之間必須配置為中繼鏈路。
VTP模式
服務(wù)器模式:每個(gè)VTP域中至少有一個(gè)服務(wù)器模式的主機(jī),以便創(chuàng)建、刪除、修改VLAN及提供VLAN信息。
客戶機(jī)模式:不允許創(chuàng)建、刪除等操作,監(jiān)聽本域中的VTP通告,并修改自己的VTP配置。
透明模式:透明模式的交換機(jī)不參與VTP,可以自行修改本身的VLAN配置,但是不向外通告自己的VLAN配置信息。
VTP通告
在使用VTP時(shí),加入VTP域的每臺交換機(jī)在中繼端口上通告下面信息。
管理域。
版本號。
配置修改編號。
它所知道的VLAN。
每個(gè)已知的VLAN的某些參數(shù)。
VTP的版本
????????在VTP管理域中,有兩個(gè)版本可以采用,分別是1和2,兩個(gè)版本不能相互操作,所以在同一個(gè)VYP域中,每臺交換機(jī)的域必須配置相同的VTP版本。
VTP修改編號
????????通知VTP功能的一項(xiàng)關(guān)鍵參數(shù)就是VTP配置修改編號。修改編號是一個(gè)32位的數(shù)字,從0開始,每修改一次配置,編號就增加1 ,直到4294967295,然后循環(huán)歸0重新增加。
VTP通告類型
匯總通告
子集通告
通告請求
VTP修剪
????????VTP修剪能減少中繼鏈路上不必要的廣播流量。VTP通告修剪沒必要擴(kuò)散的流量,從而可以提高中繼鏈路的帶寬利用率。
VTP前置
配置VTP前需要先考慮到當(dāng)前網(wǎng)絡(luò)環(huán)境中的基本任務(wù)。
1.考慮VTP運(yùn)行的版本
2.使用已有域還是新建域
3.考慮交換機(jī)的VTP工作模式
4.是否啟用修剪功能
VTP配置命令
1、創(chuàng)建VTP域
Switch(config)#vtp domain 域名
2、配置交換機(jī)VTP模式
Switch(config)#vtp mode {server | client | transparent}
注:三種工作模式
3、配置VTP口令
Switch(config)#vtp password 密碼
4、配置VTP修剪
Switch(config)#vtp pruning
5、配置VTP版本
Switch(config)#vtp version 2
注:默認(rèn)版本為1,通過上面命令指定2版本
6、查看VTP配置信息
查看VTP口令
Switch#show vtp password
查看VTP配置信息
Switch#show vtp status
VTP實(shí)例
????????根據(jù)下方拓?fù)鋱D部署,sw1位server模式,sw2和sw3為client模式,在sw1上配置VLAN,sw1和sw2學(xué)習(xí)sw1的VLAN信息。
配置sw1的VTP
Switch>en
Switch#conf t
Switch(config)#host sw1 #修改主機(jī)名
sw1(config)#vtp domain test #創(chuàng)建sete域
sw1(config)#vtp mode server #指定工作模式
sw1(config)#int f0/24 #進(jìn)入0/24接口
sw1(config-if)#sw m t #配置為trunk
配置sw2的VTP
Switch>en
Switch#conf t
Switch(config)#host sw2
sw2(config)#vtp domain test
sw2(config)#vtp mode client
sw2(config)#int f0/24
sw2(config-if)#sw m t
sw2(config-if)#int f0/23
sw2(config-if)#sw m t
配置sw3的VTP
Switch>en
Switch#conf t
Switch(config)#host sw3
sw3(config)#vtp domain test
sw3(config)#vtp mode client
sw3(config)#int f0/23
sw3(config-if)#sw m t
在sw1上創(chuàng)建vlan2和vlan3,名稱分別為name_a和name_b。
sw1(config-if)#exit
sw1(config)#vlan 2
sw1(config-vlan)#name name_a
sw1(config-vlan)#vlan 3
sw1(config-vlan)#name name_b
將端口2、3添加到vlan2,將4、5添加到vlan3,下面用的是簡寫命令,詳情查看前面的文章。
sw1(config-vlan)#exit
sw1(config)#int r f 0/2 - 3
sw1(config-if-range)#sw a v 2
sw1(config-if-range)#int r f 0/4 - 5
sw1(config-if-range)#sw a v 3
配置sw1的管理ip地址
sw1(config-if-range)#int vlan 1
sw1(config-if)#ip add 192.168.1.1 255.255.255.0
sw1(config-if)#no sh
查看sw1上的VLAN信息
sw1(config-if)#end
?
sw1#show vlan brief
?
VLAN Name ? ? ? ? ? ? ? ? ? ? ? ? ? ? Status ? Ports
---- -------------------------------- --------- -------------------------------
1 ? default ? ? ? ? ? ? ? ? ? ? ? ? active ? Fa0/1, 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, Gig0/1
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Gig0/2
2 ? name_a ? ? ? ? ? ? ? ? ? ? ? ? ? active ? Fa0/2, Fa0/3
3 ? name_b ? ? ? ? ? ? ? ? ? ? ? ? ? active ? Fa0/4, Fa0/5
1002 fddi-default ? ? ? ? ? ? ? ? ? ? active ? ?
1003 token-ring-default ? ? ? ? ? ? ? active ? ?
1004 fddinet-default ? ? ? ? ? ? ? ? active ? ?
1005 trnet-default ? ? ? ? ? ? ? ? ? active
查看sw1的VTP狀態(tài)
sw1#show vtp status
VTP Version ? ? ? ? ? ? ? ? ? ? : 2 #VTP支持的版本
Configuration Revision ? ? ? ? : 4 #修改編號
Maximum VLANs supported locally : 255 #最大VLAN數(shù)
Number of existing VLANs ? ? ? : 7
VTP Operating Mode ? ? ? ? ? ? : Server #VTP模式
VTP Domain Name ? ? ? ? ? ? ? ? : test #域名
VTP Pruning Mode ? ? ? ? ? ? ? : Disabled #VTP修剪
VTP V2 Mode ? ? ? ? ? ? ? ? ? ? : Disabled #沒有開啟VTP版本2
VTP Traps Generation ? ? ? ? ? : Disabled
MD5 digest ? ? ? ? ? ? ? ? ? ? : 0x27 0xA6 0x17 0x66 0x72 0xC0 0xC5 0x28 #MD5摘要信息
Configuration last modified by 0.0.0.0 at 3-1-93 00:25:45 #更新者
Local updater ID is 192.168.1.1 on interface Vl1 (lowest numbered VLAN interface found)
查看sw2的VLAN信息
sw2#show vlan brief
?
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, Gig0/1, Gig0/2
2 ? name_a ? ? ? ? ? ? ? ? ? ? ? ? ? active ? ?
3 ? name_b ? ? ? ? ? ? ? ? ? ? ? ? ? active ? ?
1002 fddi-default ? ? ? ? ? ? ? ? ? ? active ? ?
1003 token-ring-default ? ? ? ? ? ? ? active ? ?
1004 fddinet-default ? ? ? ? ? ? ? ? active ? ?
1005 trnet-default ? ? ? ? ? ? ? ? ? active ?
????????通過查看上面的信息,可以看到sw2已經(jīng)學(xué)到了VLAN2和VLAN3,名稱也是一樣的,但是它并不學(xué)習(xí)VLAN中的端口。
再看下面sw2的VTP信息,和sw1上查到的基本一致。
在sw2上查看VTP狀態(tài)
sw2#show vtp status
VTP Version ? ? ? ? ? ? ? ? ? ? : 2
Configuration Revision ? ? ? ? : 4
Maximum VLANs supported locally : 255
Number of existing VLANs ? ? ? : 7
VTP Operating Mode ? ? ? ? ? ? : Client
VTP Domain Name ? ? ? ? ? ? ? ? : test
VTP Pruning Mode ? ? ? ? ? ? ? : Disabled
VTP V2 Mode ? ? ? ? ? ? ? ? ? ? : Disabled
VTP Traps Generation ? ? ? ? ? : Disabled
MD5 digest ? ? ? ? ? ? ? ? ? ? : 0x27 0xA6 0x17 0x66 0x72 0xC0 0xC5 0x28
Configuration last modified by 0.0.0.0 at 3-1-93 00:25:45
配置VTP口令
sw1#conf t
sw1(config)#vtp password 123
配置VTP口令后,修改VLAN配置,添加VLAN4,
sw1#vlan data
sw1(vlan)#vlan 4 name name_c
VLAN 4 added:
? Name: name_c
查看sw1的VTP信息
sw1(vlan)#exit
APPLY completed.
Exiting....
sw1#show vtp status
VTP Version ? ? ? ? ? ? ? ? ? ? : 2
Configuration Revision ? ? ? ? : 8
Maximum VLANs supported locally : 255
Number of existing VLANs ? ? ? : 8
VTP Operating Mode ? ? ? ? ? ? : Server
VTP Domain Name ? ? ? ? ? ? ? ? : test
VTP Pruning Mode ? ? ? ? ? ? ? : Disabled
VTP V2 Mode ? ? ? ? ? ? ? ? ? ? : Disabled
VTP Traps Generation ? ? ? ? ? : Disabled
MD5 digest ? ? ? ? ? ? ? ? ? ? : 0xAC 0xFC 0x0A 0x55 0xFE 0x26 0x93 0x02
Configuration last modified by 192.168.1.1 at 3-1-93 00:46:18
Local updater ID is 192.168.1.1 on interface Vl1 (lowest numbered VLAN interface found)
查看sw2,因?yàn)闆]配置口令,sw1發(fā)出的VTP更新通告被sw2忽略,所以查到的信息還是上次的。
sw2#show vtp status
VTP Version ? ? ? ? ? ? ? ? ? ? : 2
Configuration Revision ? ? ? ? : 4
Maximum VLANs supported locally : 255
Number of existing VLANs ? ? ? : 7
VTP Operating Mode ? ? ? ? ? ? : Client
VTP Domain Name ? ? ? ? ? ? ? ? : test
VTP Pruning Mode ? ? ? ? ? ? ? : Disabled
VTP V2 Mode ? ? ? ? ? ? ? ? ? ? : Disabled
VTP Traps Generation ? ? ? ? ? : Disabled
MD5 digest ? ? ? ? ? ? ? ? ? ? : 0x27 0xA6 0x17 0x66 0x72 0xC0 0xC5 0x28
Configuration last modified by 0.0.0.0 at 3-1-93 00:25:45
查看sw2的vlan信息,沒有學(xué)習(xí)到vlan4
sw2#show vlan brief
?
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, Gig0/1, Gig0/2
2 ? name_a ? ? ? ? ? ? ? ? ? ? ? ? ? active ? ?
3 ? name_b ? ? ? ? ? ? ? ? ? ? ? ? ? active ? ?
1002 fddi-default ? ? ? ? ? ? ? ? ? ? active ? ?
1003 token-ring-default ? ? ? ? ? ? ? active ? ?
1004 fddinet-default ? ? ? ? ? ? ? ? active ? ?
1005 trnet-default ? ? ? ? ? ? ? ? ? active ? ?
在sw2上配置VTP口令
sw2#conf t
sw2(config)#vtp password 123
在來查看sw2的VTP信息和VLAN信息,這時(shí)數(shù)據(jù)都過來了。文章來源:http://www.zghlxwxcb.cn/news/detail-478727.html
sw2(config)#exit
?
sw2#show vtp status
VTP Version ? ? ? ? ? ? ? ? ? ? : 2
Configuration Revision ? ? ? ? : 8
Maximum VLANs supported locally : 255
Number of existing VLANs ? ? ? : 8
VTP Operating Mode ? ? ? ? ? ? : Client
VTP Domain Name ? ? ? ? ? ? ? ? : test
VTP Pruning Mode ? ? ? ? ? ? ? : Disabled
VTP V2 Mode ? ? ? ? ? ? ? ? ? ? : Disabled
VTP Traps Generation ? ? ? ? ? : Disabled
MD5 digest ? ? ? ? ? ? ? ? ? ? : 0xAC 0xFC 0x0A 0x55 0xFE 0x26 0x93 0x02
Configuration last modified by 192.168.1.1 at 3-1-93 00:46:18
?
sw2#show vlan brief
?
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, Gig0/1, Gig0/2
2 ? name_a ? ? ? ? ? ? ? ? ? ? ? ? ? active ? ?
3 ? name_b ? ? ? ? ? ? ? ? ? ? ? ? ? active ? ?
4 ? name_c ? ? ? ? ? ? ? ? ? ? ? ? ? active ? ?
1002 fddi-default ? ? ? ? ? ? ? ? ? ? active ? ?
1003 token-ring-default ? ? ? ? ? ? ? active ? ?
1004 fddinet-default ? ? ? ? ? ? ? ? active ? ?
1005 trnet-default ? ? ? ? ? ? ? ? ? active ?
TCP/IP總結(jié)
????????在工作環(huán)境中,相信很多人都看到了,我們實(shí)際用到的大多數(shù)還是huawei設(shè)備,也有一些使用cisco或其他設(shè)備。但是整篇文章的意義是講解該設(shè)備的工作原理,總結(jié)出各個(gè)設(shè)備的長處和短處也是一種談資。比如,文章前面寫的布線和網(wǎng)絡(luò)模型,以及單臂路由和鏈路類型,原理上華為和cisco基本相同。后面也會(huì)根據(jù)博主自身時(shí)間,繼續(xù)針對cisco和huawei、H3C總結(jié)各種網(wǎng)絡(luò)設(shè)備的原理和實(shí)例,所以本專欄TCP/IP就此完結(jié),我們下一個(gè)專欄見。文章來源地址http://www.zghlxwxcb.cn/news/detail-478727.html
到了這里,關(guān)于【網(wǎng)絡(luò)】· VTP虛擬局域網(wǎng)中繼的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!