# DTP(DynamicTrunking protocol)是思科私有協議爲Trunk服務,前身是DISL。能夠讓交換機間的鏈路自動協商是否造成Trunk。 # TRUNK介紹過配置Trunk用switchporttrunk encapsulation dot1Q和switchportmode trunk這兩條命令便可。 # 如今能夠不用手動打這兩條命令,而是用DTP來自動協商造成Trunk。另外DTP還能夠協商Trunk鏈路的封裝類型(802.1Q或ISL)。配置了DTP的交換機會發送DTP協商包,對方對DTP協商包進行響應,最終決定是否能夠造成Trunk。 # 30s發送一次DTP的frame. 該協議僅在交換機間協商。 # DTP有4種模式分別是:auto,dersirable,trunk negotiate,trunk nonegotiate # auto:被動協商,不主動發送DTP,但收到DTP後能夠回覆,回覆後成功協商成Trunk鏈路 # desirable:指望把接口置於Trunk模式,會主動發送或回覆DTP協商,只要對方能響應,就成功協商成Trunk鏈路 # negotiate:已經強制將端口配成Trunk模式了,會主動發送或回覆DTP協商,只要對方能響應,就成功協商成Trunk鏈路 # nonegotiate:已經強制將端口配成Trunk模式了,但不主動發送或回覆DTP協商。所以只有在對方端口已是negotiate或nonegotiate,即對方端口已經配置成了Trunk的狀況下,才能造成Trunk鏈路 -------------------------------------------------------------------- | SW1 | | SW2 | | trunk | -- | trunk | | none | | none | -------------------------------------------------------------------- IOU1(config)#do sh int e3/3 swi Name: Et3/3 Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: trunk Administrative Trunking Encapsulation: negotiate Operational Trunking Encapsulation: isl Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Administrative Native VLAN tagging: enabled Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk Native VLAN tagging: enabled Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk associations: none Administrative private-vlan trunk mappings: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Appliance trust: none IOU1(config)# IOU2(config)#do sh int e3/3 swi Name: Et3/3 Switchport: Enabled Administrative Mode: dynamic desirable Operational Mode: trunk Administrative Trunking Encapsulation: negotiate Operational Trunking Encapsulation: isl Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Administrative Native VLAN tagging: enabled Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk Native VLAN tagging: enabled Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk associations: none Administrative private-vlan trunk mappings: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Appliance trust: none IOU2(config)# Frame 5064: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0 Ethernet II, Src: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33), Dst: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) Destination: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) # 目的MAC地址 CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) Source: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33) Type: 802.1Q Virtual LAN (0x8100) 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 1 000. .... .... .... = Priority: Best Effort (default) (0) ...0 .... .... .... = CFI: Canonical (0) .... 0000 0000 0001 = ID: 1 # 802.1Q封裝 vlan 1 Length: 34 Padding: 0000000000000000 Logical-Link Control DSAP: SNAP (0xaa) 1010 101. = SAP: SNAP .... ...0 = IG Bit: Individual SSAP: SNAP (0xaa) 1010 101. = SAP: SNAP .... ...0 = CR Bit: Command Control field: U, func=UI (0x03) 000. 00.. = Command: Unnumbered Information (0x00) .... ..11 = Frame type: Unnumbered frame (0x3) Organization Code: Cisco (0x00000c) # cisco 私有協議 PID: DTP (0x2004) # 採用DTP協議 Dynamic Trunk Protocol: (Operating/Administrative): Trunk/Desirable (0x83) (Operating/Administrative): ISL/Negotiated (0x40): aa:bb:cc:00:04:33 Version: 1 Domain Type: Domain (0x0001) Length: 5 Domain: Trunk Status Type: Trunk Status (0x0002) Length: 5 Value: Trunk/Desirable (0x83) # Trunk Status :Trunk/Desirable 模式 1... .... = Trunk Operating Status: Trunk (0x1) .... .011 = Trunk Administrative Status: Desirable (0x3) Trunk Type Type: Trunk Type (0x0003) Length: 5 Value: ISL/Negotiated (0x40) 010. .... = Trunk Operating Type: ISL (0x2) # trunk 類型爲 ISL .... .000 = Trunk Administrative Type: Negotiated (0x0) # 管理配置類型:Negotiated Sender ID Type: Sender ID (0x0004) Length: 10 Sender ID: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33) Frame 5065: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0 Ethernet II, Src: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33), Dst: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) Destination: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) # 目的MAC地址 CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) Source: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33) Type: 802.1Q Virtual LAN (0x8100) 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 1 000. .... .... .... = Priority: Best Effort (default) (0) ...0 .... .... .... = CFI: Canonical (0) .... 0000 0000 0001 = ID: 1 Length: 34 Padding: 0000000000000000 Logical-Link Control DSAP: SNAP (0xaa) 1010 101. = SAP: SNAP .... ...0 = IG Bit: Individual SSAP: SNAP (0xaa) 1010 101. = SAP: SNAP .... ...0 = CR Bit: Command Control field: U, func=UI (0x03) 000. 00.. = Command: Unnumbered Information (0x00) .... ..11 = Frame type: Unnumbered frame (0x3) Organization Code: Cisco (0x00000c) PID: DTP (0x2004) Dynamic Trunk Protocol: (Operating/Administrative): Trunk/Desirable (0x83) (Operating/Administrative): ISL/Negotiated (0x40): aa:bb:cc:00:06:33 Version: 1 Domain Type: Domain (0x0001) Length: 5 Domain: Trunk Status Type: Trunk Status (0x0002) Length: 5 Value: Trunk/Desirable (0x83) 1... .... = Trunk Operating Status: Trunk (0x1) .... .011 = Trunk Administrative Status: Desirable (0x3) Trunk Type Type: Trunk Type (0x0003) Length: 5 Value: ISL/Negotiated (0x40) 010. .... = Trunk Operating Type: ISL (0x2) .... .000 = Trunk Administrative Type: Negotiated (0x0) Sender ID Type: Sender ID (0x0004) Length: 10 Sender ID: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33) -------------------------------------------------------------------------------------------------- | SW1 | | SW2 | | trunk | -- | trunk | |switchport trunk encapsulation dot1q | |switchport trunk encapsulation dot1q | | switchport mode trunk | | switchport mode trunk | -------------------------------------------------------------------------------------------------- IOU1(config-if)#do sh int e3/3 swi Name: Et3/3 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Administrative Native VLAN tagging: enabled Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk Native VLAN tagging: enabled Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk associations: none Administrative private-vlan trunk mappings: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Appliance trust: none IOU1(config-if)# IOU2(config-if)#do sh int e3/3 swi Name: Et3/3 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Administrative Native VLAN tagging: enabled Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk Native VLAN tagging: enabled Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk associations: none Administrative private-vlan trunk mappings: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Capture Mode Disabled Capture VLANs Allowed: ALL Appliance trust: none IOU2(config-if)# Frame 6159: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0 Ethernet II, Src: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33), Dst: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) Destination: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) Source: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33) Type: 802.1Q Virtual LAN (0x8100) 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 1 000. .... .... .... = Priority: Best Effort (default) (0) ...0 .... .... .... = CFI: Canonical (0) .... 0000 0000 0001 = ID: 1 Length: 34 Padding: 0000000000000000 Logical-Link Control DSAP: SNAP (0xaa) 1010 101. = SAP: SNAP .... ...0 = IG Bit: Individual SSAP: SNAP (0xaa) 1010 101. = SAP: SNAP .... ...0 = CR Bit: Command Control field: U, func=UI (0x03) 000. 00.. = Command: Unnumbered Information (0x00) .... ..11 = Frame type: Unnumbered frame (0x3) Organization Code: Cisco (0x00000c) PID: DTP (0x2004) Dynamic Trunk Protocol: (Operating/Administrative): Trunk/On (0x81) (Operating/Administrative): 802.1Q/802.1Q (0xa5): aa:bb:cc:00:06:33 Version: 1 Domain Type: Domain (0x0001) Length: 5 Domain: Trunk Status Type: Trunk Status (0x0002) Length: 5 Value: Trunk/On (0x81) 1... .... = Trunk Operating Status: Trunk (0x1) # .... .001 = Trunk Administrative Status: On (0x1) Trunk Type Type: Trunk Type (0x0003) Length: 5 Value: 802.1Q/802.1Q (0xa5) 101. .... = Trunk Operating Type: 802.1Q (0x5) # Trunk Type : 802.1Q .... .101 = Trunk Administrative Type: 802.1Q (0x5) # 管理配置類型: 802.1Q Sender ID Type: Sender ID (0x0004) Length: 10 Sender ID: aa:bb:cc:00:06:33 (aa:bb:cc:00:06:33) Frame 6160: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0 Ethernet II, Src: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33), Dst: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) Destination: CDP/VTP/DTP/PAgP/UDLD (01:00:0c:cc:cc:cc) Source: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33) Type: 802.1Q Virtual LAN (0x8100) 802.1Q Virtual LAN, PRI: 0, CFI: 0, ID: 1 000. .... .... .... = Priority: Best Effort (default) (0) ...0 .... .... .... = CFI: Canonical (0) .... 0000 0000 0001 = ID: 1 Length: 34 Padding: 0000000000000000 Logical-Link Control DSAP: SNAP (0xaa) 1010 101. = SAP: SNAP .... ...0 = IG Bit: Individual SSAP: SNAP (0xaa) 1010 101. = SAP: SNAP .... ...0 = CR Bit: Command Control field: U, func=UI (0x03) 000. 00.. = Command: Unnumbered Information (0x00) .... ..11 = Frame type: Unnumbered frame (0x3) Organization Code: Cisco (0x00000c) PID: DTP (0x2004) Dynamic Trunk Protocol: (Operating/Administrative): Trunk/On (0x81) (Operating/Administrative): 802.1Q/802.1Q (0xa5): aa:bb:cc:00:04:33 Version: 1 Domain Type: Domain (0x0001) Length: 5 Domain: Trunk Status Type: Trunk Status (0x0002) Length: 5 Value: Trunk/On (0x81) 1... .... = Trunk Operating Status: Trunk (0x1) .... .001 = Trunk Administrative Status: On (0x1) Trunk Type Type: Trunk Type (0x0003) Length: 5 Value: 802.1Q/802.1Q (0xa5) 101. .... = Trunk Operating Type: 802.1Q (0x5) .... .101 = Trunk Administrative Type: 802.1Q (0x5) Sender ID Type: Sender ID (0x0004) Length: 10 Sender ID: aa:bb:cc:00:04:33 (aa:bb:cc:00:04:33)