极
极核实验室
Study Notes - Initial Switch Configuration

Study Notes - Initial Switch Configuration

AI summary
交换机的配置方式主要包括 Console 口配置、Telnet 远程登录配置和 Web 界面配置,其中 Console 口配置是初始配置的必要步骤。Telnet 和 Web 配置需要交换机管理端口设置 IP 地址并开启相应服务。配置模式分为用户模式、特权模式、全局配置模式、接口配置模式和线程配置模式,特权模式可执行系统级操作,全局配置模式用于设置基本信息,接口配置模式用于配置端口参数。初始配置常用命令包括启动配置、设置特权密码、设置主机名和显示运行配置等。

Repost license

Request authorization before reposting and retain the authorization code, original URL, and go/affiliate links.

Original URL:https://www.geekcorelab.com/post/learning-notes-initial-configuration-of-switch

The commercial link is an authorized go short link that must stay on the reposted page. It records the source before sending readers to the original article.

Switch Configuration Methods

  1. Configuration through the Console port: This method requires using a serial cable to connect the computer to the switch's console port, then using terminal software to log in to the switch and configure the switch. This is a configuration method that must be used for an initial switch. Only after configuring the necessary basic parameters of the switch through this method can other switch configuration methods be used. Generally, a Console-to-USB cable is used to connect to the computer, and then software such as Xshell can be used to connect to the switch through the COM port. Of course, if some computers have a Console port, you can also connect directly with a Console-to-Console cable.
  2. Configuration via Telnet remote login: Log in remotely to the switch through the Telnet protocol to configure the switch. Connect the computer to the switch's management port with an RJ45 cable (commonly known as a network cable). The condition for using this method is that an IP address should already be set on the switch's management port. This method requires enabling the Telnet service on the switch and installing a Telnet client on the local computer. (Windows operating systems all include a Telnet terminal emulation program. Enter telnet ip in the dialog box and press Enter to log in to the switch and manage and configure it.) If you see a prompt saying that telnet is not installed (or a prompt such as “unknown command”), see the tutorial below for installing the Telnet client on Windows.
  3. Configuration via Web interface: Access the switch's IP address through a browser, enter the Web interface, and configure the switch. This method is simple to operate and easy to get started with, but it requires enabling the Web service on the switch. This method also requires the switch to have an IP address configured and to be connected to the same network segment as the management computer.

If Telnet Is Not Found When Using Windows

If this happens, you can open “Control Panel - Programs - Turn Windows features on or off”

Enable or disable Windows features page
As shown in the figure, check “Telnet Client” and then click OK.

Wait for configuration to complete
Wait for configuration to complete
Prompt when configuration is complete
When you see this prompt, the configuration is complete. You do not need to restart; just click Close. At this point, open cmd and enter “telnet”; if the following information appears, the installation is complete:

image 1684242456
Switch Configuration Modes

  1. User mode: User mode is the most basic mode of the switch; it can only browse the switch's status information. In user mode, the command-line prompt is “ Switch>”.
  2. Privileged mode: Privileged mode is an important mode for switch management. In privileged mode, you can perform system-level operations and view all configurations. To enter privileged mode, you can use the ”enable“ command. After entering the correct privilege-level password, you can enter this mode. In privileged mode, the command-line prompt is ” Switch#“
Switch> enablePassword: ! 需要输入特权用户的密码,但输入时,并不显示输入的内容Switch#
  1. Global configuration mode: Global configuration mode allows global settings to be made on the switch. In this mode, you can configure basic switch information such as hostname, domain name, time zone, etc. To enter global configuration mode, you can use the ” <strong>configure terminal</strong> “ command (the ” conf t “ command also works; this is the abbreviation), and the command-line prompt changes to ” Switch(config)# “.
Switch# conf tEnter configuration commands, one per line.  End with CNTL/Z.Switch(config)#
  1. Interface configuration mode: Interface configuration mode allows configuration of switch interfaces, such as configuring IP addresses, port speed, half-duplex or full-duplex, etc. To enter interface configuration mode, use the ” interface interface-type “ command in global configuration mode (interface-type is the specific port name), and the command-line prompt changes to ” Switch(config-if)# “.
Switch(config)#interface f0/1Switch(config-if)#
  1. Line configuration mode: When using a terminal emulation program (Telnet access) to configure a switch or router, configure parameters for VTY lines.
Switch(config)# line vty 0 4! 允许同时有 5 个用户分别在 VTY 线路上实施 Telnet 远程登陆Switch(config-line)# exec-timeout 0 0! 设定 telnet 登陆后,空闲时永不超时Switch(config-line)#

Common Commands for Initial Switch Configuration

Start Initial Switch Configuration in Privileged Mode

Switch> enaSwitch# setup

Set the Privileged Password in Global Configuration Mode

Switch# conf tEnter configuration commands, one per line.  End with CNTL/Z.Switch(config)# enable secret 123------! 设置特权模式的密码为 123

There is another command for setting a password: ” enable password “. Unlike ” enable secret “, password is a plaintext password, while secret is an encrypted password and is more secure. If you set an encrypted password and then set a plaintext password, the latter password will overwrite the former password.

Set the Hostname in Global Configuration Mode

Switch(config)# hostname nuomenuome(config)#------! 设置主机名为 nuome

Exit the Current Working Mode

Switch(config)# exitSwitch#

Display Current Running Configuration Information

Switch# show running-config 

Comments

Discussion

Be kind and keep the discussion friendly.

Complete your profile details to improve the chance of approval.

Your email will not be shown publicly.

Loading...

Markdown supported.

Discussion

0 comments

Internal link graph

Loading internal links…

View linked articles