NASA Lab #4

Cisco Switch Basics

Before Start

Download Lab materials

including:

1. Cisco Packet Tracer

2. inclass.pka

Connecting to a Switch

1. console port

a) Used when setting up the switch for the first time

b) Used when applying changes to the switch that will result in disconnection of the Internet

Connecting to a Switch

2. VTY(Telent/SSH)

Most often used method after setting up the switch

Connecting to a Switch

3. HTTP/HTTPS

Allow Web GUI to be used, but rarely used

Command Line Modes

  • User Mode (Can only view limited info)
Switch>
  • Privileged mode (Can view various info)
Switch> enable
Switch#
  • Configuration mode (Can modify config)
Switch# configure terminal
Switch(config)#

Command Line Basics

  • Auto complete: <TAB>
Switch# show ru<TAB>
Switch# show running-config
  • List of available commands
Switch#show r?
radius          redundancy  region     registry
reload          rep         resource   rhosts
rib             rif         rmon       rom-monitor
romvar          route-map   route-tag  rpl
running-config

Command Line Basics

  • Unique prefix
Switch# sh run
Switch# show running-config
Switch> ena
Switch> enable
Switch# conf t
Switch# configure terminal

Command Line Basics

  • Output modifier
<command> | include <expr>
<command> | exclude <expr>

output lines that contain <expr>

output lines without <expr>

Command Line Basics

  • Interfaces
  • FastEthernet0/1 or Fa0/1
  • GigabitEthernet1/0/2 or Gi1/0/2
  • Port-channel1 or Po1
  • Vlan543 or Vl543

Command Line Basics

  • useful info
  • show running-config : running configuration
  • show interfaces : details of all interfaces
  • show interfaces Fa0/1 : details of a specified interface
  • show interfaces status : interface status
  • show vlan : VLANs in VLAN database
  • show mac address-table : MAC address/port mapping
  • show arp : ARP table
  • show version : hardware/software information
  • show ?

Configuration

Switch# conf t

enter configuration mode

Global Configuration

Switch(config)# hostname NASA
NASA(config)#
  • hostname <name> : set the host name
  • enable password / enable secret : set password
Switch(config)# enable password PASSWORD
Switch(config)# enable secret 0 PASSWORD
Switch(config)# do show running-config | include enable
enable password PASSWORD
enable secret 5 $1$mERr$cP1uxB/ASHbnPQTLzT8H10
  • service password-encryption : encrypt password
Switch(config)#enable password PASSWORD
Switch(config)#service password-encryption
Switch(config)#do show running-config | include enable
enable password 7 08116D7D3A2E2A2536

Interface Configuration

  • Choose an interface to configure
Switch(config)# int fa0/1
Switch(config-if)#
  • Set port as access port
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 777
  • Set port as trunk port
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport allowed vlan 777-888,999

A switch port is either a access port or a trunk port

VLAN configuration

  • Configure VLAN
Switch(config)# vlan 777
Switch(config-vlan)# show ?
  • Configure VLAN interface
Switch(config)# int vlan 777
Switch(config-if)# show ?
  • Set IP on VLAN interface
Switch(config-if)# ip address 192.168.77.1 255.255.255.0

vlan v.s. int vlan

VLAN VLAN interface
virtual LAN a virtual interface in VLAN
allow multiple LANs to exist on a single switch can be used for inter-vlan routing
a network an interface

Port Channel

  • Create a port channel
Switch(config)# int port-channel 1
Switch(config-if)#
  • Set interfaces to be members
Switch(config)# int range fa0/1-2
Switch(config-if)# channel-group 1 mode active
Switch(config-if)# exit

Port Channel

Will a port channel form?

LACP

PAgP

active passive
active Yes Yes
passive Yes No
desirable auto
desirable Yes Yes
auto Yes No

Line Configuration

  • Choose line
Switch(config)# line vty 0 4
Switch(config-line)#
  • Enable login
Switch(config-line)# login
  • Set password
Switch(config-line)# password PASSWORD

Save Configuration

Switch# copy running-config startup-config
Switch# write memory
Switch# wr

Three methods to choose from

Remember to save config before exiting!!

Tip

Switch(config)# no shutdown

After configuring an interface, if the config does not take effect, check if the interface is shut down

  • Make sure an interface is not shut down

Excercise

Cisco Packet Tracer

Cisco Packet Tracer

  1. Lab material (Link)
  2. Choose your OS and download corresponding Cisco Packet Tracer (Windows/Mac/Linux)
  3. Install packet tracer (.exe/.dmg/.deb)

Cisco Packet Tracer

  1. Execute "PacketTracer7"
  2. "User Login" with account/password provided in the link
  3. Open "inclass.pka"

Cisco Packet Tracer

  1. Make RD-1 & RD-2 under VLAN100
  2. Make SP-1 & SP-2 under VLAN200
  3. Servers in the same VLAN should be able to ping each other
  4. Setup link aggregation between the two switches

Cisco Packet Tracer

trunk VLAN 100,200

Cisco Packet Tracer

Click "CLI" on switch windows to configure settings.

Cisco Packet Tracer

Use "Check results" on the "PT Activity" window to check your goals.

NASA Lab #4 Cisco Switch Basics

By JT

NASA Lab #4 Cisco Switch Basics

  • 1,326