xkonekt
Language: EN
  • English
  • Türkçe
  • Español, Coming soon
  • Português, Coming soon
  • Deutsch, Coming soon
  • Français, Coming soon

VLANs and trunking · Introduction · Module 2

802.1Q tags and trunk links

Show topologyHide topology
H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24

Interfaces and addresses · Et0/0 = Ethernet0/0. There is no router in this network.

  • between the switchesSW1 Et0/0SW2 Et0/0
  • 10.1.10.0/24SW1 Et0/1H1 eth0 10.1.10.10
  • 10.1.20.0/24SW1 Et0/2H2 eth0 10.1.20.20
  • 10.1.10.0/24SW2 Et0/1H3 eth0 10.1.10.30
Topology · Two switches on two floors, joined by one cable. H1 and H3 are staff hosts in 10.1.10.0/24; H2 is a guest host in 10.1.20.0/24.

Two switches side by side in the middle, SW1, the first-floor switch, on the left and SW2, the second-floor switch, on the right, joined by one horizontal cable. Above SW1 is H1, a staff host, cabled down to SW1, with the network 10.1.10.0/24 written beside the cable. Below SW1 is H2, a guest host, cabled up to SW1, with 10.1.20.0/24 beside the cable. Below SW2 is H3, a staff host, cabled up to SW2, with 10.1.10.0/24 beside the cable.

What a trunk is

One cable, several VLANs

One link, several VLANs

Guest hosts will also plug in on the second floor, so SW2 now has VLAN 20 too. But the cable between SW1 and SW2 carries VLAN 10 only. How can H2’s VLAN 20 frames reach SW2?

Not over that cable as it is. Each of its ends is an access port in VLAN 10, and an access port belongs to exactly one VLAN.

Both VLANs can cross in two ways. One is a second cable, with an access port in VLAN 20 at each end. The other is one cable that carries both (Figure 2.1).

(a)Two cablesSW1SW2VLAN 10VLAN 20(b)One cableSW1SW2VLAN 10, 20
Figure 2.1 · (a) One access cable per VLAN, so every VLAN that must reach both switches needs another cable. (b) One cable carries both VLANs.

Two panels, each showing SW1 on the left and SW2 on the right. Panel (a), headed “Two cables”: two cables between the switches, a straight one labeled VLAN 10 above it, and a second one that loops below the switches, labeled VLAN 20 under it. Panel (b), headed “One cable”: one straight cable carrying a chip that reads VLAN 10, 20.

With access ports only, each extra VLAN costs one more cable and one more port on each switch.

The one shared cable is a trunk: a link, here between two switches, that carries the traffic of several VLANs. Each end of it is a trunk port.

One cable doing the work of two can sound like a bigger or faster cable. The trunk here is the cable already in place, at the same speed. What changes is the setting of the port at each end, which lets frames of several VLANs share the link.

A trunk joins two devices, not two VLANs. VLAN 10 and VLAN 20 stay separate broadcast domains on it, and traffic from one VLAN to another still has to pass through a router, a device that passes traffic between networks.

How many cables between SW1 and SW2 do VLAN 10 and VLAN 20 need, first with access ports only, then with a trunk?

The 802.1Q tag

On one cable, a frame of VLAN 10 and a frame of VLAN 20 look the same. How does SW2 tell them apart?

On a trunk, the sending switch writes the VLAN into the frame itself. IEEE 802.1Q is the industry-standard way to do this on Ethernet.

The switch adds a VLAN tag, also called the 802.1Q tag. A frame is made of fields, parts in a fixed order, and the tag is 4 bytes, inserted between the source MAC address and the type field (Figure 2.2).

The MAC addresses and the payload, the data the frame carries, stay as they are. The FCS, the check value at the end of the frame, does not. Because the frame has changed, the switch computes its FCS again.

How does SW2 know a tag is there? The tag starts with the TPID (Tag Protocol Identifier), a 16-bit field set to 0x8100, and that value marks the frame as 802.1Q-tagged.

The tag ends with the VLAN ID, a 12-bit field that names the VLAN of the frame. Its 12 bits hold the values 0 to 4095, enough for every VLAN ID from 1 to 4094. For H2’s frames it is 20.

Between the two sit the PCP field, 3 priority bits, and one more bit. Neither of them decides the frame’s VLAN.

