.
.

The basic configuration of Cisco Switch

In this topic I want to show the code, step by step how to configure the Cisco Switch.
In the code below the name of the Switch device has the name 'SW1'

Basic configuring the Cisco Switch


  switch # show running-config  (show current configuration)
  switch # show startup-config (show starting configuration)
  switch # configure terminal (input in global config mode)
  switch (config) #hostname SW1 (SW1 switch setting names)
  SW1 # exit

  SW1 # configure terminal (input in global config mode)

  SW1 (config) #line console 0 (input in config mode console)
  SW1 (config-line) #line console 0 (input in config mode console)
  SW1 (config-line) #Password cisco (set Passw. Cisco to enter via console)
  SW1 (config-line) #login (acceptance Passw. Cisco to enter via console)

  SW1 (config-line) #line vty 0 15 (entry in config mode VTY - telnet)
  SW1 (config-line) #Password cisco (set Passw. Cisco to enter via telnet)
  SW1 (config-line) #login (acceptance Passw. Cisco to enter via telnet)

  SW1 (config-line) #Exit (crossing the line config mode in the global config mode)

  SW1 (config) #enable password cisco (activation password cisco on the switch)
  SW1 (config) #enable secret class (activate password encryption class on the switch)

  SW1 (config) #interface VLAN 1 (entry in config mode interface VLAN1)
  SW1 (config-if) #ip address 192.168.1.2 255.255.255.0 (set the IP address for VLAN1)
  SW1 (config-if) #No shutdown
  SW1 (config-if) #Exit

  SW1 (config) #ip default gateway 192.168.1.1 (set the default gateway for VLAN1)
  SW1 (config-if) #Exit

  SW1 # show interface VLAN 1 (display interfaces in VLAN 1)
  SW1 # copy running-config startup-config (save the current configuration to NVRAM)
  SW1 # show running-config (show current configuration)