Basic Configuration of Experiment 3 Switches

Purpose

  1. Master the basic usage of Cisco Packet Tracer simulation software;
  2. Master the basic configuration methods and commands of the switch;
  3. Master the switch telnet configuration method;
  4. Understand the role of different configuration views of the switch;

Experimental principle

(1) Switch basic configuration mode
Cisco switches provide several configuration modes (or called configuration views), and the configuration commands that can be used in each configuration mode are different. These configuration modes are as follows:
Common user mode : power on Directly enter the normal user mode. In this mode, we can only query some basic information of the switch, such as the version number (show version). Prompt information: switch>
privileged user mode : enter the enable command in the normal user mode to enter the privileged user mode, in this mode we can view the configuration information and debugging information of the switch, etc. Prompt information: switch#
Global configuration mode : Enter the configure terminal command in the privileged user mode to enter the global configuration mode. In this mode, the configuration of global parameters is mainly completed. Prompt information: switch(config)#Interface
configuration mode : Enter interface fastethernet0/1 in the global configuration mode to enter the interface configuration mode. In this mode, the configuration of interface parameters is mainly completed. Prompt information: switch(config-if)#
VLAN configuration mode : Enter vlan database in the global configuration mode to enter the VLAN configuration mode. In this configuration mode, some VLAN related configurations can be completed. switch(vlan)#

Note: When using the command line for configuration, it is impossible to remember all the command formats and parameters. Cisco switches provide a powerful help function. In any mode, you can use "?" to view the format or parameters of the command , the specific usage is as follows:

  • Directly type "?" in any mode to query all commands that can be used in any mode
  • Type "?" after the prefix character to view all commands beginning with the prefix in this view, such as entering "s?" to query all commands beginning with the character s
  • The command word is followed by a space and a "?", such as "show ?" to view the parameters of the show command

(1) Switch working mode switching

  1. Log in to the switch and enter user mode. Connect the switch and log in. Note the display symbol on the switch now. The display is as follows: Switch>
  2. Use the help command, and use the help command (?) to view the commands supported by the switch in user mode.
  3. Enter the privileged mode, enter the (enable) command, and enter the privileged mode. If the switch is password-protected, you need to enter the confirmation password at this time. Note the difference between the displayed symbols and user mode. Displayed as: Switch#
  4. Use the help command, and use the help command (?) to view the commands supported by the switch in privileged mode. Note the difference from user mode.
  5. Enter the global configuration mode, enter the command (configure terminal or config t) to enter the global configuration mode. Note the symbols now displayed along with the command prompt. The display is as follows: Switch(config) #
  6. Use the help command, and use the help command (?) to view the configuration commands supported by the switch in global configuration mode.
  7. To exit the global configuration mode, use the shortcut key (Ctrl+Z) to exit the global configuration mode and enter the privileged mode. You can also use the command (exit) to exit the global configuration mode.
  8. To exit the privileged mode, use the command (disable) to go from the privileged mode to the user mode.
  9. To exit the switch, use the command (exit) to exit the switch. This command can be used to exit the switch from privileged mode.

(2) Switch name and password setting command format
(1) Change the switch name: enter the switch through the HyperTerminal and enter the global mode, and enter the command:

Switch(config)#hostname Switch2950
Switch2950(config)#You
will find that the command line name of the switch is changed from Switch to Switch2950

(2) In the global mode, set the plaintext password cisco, which can restrict access to the privileged mode.
The password is visible in the configuration file . Note: passwords generally should not use simple or distinctive words, but words like cisco can be used during the experiment. Passwords are case sensitive.

Switch2950(config)#enable password cisco

(3) In the global mode, set the encrypted password Cisco, which can restrict access to the privileged mode.

Switch2950(config)#enable secret cisco
Note: When the encrypted password and plaintext password are set at the same time, only the encrypted password is valid.

(4) In the interface mode, set the login password of the console terminal, cisco.

Switch2950(config)#line console 0 //Enter interface mode
Switch2950(config-line)#password cisco //cisco is the password

(5) In interface mode, set the remote login password, cisco

Switch2950(config)#line vty 0 4
Switch2950(config)#password cisco
Note: vty 0 4 is 5 different virtual terminal connections.

(6) Among the above password settings, except for the encrypted password set by enable secret, the others can be
viewed in the configuration file through the show run command. The plaintext password can be encrypted through the global command.

Switch2950(config)#service password-encryption

(7) Switch command history, the Cisco switch will save the input commands, and the number of saved commands can be
set, and at the same time, it can be used again through shortcuts, which is very convenient when inputting very long or complex commands again
. it works. By default, the system will save 10 commands, and a maximum of 256 commands can be set.

Switch2950#terminal history size 100 //Set the number of command lines to 100

(8) You can use the show running-config command to view the command configuration at any time, and you can use the copy running-config startup-config command to save the configuration in the privileged mode
, or you can use the write command to save the configuration.

(3) Example of switch port configuration commands
(1) From user mode to privileged mode,
the mode mode that starts to enter the switch prompt configuration interface is user mode, the prompt is
Switch>
enter the command enable to enter the privileged mode, the prompt is
Switch#
Continue to enter the config terminal command to enter the global configuration mode from the privileged mode, and the prompt is
Switch(config)
#Configuration mode conversion example:

Switch>
Switch>enable
Switch#
Switch#config terminal
Switch(config)#

(2) Configure the port speed and working mode in the interface configuration
mode In the global configuration mode, execute the interface command to enter the interface configuration mode. In this mode, selected interfaces (ports) can be configured, and only commands for configuring switch ports can be executed. The command line prompt of the interface configuration mode is: Switch(config-if)#
For example, if you want to set
the port to 100M, full duplex mode, the configuration command is:

Switch(config)#interface fastethernet 0/1
Switch(config-if)#speed 100
Switch(config-if)#duplex full
Switch(config-if)#end

(3) View the switch configuration file
In the privileged mode, use the command showrunning-config to view the current configuration of the switch:

Switch#show running-config
Building configuration…
Current configuration : 1107 bytes
!
version 12.1
no service password-encryption
!
hostname Switch
!
interface FastEthernet0/1
duplex full
speed 100
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
……………………
!
end

(4) Revocation of switch commands
Format: no original command line
such as: no speed 100 // cancel the command with speed set to 100
no duplex full // cancel the command set to full duplex

Experimental content

  1. Practice the switching of the basic configuration mode of the switch and observe the command differences in different modes
    insert image description here
    insert image description here

  2. Complete the practice of switch name and password setting commands
    Switch name setting
    insert image description here
    and password setting command practice
    insert image description here
    insert image description here

Experiment summary

Practice using Cisco software

Guess you like

Origin blog.csdn.net/m0_63260018/article/details/131624664