H2’s frame on Et0/2, its access portMACaddressesTypePayloadFCSThe same frame on the trunkMACaddressesTagTypePayloadFCSTPID0x8100PCPVLAN ID2016 bitstagged frame3 bitspriority1 bit12 bitsthe VLAN
Figure 2.2 · On the trunk, SW1 inserts 4 bytes after the source MAC address. They start with 0x8100 and end with the VLAN ID, 20.

Three rows of boxes. The top row, H2’s frame on Et0/2: MAC addresses, Type, Payload, FCS. The middle row, the same frame on the trunk: MAC addresses, Tag (highlighted), Type, Payload, FCS. Two lines fan out from the Tag box to the bottom row, the tag’s four fields: TPID 0x8100, 16 bits, marks a tagged frame; PCP, 3 bits, priority (drawn faint); one unnamed field, 1 bit (faint); VLAN ID 20, 12 bits, the VLAN.

SW1 inserts the tag into H2’s frame on the trunk. Which other part of the frame changes?

How it works

A tag carries the VLAN

A tagged frame crosses the trunk

H2 sends a broadcast in VLAN 20. What happens to the frame on the trunk, and at SW2?

On the trunk it is tagged, and SW2 puts it in its VLAN 20. Where it goes next depends on SW2’s VLAN 20 ports, and show vlan brief lists SW2’s VLANs and the access ports in each.

On SW2, while both ends of the cable are still access ports:

Output · IOS XE 17.18.2
SW2#show vlan briefVLAN 1Name defaultStatus activePorts Et0/2, Et0/31VLAN 10Name STAFFStatus activePorts Et0/0, Et0/12VLAN 20Name GUESTStatus activePorts —3VLAN 1002Name fddi-defaultStatus act/unsupPorts —3VLAN 1003Name token-ring-defaultStatus act/unsupPorts —3VLAN 1004Name fddinet-defaultStatus act/unsupPorts —3VLAN 1005Name trnet-defaultStatus act/unsupPorts —
  1. Et0/0, the port toward SW1, is an access port in VLAN 10. Et0/1 is H3’s port.
  2. VLAN 20, GUEST, exists. No port is in it.
  3. VLANs 1002 to 1005 are reserved for Token Ring and FDDI, two old kinds of network. No port is in them, and you can leave them aside.
Full output · 10 lines
SW2#show vlan brief VLAN Name                             Status    Ports---- -------------------------------- --------- -------------------------------1    default                          active    Et0/2, Et0/310   STAFF                            active    Et0/0, Et0/120   GUEST                            active    1002 fddi-default                     act/unsup 1003 token-ring-default               act/unsup 1004 fddinet-default                  act/unsup 1005 trnet-default                    act/unsup 

Then both ends of that cable are made trunk ports. Follow one broadcast from H2 across the trunk (Figure 2.3).

Step 1 of 6

H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 10VLAN 20VLAN 10trunk

H2 sends a broadcast, an ordinary frame with no tag. It comes in on Et0/2, an access port in VLAN 20, so SW1 puts it in VLAN 20.

Step 2 of 6

H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 10VLAN 20VLAN 10trunknot sent

SW1 floods the frame in VLAN 20. Et0/1, H1’s port, is in VLAN 10, so nothing goes to H1. Et0/0 is a trunk port and carries VLAN 20 too, so the frame goes out there.

Step 3 of 6

H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 10VLAN 20VLAN 10trunknot senttag 20

On the way out of Et0/0, SW1 inserts the 802.1Q tag. It holds 0x8100 and VLAN ID 20.

Step 4 of 6

H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 10VLAN 20VLAN 10trunknot senttag 20

The frame reaches SW2 on Et0/0. That port carries several VLANs, VLAN 20 among them.

How does SW2 know that this frame is in VLAN 20?

  • It reads VLAN ID 20 in the tag (Correct): Et0/0 carries several VLANs, so the port cannot say which one. The tag can. SW2 reads VLAN ID 20 in it and takes the frame into its VLAN 20.
  • From H2’s address, 10.1.20.20: A switch does not read the IP address to choose a VLAN. SW2 reads the VLAN ID in the tag.
  • From the port it came in on: That works for an access port, which is in one VLAN. Et0/0 is a trunk port and carries several VLANs, so the port alone cannot say which.
  • It cannot tell, so it floods the frame out of every port: SW2 can tell. The tag carries the VLAN ID, and SW2 floods the frame only to the ports of that VLAN.

