Lab 12 - Configuring Trunk Ports




Goal:
Create static trunk ports

Requirements:

● Switches labsw1, labsw1
● 2 PCs with COM port, Ethernet ports
● Cisco rollover cable
● 2 Ethernet cables
● 1 Ethernet crossover cable


The following lab will create permanent trunk connections, using labsw1, interface Fa0/24, and labsw2, interface Fa0/24. Creating a trunk configuration requires two interface-specific commands:

switchport mode trunk
switchport trunk allowed vlan [all]


The first command: switchport mode trunk, changes the port to a trunking-only port. It disables DTP. If the port can only trunk, then it cannot dynamically “decide” to be a trunk port or an access port.

The second command: (switchport trunk allowed vlan all, specifies which VLANs can use the trunk, or more accurately, what VLAN data will be “allowed” on the trunk connection. The command in this example allows the trunk to carry all VLAN traffic, and will be used in most labs. (However, the trunk can be configured to carry traffic only for specified VLANs.)

labsw1

1. labsw1(config)#int fa0/24
2. labsw1(config-if)#switchport mode trunk
3. labsw1(config-if)#switchport trunk allowed vlan all
4. labsw1 (config-if)# Crtl-Z


labsw2

5. labsw2(config)#int fa0/24
6. labsw2(config-if)#switch mode trunk
7. labsw2(config-if)#switchport trunk allowed vlan all
8. labsw2 (config-if)#Crtl-Z


Notice the changes in Administrative Mode in Steps 9 and 10 below. For both switches, the trunking interfaces are now “trunk”, not “dynamic desirable.” Dynamic Trunking Protocol (DTP) has been disabled. The ports will now only function as trunk ports.

labsw1

9. labsw1#show interface fa0/24 switchport

Name: Fa0/24
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On

(lines omitted)

labsw2

10. labsw2#show interface fa0/24 switchport

Name: Fa0/24
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On

(lines omitted)

Notice that the switchport mode has changed from “desirable” to “on.”

labsw1

11. labsw1#show interfaces trunk


Port     Mode       Encapsulation   Status   Native vlan
Fa0/24   On         802.1q           trunking    1

Port     Vlans allowed on trunk
Fa0/24   1-4094

Port     Vlans allowed and active in management domain
Fa0/24   1,200-203

Port     Vlans in spanning tree forwarding state and not pruned
Fa0/24   1,200-203


labsw2

11. labsw2#show interfaces trunk


Port     Mode       Encapsulation   Status   Native vlan
Fa0/24   On         802.1q           trunking    1

Port     Vlans allowed on trunk
Fa0/24   1-4094

Port     Vlans allowed and active in management domain
Fa0/24   1,200-203

Port     Vlans in spanning tree forwarding state and not pruned
Fa0/24   1,200-203


Best practices dictate that all trunk ports should be configured as trunk ports, and not rely on DTP to create them. Controlling connectivity is an important part of network management, and interface configuration is the best way to accomplish that. A later, critical lab on VTP (VLAN Trunking Protocol) will not work if the trunk links are created dynamically.

In fact, all configuration choices should be hard coded whenever possible. Switches are able to negotiate multiple configuration choices such as speed and duplex. However, all dynamically negotiated parameters take time to be accomplished, and occasionally, the results do not function as planned.

It is also important to understand that for many configurations, a dynamic trunk port and a configured trunk port function the same way. The trunk connection will deliver data the same regardless of how the trunk is created. This can be verified by repeating the ping tests from Lab 11.

Extra Credit (but not necessary. If you understand the “all” parameter, you can figure out how to change the all to a specific VLAN)

As noted above, the trunk configuration allows the trunk to carry VLAN traffic for all VLANs. If the decision is made to allow the trunk to carry traffic only some VLANs, the command would be

switchport trunk allowed vlan [VLAN number]


If more than one VLAN is needed, the command is

switchport trunk allowed vlan add [new VLAN number]


Specifying individual VLANs on trunk links in this manner has some risk. If a new VLAN is created, consideration must be given to whether a particular trunk must have the VLAN added. This step is often forgotten, and can create problems until the configuration is changed to support the new VLAN. Unless there is a reason to limit the VLANs that can use a specific trunk link, it is advisable to allow all VLANs to use trunk links.

The example below will configure labsw2, interface Fa0/22, to carry VLAN traffic only for VLANs 200 and 202:

1a. labsw2(config)#interface fa0/22
2a. labsw2(config-if)#switchport mode trunk
3a. labsw2(config-if)#switchport trunk allowed vlan 200
4a. labsw2(config-if)#switchport trunk allowed add vlan 202

Repeat the above command for each VLAN to be included


5a. labsw2(config-if)#Crtl-Z

If interface Fa0/22 was connected to another switch to created a trunk port, only VLANs 200 and 202 could use the new trunk.

6a. labsw2#show run interface fa0/22

Building configuration...
Current configuration : 96 bytes
!
interface FastEthernet0/22
switchport trunk allowed vlan 200,202
switchport mode trunk
end

7a. labsw2#show interfaces trunk

Port     Mode       Encapsulation   Status   Native vlan
Fa0/22   On         802.1q           trunking    1

Port     Vlans allowed on trunk
Fa0/22   200, 202

Port     Vlans allowed and active in management domain
Fa0/22   200, 202

Port     Vlans in spanning tree forwarding state and not pruned
Fa0/22   1,200-203

8a. labsw2#show interface fa0/22 switchport

Name: Fa0/22
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
.
(lines omitted)
.
Trunking VLANs Enabled: 200,202

(lines omitted)

This lab is the critical lab for trunking. You should memorize the two commands, whether you are preparing for the exam or working in an enterprise network.