Cisco Switch Basics

Li-Wei

Outline

  • Connection to a Switch
  • Command Line Modes
  • Command Line Basics
  • Show
  • Configuration Mode
  • Exercise

Connection to a Switch

  • Console Port (Serial RS232, USB)




 

 

 

  • VTY (Telnet, SSH)

  • HTTP, HTTPS

Command Line Modes

  • User Mode
  • Privileged Mode
  • Configuration Mode
Switch>
Switch>enable
Switch#
Switch#configure terminal
Switch(config)#exit
Switch#

Command Line Basics

  • Autocomplete: <TAB>
Switch#show ru<TAB>
Switch#show running-config
  • List 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

Switch(config)#?
Configure commands:
  aaa                         Authentication, Authorization and Accounting.
  access-list                 Add an access list entry
  access-session              Access Sesion Global Configuration Commands
  alias                       Create command alias
  ancp                        Configure ANCP
  archive                     Archive the configuration
  arp                         Set a static ARP entry
...

Command Line Basics

  • Interface Numbers
    • FastEthernet0/1 or Fa0/1
    • GigabitEthernet1/0/2 or Gi1/0/2
    • TenGigabitEthernet1/0/3 or Te1/0/3​
    • Port-channel1 or Po1
    • Vlan543 or Vl543

Command Line Basics

  • Output Modifier: |

    • ​<command> | include <expr>
      • output lines that include <expr>

    • ​<command> | exclude <expr>
      • output lines without <expr>

    • ​<command> | begin <expr>
      • output begins from the first line that includes <expr>
Switch#show arp | include 140.112.30.34
Internet  140.112.30.34  102  98f2.b3ee.bb4e  ARPA  Vlan30

      Note: spaces around "|" cannot be omitted!

Show

  • show running-config : running configuration
  • show interfaces : detail of all interfaces
    
  • show interfaces Fa0/1 : detail 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 infomation
  • show ?

Configuration Mode

Switch#configure terminal
Switch(config)#

Global Configurations

  • hostname <name>
  • enable password / enable secret
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
Switch(config)#enable password PASSWORD
Switch(config)#service password-encryption
Switch(config)#do show running-config | include enable
enable password 7 08116D7D3A2E2A2536

  • no <command>

: set hostname

: set enable password

: enable password encryption feature

: negates a command

Interface Configurations

  • choose interface:
Switch(config)#interface FastEthernet0/1
Switch(config-if)#
  • set port access VLAN:
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 543
  • set port as a trunk port:
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 543,544
  • set IP on VLAN interfaces:
Switch(config-if)#ip address 192.168.252.254 255.255.255.0

Interface Configurations

  • set channel group:
Switch(config-if)#channel-group 1 mode active
  • choose "port channel" interface:
Switch(config)#interface Port-channel 1
Switch(config-if)#
  • link aggregation / port channel setup steps:
    • create a port channel interface
    • make port channel & physical interfaces have the
      same (VLAN, ...) settings
    • make physical interfaces have the "channel group" configuration

Line (Console) Configuration

  • choose line:
  • enable login:
  • set password:
Switch(config)#line vty 0 4
Switch(config-line)#
Switch(config-line)#login
Switch(config-line)#password PASSWORD

Save Configuration

Switch#copy running-config startup-config

CRUCIALLY IMPORTANT!!!

Switch#write memory

Method 1:

Method 2:

Exercise

Cisco Packet Tracer

Cisco Packet Tracer

  • download Cisco Packet Tracer (link)
  • unzip and execute "bin/PacketTracer7.exe"
  • download "inclass.pka" & open it with Cisco PT

Goals

  • make RD-1 & RD-2 under VLAN100
  • make SP-1 & SP-2 under VLAN200
  • servers in the same VLAN should be able to ping each other
  • setup link aggregation between two switches

Note: use "Check results" on the "PT Activity" window to check your goals.

trunk VLAN 100, 200

NASA2019-lab4

By b04902011

NASA2019-lab4

  • 1,037