- [Instructor] switchports can be assigned to one
and only one VLAN.
I'm now going to show you how you can move ports
from the default VLAN into those newly created VLANs.
I'm going to go ahead and click on the switch.
I'm going to go and show VLAN brief,
just so you can see the VLANs we created.
I'm going to expand the window.
Config from the terminal.
VLAN access is done within the interface command line.
So I'm going to go ahead and go into the interface.
I'm going to move fastEthernet 0/3 first.
And I'm going to put fastEthernet 3 into VLAN 10.
The command is switchport mode.
Access is to set the port as an access port.
And switchport access VLAN 10.
I'm going to go ahead and exit out.
And then I'm going to go ahead and do the next interface.
Interface fastEthernet 0/2.
I'm going to do switchport access.
And I'm going to show you what happens if you inadvertently
type a VLAN number that doesn't exist.
So let's say VLAN 50.
Notice that the switch automatically created VLAN 50
and it moved fastEthernet 2 into that VLAN.
I'm going to show you that.
Control + Z.
Show the VLAN brief.
You can see that VLAN 50 was created.
It gives it a default name of VLAN 0050 and fastEthernet 0/2
is now assigned to that VLAN.
Okay, That's not what I wanted.
First, I have to remove that port from the VLAN.
So I'm going to go into interface,
fastEthernet 0/2.
I'm going to go no switchport access VLAN 50.
I'm going to exit out.
And then I can go ahead and go no VLAN 50.
That removes the port and removes the VLAN.
And I can start over with interface.
FastEthernet 0/2.
Switchport mode access.
Switchport access VLAN 20.
We do a control + Z.
Show VLAN brief.
And you can see that I now have the right ports
into the right VLANs.
And by the way,
if you delete the VLAN, that newly created VLAN 50
from the switch before you move the port out of the VLAN,
it will orphan that port
and you will have to manually reassign it
to the default VLAN.
So now I'm going to demonstrate how you
can actually move a group of ports at a time
into one of the other VLANs.
So we're going to go ahead, config from the terminal.
I'm going to go into interface.
And the command for a group is the command range.
So interface range, fastEthernet 0/5-9.
Switchport mode access.
And I'm going to go ahead and hit the up arrow key
to recall my commands
Switchport access, VLAN 30.
Hit enter. Exit out.
I'm going to do this again with another group.
Interface range, fastEthernet 0/10-21.
Enter.
You can see my command changes to config interface range,
switchport mode, access.
Switchport access VLAN.
And I'm going to assign these to the wireless VLAN, VLAN 100.
Exit out.
Show VLAN brief.
You can see that the ports as assign are in their VLANs.
Additionally, let's say that you have a port, port 21,
and you don't want that port to be in the wireless VLAN.
So I'm going to show you how you remove it,
and it will automatically by default,
go back into VLAN 1.
So config terminal.
Go back into the interface, in this case interface,
fastEthernet 0/21.
Enter, and I'm just going to go no switchport access.
VLAN 100.
I'm going to do a control + Z, show VLAN brief
to verify that that port,
port 21 has now been put back
into the default VLAN.
As an FYI, the VLAN configurations
are automatically saved in a VLAN database file
named VLAN.dat, which has saved to the flash memory.