loader-logo

How to Configure VLANs

VLANs are in every network environment. Whether you’re configuring end-to-end or local VLANs you are segmenting the network into logical groups.

Before getting into the configuration of a VLAN, there are some best practices to be aware of:

  • Avoid using VLAN 1. Put unused ports on an unused VLAN. I like to use VLAN 999.
  • Separate voice and data VLANs.
  • Place management on its own VLAN.
  • Configure non-trunk links as access ports.
  • Use SSH instead of Telnet.

To configure a VLAN, start in global config mode:

SW01#conf t

Create a VLAN with a VLAN ID number:

SW01(config)#vlan 10

Give the VLAN a name:

SW01(config-vlan)#name Users
SW01(config-vlan)#exit

Assign a switchport to the new VLAN:

SW01(config)#interface g0/5
SW01(config-if)#switchport access vlan 10
SW01(config-if)#end

switchport access vlan 10 changes the default VLAN membership of this port to VLAN 10.

Verify the new VLAN configuration:

SW01#show vlan

The whole configuration will look like this:

SW01#conf t
SW01(config)#vlan 10
SW01(config-vlan)#name Users
SW01(config-vlan)#exit
SW01(config)#interface g0/5
SW01(config-if)#switchport access vlan 10
SW01(config-if)#end
SW01#show vlan
Switch#show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Gi0/1, Gi0/2, Gi0/3, Gi0/4
                                                Gi0/6, Gi0/7, Gi0/8, Gi0/9
                                                Gi0/10, Gi0/11, Gi0/12, Gi0/13
                                                Gi0/14, Gi0/15, Gi0/16, Gi0/17
                                                Gi0/18, Gi0/1
00:03:06: %SYS-5-CONFIG_9, Gi0/20, Gi0/21
                                                Gi0/22, Gi0/23, Gi0/24, Gi0/25
                                                Gi0/26, Gi0/27, Gi0/28, Gi0/29
                                                Gi0/30, Gi0/31, Gi0/32, Gi0/33
                                                Gi0/34, Gi0/35, Gi0/36, Gi0/37
                                                Gi0/38, Gi0/39, Gi0/40, Gi0/41
                                                Gi0/42, Gi0/43, Gi0/44, Gi0/45
            I: Configured from console by console                                    Gi0/46, Gi0/47, Gi0/48, Gi0/49
                                                Gi0/50, Gi0/51, Gi0/52
10   Users                            active    Gi0/5


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.