elephant-trunk-girls-face

This pictures cracks me up, I think the Elephant is in full on Trunk mode! ūüôā

EDIT 8/26:

While doing some messing around on the lab with the original notes on this article, I found some incorrect information in my tired attempt at studying, that I have now corrected on this page.

/End Edit.

However first some real world things quick that have changed from the days when I took my CCNA, and now adays (please excuse any redundant pointers):

  • Cross-over cables are officially recommended to be used, but I tested a straight-through cable on my lab between two switches, and it came right up. So if asked a cross-over is technically correct, but in real world context not needed on newer switch models
  • It used to be taught that Trunk ports would default to “dynamic desirable”, however now they are “Dynamic Auto” and not trying to actively Trunk
  • Not all switch models / platforms support ISL (Inter-Switch Link Protocol), so you will sometimes not even see “switchport trunk encapsulation” as an option on the interface of the switch because it will only use 802.1q Trunk.

For the first part of this actual section, I’d like to quickly review the “mode” types:

  • Trunk – Shows as “On” in “sh int trunk output”, unconditionally attempting to trunk with the remote end
  • Dynamic “desirable” – Actively attempting to form a trunk with the remote end, configuring this mode would actually show it as “Desirable” in “sh int trunk” and “sh int switchport” Admin output if configured, will only form a Trunk if remote end is running in ‘desirable’, ‘trunk’, or ‘auto’ mode
  • Dynamic “auto” – Does not actively attempt to Trunk, but will form Trunk if remote end is actively trying to form one
  • And a couple others we won’t bother to look at yet, here is where to find said modes on the interface level:

SW2(config-if)#switchport mode ?
access Set trunking mode to ACCESS unconditionally
dot1q-tunnel set trunking mode to TUNNEL unconditionally
dynamic Set trunking mode to dynamically negotiate access or trunk mode
private-vlan Set private-vlan mode
trunk Set trunking mode to TRUNK unconditionally
SW2(config-if)#
SW2(config-if)#switchport mode dynamic ?
auto Set trunking mode dynamic negotiation parameter to AUTO
desirable Set trunking mode dynamic negotiation parameter to DESIRABLE

So auto and desirable are sub-commands of “switchport trunk mode”, and the others are top level “switchport trunk” modes.

Lets take a look at “sh int trunk” and see what all the values are about here:

I got rid of the ISL on Fa1/0/20 and changed it to dot1q for this lab:

SW1(config)#do sh int trunk

Port             Mode         Encapsulation  Status    Native vlan
Fa1/0/10        on                802.1q             trunking      1
Fa1/0/20        on                802.1q             trunking      1

Port Vlans allowed on trunk
Fa1/0/10 1-4094
Fa1/0/20 1-4094

Port Vlans allowed and active in management domain
Fa1/0/10 1,12,34,100
Fa1/0/20 1,12,34,100

Port Vlans in spanning tree forwarding state and not pruned
Fa1/0/10 1,12,34,100
Fa1/0/20 1,12,34,100

This is at it’s most basic, just “switchport trunk encap dot1q” and “switchport mode trunk”, and going from left to right you have:

  • The trunk port #
  • The mode that the port is currently in
  • The current encapsulation being used
  • Trunk status – Will either be Trunking or Not Trunking, no alternatives to this
  • Native VLAN, 1 by default unless configured differently with “switchport trunk native …”

Below there are three other portions which are VLANs in general allowed across the Trunk, VLANs allowed and active in the management domain, and the bottom portion of output is for Spanning-Tree Protocol “VLAN Pruning” which is a mechanism to stop VLANs from going over the Trunk.

Here is the new default state for exam day, along with it changing by encap used:

SW4(config)#int fa1/0/1
SW4(config-if)#switchport trunk encap dot1q
SW4(config-if)#switchport mode trunk
SW4(config-if)#
*Mar 1 00:51:16.479: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/1, changed state to down
*Mar 1 00:51:19.499: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/1, changed state to up
ASR#3
[Resuming connection 3 to sw3 … ]

