【Cisco Packet Tracer| 一.交换机配置模式与基本参数配置】

思科模拟软件:Cisco Packet Tracer Student

一.交换机的多种模式以及切换

1.如何进入到交换机配置的命令行用户界面(Command Line Interface)

image-20230416212529563

enter进入到普通用户模式

2.普通模式模式

普通用户模式下的
命令提示符:>
Switch>?
Exec commands:
  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

命令行下的复制粘贴:

shift+insert:复制命令行上的内容

shift+delete:粘贴最近一次剪切板中的内容到命令行上

普通用户模式转为特权用户模式:

Switch>enable
Switch#

3.特权用户模式

特权用户模式下的命令提示符:#
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
  --More--

more表示由于屏幕大小原因,还有部分内容没有显示出来:

  1. 回车键:一次向下显示一行
  2. 空格键:一次向下显示一屏

特权用户模式转为全局配置模式:

Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#

ps:

configure terminal意为配置终端,单词较长,可采用以下解决办法:

  1. tab键自动补全
  2. 简写成conf t

4.全局配置模式

特权用户模式下的命令提示符:(configure)+#
Switch(config)#?
Configure commands:
  access-list        Add an access list entry
  banner             Define a login banner
  boot               Boot Commands
  cdp                Global CDP configuration subcommands
  clock              Configure time-of-day clock
  crypto             Encryption module
  do                 To run exec commands in config mode
  enable             Modify enable password parameters
  end                Exit from configure mode
  exit               Exit from configure mode
  hostname           Set system's network name
  interface          Select an interface to configure
  ip                 Global IP configuration subcommands
  line               Configure a terminal line
  logging            Modify message logging facilities
  mac                MAC configuration
  mac-address-table  Configure the MAC address table
  no                 Negate a command or set its defaults
  port-channel       EtherChannel configuration
  privilege          Command privilege parameters
  service            Modify use of network based services
  snmp-server        Modify SNMP engine parameters
 --More-- 

查看配置模式中的24个端口:

image-20230416214633387

ps: FastEthernet0/1单词意为快速以太网0/1

全局配置模式转为接口配置模式:

Switch(config-if)#interface f0/1
Switch(config-if)#

全局配置模式转为vlan配置模式:

Switch(config)#vlan 4
Switch(config-vlan)#

5.模式切换图

image-20230416220005597

二.交换机名称,口令等设置

1.全局模式下-交换机改名

全局模式下:

Switch(config)#hostname song
song(config)#

2.接口模式下-配置端口速度和工作模式

2.1配置端口速度

image-20230416220444311

song(config-if)#speed ?
  10    Force 10 Mbps operation
  100   Force 100 Mbps operation
  auto  Enable AUTO speed configuration

ps:默认会自动地匹配式10Mbps,还是100Mbps

image-20230416220645831

song(config-if)#speed 10
song(config-if)#speed 100
song(config-if)#speed auto
song(config-if)#

2.2配置工作模式

image-20230416220912436

song(config-if)#duplex ?
  auto  Enable AUTO duplex configuration
  full  Force full duplex operation
  half  Force half-duplex operation

image-20230416220956648

3.特权模式下-查看交换机历史命令

原则上可以一个一个通过上键来上翻找到所有的历史命令,但是不方便

song#show running-conf
Building configuration...

Current configuration : 975 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname song
!
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
 --More-- 

4.命令的撤销

有些命令可以通过覆盖来达到撤销后再次写入的目的,但是有些命令只能通过撤销后再次写入来完成

song(config-if)#speed 100
song(config-if)#no speed 100
song(config-if)#

猜你喜欢

转载自blog.csdn.net/qq_64428099/article/details/130189766
今日推荐