This is a basic configuration of a VLAN (Virtual Local Area Network). A VLAN partitions networks into separate broadcast domains or segments. It separates network traffic for a more efficient flow of data, minimizing bottlenecks and congestion.

This guide is used for general VLAN configurations on CISCO switches (e.g. Catalyst series). This requires the user to have elevated admin privileges with enable rights for terminal configuration. The switch Cisco device that provides data packets transmission and reception from other networks and devices. The switch does not deal with logical addresses, but with the MAC address, so IP settings are not going to be included.

To begin, user must have access to the terminal on the switch. On older switches it is accessed via the RS-232 serial interface or TTY connection. This gives access to the CLI of the Cisco CatOS and IOS software. Most switches are accessed by terminal emulators that implement strong security like SSH (recommended) rather than by simple unencrypted telnet.

The switch usually has a default VLAN set up, which is the default VLAN 1. In this tutorial we will be setting up another VLAN which we will call VLAN 2. Then we will configure the ports for the switch to create the VLAN.

Step 1: Login On The Switch Terminal As Privileged EXEC Mode

MySwitch>enable
MySwitch#configure terminal

We enter EXEC mode and then enable privileged EXEC mode to configure the terminal.

Step 2: Create the VLAN 2 Interface

MySwitch(config)#interface vlan 2

Create the VLAN called ‘vlan 2’ in interface configuration.

Step 3: Give a description to the VLAN

MySwitch(config-if)#description accounting VLAN
MySwitch(config-if)#exit

For this example we can describe the VLAN as accounting. In a real world scenario this can be used to describe the network segment for the accounting department.

Step 4: Define the ports to add to VLAN 2

MySwitch(config)#interface range FastEthernet 0/13 , FastEthernet 0/24

Ports 13 to 24 on the switch are assigned to VLAN 2 at the interface configuration.

Step 5: Configure the Switchport Mode

MySwitch(config)#switchport mode access
MySwitch(config)#switchport access vlan 2

This mode disables DTP (Dynamic Trunking Protocol) on the specified interface and turns off trunk negotiation. The access to the port is set for ‘vlan 2’ .

This VLAN configuration is for a single switch only. When connecting two switches, the VLAN needs to pass between 2 or more switches. This requires implementing a trunk port.

For example if the switch has 32 ports and you want to configure port 32 as the trunk port, this setting has to be added.

MySwitch>enable
MySwitch#conf t
MySwitch(config)#interface FastEthernet 0/32
MySwitch(config-if-range)#switchport mode trunk

36 Spice ups

Very nice write up…if only I can spice this up…

interface vlan is L3 for routing.

Just use set vlan or for Nexus:
vlan x
name vlan-x
exit