CCIE思科教育培训 CCIE培训

盘点cisco交换机命令

  交换机口令设置:

  (我所针对的都是cisco 的设备而言的,华为的可以跟据手册来查,配置都是差不多的,这里华子就不多写华为的设备了,了解的也不是很多)

  switch>enable 进入特权模式

  switch#config terminal 进入全局配置模式

  switch(config)#hostname 设置交换机的主机名

  switch(config)#enable secret xxx 设置特权加密口令

  switch(config)#enable password xxa 设置特权非密口令

  使用Telnet远程式管理

  switch(config)#interface vlan 1 进入vlan 1

  switch(config-if)#ip address 设置IP地址

  switch(config-if)#ip default-gateway 设置默认网关

  switch(config)#line vty 0 4 进入虚拟终端

  switch(config-line)#login 允许登录

  switch(config-line)#password xx 设置登录口令

  switch#exit 返回命令

  控制台口令

  switch(config)#line console 0 进入控制台口

  switch(config-line)#login 允许登录

  switch(config-line)#password xx 设置登录口令

  switch#exit 返回命令

  基本接口配置

  switch(config)#interface f0/1 进入f0/1接口

  switch(config-if)#duplex full 配置全双工模式

  switch(config-if)#speed 100 配置速率

  switch(config-if)#description to ***** 接口描述

  switch(config)#ip domain-name ***.com 设置或名服务器

  switch(config)#mac-address-table aging-time 设置mac表超时时间

  switch#write 保存配置信息

  switch#copy running-config startup-config 保存当前配置nvram

  switch#erase startup-config 清除配置文件

  交换机VLAN设置:

  switch#vlan database 进入VLAN设置

  switch(vlan)#vlan 2 建VLAN 2

  switch(vlan)#name 名字 建VLAN 2的名称

  switch(vlan)#no vlan 2 删vlan 2

  注:删除vlan时原属于此vlan的端口处于非激活状态,直到重新分配为止

  switch(config)#int f0/1 进入端口1

  switch(config-if)#switchport mode access 当前端口工作莫试

  switch(config-if)#switchport access vlan 2 当前端口加入vlan 2

  switch(config-if)#switchport mode trunk 设置为干线

  switch(config-if)#switchport trunk encapsulation dot1q 设置vlan 中继协议

  switch(config-if)#no switchport mode 或 ( switchport mode access) 禁用干线

  switch(config-if)#switchport trunk allowed vlan add 1,2 ;从Trunk中添加vlans

  switch(config-if)#switchport trunk allowed vlan remove 1,2 ;从Trunk中删除vlans

  switch(config-if)#switchport trunk pruning vlan remove 1,2 ;从Trunk中关闭局部修剪


Tags:

发布: admin 分类: CCIE思科 评论: 0 浏览: 144
留言列表
发表留言
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。