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 1

VLANs: one switch, separate LANs

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 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.

SW1 has no VLANs set up yet. H1 sends a broadcast frame. Does SW1 send it out of H2’s port?
H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24to everyoneTwo hosts hear H1’s broadcast
Figure 1.1 · Before VLANs, one broadcast from H1 reaches H2 and H3. The switches flood it out of every other port.

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).

H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 10VLAN 20VLAN 10VLAN 10Two VLANs, two broadcast domains
Figure 1.2 · With VLANs, SW1 holds two LANs, VLAN 10 (H1, and H3 through SW2) and VLAN 20 (H2).

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.

H1 is in VLAN 10 and H2 in VLAN 20, on the same switch. Can H1 reach H2 in this network?

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:

Output · IOS XE 17.18.2
SW1#show vlan brief1VLAN 1Name defaultStatus activePorts Et0/0, Et0/1, Et0/2, Et0/32VLAN 1002Name fddi-defaultStatus act/unsupPorts —2VLAN 1003Name token-ring-defaultStatus act/unsupPorts —2VLAN 1004Name fddinet-defaultStatus act/unsupPorts —2VLAN 1005Name trnet-defaultStatus act/unsupPorts —
  1. The default VLAN holds Et0/0 to Et0/3.
  2. 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 

Follow one broadcast from H1, first before VLANs and then with them (Figure 1.3).

Step 1 of 6

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

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

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

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

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

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

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

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

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

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

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

One broadcast domain per VLAN. H1’s broadcast reaches H3, in VLAN 10, and not H2, in VLAN 20.

Step 1 of 6

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.

Figure 1.3 · With VLANs, H1’s broadcast leaves only through the other VLAN 10 ports, so H3 gets it and H2 does not.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.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.SW1 must flood the frame. Et0/0, the cable to SW2, is in VLAN 10. Et0/2, H2’s port, is in VLAN 20.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.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.One broadcast domain per VLAN. H1’s broadcast reaches H3, in VLAN 10, and not H2, in VLAN 20.

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:

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, 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

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

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.

Broadcasts in this network
SenderVLANLeaves throughReaches
H110SW1 Et0/0, SW2 Et0/1H3
H220no portno host
H310SW2 Et0/0, SW1 Et0/1H1

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:

Output · IOS XE 17.18.2
SW1#show interfaces statusPort Et0/0Name —Status connectedVlan 10Duplex fullSpeed autoType 10/100/1000BaseTXPort Et0/1Name —Status connectedVlan 10Duplex fullSpeed autoType 10/100/1000BaseTX1Port Et0/2Name —Status connectedVlan 1Duplex fullSpeed autoType 10/100/1000BaseTXPort Et0/3Name —Status disabledVlan 1Duplex fullSpeed autoType 10/100/1000BaseTX
  1. 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

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)#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
  1. configure terminal Global configuration. New prompt: SW1(config)#
  2. vlan 20 Creates VLAN 20. The prompt (config-vlan)# is for the settings of this one VLAN. New prompt: SW1(config-vlan)#
  3. name GUEST A name for people to read. The switch tells VLANs apart by their ID.
  4. exit Back to global configuration. New prompt: SW1(config)#
  5. interface Ethernet0/2 Interface configuration for Et0/2, H2’s port. New prompt: SW1(config-if)#
  6. switchport mode access Makes Et0/2 an access port, a port in one VLAN.
  7. switchport access vlan 20 Puts the port in a VLAN, here VLAN 20.
  8. end Back 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.

After these lines, which VLAN is Et0/1, H1’s port, in?

On SW1, after the change:

Output · IOS XE 17.18.2
SW1#show interfaces statusPort Et0/0Name —Status connectedVlan 10Duplex fullSpeed autoType 10/100/1000BaseTXPort Et0/1Name —Status connectedVlan 10Duplex fullSpeed autoType 10/100/1000BaseTX1Port Et0/2Name —Status connectedVlan 20Duplex fullSpeed autoType 10/100/1000BaseTXPort Et0/3Name —Status disabledVlan 1Duplex fullSpeed autoType 10/100/1000BaseTX
  1. 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

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.

SW1first floorEt0/0to SW2VLAN 10Et0/1H1VLAN 10Et0/2H2VLAN 20Et0/3unusedVLAN 1shut
Figure 1.4 · SW1’s four ports: two in VLAN 10, one in VLAN 20, and the unused one still in VLAN 1.

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.

Output · IOS XE 17.18.2
SW1#show vlan brief
  1. On SW1, VLAN 1 keeps Et0/3, the port nobody moved. A port that is shut is still listed.
  2. VLAN 10, STAFF. Et0/1 is H1’s port and Et0/0 is the cable to SW2.
  3. VLAN 20, GUEST, with H2’s port.
  4. 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 

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:

