Sunday, 16 December 2018

Dynamic Trunking Protocol (DTP) and configuration

Cisco has implemented a proprietary, point-to-point protocol called Dynamic Trunking protocol (DTP) that negotiates a common trunking mode between two switches. DTP is used on Cisco IOS switches to negotiate if the interface should become an access port or trunk port.


By default Dynamic Trunking Protocol DTP is enabled and the interfaces of our switches will be in (dynamic auto) or (dynamic desirable) mode. Its means that whenever we receive a DTP packet that requests to form a trunk, your interface will be in trunk mode.



You should disable DTP negotiation if a switch has a trunk link connected a non-trunking router or firewall interface because those devices cannot participate in DTP negotiation.

(if you are not familiar with trunk link click Trunk Link and configuration ).

 Dynamic Trunking Protocol modes:-

1. Desirable
  • This mode is desire to become trunk. in other words this mode always want to be trunk. desirable mode sends and response (reply) to DTP messages. this mode can beecome a trunk is the other side of switch is set to trunk, dynamic desirable or dynamic auto mode.
2. Auto:


  • This mode only response  (reply) to DTP messages but it do not sent. auto mode is default mode  on most of the modern switches. auto mode it only become a trunk if the other switch link is set to trunk or dynamic desirable mode.
3. Trunk:
  • this mode configure manually by the command switchport mode trunk. this port also negotiates trunking with the port on the other side switch link.
4. Access:
  • This port is also configure manually by the command switchport mode access. access port is a end user port in a single VLAN.
5. NO-Negotiate:
  • this mode means DTP is disable, there is no DTP messages. the port is a trunk but does not do DTP negotiation with any side of the link.

                                         


 dynamic auto  
 dynamic desirable  
 Trunk
 Access
 dynamic auto
  access
  Trunk
  Trunk
 Access
 dynamic desirable
  Trunk
  Trunk
  Trunk
 Access
 Trunk
  Trunk
  Trunk
 Trunk
 limited connectivity (not recommended) 
 Access
 access
 access
 limited connectivity (not recommended)
 Access




NOTE: Configure trunk links statically whenever possible. The default DTP mode is dependent on the Cisco IOS Software version and on the platform.



let see the configuration:-

Topology:-

Goal:

  • configure the topology as per the diagram, configure VLAN 10 on both the switch and shift the port to  respective VLAN 10.
  • configure fastethernet 0/2 of switch 1 to actively negotiate the DTP messages and switch 2 fastethernet 0/2 port should reply to the DTP messages. make sure host 1 can communicate with his vlan 10 partner host 2 on other switch .




Switch(config)#hostname switch-1
switch-1(config)#vlan 10
switch-1(config-vlan)#name sales
switch-1(config-vlan)#exit

Switch(config)#hostname switch-2
switch-2(config)#vlan 10
switch-2(config-vlan)#name sales
switch-2(config-vlan)#exit

switch-1(config-if)#interface fastEthernet 0/1
switch-1(config-if)#switchport mode access
switch-1(config-if)#switchport access vlan 10
switch-1(config-if)#exit

switch-2(config)#interface fastEthernet 0/1
switch-2(config-if)#switchport mode access
switch-2(config-if)#switchport access vlan 10
switch-2(config-if)#exit



SWITCH -1




SWITCH - 2
switch-1#show interfaces fastEthernet 0/2 switchport
Name: Fa0/2
Switchport: Enabled
Administrative Mode: dynamic auto
Operational Mode: static access
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: native
Negotiation of Trunking: On

Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
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 encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false

Appliance trust: none

switch-1(config)#interface fastEthernet 0/2

switch-1(config-if)#switchport mode ?
access Set trunking mode to ACCESS unconditionally
dynamic Set trunking mode to dynamically negotiate access or trunk mode
trunk Set trunking mode to TRUNK unconditionally

switch-1(config-if)#switchport mode dynamic ?
auto Set trunking mode dynamic negotiation parameter to AUTO
desirable Set trunking mode dynamic negotiation parameter to DESIRABLE

switch-1(config-if)#switchport mode dynamic desirable


%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, 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

switch-1#show interfaces fastEthernet 0/2 switchport
Name: Fa0/2
Switchport: Enabled
Administrative Mode: dynamic desirable
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)
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 encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false

Appliance trust: none


(from the above output you can see fastethernet 0/2 is become trunk via DTP negotiation process.)

switch-1#show interfaces trunk
Port          Mode          Encapsulation     Status     Native vlan
Fa0/       desirable          n-802.1q         trunking        1

Port Vlans allowed on trunk
Fa0/2 1-1005

Port Vlans allowed and active in management domain
Fa0/2 1,10

Port Vlans in spanning tree forwarding state and not pruned

Fa0/2 1,10

switch-2#show interfaces trunk
Port          Mode            Encapsulation     Status           Native vlan
Fa0/2       auto                 n-802.1q         trunking             1

Port Vlans allowed on trunk
Fa0/2 1-1005

Port Vlans allowed and active in management domain
Fa0/2 1,10

Port Vlans in spanning tree forwarding state and not pruned


Fa0/2 1,10

switch-1#show dtp
Global DTP information
Sending DTP Hello packets every 30 seconds
Dynamic Trunk timeout is 300 seconds

1 interfaces using DTP

switch-2#show dtp
Global DTP information
Sending DTP Hello packets every 30 seconds
Dynamic Trunk timeout is 300 seconds

1 interfaces using DTP

(let see the connectivity between host 1 and host 2 both are in same VLAN 10  but on different switches.)



from HOST 1


from HOST 2


PIM Sparse Mode

PIM Sparse Mode  ( PIM-SM )  PIM  Sparse Mode explicitly builds unidirectional shared trees rooted at a ( RP ) rendezvous point per...