交换机的操作 (思科 )

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

  • 3
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值