Cisco交换机range命令的使用,批处理改变多个端口设置

MTnetwork 网络运维评论5,399阅读模式

Cisco交换机range命令的使用,批处理改变多个端口设置
在Cisco交换机里面有一个非常有用的命令,开始刚学习的时候不知道,走了不少弯路。这个命令可以用一次改变多个端口的设置。换句话说,如果你需要在交换机的许多个端口上进行相同的操作,不需要一个一个端口的设置,只需要一个命令就可以了。这个命令就是“range”,例如下:
S1(config)#interface range fastEthernet 0/1-24
S1(config-if-range)#no shutdown
//注意:从这儿开始是交换机改变设置时自动显示的端口变化情况
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
%LINK-5-CHANGED: Interface FastEthernet0/2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
%LINK-5-CHANGED: Interface FastEthernet0/3, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
%LINK-5-CHANGED: Interface FastEthernet0/4, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/5, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/6, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/7, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/8, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/9, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/10, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/11, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/12, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/13, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/14, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/15, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/16, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/17, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/18, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/19, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/20, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/21, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/22, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/23, changed state to down
%LINK-5-CHANGED: Interface FastEthernet0/24, changed state to down
S1(config-if-range)#
还可以用show running...验证下,很好玩。

文章末尾固定信息

我的微信
这是我的微信扫一扫
weinxin
我的微信
我的微信公众号
我的微信公众号扫一扫
weinxin
我的公众号
 
MTnetwork
  • 本文由 MTnetwork 发表于 2017年4月1日 13:48:06
  • 转载请务必保留本文链接:https://www.mtwl.net/cisoc-switch-range.html
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
确定