Step 5 of 6

H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 10VLAN 20VLAN 10trunknot senttag 20VLAN 20

SW2 reads VLAN ID 20 in the tag and takes the frame into its VLAN 20.

Step 6 of 6

H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 10VLAN 20VLAN 10trunknot senttag 20VLAN 20not sent

SW2 takes H2’s frame into VLAN 20, which has no access port on SW2 yet, so the frame goes no further. H3, in VLAN 10, gets nothing.

Step 1 of 6

The network as in the topology, with a chip at the switch end of each host cable: VLAN 10 at H1’s, VLAN 20 at H2’s and VLAN 10 at H3’s; the cable between the switches carries the chip trunk. Step 1: an arrow beside H2’s cable points up into SW1. Step 2: an arrow under the cable between the switches points toward SW2, and a cross with “not sent” sits beside H1’s cable. Step 3: a chip tag 20 appears under the cable between the switches. Step 4 asks how SW2 knows the VLAN. Step 5: a chip VLAN 20 appears above SW2’s name. Step 6 shows the whole path, with a cross and “not sent” beside H3’s cable.

Figure 2.3 · SW1 tags H2’s frame with VLAN ID 20 on the trunk, and SW2 reads the tag to put the frame in its VLAN 20.H2 sends a broadcast, an ordinary frame with no tag. It comes in on Et0/2, an access port in VLAN 20, so SW1 puts it in VLAN 20.SW1 floods the frame in VLAN 20. Et0/1, H1’s port, is in VLAN 10, so nothing goes to H1. Et0/0 is a trunk port and carries VLAN 20 too, so the frame goes out there.On the way out of Et0/0, SW1 inserts the 802.1Q tag. It holds 0x8100 and VLAN ID 20.The frame reaches SW2 on Et0/0. That port carries several VLANs, VLAN 20 among them.SW2 reads VLAN ID 20 in the tag and takes the frame into its VLAN 20.SW2 takes H2’s frame into VLAN 20, which has no access port on SW2 yet, so the frame goes no further. H3, in VLAN 10, gets nothing.

Now follow H1’s broadcast yourself.

Tap every port H1’s broadcast leaves through, set tag or no tag on each trunk port, then submit.

H1’s frame enters SW1 on Et0/1.

Ports of SW1

Ports of SW2

Answer

It leaves through SW1 Et0/0 (tag 10), SW2 Et0/1 (no tag). Reaches: H3.

H1’s port is in VLAN 10. SW1 floods the frame out of its other ports that carry VLAN 10, and that is only the trunk, Et0/0. There it carries a tag with VLAN ID 10. SW2 reads the tag and sends the frame out of its VLAN 10 access port, Et0/1, to H3, with no tag.

Broadcasts in this network
SenderVLANLeaves throughReaches
H110SW1 Et0/0 (tag 10), SW2 Et0/1 (no tag)H3
H220SW1 Et0/0 (tag 20)no host
H310SW2 Et0/0 (tag 10), SW1 Et0/1 (no tag)H1

Key idea

On this trunk the sending switch tags each VLAN 10 and VLAN 20 frame with its VLAN ID. The receiving switch reads the tag, keeps the frame in that VLAN, and sends it out of an access port with no tag.

Frames without a tag: the native VLAN

Does every frame on the trunk carry a tag?

No. The native VLAN is the one VLAN whose frames 802.1Q does not tag on a trunk.

A switch puts an untagged frame that comes in on a trunk into the native VLAN, which is VLAN 1 by default (Figure 2.4).

SW1first floorSW2second floorVLAN 10tag 10VLAN 20tag 20VLAN 1no tag, native
Figure 2.4 · On the trunk, VLAN 10 and VLAN 20 frames carry tags. VLAN 1, the native VLAN, crosses without one.

SW1 and SW2 side by side, joined by one cable. Under them, three rows, each with an arrow from left to right: VLAN 10 leads to tag 10; VLAN 20 leads to tag 20; VLAN 1 leads to no tag, native, highlighted.

Here VLAN 1’s frames, such as the few that SW1 sends of its own, cross the trunk with no tag, exactly as they are.

Key idea

On a trunk every frame carries a tag with its VLAN ID, except the native VLAN’s, VLAN 1 here. The hosts’ frames on their access ports carry no tag.