00:52:17: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
00:52:17: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
00:52:20: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
SW3#
SW3#
SW3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW3(config)#int fa0/1
SW3(config-if)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is “Auto” can not be configured to “trunk” mode.
SW3(config-if)#
00:52:50: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
00:52:50: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan200, changed state to up

 

SW3(config-if)#do sh int trunk

Port     Mode    Encapsulation     Status      Native vlan
Fa0/1    auto        n-802.1q            trunking         1

Port Vlans allowed on trunk
Fa0/1 1-4094

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

Port Vlans in spanning tree forwarding state and not pruned
Fa0/1 1,200
SW3(config-if)#

Now for a “sh int trunk” on the 3750 for comparison:

SW4(config-if)#do sh int trunk

Port       Mode    Encapsulation    Status      Native vlan
Fa1/0/1    on            802.1q             trunking          1

Port Vlans allowed on trunk
Fa1/0/1 1-4094

Port Vlans allowed and active in management domain
Fa1/0/1 1

Port Vlans in spanning tree forwarding state and not pruned
Fa1/0/1 1
SW4(config-if)#

First, I apologize if the “sh int trunk” output looks a little goofy, when I copy and paste the output it mashes itself into one clump of config.

 

That error is not a bug to this specific IOS image, unless it was also found on the 3560’s 12.2 IOS version, which is possible but unlikely. This also occurs between 2 3750’s when I did said editing / labbing above, but will spare the switch output!

The thing I don’t understand, is why it states it rejected the command, when the trunk will in fact form if the other side is sending it a remote “Hello lets Trunk” message. Not sure if I have some buggy IOS images, or if Cisco just slapped an odd warning message when turning Trunking on a switchport.

As can be seen above, when an encapsulation type is chosen first, the port goes into “Trunk” as its ‘default’ if entered before “switchport mode trunk” and I am not exactly sure how to explain that for exam day more than a gotcha, but the default mode for Trunks is officially “Auto”.

Also the 3560 has “n-802.1q” because its side “negotiated” with the other side telling it how to Trunk, which is why the 3750 shows only “802.1q” – Important point here.

So with that being clear up, lets take a look at the lab and some other gotchas!

I’m going to drop the first (and most important) verification command on you here:

From the 3560, and to demonstrate I’m using a case sensitive modifier:

SW3#sh int switchport | begin fa0/1
SW3#
SW3#sh int switchport | begin Fa0/1
Name: Fa0/1
Switchport: Enabled
Administrative Mode: dynamic auto
Operational Mode: trunk
Administrative Trunking Encapsulation: negotiate
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 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
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none

Firstly, I highlighted in red the modifiers and how they are case sensitive which I explain below, but more importantly highlighted in blue is a wealth of information about the ports status and configuration! The base command being “sh int switchport” to list all the ports, and using the pipe | and begin to skip to the interface I am looking for.

  • Switchport Status – If the port is operational
  • Administrative Mode – Default “mode” or what was configured on the port
  • Operational Mode – It’s current “mode” that it is running in
  • Admin and Operational Encap – Same as above except obviously the encapsulation
  • Trunking VLANs – Which VLANs are configured for the Trunk, all by default!
  • Voice VLANs – For later study, but is good to know it can be verified here
  • Pruning VLANs – STP related, also for later study, but in here as well

Why don’t we look at the differences on the IOS 15.x switch output? Good question!

SW4#sh int switchport | b Fa1/0/1
Name: Fa1/0/1
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

I’ll spare the bulk of output, but as can be seen the Admin and Operational Mode is “Trunk” because as mentioned above, I set the encapsulation type to dot1q before configuring the port to be a Trunk, and that apparently defaults the port to trunk mode (unless you type “switchport trunk mode dynamic auto… of course).

I moved the cable to port 2 on between SW3 and SW4 to demonstrate that “Auto” won’t form a Trunk, just to drill that into your head once more:

SW4(config)#int fa1/0/2
SW4(config-if)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is “Auto” can not be configured to “trunk” mode.