Output · IOS XE 17.18.2
SW1#show mac address-table dynamic Mac Address Table-------------------------------------------1Vlan 10Mac Address 5254.0000.0011Type DYNAMICPorts Et0/12Vlan 10Mac Address 5254.0000.0033Type DYNAMICPorts Et0/03Vlan 20Mac Address 5254.0000.0022Type DYNAMICPorts Et0/2Total Mac Addresses for this criterion: 3
  1. H1, in VLAN 10, on its port Et0/1.
  2. H3, in VLAN 10, on Et0/0.
  3. 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

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.

In SW1’s MAC address table, why is H3, a host on SW2, listed on SW1’s port Et0/0?

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

  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:

    Output · IOS XE 17.18.2
    SW2#show mac address-table dynamic Mac Address Table-------------------------------------------1Vlan 10Mac Address aabb.cc00.0400Type DYNAMICPorts Et0/0Total Mac Addresses for this criterion: 1
    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
  2. Case 1 · Command

    Which VLAN is H1’s port in?

  3. Case 1 · Output

    On SW1:

    Output · IOS XE 17.18.2
    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 —
    1. Key line Et0/1, H1’s port, is in VLAN 1.
    2. 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 
  4. Case 1 · How far it reaches

    Check the guest VLAN too.

    On SW1:

    Output · IOS XE 17.18.2
    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
    1. SW1 files H1 under VLAN 1, on Et0/1.
    2. 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
  5. Case 1 · What it means

    H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 1VLAN 20VLAN 10VLAN 10not sent
    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.
  6. Case 1 · Fix

    One line puts Et0/1, still an access port, back in VLAN 10.

    On SW1:

    Output · IOS XE 17.18.2
    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
    1. 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.

  7. Case 1 · Proof

    SW1 lists Et0/1 under VLAN 10 again.

    On SW1, after the fix:

    Output · IOS XE 17.18.2
    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 —
    1. 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 

End of case 1. Solved: H1 is back in VLAN 10, with H3.

Case 2 of 2.VLAN 10 was deleted on SW2

  1. 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:

    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. SW2 has learned no address at all.
  2. Case 2 · Command

    Which VLANs does SW2 have, and where are its ports?

  3. Case 2 · Output

    On SW2:

    Output · IOS XE 17.18.2
    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 —
    1. 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 

    On SW2, for Et0/1, H3’s port, only the line that contains Access Mode:

    Output · IOS XE 17.18.2
    SW2#show interfaces Ethernet0/1 switchport | include Access Mode1Access Mode VLAN: 10 (Inactive)
    1. Et0/1 still names VLAN 10, marked Inactive.
  4. Case 2 · How far it reaches

    The break may reach SW1 too.

    On SW1:

    Output · IOS XE 17.18.2
    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
    1. SW1 still learns H1 in VLAN 10.
    2. 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
  5. Case 2 · What it means

    H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 10VLAN 20VLAN 10inactiveVLAN 10inactive
    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.
  6. Case 2 · Fix

    Create VLAN 10 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 10SW2(config-vlan)#name STAFFSW2(config-vlan)#end
    1. 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.

  7. Case 2 · Proof

    SW2 lists Et0/0 and Et0/1 under VLAN 10 again.

    On SW2, after the fix:

    Output · IOS XE 17.18.2
    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 —
    1. 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 

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.

On SW1, Et0/1 is moved to VLAN 20 by mistake. Whose broadcasts does H1 hear now?

Check

A switch has ports in VLAN 1, VLAN 10 and VLAN 20. How many broadcast domains does it hold?
A new guest host, H4, is cabled to SW1’s Et0/3, which is put in VLAN 20 and brought up. SW1’s other ports stay as they are. H2 sends a broadcast. Which ports does SW1 send it out of?

On SW2:

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

Find the row that lists H3’s port, Et0/1.

Output · IOS XE 17.18.2
SW2#show vlan brief
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 
On SW1, Et0/2, H2’s port, is moved into VLAN 10. Nothing else changes. H3 sends a broadcast. Which hosts get it?
On SW2, Et0/1, H3’s port, is put in VLAN 20, which has been created on SW2. Whose broadcasts can H3 hear now?

Summary

H1staff hostSW1first floorSW2second floorH2guest hostH3staff host10.1.10.0/2410.1.20.0/2410.1.10.0/24VLAN 10VLAN 20VLAN 10VLAN 10not sent
Figure 1.3, recap · One broadcast domain per VLAN. H1’s broadcast reaches H3, in VLAN 10, and not H2, in VLAN 20.

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 access and switchport access vlan put a port in it.
  • show vlan brief lists 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.