SW1 sends three frames out of the trunk: H1’s broadcast, H2’s broadcast and a frame in VLAN 1. Which of them crosses without a tag?

Configure

Make the link a trunk

How do you make the cable between the switches a trunk?

Each end is a port on a different switch, so each end is set up on its own switch, and you type the same lines on both.

Before the change, SW2’s MAC address table shows what crosses the cable. show mac address-table dynamic lists each address SW2 has learned, with its VLAN and the port its frames came in on.

On SW2, before the change, after H1 and H2 have sent frames:

Output · IOS XE 17.18.2
SW2#show mac address-table dynamic Mac Address Table-------------------------------------------1Vlan 10Mac Address 5254.0000.0011Type DYNAMICPorts Et0/02Vlan 10Mac Address 5254.0000.0033Type DYNAMICPorts Et0/13Vlan 10Mac Address aabb.cc00.0400Type DYNAMICPorts Et0/0Total Mac Addresses for this criterion: 3
  1. H1’s address, learned on Et0/0 in VLAN 10.
  2. H3’s address, on its own port Et0/1.
  3. aabb.cc00.0400 is SW1’s own address. SW1 sends a few frames of its own over the cable. It is not host traffic.

There is no entry for H2’s 5254.0000.0022. Its VLAN 20 frames cannot cross a cable whose ends are access ports in VLAN 10.

Full output · 9 lines
SW2#show mac address-table dynamic          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----  10    5254.0000.0011    DYNAMIC     Et0/0  10    5254.0000.0033    DYNAMIC     Et0/1  10    aabb.cc00.0400    DYNAMIC     Et0/0Total Mac Addresses for this criterion: 3

On SW1, in privileged EXEC:

Output · IOS XE 17.18.2
1SW1#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.2SW1(config)#interface Ethernet0/03SW1(config-if)#switchport trunk encapsulation dot1q4SW1(config-if)#switchport mode trunk5SW1(config-if)#end
  1. configure terminal Global configuration. New prompt: SW1(config)#
  2. interface Ethernet0/0 Interface configuration for Et0/0, the port toward SW2. New prompt: SW1(config-if)#
  3. switchport trunk encapsulation dot1q Sets the trunk to use 802.1Q tags.
  4. switchport mode trunk Makes the port a trunk port. By default every VLAN ID, 1 to 4094, is allowed on a trunk port.
  5. end Back to privileged EXEC. New prompt: SW1#

Impact These lines change SW1’s end of the link only. VLAN 20 crosses only once both ends are trunk ports.

Once SW2’s end is a trunk port too, H2 sends a broadcast again. Under which VLAN, and on which port, will SW2 list H2’s address?

On SW2, the same lines for its end:

Output · IOS XE 17.18.2
1SW2#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.2SW2(config)#interface Ethernet0/03SW2(config-if)#switchport trunk encapsulation dot1q4SW2(config-if)#switchport mode trunk5SW2(config-if)#end
  1. configure terminal Global configuration. New prompt: SW2(config)#
  2. interface Ethernet0/0 Interface configuration for Et0/0, the port toward SW1. New prompt: SW2(config-if)#
  3. switchport trunk encapsulation dot1q Sets the trunk to use 802.1Q tags, as on SW1.
  4. switchport mode trunk Et0/0 becomes a trunk port.
  5. end Back to privileged EXEC. New prompt: SW2#

Both ends of the cable are now trunk ports.

On SW2, after the change, once H1 and H2 have sent frames:

Output · IOS XE 17.18.2
SW2#show mac address-table dynamic Mac Address Table-------------------------------------------1Vlan 1Mac Address aabb.cc00.0400Type DYNAMICPorts Et0/02Vlan 10Mac Address 5254.0000.0011Type DYNAMICPorts Et0/0Vlan 10Mac Address 5254.0000.0033Type DYNAMICPorts Et0/11Vlan 10Mac Address aabb.cc00.0400Type DYNAMICPorts Et0/03Vlan 20Mac Address 5254.0000.0022Type DYNAMICPorts Et0/01Vlan 20Mac Address aabb.cc00.0400Type DYNAMICPorts Et0/0Total Mac Addresses for this criterion: 6
  1. SW1’s own address, now in VLAN 1, VLAN 10 and VLAN 20. SW1 sends a few frames of its own in each VLAN on the trunk.
  2. H1, in VLAN 10, on Et0/0.
  3. H2, in VLAN 20, on Et0/0 too. VLAN 20 now crosses the link.

