交换机的操作 (思科 )

1、交换机的四种操作模式

用户模式 :该模式可以查看交换机软、硬件版本信息并进行简单的测试。提示符为:“Switch>"

特权模式:该模式下对交换机配置文件管理、查看交换机配置信息、进行网络测试等。提示符为:“Switch #”

全局配置模式:该模式下可配置交换机全局参数,如:主机名等。提示符为:“switch(config)   #"

端口模式:该模式下可以对交换机端口参数进行配置。提示符为”Switch(config-if)#“

2、各个模式下可执行的命令

用户模式

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            //显示运行的系统信息
  ssh         Open a secure shell client connection        //打开一个安全的shell客户端连接
  telnet      Open a telnet connection                    //打开Telnet连接
  terminal    Set terminal line parameters            //设置终端线路参数
  traceroute  Trace route to destination                //跟踪到目的地的路由

特权模式

  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                /打开一个安全shell客户端连接
  terminal    Set terminal line parameters        /设置终端线路参数
  traceroute  Trace route to destination            /跟踪到目的地的路由
  undebug     Disable debugging functions (see also 'debug')     /关闭调试函数
  write       Write running configuration to memory, network, or terminal    /将运行配置写入内存、网络或终端

全局配置模式

  aaa                Authentication, Authorization and Accounting.  /认证、授权和计费。
  access-list        Add an access list entry    /添加访问列表项
  banner             Define a login banner        /定义一个登陆横幅
  boot               Boot Commands        /启动命令
  cdp                Global CDP configuration subcommands   /全局CDP配置子命令
  clock              Configure time-of-day clock            /配置时间时钟
  crypto             Encryption module                        /加密模块
  default            Set a command to its defaults            /默认值设置
  do-exec            To run exec commands in config mode      /在config模式下执行exec命令
  dot1x              IEEE 802.1X Global Configuration Commands   /IEEE 802.1X全局配置命令
  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            /IP配置子命令
  line               Configure a terminal line                        /配置线路终端
  lldp               Global LLDP configuration subcommands            /LLDP全局配置子命令
  logging            Modify message logging facilities                /修改消息日志记录功能
  mac                MAC configuration                            /MAC配置
  mls                mls global commands                        /mls 全局命令
  monitor            SPAN information and configuration            /SPAN信息和配置
  no                 Negate a command or set its defaults           /否定命令或设置其默认值
  ntp                Configure NTP                                /NTP配置 
  port-channel       EtherChannel configuration                    /以太网通道配置
  privilege          Command privilege parameters                    /命令权限配置
  sdm                Switch database management                        /交换机数据库管理
  service            Modify use of network based services                /修改基于网络的服务的使用
  snmp-server        Modify SNMP engine parameters        /修改SNMP引擎参数
  spanning-tree      Spanning Tree Subsystem                /生成树子系统
  tacacs-server      Modify TACACS query parameters        /修改TACACS查询参数
  username           Establish User Name Authentication      /建立用户名认证
  vlan               Vlan commands                            /创建vlan 命令
  vtp                Configure global VTP state                /配置全局VTP状态

端口模式

  authentication    Auth Manager Interface Configuration Commands   /认证管理器接口配置命令
  cdp               Global CDP configuration subcommands        /CDP全局配置子命令
  channel-group     Etherchannel/port bundling configuration        /以太通道/端口捆绑配置
  channel-protocol  Select the channel protocol (LACP, PAgP)        /选择通道协议(LACP, PAgP)
  description       Interface specific description        /接口特定描述
  dot1x             Interface Config Commands for IEEE 802.1X        /IEEE 802.1X接口配置命令
  duplex            Configure duplex operation.        /通信配置
  exit              Exit from interface configuration mode        /退出接口配置模式
  ip                Interface Internet Protocol config commands        /接口Internet协议配置命令
  lldp              LLDP interface subcommands            /LLDP接口子命令
  mdix              Set Media Dependent Interface with Crossover  /将媒体依赖接口设置为交叉
  mls               mls interface commands            /MLS接口命令
  no                Negate a command or set its defaults        /否定命令或设置其默认值
  shutdown          Shutdown the selected interface        /关闭所选接口
  spanning-tree     Spanning Tree Subsystem                /生成树子系统
  speed             Configure speed operation.
  storm-control     storm configuration            /风暴的配置
  switchport        Set switching mode characteristics  /设置交换机模式特征
  tx-ring-limit     Configure PA level transmit ring limit        /配置PA级发送环限制

3、各个模式下常用的基础命令

用户模式

进入特权模式

Switch>enable

退出用户模式

Switch>exit

默认第一层就是用户模式,退出后会刷新再次进入用户模式

退出用户登录

Switch>logout

当使用密码或用户登录时,可以使用此退出登录

测试连通性

Switch>ping 192.168.1.1

默认发送五个回文请求,通过表示连通良好,否则网路不通

查看版本信息

Switch>show version

查看   交换机当前MAC地址表信息

Switch>show mac-address-table

特权模式

进入全局配置模式

Switch#configure terminal

退出特权模式

Switch#exit

查看运行的配置

Switch#show running-config

保存正在运行的配置

Switch#write

使用此命令后,断电配置信息依然存在

配置访问控制列表

Switch(config)#access-list 1 permit any

创建vlan

Switch(config)#vlan 10

退到特权模式

Switch(config)#exit

创建虚拟链路

Switch(config)#line vty 0 4

修改设备名称

Switch(config-line)#hostname 34

### Cursor 和 VSCode 的功能对比 #### 功能特性 VSCode 提供了丰富的插件市场,允许开发者安装各种扩展来增强编辑器的功能[^1]。相比之下,Cursor 更专注于写作体验优化,内置了一些特定于Markdown和文本创作的功能。 对于代码调试支持方面,VSCode 集成了强大的调试工具,能够设置断点、查看变量状态以及执行逐步调试操作;而Cursor 主要面向作家群体,在这方面的能力较为有限[^2]。 在版本控制系统集成上,VSCode 可以很好地与Git等主流VCS协同工作,提供图形化的提交历史浏览界面;Cursor 则更侧重于文档管理和协作编写环境下的变更追踪机制[^3]。 #### 用户体验 就启动速度而言,由于VSCode拥有较大的体积加载众多默认启用的组件和服务,初次打开项目时可能会稍慢一些;相反地,轻量级设计使得Cursor能够在瞬间完成初始化过程[^4]。 关于界面美观度和个人化定制选项,两者都提供了主题更换能力,不过VSCode还额外具备修改字体大小/颜色方案等功能,给予使用者更大的自由度去调整视觉效果[^5]。 当涉及到跨平台兼容性和多设备同步服务的时候,尽管两个应用程序都能运行于Windows、macOS及Linux操作系统之上,但是只有VSCode官方推出了Web版,方便随时随地访问云端开发空间[^6]。 ```json { "features": { "extensionsMarketplace": ["VSCode"], "debuggingSupport": ["VSCode", "limited in Cursor"], "versionControlIntegration": ["both but stronger in VSCode"] }, "userExperience": { "startupSpeed": ["faster in Cursor"], "interfaceCustomization": ["more options available in VSCode"], "crossPlatformSyncService": ["only provided by VSCode Web version"] } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值