VLANs and trunking · Introduction · Module 2
802.1Q tags and trunk links
Show topologyHide topology
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
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).
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.
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.
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.
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:
- Et0/0, the port toward SW1, is an access port in VLAN 10. Et0/1 is H3’s port.
- VLAN 20, GUEST, exists. No port is in it.
- 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
Scroll sideways to see the whole output
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
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
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
On the way out of Et0/0, SW1 inserts the 802.1Q tag. It holds 0x8100 and VLAN ID 20.
Step 4 of 6
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
SW2 reads VLAN ID 20 in the tag and takes the frame into its VLAN 20.
Step 6 of 6
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 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.
Answer here to see step 5, or tap “Skip, show me”.
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
SW1 Et0/0: does the frame carry a tag there?
SW2 Et0/0: does the frame carry a tag there?
Pick a sender
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.
| Sender | VLAN | Leaves through | Reaches |
|---|---|---|---|
| H1 | 10 | SW1 Et0/0 (tag 10), SW2 Et0/1 (no tag) | H3 |
| H2 | 20 | SW1 Et0/0 (tag 20) | no host |
| H3 | 10 | SW2 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).
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.
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:
- H1’s address, learned on Et0/0 in VLAN 10.
- H3’s address, on its own port Et0/1.
- 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
Scroll sideways to see the whole output
On SW1, in privileged EXEC:
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
configure terminalGlobal configuration. New prompt:SW1(config)#interface Ethernet0/0Interface configuration for Et0/0, the port toward SW2. New prompt:SW1(config-if)#switchport trunk encapsulation dot1qSets the trunk to use 802.1Q tags.switchport mode trunkMakes the port a trunk port. By default every VLAN ID, 1 to 4094, is allowed on a trunk port.endBack 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.
On SW2, the same lines for its end:
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
configure terminalGlobal configuration. New prompt:SW2(config)#interface Ethernet0/0Interface configuration for Et0/0, the port toward SW1. New prompt:SW2(config-if)#switchport trunk encapsulation dot1qSets the trunk to use 802.1Q tags, as on SW1.switchport mode trunkEt0/0 becomes a trunk port.endBack 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:
- 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.
- H1, in VLAN 10, on Et0/0.
- 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
Scroll sideways to see the whole output
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.
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:
1SW1#show interfaces trunk(no output: the command printed nothing)
Scroll sideways to see the whole output
- 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.
- Et0/0 is set to trunk by hand (on), uses the 802.1Q tag and is trunking. Its native VLAN is 1.
- By default every VLAN ID, 1 to 4094, is allowed. This is a limit, not a list of VLANs that exist.
- The allowed VLANs that are active on SW1. The old reserved VLANs 1002 to 1005 are left out.
- 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
Scroll sideways to see the whole output
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:
- VLAN 10 lists only Et0/1, H1’s port. Et0/0, now a trunk port, has left the list.
- 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
Scroll sideways to see the whole output
Key idea
show interfaces trunk is where a trunk shows up, with its status, its native VLAN and the VLANs it carries.
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
Case 1 · Symptom
It starts after some work on the second floor.
On SW2, after H2 has sent a broadcast:
SW2#show mac address-table dynamic Mac Address Table------------------------------------------- 1Vlan Mac Address Type Ports---- ----------- -------- -----
- Nothing under the header. There is no line for H2’s 5254.0000.0022, and none for any other address.
Case 1 · Command
Is SW2’s Et0/0 still a trunk port?
Case 1 · Output
On SW2:
1SW2#show interfaces trunk(no output: the command printed nothing)
Scroll sideways to see the whole output
- Key line Nothing under the command. SW2 has no trunk port.
On SW2, the VLAN list:
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 —- 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
Scroll sideways to see the whole output
On SW1, the other end:
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- 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
Scroll sideways to see the whole output
Case 1 · What it means
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.
Case 1 · Fix
Make SW2’s end a trunk port. Its encapsulation line is still there, so
switchport mode trunkalone is enough.On SW2:
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
- Et0/0 becomes a trunk port again.
Case 1 · Proof
SW2 lists Et0/0 as trunking again.
On SW2, after the fix:
SW2#show interfaces trunk1Port Et0/0Mode onEncapsulation 802.1qStatus trunkingNative vlan 1… 8 more lines (see Full output)- 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
Scroll sideways to see the whole output
End of case 1. Solved: Both ends are trunk ports again.
Case 2 of 2.SW2 stops taking in H2’s frames again
Case 2 · Symptom
A week later, after more work on SW2, the same symptom is back.
On SW2, after H2 has sent a broadcast:
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- 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
Scroll sideways to see the whole output
Case 2 · Command
Is Et0/0 still trunking, and which VLANs does it carry?
Case 2 · Output
On SW2:
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- Et0/0 is trunking, so the trunk is up.
- 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
Scroll sideways to see the whole output
On SW2, the VLAN list:
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 —- 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
Scroll sideways to see the whole output
Case 2 · What it means
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.
Case 2 · Fix
Create VLAN 20 on SW2 again.
On SW2:
SW2#configure terminalEnter configuration commands, one per line. End with CNTL/Z.1SW2(config)#vlan 20SW2(config-vlan)#name GUESTSW2(config-vlan)#end
- 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.
Case 2 · Proof
SW2 lists VLAN 20 as allowed and active again.
On SW2, after the fix:
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)- 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
Scroll sideways to see the whole output
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”.
Check
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.
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
Scroll sideways to see the whole output
Summary
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 dot1qandswitchport mode trunkon both ends make the link a trunk. show interfaces trunkshows whether a port is trunking, its native VLAN and the VLANs it carries.show vlan briefdoes not list SW1’s trunk port.- A VLAN crosses a trunk only if both ends are trunking and both switches have the VLAN.