One port carries both VLANs, and the tags keep them apart.

Full output · 12 lines
SW2#show mac address-table dynamic          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    aabb.cc00.0400    DYNAMIC     Et0/0  10    5254.0000.0011    DYNAMIC     Et0/0  10    5254.0000.0033    DYNAMIC     Et0/1  10    aabb.cc00.0400    DYNAMIC     Et0/0  20    5254.0000.0022    DYNAMIC     Et0/0  20    aabb.cc00.0400    DYNAMIC     Et0/0Total Mac Addresses for this criterion: 6

Key idea

Make both ends of the link trunk ports. On these switches each end takes switchport trunk encapsulation dot1q and then switchport mode trunk. Then every VLAN that exists on both switches, here VLANs 1, 10 and 20, crosses it.

Verify

Read show interfaces trunk

Is Et0/0 really a trunk now, and which VLANs does it carry?

Before you read the output, count. Both switches have VLANs 1, 10 and 20 (Figure 2.5), so the trunk should carry three.

SW1first floorSW2second floor1, 10, 20trunktrunkThree VLANs on one cable
Figure 2.5 · SW1 and SW2 both have VLANs 1, 10 and 20, so the trunk carries all three.

SW1 and SW2 side by side, joined by one cable that carries the chip 1, 10, 20. A chip under each switch reads trunk. Under the drawing: three VLANs on one cable.

show interfaces trunk shows the trunk configuration of each port that is trunking (working as a trunk port now).

On SW1, before the change:

Output · IOS XE 17.18.2
1SW1#show interfaces trunk(no output: the command printed nothing)
  1. Nothing under the command. SW1 had no trunk port.

After the change, the first part of the output gives each port’s mode, encapsulation (the way it tags frames), status and native VLAN.

On SW1, now:

Tap a line, or “Not in the output”, then submit.

Find the line that gives Et0/0’s native VLAN.

Output · IOS XE 17.18.2
SW1#show interfaces trunk
  1. Et0/0 is set to trunk by hand (on), uses the 802.1Q tag and is trunking. Its native VLAN is 1.
  2. By default every VLAN ID, 1 to 4094, is allowed. This is a limit, not a list of VLANs that exist.
  3. The allowed VLANs that are active on SW1. The old reserved VLANs 1002 to 1005 are left out.
  4. Of those, the VLANs the trunk forwards. Here they are the same three, so the trunk carries all of them.
Full output · 12 lines
SW1#show interfaces trunk Port           Mode             Encapsulation  Status        Native vlan  Et0/0          on               802.1q         trunking      1 Port           Vlans allowed on trunkEt0/0          1-4094 Port           Vlans allowed and active in management domainEt0/0          1,10,20 Port           Vlans in spanning tree forwarding state and not prunedEt0/0          1,10,20

Now that Et0/0 is a trunk port, no row of SW1’s show vlan brief lists it, although it carries VLANs 1, 10 and 20.

On SW1, now:

Output · IOS XE 17.18.2
SW1#show vlan briefVLAN 1Name defaultStatus activePorts Et0/31VLAN 10Name STAFFStatus activePorts Et0/12VLAN 20Name GUESTStatus activePorts Et0/2VLAN 1002Name fddi-defaultStatus act/unsupPorts —VLAN 1003Name token-ring-defaultStatus act/unsupPorts —VLAN 1004Name fddinet-defaultStatus act/unsupPorts —VLAN 1005Name trnet-defaultStatus act/unsupPorts —
  1. VLAN 10 lists only Et0/1, H1’s port. Et0/0, now a trunk port, has left the list.
  2. VLAN 20 lists Et0/2, H2’s port.
Full output · 10 lines
SW1#show vlan brief VLAN Name                             Status    Ports---- -------------------------------- --------- -------------------------------1    default                          active    Et0/310   STAFF                            active    Et0/120   GUEST                            active    Et0/21002 fddi-default                     act/unsup 1003 token-ring-default               act/unsup 1004 fddinet-default                  act/unsup 1005 trnet-default                    act/unsup 

Key idea

show interfaces trunk is where a trunk shows up, with its status, its native VLAN and the VLANs it carries.

