前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【Cisco Packet Tracer| 一.交换机配置模式与基本参数配置】

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

作者头像
MicroFrank
发布2023-04-24 10:47:06
1.5K0
发布2023-04-24 10:47:06
举报
文章被收录于专栏:同步文章1234

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

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

image-20230416212529563
image-20230416212529563
代码语言:javascript
复制
enter进入到普通用户模式

2.普通模式模式

代码语言:javascript
复制
普通用户模式下的
命令提示符:>
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:粘贴最近一次剪切板中的内容到命令行上

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

代码语言:javascript
复制
Switch>enable
Switch#

3.特权用户模式

代码语言:javascript
复制
特权用户模式下的命令提示符:#
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. 空格键:一次向下显示一屏

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

代码语言:javascript
复制
Switch#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#

ps:

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

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

4.全局配置模式

代码语言:javascript
复制
特权用户模式下的命令提示符:(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
image-20230416214633387

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

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

代码语言:javascript
复制
Switch(config-if)#interface f0/1
Switch(config-if)#

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

代码语言:javascript
复制
Switch(config)#vlan 4
Switch(config-vlan)#

5.模式切换图

image-20230416220005597
image-20230416220005597

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

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

全局模式下:

代码语言:javascript
复制
Switch(config)#hostname song
song(config)#

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

2.1配置端口速度
image-20230416220444311
image-20230416220444311
代码语言:javascript
复制
song(config-if)#speed ?
  10    Force 10 Mbps operation
  100   Force 100 Mbps operation
  auto  Enable AUTO speed configuration

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

image-20230416220645831
image-20230416220645831
代码语言:javascript
复制
song(config-if)#speed 10
song(config-if)#speed 100
song(config-if)#speed auto
song(config-if)#
2.2配置工作模式
image-20230416220912436
image-20230416220912436
代码语言:javascript
复制
song(config-if)#duplex ?
  auto  Enable AUTO duplex configuration
  full  Force full duplex operation
  half  Force half-duplex operation
image-20230416220956648
image-20230416220956648

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

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

代码语言:javascript
复制
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.命令的撤销

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

代码语言:javascript
复制
song(config-if)#speed 100
song(config-if)#no speed 100
song(config-if)#
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2023-04-16,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一.交换机的多种模式以及切换
  • 1.如何进入到交换机配置的命令行用户界面(Command Line Interface)
  • 2.普通模式模式
  • 3.特权用户模式
  • 4.全局配置模式
  • 5.模式切换图
  • 二.交换机名称,口令等设置
    • 1.全局模式下-交换机改名
      • 2.接口模式下-配置端口速度和工作模式
        • 2.1配置端口速度
        • 2.2配置工作模式
      • 3.特权模式下-查看交换机历史命令
        • 4.命令的撤销
        领券
        问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档