Explain Static and Dynamic Trunking with examples.

Started by certforumz, February 17, 2023, 01:01:46 PM

Previous topic - Next topic

certforumz

What are static and dynamic 802.1q trunking protocols?

802.1Q is a protocol that is used to tag frames on a network and identify which VLAN they belong to. Trunking, on the other hand, is a way to carry multiple VLANs over a single link. There are two main types of trunking protocols: static and dynamic.

Static trunking, also known as manual trunking, is a method of configuring trunk ports on switches. In static trunking, the network administrator manually configures the ports on each end of the link to be trunk ports and specifies which VLANs should be carried over the link. This configuration is done using commands in the switch's configuration interface. Static trunking is a simple and straightforward way to configure a trunk link, but it can be time-consuming and prone to human error.

Dynamic trunking, on the other hand, is a protocol that allows switches to automatically negotiate trunking and VLAN information with each other. The two most common dynamic trunking protocols are Dynamic Trunking Protocol (DTP) and Link Aggregation Control Protocol (LACP). DTP is a Cisco proprietary protocol that enables switches to negotiate the mode of the link, while LACP is an IEEE standard that enables the formation of link aggregation groups. Dynamic trunking protocols are generally more efficient than static trunking because they allow for automatic negotiation and reconfiguration of trunk links, but they may be more complex to configure and can introduce security risks if not properly secured.

In summary, static trunking requires manual configuration of trunk ports and VLAN information, while dynamic trunking enables switches to automatically negotiate trunking and VLAN information.

Configure static trunking
To configure static trunking on a switch, you need to configure the port as a trunk port and specify which VLANs will be allowed to pass over the trunk. Here's a basic configuration example using Cisco IOS commands:

First, enter global configuration mode:

switch# configure terminal
Next, configure the port to be a trunk port:

switch(config)# interface gigabitethernet 1/1
switch(config-if)# switchport mode trunk
Then, specify which VLANs are allowed to pass over the trunk. In this example, we will allow VLANs 10, 20, and 30:

switch(config-if)# switchport trunk allowed vlan 10,20,30Finally, exit interface configuration mode and save the configuration:

switch(config-if)# endswitch# copy running-config startup
This configuration will set the specified interface to a trunk port and allow VLANs 10, 20, and 30 to pass over the trunk. You can repeat this process on the other end of the link to create a working static trunk link between two switches. Note that the commands may vary depending on the switch model and operating system.

Example of dynamic trunking:

Dynamic trunking protocols enable switches to negotiate trunking and VLAN information automatically, making the configuration process more efficient. Two common dynamic trunking protocols are Dynamic Trunking Protocol (DTP) and Link Aggregation Control Protocol (LACP).

Here's an example of configuring a trunk link using DTP:

Enter global configuration mode:

switch# configure terminal
Configure the port as an access port or leave it as a trunk port by default:

switch(config)# interface gigabitethernet 1/1
switch(config-if)# switchport mode access

Enable DTP on the interface to allow for automatic trunk negotiation:

switch(config-if)# switchport nonegotiate
Exit interface configuration mode and save the configuration:
switch(config-if)# end
switch# copy running-config startup-config
With DTP enabled, the interface will attempt to negotiate trunking with the other switch. If the other switch also has DTP enabled and the appropriate settings match, the link will be automatically configured as a trunk link with the appropriate VLANs allowed to pass over the link.

Here's an example of configuring a trunk link using LACP:

Enter global configuration mode:

switch# configure terminalConfigure the ports to be part of a channel group:

switch(config)# interface gigabitethernet 1/1
switch(config-if)# channel-group 1 mode active
switch(config)# interface gigabitethernet 1/2
switch(config-if)# channel-group 1 mode active
Configure the channel group to be a trunk port and specify which VLANs are allowed to pass
switch(config)# interface port-channel 1
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk allowed vlan 10,20,30
Exit interface configuration mode and save the configuration:

switch(config-if)# end
switch# copy running-config startup-config
With LACP enabled, the two ports will form a link aggregation group (LAG) and negotiate trunking and VLAN information. This allows for automatic load balancing and redundancy in the network. Note that the commands may vary depending on the switch model and operating system.