Where do you read that VLAN 20 is allowed and active on Et0/0?

Troubleshoot

When a VLAN does not cross

Sometimes SW2 stops taking in H2’s frames. What stops one VLAN from crossing a link?

Case 1 of 2.SW2 stops taking in H2’s frames

  1. Case 1 · Symptom

    It starts after some work on the second floor.

    On SW2, after H2 has sent a broadcast:

    Output · IOS XE 17.18.2
    SW2#show mac address-table dynamic          Mac Address Table------------------------------------------- 1Vlan    Mac Address       Type        Ports----    -----------       --------    -----
    1. Nothing under the header. There is no line for H2’s 5254.0000.0022, and none for any other address.
  2. Case 1 · Command

    Is SW2’s Et0/0 still a trunk port?

  3. Case 1 · Output

    On SW2:

    Output · IOS XE 17.18.2
    1SW2#show interfaces trunk(no output: the command printed nothing)
    1. Key line Nothing under the command. SW2 has no trunk port.

    On SW2, the VLAN list:

    Output · IOS XE 17.18.2
    SW2#show vlan briefVLAN 1Name defaultStatus activePorts Et0/2, Et0/31VLAN 10Name STAFFStatus activePorts Et0/0, Et0/1VLAN 20Name GUESTStatus activePorts —VLAN 1002Name fddi-defaultStatus act/unsupPorts —VLAN 1003Name token-ring-defaultStatus act/unsupPorts —VLAN 1004Name fddinet-defaultStatus act/unsupPorts —VLAN 1005Name trnet-defaultStatus act/unsupPorts —
    1. Et0/0 is listed under VLAN 10 again, so it is an access port.
    Full output · 10 lines
    SW2#show vlan brief VLAN Name                             Status    Ports---- -------------------------------- --------- -------------------------------1    default                          active    Et0/2, Et0/310   STAFF                            active    Et0/0, Et0/120   GUEST                            active    1002 fddi-default                     act/unsup 1003 token-ring-default               act/unsup 1004 fddinet-default                  act/unsup 1005 trnet-default                    act/unsup 

    On SW1, the other end:

    Output · IOS XE 17.18.2
    SW1#show interfaces trunk1Port Et0/0Mode onEncapsulation 802.1qStatus trunkingNative vlan 1Port Et0/0Vlans allowed on trunk 1-4094Port Et0/0Vlans allowed and active in management domain 1,10,20Port Et0/0Vlans in spanning tree forwarding state and not pruned 1,10,20
    1. SW1’s end is still a trunk port.
    Full output · 12 lines
    SW1#show interfaces trunk Port           Mode             Encapsulation  Status        Native vlan  Et0/0          on               802.1q         trunking      1 Port           Vlans allowed on trunkEt0/0          1-4094 Port           Vlans allowed and active in management domainEt0/0          1,10,20 Port           Vlans in spanning tree forwarding state and not prunedEt0/0          1,10,20
  4. Case 1 · What it means

    SW1first floorSW2second floortrunkaccessVLAN 10tag 20
    Figure 2.6 · Case 1 · SW1 sends tagged frames, but SW2’s end is an access port, so VLAN 20 does not get in.

    SW1 on the left and SW2 on the right, joined by one cable. The chip under SW1 reads trunk. The chip under SW2 reads access, VLAN 10, and is highlighted. An arrow under the cable, labeled tag 20, points from SW1 toward SW2 and ends at a cross next to SW2.

    • SW1 still sends H2’s frames tagged. But SW2 lists its Et0/0 under VLAN 10 and not as a trunk port, so SW2’s end is an access port in VLAN 10. An access port carries the traffic of only one VLAN, and SW2 learned none of H2’s VLAN 20 frames on it.
    • SW1’s end alone is not enough; both ends must be trunking.
  5. Case 1 · Fix

    Make SW2’s end a trunk port. Its encapsulation line is still there, so switchport mode trunk alone is enough.

    On SW2:

    Output · IOS XE 17.18.2
    SW2#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.SW2(config)#interface Ethernet0/01SW2(config-if)#switchport mode trunkSW2(config-if)#end
    1. Et0/0 becomes a trunk port again.
  6. Case 1 · Proof

    SW2 lists Et0/0 as trunking again.

    On SW2, after the fix:

    Output · IOS XE 17.18.2
    SW2#show interfaces trunk1Port Et0/0Mode onEncapsulation 802.1qStatus trunkingNative vlan 1… 8 more lines (see Full output)
    1. Et0/0 is trunking, with native VLAN 1.
    Full output · 12 lines
    SW2#show interfaces trunk Port           Mode             Encapsulation  Status        Native vlan  Et0/0          on               802.1q         trunking      1 Port           Vlans allowed on trunkEt0/0          1-4094 Port           Vlans allowed and active in management domainEt0/0          1,10,20 Port           Vlans in spanning tree forwarding state and not prunedEt0/0          1,10,20

