VLANs and trunking · Introduction · Module 1
VLANs: one switch, separate LANs
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 VLAN is
One switch, several LANs
One switch, one broadcast domain
H1, a staff host, and H2, a guest host, plug into the same switch, and their addresses are in different networks. How far does a broadcast from H1 travel?
As far as the switches flood it. A broadcast is meant for every device, and all the devices one broadcast reaches form one broadcast domain. A switch floods a broadcast frame, sending it out of every other port that is up.
Each floor of this office has a LAN, the local network of one place, and your home network is one too. SW1 serves the first floor and SW2 the second, and one cable joins them.
The network as in the topology, with a chip “to everyone” next to H1. Arrows beside the cables follow the broadcast: from H1 down into SW1, from SW1 down to H2 (highlighted), from SW1 along the cable to SW2, and from SW2 down to H3. Under the drawing: two hosts hear it.
Without VLANs, a switch and everything cabled to it is one broadcast domain. H2 hears H1’s broadcasts (Figure 1.1).
Addresses in different IP networks do not split a broadcast domain. The switch forwards frames by port and MAC address, so a host’s IP address plays no part in where a broadcast goes.
So a guest host hears every staff broadcast, and every host spends time on broadcasts it has no use for.
A VLAN splits one switch into separate LANs
Could SW1 act as two switches in one box, one for staff and one for guests?
It can. A VLAN (virtual LAN) is a group of switch ports that forms its own LAN. A switch floods frames, broadcasts included, only to the ports of the same VLAN.
One VLAN is one broadcast domain. So a switch with several VLANs holds one broadcast domain per VLAN.
You do not need a second switch or new cables for a VLAN. The hosts keep their switch and their cables, and the switch keeps the groups apart by port.
SW1’s hosts sit in two VLANs, numbered 10 and 20 (Figure 1.2).
The network as in the topology, with a VLAN chip at the switch end of each host cable: VLAN 10 at H1’s cable, VLAN 20 at H2’s cable (highlighted) and VLAN 10 at H3’s cable on SW2; a VLAN 10 chip sits on the cable between the switches. Under the drawing: two VLANs, two broadcast domains.
How do you tell the VLANs apart? Each VLAN has a VLAN ID, a number from 1 to 4094 that names it, and it can also have a name for people to read. In this network VLAN 10, named STAFF, is the staff VLAN, and VLAN 20, named GUEST, is the guest VLAN.
VLAN 1 is the default VLAN. It always exists and cannot be deleted. Every port of SW1 started in it, and on SW1 a port stays there until it is put in another VLAN.
So a port that nobody has set up is still in a VLAN.
Here each VLAN is also one IP network. VLAN 10 uses 10.1.10.0/24 and VLAN 20 uses 10.1.20.0/24. Tying each VLAN to one IP network is a common plan, not a rule, and the VLAN ID and the address are chosen separately.
Traffic from one VLAN to another must pass through a router, a device that passes traffic between networks. This network has none.
How it works
A broadcast stays in its VLAN
SW1 cannot see who is behind a port. So how does it know which VLAN a frame belongs to?
It goes by the port the frame came in on, not by the host or its address.
An access port is a switch port that belongs to exactly one VLAN. The host on it sends ordinary frames and does not know its VLAN. The switch puts every ordinary frame that comes in on an access port into that port’s VLAN.
A host on an access port does not pick its VLAN, and its frames carry no VLAN number. Put its port in another VLAN, and the same host, sending the same frames, is in that VLAN.
You can read each access port’s VLAN with show vlan brief, which lists a switch’s VLANs and their access ports. These switches name their ports Ethernet0/0 and so on, Et0/0 for short. On SW1, Et0/0 goes to SW2, Et0/1 to H1 and Et0/2 to H2.
On SW1, before any VLAN is set up:
- The default VLAN holds Et0/0 to Et0/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 · 8 lines
SW1#show vlan brief VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Et0/0, Et0/1, Et0/2, Et0/31002 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
Follow one broadcast from H1, first before VLANs and then with them (Figure 1.3).
Step 1 of 6
Before VLANs. H1’s broadcast comes in on Et0/1, and SW1 floods it out of Et0/0 and Et0/2. H2 gets it, and so does H3 through SW2.
Step 2 of 6
Now the ports are in VLANs, and Et0/1, H1’s port, is an access port in VLAN 10. H1 sends the same ordinary frame. SW1 puts it in VLAN 10 because it came in on Et0/1.
Step 3 of 6
SW1 must flood the frame. Et0/0, the cable to SW2, is in VLAN 10. Et0/2, H2’s port, is in VLAN 20.
Which ports does SW1 send H1’s broadcast out of?
- Et0/0 only, the cable to SW2 (Correct): The frame is in VLAN 10. SW1 floods it out of its other VLAN 10 ports only, and the one left is Et0/0, the cable to SW2. Et0/2 is in VLAN 20.
- Et0/0 and Et0/2: both have a cable: A cable is not enough. Et0/2 is in VLAN 20, and SW1 floods a VLAN 10 frame only to VLAN 10 ports.
- Et0/2 only: H2 is on the same switch: H2’s port is in VLAN 20, so it gets none of VLAN 10’s frames. The frame goes out of Et0/0, the other VLAN 10 port.
- Every other port, as before VLANs: The cables are the ones from before, but the ports are now in VLANs. From now on SW1 floods a frame only to the ports of the frame’s VLAN.
Step 4 of 6
SW1 sends it out of the other VLAN 10 port only, Et0/0 toward SW2. Et0/2 is in VLAN 20, so nothing goes to H2.
Step 5 of 6
SW2’s Et0/0 is in VLAN 10 too. SW2 floods the frame out of its other VLAN 10 port, Et0/1, and H3 gets it.
Step 6 of 6
One broadcast domain per VLAN. H1’s broadcast reaches H3, in VLAN 10, and not H2, in VLAN 20.
The network as in the topology. Step 1, before VLANs: arrows beside the cables go from H1 into SW1, from SW1 to H2, from SW1 to SW2 and from SW2 to H3. Step 2: VLAN chips appear at the switch end of each cable, VLAN 10 at H1’s, VLAN 20 at H2’s, VLAN 10 at H3’s and on the cable between the switches; only the arrow from H1 into SW1 is drawn. Step 3 asks where SW1 sends the frame. Step 4: an arrow from SW1 toward SW2, and a cross with “not sent” beside H2’s cable. Step 5: an arrow from SW2 down to H3. Step 6 shows the whole path from H1 to H3, with the cross at H2’s cable.
Answer here to see step 4, or tap “Skip, show me”.
SW2’s MAC address table, which lists each address with its VLAN and port, shows H1’s frames got there.
On SW2, with the ports in their VLANs, after H1 has 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, so SW2 learns it too. It is not host traffic.
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
Now follow a broadcast from H3, on SW2.
Tap every port H3’s broadcast leaves through, then submit.
H3’s frame enters SW2 on Et0/1.
Ports of SW1
Ports of SW2
Pick a sender
Answer
It leaves through SW2 Et0/0, SW1 Et0/1. Reaches: H1.
H3’s port is in VLAN 10. SW2 floods the frame out of its other VLAN 10 port, Et0/0, to SW1. That cable is in VLAN 10 at SW1 too, so SW1 floods it out of its other VLAN 10 port, Et0/1, to H1.
| Sender | VLAN | Leaves through | Reaches |
|---|---|---|---|
| H1 | 10 | SW1 Et0/0, SW2 Et0/1 | H3 |
| H2 | 20 | no port | no host |
| H3 | 10 | SW2 Et0/0, SW1 Et0/1 | H1 |
Both ends of the cable between SW1 and SW2 are access ports in VLAN 10, so the cable carries VLAN 10 only. A VLAN 20 broadcast from H2 has no port to leave SW1 through.
Key idea
An access port belongs to one VLAN. A switch floods a broadcast only out of the other ports of that VLAN, so the port’s VLAN, not the host’s address, decides who hears it.
Configure
Put a port in a VLAN
How did H2’s port get into VLAN 20?
In two steps. The VLAN is created, then two lines put the port in it.
First check which VLAN the port is in now. show interfaces status prints each port’s state and VLAN. Et0/3 is shut, turned off by hand, so its state reads disabled.
On SW1, before the change:
- Et0/2, H2’s port, is in VLAN 1.
Full output · 6 lines
SW1#show interfaces status Port Name Status Vlan Duplex Speed TypeEt0/0 connected 10 full auto 10/100/1000BaseTXEt0/1 connected 10 full auto 10/100/1000BaseTXEt0/2 connected 1 full auto 10/100/1000BaseTXEt0/3 disabled 1 full auto 10/100/1000BaseTX
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)#vlan 203SW1(config-vlan)#name GUEST4SW1(config-vlan)#exit5SW1(config)#interface Ethernet0/26SW1(config-if)#switchport mode access7SW1(config-if)#switchport access vlan 208SW1(config-if)#end
configure terminalGlobal configuration. New prompt:SW1(config)#vlan 20Creates VLAN 20. The prompt(config-vlan)#is for the settings of this one VLAN. New prompt:SW1(config-vlan)#name GUESTA name for people to read. The switch tells VLANs apart by their ID.exitBack to global configuration. New prompt:SW1(config)#interface Ethernet0/2Interface configuration for Et0/2, H2’s port. New prompt:SW1(config-if)#switchport mode accessMakes Et0/2 an access port, a port in one VLAN.switchport access vlan 20Puts the port in a VLAN, here VLAN 20.endBack to privileged EXEC. New prompt:SW1#
VLAN 20 now exists, and Et0/2 is an access port in it.
Impact Moving a port to another VLAN cuts its host off from the old VLAN at once.
On SW1, after the change:
- Et0/2 is now in VLAN 20. The other ports kept their VLANs.
Full output · 6 lines
SW1#show interfaces status Port Name Status Vlan Duplex Speed TypeEt0/0 connected 10 full auto 10/100/1000BaseTXEt0/1 connected 10 full auto 10/100/1000BaseTXEt0/2 connected 20 full auto 10/100/1000BaseTXEt0/3 disabled 1 full auto 10/100/1000BaseTX
Scroll sideways to see the whole output
Key idea
Create the VLAN, then give the port two lines: switchport mode access, and switchport access vlan with the VLAN ID.
Verify
Read show vlan brief
Which VLANs does SW1 have now, and which ports are in each?
Count first. SW1 has four ports (Figure 1.4). Two are in VLAN 10, one is in VLAN 20, and the unused one, Et0/3, is still in VLAN 1. So three VLANs should list ports.
SW1, the first-floor switch, with its four ports drawn as a row of boxes under it. Et0/0, to SW2, VLAN 10. Et0/1, H1, VLAN 10. Et0/2, H2, VLAN 20. Et0/3, unused, VLAN 1, shut.
show vlan brief prints one row per VLAN, with its ID, its name, its state and its access ports.
On SW1, now:
Tap a line, or “Not in the output”, then submit.
Find the line that says which VLAN H2’s port, Et0/2, is in.
- On SW1, VLAN 1 keeps Et0/3, the port nobody moved. A port that is shut is still listed.
- VLAN 10, STAFF. Et0/1 is H1’s port and Et0/0 is the cable to SW2.
- VLAN 20, GUEST, with H2’s port.
- VLANs 1002 to 1005, the rows reserved for old network types. No port is in them.
Full output · 10 lines
SW1#show vlan brief VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Et0/310 STAFF active Et0/0, 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
SW1 also files each MAC address it learns under a VLAN, even for hosts on SW2. show mac address-table dynamic lists those entries.
On SW1, after the hosts have sent some frames:
- H1, in VLAN 10, on its port Et0/1.
- H3, in VLAN 10, on Et0/0.
- H2, in VLAN 20, on Et0/2.
Full output · 9 lines
SW1#show mac address-table dynamic Mac Address Table------------------------------------------- Vlan Mac Address Type Ports---- ----------- -------- ----- 10 5254.0000.0011 DYNAMIC Et0/1 10 5254.0000.0033 DYNAMIC Et0/0 20 5254.0000.0022 DYNAMIC Et0/2Total Mac Addresses for this criterion: 3
Scroll sideways to see the whole output
Key idea
show vlan brief lists each VLAN with its access ports. On SW1, the port nobody moved, Et0/3, is still in the default VLAN.
Troubleshoot
A host in the wrong VLAN
Every cable is fine, yet H1 and H3 cannot reach each other. What can a VLAN setting break?
Case 1 of 2.H1’s port is in VLAN 1
Case 1 · Symptom
H1’s user says H3 does not answer. Nothing changed on the second floor.
On SW2, after H1 tried to reach H3:
SW2#show mac address-table dynamic Mac Address Table-------------------------------------------1Vlan 10Mac Address aabb.cc00.0400Type DYNAMICPorts Et0/0Total Mac Addresses for this criterion: 1- Only aabb.cc00.0400, SW1’s own address. SW2 has learned nothing from H1 or H3.
Full output · 7 lines
SW2#show mac address-table dynamic Mac Address Table------------------------------------------- Vlan Mac Address Type Ports---- ----------- -------- ----- 10 aabb.cc00.0400 DYNAMIC Et0/0Total Mac Addresses for this criterion: 1
Scroll sideways to see the whole output
Case 1 · Command
Which VLAN is H1’s port in?
Case 1 · Output
On SW1:
SW1#show vlan brief1VLAN 1Name defaultStatus activePorts Et0/1, Et0/32VLAN 10Name STAFFStatus activePorts Et0/0VLAN 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 —- Key line Et0/1, H1’s port, is in VLAN 1.
- VLAN 10 holds only Et0/0, the cable to SW2.
Full output · 10 lines
SW1#show vlan brief VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Et0/1, Et0/310 STAFF active Et0/020 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
Case 1 · How far it reaches
Check the guest VLAN too.
On SW1:
SW1#show mac address-table dynamic Mac Address Table-------------------------------------------1Vlan 1Mac Address 5254.0000.0011Type DYNAMICPorts Et0/12Vlan 20Mac Address 5254.0000.0022Type DYNAMICPorts Et0/2Total Mac Addresses for this criterion: 2- SW1 files H1 under VLAN 1, on Et0/1.
- H2 is still learned in VLAN 20. The guest VLAN works.
Full output · 8 lines
SW1#show mac address-table dynamic Mac Address Table------------------------------------------- Vlan Mac Address Type Ports---- ----------- -------- ----- 1 5254.0000.0011 DYNAMIC Et0/1 20 5254.0000.0022 DYNAMIC Et0/2Total Mac Addresses for this criterion: 2
Scroll sideways to see the whole output
Case 1 · What it means
Figure 1.5 · Case 1 · Et0/1 is in VLAN 1, so H1’s frames do not take the VLAN 10 cable to SW2. The network as in the topology. The chip at the switch end of H1’s cable reads VLAN 1 and is highlighted; H2’s chip reads VLAN 20, the chip on the cable between the switches VLAN 10, and H3’s chip on SW2 VLAN 10. An arrow beside H1’s cable points down into SW1. Under the cable between the switches, next to SW1, a cross with the note “not sent”.
- Et0/1 is in VLAN 1. SW1’s only other VLAN 1 port, Et0/3, is shut, and SW1’s Et0/0 is in VLAN 10, so H1’s frames leave through no port.
- H3 is in VLAN 10, another broadcast domain. Even H1’s ARP request does not reach it.
Case 1 · Fix
One line puts Et0/1, still an access port, back in VLAN 10.
On SW1:
SW1#configure terminalEnter configuration commands, one per line. End with CNTL/Z.SW1(config)#interface Ethernet0/11SW1(config-if)#switchport access vlan 10SW1(config-if)#end
- Et0/1 goes into VLAN 10, as H1’s port should be.
Impact Moving a port to another VLAN cuts its host off from the old VLAN at once.
Case 1 · Proof
SW1 lists Et0/1 under VLAN 10 again.
On SW1, after the fix:
SW1#show vlan briefVLAN 1Name defaultStatus activePorts Et0/31VLAN 10Name STAFFStatus activePorts Et0/0, Et0/1VLAN 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 —- VLAN 10 holds Et0/0 and Et0/1 again.
Full output · 10 lines
SW1#show vlan brief VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Et0/310 STAFF active Et0/0, 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
End of case 1. Solved: H1 is back in VLAN 10, with H3.
Case 2 of 2.VLAN 10 was deleted on SW2
Case 2 · Symptom
A week later H1 and H3 cannot reach each other again. SW1’s VLANs look right.
On SW2, after H1 tried to reach H3:
SW2#show mac address-table dynamic Mac Address Table------------------------------------------- 1Vlan Mac Address Type Ports---- ----------- -------- -----
- Nothing under the header. SW2 has learned no address at all.
Case 2 · Command
Which VLANs does SW2 have, and where are its ports?
Case 2 · Output
On SW2:
SW2#show vlan brief1VLAN 1Name defaultStatus activePorts Et0/2, Et0/3VLAN 1002Name fddi-defaultStatus act/unsupPorts —VLAN 1003Name token-ring-defaultStatus act/unsupPorts —VLAN 1004Name fddinet-defaultStatus act/unsupPorts —VLAN 1005Name trnet-defaultStatus act/unsupPorts —- Key line Only VLAN 1 lists ports. There is no VLAN 10 row, and no row lists Et0/0 or Et0/1.
Full output · 8 lines
SW2#show vlan brief VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Et0/2, Et0/31002 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 SW2, for Et0/1, H3’s port, only the line that contains Access Mode:
SW2#show interfaces Ethernet0/1 switchport | include Access Mode1Access Mode VLAN: 10 (Inactive)
- Et0/1 still names VLAN 10, marked Inactive.
Case 2 · How far it reaches
The break may reach SW1 too.
On SW1:
SW1#show mac address-table dynamic Mac Address Table-------------------------------------------1Vlan 10Mac Address 5254.0000.0011Type DYNAMICPorts Et0/12Vlan 20Mac Address 5254.0000.0022Type DYNAMICPorts Et0/2Total Mac Addresses for this criterion: 2- SW1 still learns H1 in VLAN 10.
- H2 is still learned in VLAN 20. Only H3 is missing, because nothing from it comes over the cable.
Full output · 8 lines
SW1#show mac address-table dynamic Mac Address Table------------------------------------------- Vlan Mac Address Type Ports---- ----------- -------- ----- 10 5254.0000.0011 DYNAMIC Et0/1 20 5254.0000.0022 DYNAMIC Et0/2Total Mac Addresses for this criterion: 2
Scroll sideways to see the whole output
Case 2 · What it means
Figure 1.6 · Case 2 · SW2 has no VLAN 10, so its two VLAN 10 ports stop forwarding and H3 gets nothing. The network as in the topology. On SW1 the chips read VLAN 10 at H1’s cable and VLAN 20 at H2’s cable, and the chip on the cable between the switches reads VLAN 10. Arrows show a frame from H1 going into SW1 and along the cable toward SW2. At SW2’s end of that cable, its Et0/0, a cross with the note “inactive”. The chip at H3’s cable on SW2 reads “VLAN 10, inactive” and is highlighted.
- VLAN 10 no longer exists on SW2.
- Its ports stay tied to the VLAN and are inactive, so they forward nothing. They are not moved to VLAN 1.
- A VLAN must exist on every switch whose ports are set to it.
Case 2 · Fix
Create VLAN 10 on SW2 again.
On SW2:
SW2#configure terminalEnter configuration commands, one per line. End with CNTL/Z.1SW2(config)#vlan 10SW2(config-vlan)#name STAFFSW2(config-vlan)#end
- VLAN 10 exists again. The next line gives it its name.
Impact Creating a VLAN changes no port. The ports that name it start forwarding again.
Case 2 · Proof
SW2 lists Et0/0 and Et0/1 under VLAN 10 again.
On SW2, after the fix:
SW2#show vlan briefVLAN 1Name defaultStatus activePorts Et0/2, Et0/31VLAN 10Name STAFFStatus activePorts Et0/0, 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 lists Et0/0 and Et0/1 again.
Full output · 9 lines
SW2#show vlan brief VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Et0/2, Et0/310 STAFF active Et0/0, 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
End of case 2. Solved: VLAN 10 is back on SW2.
Both cases
Key idea
A host hears only the broadcasts of its own VLAN. Check the port’s VLAN on each switch along the way, and check that the VLAN exists on each of them.
Check
On SW2:
Tap a line, or “Not in the output”, then submit.
Find the row that lists H3’s port, Et0/1.
Full output · 9 lines
SW2#show vlan brief VLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Et0/2, Et0/310 STAFF active Et0/0, 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
Summary
The network with a VLAN chip at the switch end of each cable. Arrows follow H1’s broadcast into SW1, along the cable to SW2 and down to H3, all in VLAN 10. Beside H2’s cable, in VLAN 20, a cross with “not sent”.
- Without VLANs, a switch and everything cabled to it is one broadcast domain.
- A VLAN is a group of switch ports that forms its own LAN, named by a VLAN ID. Every port of SW1 started in VLAN 1, the default VLAN.
- An access port belongs to one VLAN, and a broadcast leaves only through the other ports of its VLAN.
- Once the VLAN is created,
switchport mode accessandswitchport access vlanput a port in it. show vlan brieflists each VLAN with its access ports.- A host whose port is in the wrong VLAN, or whose VLAN is missing on a switch, is cut off from its VLAN.