交换机常见配置命令
作者:  出处:  更新时间: 2008年08月26日 
在这里我只总结了常用的switch命令

1.设置主机名/系统名: 
在基于IOS的交换机上switch(config)# hostname hostname (主机名)
在基于CLI的交换机上switch(enable) set system name name-string 
2.设置登录口令: 
在基于IOS的交换机上switch(config)# enable password level 1 password 
在基于CLI的交换机上switch(enable) set password 
                      switch(enable) set enalbepass 需要设置二级密码
3.设置远程访问: 
在基于IOS的交换机上switch(config)# interface vlan 1 
switch(config-if)# ip address ip-address netmask 
switch(config-if)# ip default-gateway ip-address 
在基于CLI的交换机上
switch(enable) set interface sc0 ip-address netmask broadcast-address 
switch(enable) set interface sc0 vlan 
switch(enable) set ip route default gateway 
4.设置端口速度: 
在基于IOS的交换机上switch(config-if)# speed{10|100|auto} 
在基于CLI的交换机上
switch(enable) set port speed moudle/number {10|100|auto} 
switch(enable) set port speed moudle/number {4|16|auto}
5.设置以太网的链路模式: 
在基于IOS的交换机上switch(config-if)# duplex {auto|full|half} (自动|全双工|半双工)
在基于CLI的交换机上switch(enable) set port duplex module/number {full|half} 
6.配置静态VLAN: 
在基于IOS的交换机上
switch# vlan database 
switch(vlan)# vlan vlan-num name vla 
switch(vlan)# exit 
switch# configure teriminal 
switch(config)# interface interface module/number 
switch(config-if)# switchport mode access 
switch(config-if)# switchport access vlan vlan-num 
switch(config-if)# end 
在基于CLI的交换机上
switch(enable) set vlan vlan-num [name name] (命令字,vlan号,名字)
switch(enable) set vlan vlan-num mod-num/port-list 
7.配置VLAN中继线: 
在基于IOS的交换机上
switch(config)# interface interface mod/port 
switch(config-if)# switchport mode trunk 
switch(config-if)# switchport trunk encapsulation {isl|dotlq} 
switch(config-if)# switchport trunk allowed vlan remove vlan-list 
switch(config-if)# switchport trunk allowed vlan add vlan-list 
在基于CLI的交换机上(在哪个端口上设置trunk)
switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate] 
Vlan-range [isl|dotlq|dotl0|lane|negotiate] 
8.配置VTP管理域: 
在基于IOS的交换机上
switch# vlan database 
switch(vlan)# vtp domain domain-name 
在基于CLI的交换机上
switch(enable) set vtp [domain domain-name] 
9.配置VTP 模式: 
在基于IOS的交换机上
switch# vlan database 
switch(vlan)# vtp domain domain-name 
switch(vlan)# vtp {sever|cilent|transparent} 
switch(vlan)# vtp password password 
在基于CLI的交换机上
switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password]
注:vtp有三种模式:客户端模式,服务器模式,透明模式
10. 为了从一条中继链路上删除VLAN,可使用下列命令: 
switch(enable) clear trunk module/port vlan-range 
11.显示管理域的VTP参数. show vtp statistics
12. 用物理接口建立与VLAN的连接: 
router# configure terminal 
router(config)# interface media module/port 
router(config-if)# description description-string 
router(config-if)# ip address ip-addr subnet-mask 
router(config-if)# no shutdown 
13.在路由处理器上进行动态路由配置,用下列IOS命令进行: 
router(config)# ip routing 
router(config)# router ip-routing-protocol 
router(config-router)# network ip-network-number 
router(config-router)# network ip-network-number 
14. 配置默认路由: 
switch(enable) set ip route default gateway
15. 配置HSRP跟踪: 
router(config-if)# standy group-number track type-number interface-priority 
16. 在Cisco设备上设置控制台及vty端口的会话超时: 
R1(config)# line console 0 
R1(config-line)# exec-timeout 5 10 
R1(config)# line vty 0 4(设置对话时间)
R1(config-line)# exec-timeout 5 2
17. 显示SPAN信息: 
Consile> show spantree

 (本文已被浏览 26 次)
 发布人:s
 → 推荐给我的好友
上篇文章:交换机的分类标准
下篇文章:交换机配置
  → 相关文章
交换机常见配置命令

  → 评论内容 (点击查看)   共0条评论,每页显示5条评论   浏览所有评论
(没有相关评论)
  → 发表我的评论
您的姓名: 您的Email:
评论内容:
250字内
发表评论:      发表评论须知 →
  • 尊重网上道德,遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他各项有关法律法;
  • 本站有权保留或删除您发表的任何评论内容;
  • 阅读排行
    · 电话交换机原理
    · 什么是pabx?
    · 什么是pbx?
    · 电话交换机常见故障简...
    · VoIP 原理
    · 电话交换机的作用
    · 什么叫PABX?
    · 什么是电话交换机?
    · 爱普生打印机维修资料...
    · 摄像机的分类与选购
    · IP电话与电话交换机...
    · 电脑CPU占用100...
     
     
    推荐文章
    · 综合布线系统构成 ,...
    · 什么是综合布线
    · 广电传输技术在小区安...
    · 交换机、集线器、路由...
    · 复印机的常见问题及日...
    · 激光传真机常出现的问...
    · 三层交换机的工作原理
    · 安全交换机
    · 复印机的保养使用方法
    · 如何对调音台的进行分...
    · 如何选用调音台?
    · 如何正确选购优质话筒?
    关于我们   友情链接   留言  
    版权所有:上海电话交换机网  http://www.youdong.com.cn/    
    上海电话交换机网客服:上海电话交换机网真诚为您服务。   邮东通信::谢谢。      沪ICP备05043203号