End of case 1. Solved: Both ends are trunk ports again.

Case 2 of 2.SW2 stops taking in H2’s frames again

  1. Case 2 · Symptom

    A week later, after more work on SW2, the same symptom is back.

    On SW2, after H2 has sent a broadcast:

    Output · IOS XE 17.18.2
    SW2#show mac address-table dynamic Mac Address Table-------------------------------------------1Vlan 1Mac Address aabb.cc00.0400Type DYNAMICPorts Et0/01Vlan 10Mac Address aabb.cc00.0400Type DYNAMICPorts Et0/0Total Mac Addresses for this criterion: 2
    1. Only SW1’s own address. There is no entry for H2’s 5254.0000.0022.
    Full output · 8 lines
    SW2#show mac address-table dynamic          Mac Address Table------------------------------------------- Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    aabb.cc00.0400    DYNAMIC     Et0/0  10    aabb.cc00.0400    DYNAMIC     Et0/0Total Mac Addresses for this criterion: 2
  2. Case 2 · Command

    Is Et0/0 still trunking, and which VLANs does it carry?

  3. Case 2 · Output

    On SW2:

    Output · IOS XE 17.18.2
    SW2#show interfaces trunk1Port Et0/0Mode onEncapsulation 802.1qStatus trunkingNative vlan 1Port Et0/0Vlans allowed on trunk 1-40942Port Et0/0Vlans allowed and active in management domain 1,10Port Et0/0Vlans in spanning tree forwarding state and not pruned 1,10
    1. Et0/0 is trunking, so the trunk is up.
    2. Key line Only VLANs 1 and 10 are allowed and active. VLAN 20 is allowed, but SW2 does not have it. VLAN 10 still crosses.
    Full output · 12 lines
    SW2#show interfaces trunk Port           Mode             Encapsulation  Status        Native vlan  Et0/0          on               802.1q         trunking      1 Port           Vlans allowed on trunkEt0/0          1-4094 Port           Vlans allowed and active in management domainEt0/0          1,10 Port           Vlans in spanning tree forwarding state and not prunedEt0/0          1,10

    On SW2, the VLAN list:

    Output · IOS XE 17.18.2
    SW2#show vlan briefVLAN 1Name defaultStatus activePorts Et0/2, Et0/31VLAN 10Name STAFFStatus activePorts Et0/1VLAN 1002Name fddi-defaultStatus act/unsupPorts —VLAN 1003Name token-ring-defaultStatus act/unsupPorts —VLAN 1004Name fddinet-defaultStatus act/unsupPorts —VLAN 1005Name trnet-defaultStatus act/unsupPorts —
    1. VLAN 10 is the last VLAN before the reserved rows 1002 to 1005. There is no row for VLAN 20.
    Full output · 9 lines
    SW2#show vlan brief VLAN Name                             Status    Ports---- -------------------------------- --------- -------------------------------1    default                          active    Et0/2, Et0/310   STAFF                            active    Et0/11002 fddi-default                     act/unsup 1003 token-ring-default               act/unsup 1004 fddinet-default                  act/unsup 1005 trnet-default                    act/unsup 
  4. Case 2 · What it means

    SW1first floorSW2second floortrunktrunkVLANs 1, 10tag 20
    Figure 2.7 · Case 2 · The trunk is up, but SW2 has no VLAN 20, so it does not take VLAN 20 frames in.

    SW1 on the left and SW2 on the right, joined by one cable. The chip under SW1 reads trunk. The chip under SW2 reads trunk, VLANs 1, 10, and is highlighted. An arrow under the cable, labeled tag 20, points from SW1 toward SW2 and ends at a cross next to SW2.

    • SW2 has no VLAN 20 row, and its trunk lists only VLANs 1 and 10 as allowed and active.
    • A trunk carries only the allowed VLANs that are active on the switch, so SW2 does not take VLAN 20 frames in.
    • Allowing a VLAN on the trunk is not enough. Both switches must have it.
  5. Case 2 · Fix

    Create VLAN 20 on SW2 again.

    On SW2:

    Output · IOS XE 17.18.2
    SW2#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.1SW2(config)#vlan 20SW2(config-vlan)#name GUESTSW2(config-vlan)#end
    1. VLAN 20 exists again. The next line gives it its name.

    Impact Creating a VLAN changes no port. The trunk then carries the VLAN again.

  6. Case 2 · Proof

    SW2 lists VLAN 20 as allowed and active again.

    On SW2, after the fix:

    Output · IOS XE 17.18.2
    SW2#show interfaces trunk… 7 more lines (see Full output)1Port Et0/0Vlans allowed and active in management domain 1,10,20… 3 more lines (see Full output)
    1. Allowed and active: 1, 10 and 20 again.
    Full output · 12 lines
    SW2#show interfaces trunk Port           Mode             Encapsulation  Status        Native vlan  Et0/0          on               802.1q         trunking      1 Port           Vlans allowed on trunkEt0/0          1-4094 Port           Vlans allowed and active in management domainEt0/0          1,10,20 Port           Vlans in spanning tree forwarding state and not prunedEt0/0          1,10,20

