zoukankan      html  css  js  c++  java
  • cisco(思科)交换机配置篇【两】

    上一页大家津津乐道cisco基本操作命令开关,而端午假期,该cisco简单的开关配置,并希望请您分享“端午节快乐”!Ok,配置交换机,首先,你必须进入全局配置模式Switch,在成功连接开关和着陆成功进入特权模式

    1、进入全局配置模式:

    switch#configure terminal 
    Enter configuration commands, one per line.  End with CNTL/Z.
    switch(config)#
    switch(config)#
    switch(config)#
    这么简单的一条命令,俺们就进入到全局配置模式了,还记得上一篇中查看port所查询到的信息中name字段下的值吗?这字段事实上代表的是交换机port的描写叙述信息

    2、改动port描写叙述

    switch#
    switch#
    switch#conf ter
    Enter configuration commands, one per line.  End with CNTL/Z.
    switch(config)#
    switch(config)#int fa0/3
    switch(config-if)#
    switch(config-if)#desc
    switch(config-if)#description updateDesc
    switch(config-if)#
    switch(config-if)#exit
    switch(config)#exit
    switch#
    switch#show inter
    switch#show interfaces statu
    switch#show interfaces status 
    
    Port      Name               Status       Vlan       Duplex  Speed Type
    Fa0/1                        connected    1          a-full  a-100 10/100BaseTX
    Fa0/2     h3c2.250           connected    trunk      a-full  a-100 10/100BaseTX
    Fa0/3     updateDesc         notconnect   1            auto   auto 10/100BaseTX
    Fa0/4                        connected    1          a-full  a-100 10/100BaseTX
    Fa0/5     h3c-2.200          connected    1          a-full  a-100 10/100BaseTX
    Fa0/6                        notconnect   1            auto   auto 10/100BaseTX

    改动描写叙述的关键命令在于,在配置模式下。进入到要改动的port下,然后使用description + “内容”。效果应该非常直观了吧。接下来就是改动port的所在Vlan了

    3、改动portVlan

    switch#
    switch#
    switch#conf t
    Enter configuration commands, one per line.  End with CNTL/Z.
    switch(config)#
    switch(config)#int fa0/3
    switch(config-if)#
    switch(config-if)#sw acc vl 2
    switch(config-if)#
    switch(config-if)#exit
    switch(config)#
    switch(config)#exit
    switch#
    switch#show inter statu
    
    Port      Name               Status       Vlan       Duplex  Speed Type
    Fa0/1                        connected    1          a-full  a-100 10/100BaseTX
    Fa0/2     h3c2.250           connected    trunk      a-full  a-100 10/100BaseTX
    Fa0/3     updateDesc         notconnect   2            auto   auto 10/100BaseTX
    Fa0/4                        connected    1          a-full  a-100 10/100BaseTX
    Fa0/5     h3c-2.200          connected    1          a-full  a-100 10/100BaseTX
    Fa0/6                        notconnect   1            auto   auto 10/100BaseTX

    逻辑和改动port描写叙述是一样的,对于配置来说,肯定是到了能有配置权限的地方和要配置的对象。这里改动portVlan的关键命令为:sw acc vl + vlantag,命令非常明显被简写了,可是不影响运行。命令的全写为:switchport access vlan + vlantag

    另一些对port的简单操作,譬如改动port的模式,

    4、改动port模式

    switch(config-if)#switchport trunk encap dot1q ----------------设置vlan 中继的封装协议
    注:dot1q就是 IEEE 802.1Q协议,是vlan的一种封装方式,是公有协议。

    另一种trunk协议,是ISL,也是vlan的一种封装方式,只是这是Cisco思科私有协议。其它厂商不能用。 switch(config-if)#switchport mode trunk ------------------------设置端口类型为trunk switch(config-if)#switchport trunk allowed vlan 1。2 ---------设置同意的vlan。默认不用配置。为全部vlan switch(config-if)#switchport trun native vlan 999 ---------------设置trunk口的native vlan


    5、port状态
    switch(config)#
    switch(config)#int fa0/3
    switch(config-if)#
    switch(config-if)#
    switch(config-if)#sw acc vl 1
    switch(config-if)#
    switch(config-if)#
    switch(config-if)#shutd   
    switch(config-if)#shutdown 
    switch(config-if)#    
    switch(config-if)#exit
    switch(config)#
    switch(config)#exit
    switch#
    switch#show inter statu
    
    Port      Name               Status       Vlan       Duplex  Speed Type
    Fa0/1                        connected    1          a-full  a-100 10/100BaseTX
    Fa0/2     h3c2.250           connected    trunk      a-full  a-100 10/100BaseTX
    Fa0/3     updateDesc         disabled     1            auto   auto 10/100BaseTX
    Fa0/4                        connected    1          a-full  a-100 10/100BaseTX

    上面的一系列为切换Vlan,而且shutdownport,这时候大家可能看到了交换机3号port的状态已变成disable了,假设我们要启用port仅仅需
    switch#conf t
    Enter configuration commands, one per line.  End with CNTL/Z.
    switch(config)#
    switch(config)#int fa0/3
    switch(config-if)#
    switch(config-if)#no shut
    switch(config-if)#no shutdown 
    switch(config-if)#
    switch(config-if)#exit
    switch(config)#
    switch(config)#exit
    switch#
    switch#show inter statu
    
    Port      Name               Status       Vlan       Duplex  Speed Type
    Fa0/1                        connected    1          a-full  a-100 10/100BaseTX
    Fa0/2     h3c2.250           connected    trunk      a-full  a-100 10/100BaseTX
    Fa0/3     updateDesc         notconnect   1            auto   auto 10/100BaseTX
    Fa0/4                        connected    1          a-full  a-100 10/100BaseTX

    今天就到这里了。有时间再来和大家分享一下在工作上须要的而且对自己非常实用的东西与知识。请继续关注下一个——在交换机登录某些设置

    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    设计若干个函数, ①删除除空格、英文逗号、句号、问号、感叹号之外的所有字符; ②两个英文单词之间的空格多于1个的,把多余的删去; ③检测每句首字母是否为大写字母,若不是,将其转换为大写字母; 检测句中除首字母外是否有大写字母,若有,将其转化为小写字母。
    在一个无序整数数组中,找出连续增长片段最长的一段, 增长步长是1。Example: [3,2,4,5,6,1,9], 最长的是[4,5,6]
    linux常用命令
    linux下硬盘分区/格式化/挂载
    Solr集群搭建
    redis集群搭建手册
    免费论文查重
    log4 配置日志文件变量名
    sqlserver 属性 DefaultFullTextLanguageLcid 不可用
    iis 0x80070032 Cannot read configuration file because it exceeds the maximum file size
  • 原文地址:https://www.cnblogs.com/lcchuguo/p/4668252.html
Copyright © 2011-2022 走看看