Pin Me

Configuring a Cisco Switch

written by: George Garza•edited by: Lamar Stonecypher•updated: 3/7/2010

The Cisco Switch is the hardware device that allows multiple hosts (computers) to be put on a network. They are devices that help create local area networks. If they are attached to a router then they also can be used for Wide Area Networks.

  • slide 1 of 4

    Switches in a Local Area Network

    A switch is a layer 2 computer networking device that connects network segments together, like a hub. A hub is a layer 1 device which allows multiple users to attach a network cable from their computer to a common device. Hubs and switches look similar, but one can be programmed- the switch- and the other cannot, the hub. Both switches and hubs have multiple access ports so that they allow multiple computers to connect to one port each. This forms a local area network. A local area network, or LAN, is a collection of computers that can be used to share files, or send e-mail, or provide common operations.

    A network hub, also known as a repeater, is a straight network device with multiple points of entry. Hubs do not provide any traffic management. When a packet (of information) enters a port, it is broadcast out on every other port, except for the port of entry.

  • slide 2 of 4

    How Switches Work

    The OSI-Model - 7 Layers 

    Switches Connect Network Components

    The first thing that a switch does is to allow all the devices on the network, printers, computers, hubs and any other equipment, to interact with one another. Switches are important because they are a key hardware component that allows connected machines to exchange mail and messages with one another; they can also allow host computers to store files on a file server. Physical connectivity to other devices is not required. For example, if a printer is connected to a switch, then any computer on the local area network can print to that device without regard to where the computer may physically be located.

    Router-Switch-Lan 

    R1 is a router. R2 is a switch. 192.168.1.0/24 is the IP network address for the LAN.

    Switches Pass IP Traffic

    Switches use the Internet Protocol, or IP, to pass traffic. When a device such as a computer, printer, hub or other hardware component is connected to the switch, the switch will assign a unique IP address to the device, using the Dynamic Host Control Protocol (DHCP). The switch will use this address to identify and tag data packets with originating and destination addresses. This will quickly and simply pass messages and responses along to the appropriate devices on the network.

    A Switch is Not a Router

    Routers and switches behave in similar ways. A switch passes data packets between connected devices in the local area network. A router performs this function as well, but it also directs network traffic into the LAN from outside networks or subnetworks. A router also serves as a gateway for computers to access an external network, like the Internet. Also unlike switches, routers can also perform advanced network functions like address translation, port blocking, and other network management tasks.

    4-Port Wireless Switch 

  • slide 3 of 4

    How to Configure a Switch

    In order to configure a switch, here are some basic steps. In this configuration, there is no attempt to setup VLANS, or Routing Protocols, or Trunk links in this configuration.

    Step [1]

    First erase any configuration that is on the switch.

    (switch)# write erase

    Step [2]

    You can reboot the switch using:

    (switch)# reload

    Step [3]

    Now you may want to set the switch name with this command:

    (switch)# Cisco-Catalyst-Switch

    Step [4]

    You can set the enable password to enter the switch:

    (switch)# enable password MyEnablePassword

    Step [5]

    You can set the enable secret, an encrypted password:

    (switch)# enable secret MyEnableSecretPassword

    Step [6]

    Set the console login password to control the console login

    (switch)# line con 0

    (switch)# password MySwitchConsolePassword

    (switch)# logging synchronous

    (switch)# login

    Step [7]

    Set the telnet login line, for remote switch administration

    (switch)# line vty 0 4

    (switch)# password TelnetLoginPassword

    (switch)# login

    Step [8]

    Passwords can be hidden:

    (switch)# service password-encryption

    Step [9]

    Save the switch configuration:

    (switch)# write

    Or

    (switch)# copy run start

    Step [10]

    Set up the clock:

    (switch)# clock set 12:00:00 Month Day Year

    Step [11]

    Set the default gateway:

    (switch)# ip default-gateway x.x.x.x

  • slide 4 of 4

    Summary

    A switch is a device that will bring multiple hosts together to form a local area network. They are layer two devices because they transmit the MAC address across the network in order to make connections. They can isolate network traffic into different ports which then makes the network perform better and faster. They can connect different hosts regardless of location, and allow sharing of information or physical operations, like printing or e-mail.