End of case 2. Solved: VLAN 20 crosses the trunk again.

Both cases

Key idea

A VLAN crosses a trunk only if both ends are trunking and both switches have the VLAN. Run show interfaces trunk on both switches. Each must list the port as trunking, with the VLAN under “allowed and active”.

On SW1, the “allowed on trunk” line for Et0/0 still reads 1-4094, but the “allowed and active” line lists VLAN 1 and VLAN 10 only. Whose frames stop crossing to SW2?

Check

Which part of H2’s tagged frame tells SW2 that the frame is in VLAN 20?
A trunk between two other switches carries VLANs 1, 10 and 20, and its native VLAN is 1. Which frames cross it without a tag?

On SW2:

Tap a line, or “Not in the output”, then submit.

Find the line that lists the allowed VLANs that are active on SW2 for Et0/0.

Output · IOS XE 17.18.2
SW2#show interfaces trunk
Full output · 12 lines
SW2#show interfaces trunk Port           Mode             Encapsulation  Status        Native vlan  Et0/0          on               802.1q         trunking      1 Port           Vlans allowed on trunkEt0/0          1-4094 Port           Vlans allowed and active in management domainEt0/0          1,10,20 Port           Vlans in spanning tree forwarding state and not prunedEt0/0          1,10,20
H3 sends a broadcast, and both ends of the cable are trunk ports. What does its frame carry on the trunk, and who gets it?
SW1’s Et0/0 is set back to an access port in VLAN 10, and SW2’s end stays a trunk port. What happens to H2’s broadcasts?

Summary

H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 10VLAN 20VLAN 10trunknot senttag 20VLAN 20not sent
Figure 2.3, recap · SW2 takes H2’s frame into VLAN 20, which has no access port on SW2 yet, so the frame goes no further. H3, in VLAN 10, gets nothing.

The network with a VLAN chip at the switch end of each host cable and the chip trunk on the cable between the switches. Arrows follow H2’s broadcast up into SW1 and along the trunk toward SW2, with the chip tag 20 under the cable and the chip VLAN 20 above SW2’s name. Crosses with “not sent” sit beside H1’s cable and H3’s cable, both in VLAN 10.

  • An access port carries one VLAN. A trunk carries several VLANs on one cable, here between the two switches.
  • On a trunk, a tagged frame carries a 4-byte 802.1Q tag after the source MAC address. It holds the TPID, 0x8100, and the 12-bit VLAN ID.
  • The receiving switch reads the tag, keeps the frame in that VLAN, and sends it out of an access port with no tag. The native VLAN, VLAN 1 by default, crosses without a tag.
  • On these switches, switchport trunk encapsulation dot1q and switchport mode trunk on both ends make the link a trunk.
  • show interfaces trunk shows whether a port is trunking, its native VLAN and the VLANs it carries. show vlan brief does not list SW1’s trunk port.
  • A VLAN crosses a trunk only if both ends are trunking and both switches have the VLAN.