Switch tutorial

<< Prev
Next >>

Introduction

A switch is a device that interconnects different network equipment based on MAC addresses.

Switch

Traditional switching operates at layer 2 of the OSI model.
The data connections are 10/100/1000 Mbps in half duplex or duplex.
In half-duplex mode, the switches transmit periodically (one transmits and the other receives and vice versa), while in duplex mode, both transmit and receive simultaneously.


Set up a Cisco switch

In large telecommunication networks, Cisco switches are the most used.
At the first configuration of the switch, we need to connect our PC to the RS232 serial interface (console) with a serial cable (then we can access the switch and remote using SSH or Telnet). To sign in, use the free Putty app:


Putty

We set the connection parameters and connect. The prompt will appear:


Switch>


Now we are in: user exec mode. Here are just a few commands and queries.
To move to the privileged mode, we will type: enable, and the prompt will change:


Switch#


For configuration, we will go to: global configuration mode, typing: configure terminal, and the prompt will change:

Switch# configure terminal
Switch(config)#


Configure VLANs.

Local virtual networks (VLANs) logically separate a network into multiple subnets. They identify by VLAN ID.
Configuration of VLANs is done on switch interfaces (ports).


Configure Management VLAN.

In order to access the remote switch via SSH or Telnet, we need to set up a management VLAN. This is done as follows:


Switch>enable
Switch#configure terminal
Switch(config)#vlan 100
Switch(config-vlan)#name management
Switch(config-vlan)#exit
Switch(config)#interface Fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 100


Then we will configure the management IP for this interface:


Switch(config)#interface vlan 100
Switch(config-if)#no shutdown
Switch(config-if)#ip address 192.168.1.254 255.255.255.0


Now the switch can be accessed from the management station at: 192.168.1.254.


Configuring Traffic VLANs.

Switch# configure terminal
Switch(config)# vlan 901
Switch(config)# vlan 903
Switch(config)# interface vlan 901
Switch(config-if)# ip address 192.168.1.1 255.255.255.0
Switch(config-if)# no shut
Switch(config-if)# interface vlan 903
Switch(config-if)# ip address 172.168.1.1 255.255.255.0
Switch(config-if)# no shut
Switch(config-if)# interface gigabitethernet 0/1
Switch(config-if)# switchport access vlan 901
Switch(config-if)# interface gigabitethernet 0/2
Switch(config-if)# switchport access vlan 903
Switch(config-if)# exit


Trunk mode.

For connectivity between equipment in the same VLAN but physically connected in different switches, we need to configure the trunk switch connections.
Configuring switch 1:


Switch1>enable
Switch1#configure terminal
Switch1(config)#int fastEthernet 1/1
Switch1(config-if)#switchport mode trunk
Switch1(config-if)#switchport trunk allowed vlan all
Switch1(config-if)#


And configuring switch 2:


Switch2>enable
Switch2#configure terminal
Switch2(config)#int fastEthernet 1/3
Switch2(config-if)#switchport mode trunk
Switch2(config-if)#switchport trunk allowed vlan all
Switch2(config-if)#


Gateway configuration.

This is done using the command:


Switch(config)# ip default-gateway 192.168.100.1


Saving configurations is done using the command:


Switch# copy running-config startup-config


Deleting a VLAN (for example, VLAN 901):


no VLAN 901


<< Prev
Next >>