天天看點

交換機的基本原理(二)

一、交換機配置前的準備

1、計算機與交換機的實體連接配接

交換機/路由器的console口

console線(一般用com1、com2口)/USB轉console線(一般用com3、com4口)

2、計算機與交換機的軟體

SecureCRT軟體(選擇序列槽、端口、波特率,資料位,停止位)

2、實驗環境與練習

可以購買二手裝置

可以網上購買雲實驗室VIP

使用思科出品的專用模拟軟體Cisco Packet Tracer

Cisco Packet Tracer相關使用方法:

https://jingyan.baidu.com/article/b87fe19e472ca4521835680c.html https://jingyan.baidu.com/article/ea24bc39f24684da62b33137.html https://jingyan.baidu.com/article/0320e2c13db6321b87507bdd.html https://jingyan.baidu.com/article/e75aca85077a44142edac6c3.html

二、Cisco交換機的指令行介紹

1、使用者模式

switch>           

2、特權模式

switch>enable
  switch#           

3、全局配置模式

switch#config terminal
  switch(config)#           

4、接口模式

switch(config)#interface fastetherent 0/1
  switch(config-if)#           

指令的含義:

interface 關鍵字

fastetherent 接口類型:E表示10M接口、F表示100M接口、Gi表示1000M接口、Te表示10000M接口

示例進入千兆接口Switch(config)#interface gigabitEthernet 0/1           

0/1:其中0表示子產品 1表示端口号

備注:進階裝置會有0/0/1:其中第一個0表示槽位号

5、模式間的轉換

5.1、進入不同模式的指令可以簡寫
Switch>en 
  Switch#conf t 
  Enter configuration commands, one per line.  End with CNTL/Z.
  Switch(config)#int f0/1
           
5.2、exit指令:退出目前模式,傳回上一模式
Switch(config-if)#exit
  Switch(config)#exit
  Switch#
  %SYS-5-CONFIG_I: Configured from console by console

  Switch#exit

  Switch con0 is now available
  Press RETURN to get started.
  Switch>           
5.3、end指令:無論在任何模式下,直接傳回特權模式
Switch>
  Switch>en 
  Switch#conf t
  Enter configuration commands, one per line.  End with CNTL/Z.
  Switch(config)#int 0/1
               ^
  % Invalid input detected at '^' marker.

  Switch(config)#end
  Switch#
  %SYS-5-CONFIG_I: Configured from console by console

  Switch#
           
5.4、Ctrl+z快捷鍵:直接傳回到特權模式

三、指令行的層次關系

交換機的基本原理(二)

四、幫助指令行?的作用

1、顯示指令

在目前模式下直接輸入?即可顯示目前模式下的所有指令
Switch#?
 Exec commands:
      clear       Reset functions
      clock       Manage the system clock
      configure   Enter configuration mode
      connect     Open a terminal connection
      copy        Copy from one file to another
      debug       Debugging functions (see also 'undebug')
      delete      Delete a file
      dir         List files on a filesystem
      disable     Turn off privileged commands
      disconnect  Disconnect an existing network connection
      enable      Turn on privileged commands
      erase       Erase a filesystem
      exit        Exit from the EXEC
      logout      Exit from the EXEC
      more        Display the contents of a file
      no          Disable debugging informations
      ping        Send echo messages
      reload      Halt and perform a cold restart
      resume      Resume an active network connection
      setup       Run the SETUP command facility
      show        Show running system information
      ssh         Open a secure shell client connection
      telnet      Open a telnet connection
      terminal    Set terminal line parameters
      traceroute  Trace route to destination
      undebug     Disable debugging functions (see also 'debug')
      vlan        Configure VLAN parameters
      write       Write running configuration to memory, network, or                 terminal
  Switch#
           

2、顯示參數

在指令後輸入?可以顯示該指令的所有參數
Switch(config)#int ?
    Ethernet         IEEE 802.3
    FastEthernet     FastEthernet IEEE 802.3
    GigabitEthernet  GigabitEthernet IEEE 802.3z
    Port-channel     Ethernet Channel of interfaces
    Vlan             Catalyst Vlans
    range            interface range command
           

3、指令清單

忘記某個指令的拼寫,輸入前幾個字母?即可顯示以此開頭的所有可用指令
Switch(config)#i?
  interface  ip            

五、Tab鍵:用于補全指令