Configuring a VLAN on a Cisco Switch

by Srv Olympe

Objective: Segment the network by configuring VLANs to separate broadcast domains and improve security.

Prerequisites:

  • A Cisco switch (e.g., Cisco Catalyst 2960)
  • Administration console (telnet, SSH, or physical console)
  • Administrator privileges

Steps:

  1. Access the Cisco switch:
    • Connect to the switch via a terminal session (e.g., PuTTY).
    • Enter privileged mode by typing:
      bash
      enable
  2. Create a VLAN:
    • Enter global configuration mode:
      bash
      configure terminal
    • Create a VLAN with a specific number (e.g., VLAN 10):
      bash
      vlan 10
      name Sales
  3. Assign ports to the VLAN:
    • Select the interfaces to assign to the VLAN. For example, to assign interfaces 1 to 10 to VLAN 10:
      bash
      interface range FastEthernet0/1 - 10
      switchport mode access
      switchport access vlan 10
  4. Configure VLAN Trunking:
    • To allow a port to carry multiple VLANs (trunking), for example, for connections between switches or to a router:
      bash
      interface FastEthernet0/24
      switchport mode trunk
      switchport trunk allowed vlan 10,20
  5. Save the configuration:
    • Save the configuration to prevent losing changes after a reboot:
      bash
      write memory
  6. Verify the configuration:
    • Check that the VLAN has been correctly configured by typing:
      bash
      show vlan brief