SW4(config-if)#
ASR#3
[Resuming connection 3 to sw3 … ]
SW3#
SW3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW3(config)#int fa0/2
SW3(config-if)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is “Auto” can not be configured to “trunk” mode.

SW3(config-if)#do sh int trunk

SW3(config-if)#

So there is no Trunk now because SW4 was driving the tunnel to form because of the encapsulation configuration, and SW3 is in Auto mode so it needs a remote poke to form a Trunk, and both of them are in their default “Auto” mode which DOES NOT INITIATE FORMING A TRUNK!

So when SW3 through the error, I assume it got it from SW4 somehow, or is a bug I’m too tired to hunt down tonight ūüôā

Out of pure curiosity, I decided to see if this would also work with ISL since we have the option to try it, and check it out:

SW4(config-if)#do sh int trunk
SW4(config-if)#switchport trunk encap ?
dot1q Interface uses only 802.1q trunking encapsulation when trunking
isl Interface uses only ISL trunking encapsulation when trunking
negotiate Device will negotiate trunking encapsulation with peer on
interface

SW4(config-if)#switchport trunk encap isl
SW4(config-if)#switchport mode trunk
SW4(config-if)#
*Mar 1 02:17:34.431: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/2, changed state to down
*Mar 1 02:17:37.443: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/2, changed state to up
SW4(config-if)#
ASR#3
[Resuming connection 3 to sw3 … ]

02:18:35: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
02:18:35: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
02:18:38: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
SW3(config-if)#do sh int trunk

Port        Mode Encapsulation  Status      Native vlan
Fa0/2        auto        n-isl               trunking        1

So it will also negotiate and allow for ISL Trunks to form as well!

For my final act tonight, I moved SW1 cable from port 10 to port 12 so we are starting with another unconfigured switchport, to see what we end up with:

SW1(config)#int fa1/0/12
SW1(config-if)#switchport trunk encap ?
dot1q Interface uses only 802.1q trunking encapsulation when trunking
isl Interface uses only ISL trunking encapsulation when trunking
negotiate Device will negotiate trunking encapsulation with peer on
interface

SW1(config-if)#switchport trunk encap neg
SW1(config-if)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is “Auto” can not be configured to “trunk” mode.

SW1(config-if)#
ASR#2
[Resuming connection 2 to sw2 … ]

SW2(config)#int fa1/0/12
SW2(config-if)#switchport trunk encap negotiate
SW2(config-if)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is “Auto” can not be configured to “trunk” mode.

SW2(config-if)#do sh int trunk

Port          Mode   Encapsulation   Status       Native vlan
Fa1/0/20    on           802.1q           trunking              1

*** IMPORTANT POINT ON ENCAPS AND MODES ABOVE! ***

THE ONE ENCAPSULATION TYPE YOU CAN CONFIGURE AND IT DOES NOT CHANGE THE DEFAULT MODE OF “AUTO” IS ENCAP NEGOTIATION, DON’T LET THIS GETCHA ON EXAM DAY!

DTP (Dynamic Trunking Protocol) is what does the negotiation portion between dynamically formed trunks, but honestly this post went so long I’ll make a much shorter (I hope) post for the next to finish off our Trunking section.

One last thing I wanted to demonstrate to help you extract only info you need both in the real world and exam, some of these output modifiers will and will not work on certain devices, but I wanted to show you a list of ways to view any “show (something)” command and only view certain information:

SW2#sh run | ?
append Append redirected output to URL (URLs supporting append operation
only)
begin Begin with the line that matches
count Count number of lines which match regexp
exclude Exclude lines that match
format Format the output using the specified spec file
include Include lines that match
redirect Redirect output to URL
section Filter a section of output
tee Copy output to URL

SW2#sh run | section ?
LINE Regular Expression
exclude Exclude entire section(s) of output
include Include entire section(s) of output

SW2#sh run | section (something)

There are some output types like “tee” I haven’t even seen before on a device, and won’t go into demonstrating them, but I wanted it to be known you can see what is available for use by using a ? right after the | (pipe) to see what modifiers are available to narrow the output you are digging through – This can be done on any Cisco CLI.