在网络中配置思科交换机

By default, all ports of a switch are enabled. As we are talking about layer 2 switching, there is no need to configure IP address or any routing protocol on the switch. In such a situation, the configuration is not focused on the switch.

缺省情况下,交换机的所有端口均处于启用状态。 当我们谈论第2层交换时 ,无需在交换器上配置IP地址或任何路由协议。 在这种情况下,配置不会集中在交换机上。

The normal configuration given below can be done on the switch:

下面给出的常规配置可以在交换机上完成:

  1. You can define the hostname on the switch.

    您可以在交换机上定义主机名。

  2. You can set the password for the switch.

    您可以设置交换机的密码。

  3. You can describe all the ports of the switch.

    您可以描述交换机的所有端口。

  4. You can set the password for the console ports.

    您可以设置控制台端口的密码。

  5. You can set the password of ports for Telnetting.

    您可以设置用于Telnet的端口密码。

The above mentioned configuration list can be seen with the following example:

通过以下示例可以看到上面提到的配置列表:

  • First, you have to execute the command execute using the command execution mode. You will see switch by default as soon as you open it. Once you run this command, you will enter into privileged execution mode. In this mode, you execute the config terminal command. By executing this command, you will be in the global configuration mode.

    首先,必须使用命令执行模式执行命令执行。 默认情况下,您将在打开开关后立即看到它。 一旦运行此命令,您将进入特权执行模式。 在这种模式下,您将执行config terminal命令。 通过执行此命令,您将进入全局配置模式。

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

  • You can configure your switch after coming into the global configuration mode. You use the hostname command to configure hostname on the switch. After this command, you can mention the name that you want to give to the switch.

    进入全局配置模式后,可以配置交换机。 您可以使用hostname命令在交换机上配置主机名。 执行此命令后,您可以提及要为交换机指定的名称。

  • Switch(config)#hostname MRSwitch
    
    
  • As soon as this command is executed, the name of your switch is set up.

    执行此命令后,即会设置交换机的名称。

  • MRSwitch(config)#
    
    
  • The switch can be protected from password so that no unauthorized person can access it. You use the enable secret command for this. After this command, you type the password you want to set for the switch.

    可以使用密码保护该开关,以便任何未经授权的人都不能访问它。 为此,请使用enable secret命令。 此命令后,键入要为交换机设置的密码。

  • MRSwitch(config)#enable secret MR123
    
    
  • To configure an interface of the switch, first, you have to go to the interface configuration mode. For this, use the interface command. Next, to this command, you have to type the name of the interface.

    要配置交换机的接口,首先,必须进入接口配置模式。 为此,请使用interface命令。 接下来,在此命令中,您必须键入接口的名称。

  • MRSwitch(config)# interface f0/16
    
    
  • To define the description of an interface, you use the description command in the interface configuration mode. Next, to this command, you write the description of that interface.

    要定义接口的描述,请在接口配置模式下使用description命令。 接下来,在此命令中,编写该接口的描述。

  • MRSwitch(config-if)# description Description of of/16 interface
    
    
  • You use the password command to set the password of any console line. But for this, you have to first go to the configuration mode of the console line you want to set. For this, you execute the line console command. Next, to this command, you type the console number of the console.

    您可以使用password命令来设置任何控制台行的密码。 但是为此,您必须首先进入要设置的控制台行的配置模式。 为此,您执行line console命令。 接下来,在此命令中,键入控制台的控制台号。

  • MRSwitch(config-if)# line console 0
    MRSwitch(config-line)#password mrconsole
    
    
  • After that, you can execute the login command. Anyone trying to access the console line by this command is forced to enter the password. If you do not execute the login command, then the password is set but the password is not compulsory to enter. You can execute this command even after the telnet password is set.

    之后,您可以执行login命令。 任何试图通过此命令访问控制台行的人都必须输入密码。 如果不执行login命令,则将设置密码,但密码不是必须输入的。 即使设置了telnet密码,您也可以执行此命令。

  • You use the line "vty" command to set the telnet password on the interfaces. Next, to this command, you give the range of virtual terminals lines. If you want to configure all 16 lines, then it gives 0 to 15 range. Then you set the telnet password with the password command and execute the login command.

    您可以使用line “ vty”命令在接口上设置telnet密码。 接下来,向该命令提供虚拟终端线的范围。 如果要配置所有16条线,则其范围为0到15。 然后,使用password命令设置telnet密码并执行login命令。

  • MRSwitch(config-line)#line vty 0 15
    MRSwitch(config-line)#password mrtelnet
    MRSwitch(config-line)#login
    
    
    
    

    翻译自: https://www.includehelp.com/computer-networks/configuring-cisco-switches.aspx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值