交换机基本配置

使用交换机的命令行去管理界面

一、技术原理:

      交换机的管理方式基本分为两种:带内管理和带外管理。通过交换机的console口管理交换机属于带外管理,不占用交换机的网络接口,其特点是需要使用配置线,近距离配置。第一次配置交换机是必须利用console端口进行配置

      交换机的命令行操作模式,主要包括:用户模式、特权模式、全局配置模式、端口模式等几种

  1.       用户模式: 进入交换机就后得到的就是用户模式,该操作模式可以简单的查看交换机的软硬件版本信息,并对其就行简单的测试。用户模式的提示符为:switch>
  2. 特权模式:有用户模式进入下一级模式,改模式下可以对交换机的配置文件进行管理,查看交换机的配置信息,进行网络测试和调试等。特权模式提示符为:switch#
  3. 全局配置模式: 是属于特权模式的下一级模式,该模式下可以配置交换机的全局性参数(主机命、登陆密码等),全局配置模式的提示符为:switch(config)#
  4. 端口模式:属于全局配置模式下一级模式,该模式可以进行对交换机端口的参数进行配置。端口模式的提示符:switch(config-if)
  5. exit命令是退回上一级操作模式
  6. End命令指用户从特权模式以及下级模式直接退回到特权模式

命令使用例子、

1、交换机命令操作模式的进入

Switch>enable                     !进入特权模式
Switch#config terminal            !进入全局配置模式
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface fastethernet 0/1        !进入交换机F0/1接口模式
Switch(config-if)#exit                            !退回到上一级
Switch(config)#end                                !直接回到特权模式
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#

2、交换机基本功能

Switch>?      !显示当前模式下所有可执行的命令
Exec commands:
  <1-99>      Session number to resume
  connect     Open a terminal connection
  disable     Turn off privileged commands
  disconnect  Disconnect an existing network connection
  enable      Turn on privileged commands
  exit        Exit from the EXEC
  logout      Exit from the EXEC
  ping        Send echo messages
  resume      Resume an active network connection
  show        Show running system information
  telnet      Open a telnet connection
  terminal    Set terminal line parameters
  traceroute  Trace route to destination
Switch>enable            !进入特权模式
Switch#co?               !显示当前模式下所有以co开头的命令
configure  connect  copy  

Switch#copy ?            !显示copy命令可执行的参数
  flash:          Copy from flash: file system
  ftp:            Copy from ftp: file system
  running-config  Copy from current system configuration
  startup-config  Copy from startup configuration
  tftp:           Copy from tftp: file system
Switch#conf ter               !交换机命令支持命令的简写
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#
Switch(config)#^Z             !CTRL+Z退回到特权模式
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#

总结:

  1. enable:从用户模式进入特权模式
  2. config terminal:从特权模式进入全局配置模式
  3. interface fastethernet 0/1 :进入交换机的F0/1接口模式 如果是0/n,就是进入F0/n的接口模式
  4. CTRL+Z:直接退回特权模式
  5. end :直接退回特权模式
  6. exit : 退回上一级模式

你可能感兴趣的:(交换机初级篇)