




全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
交换机基本状态: switch: ;ROM状态, 路由器是rommon hostname ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;接口状态 交换机口令设置: switchenable ;进入特权模式 switch#config terminal ;进入全局配置模式 switch(config)#hostname ;设置交换机的主机名 switch(config)#enable secret xxx ;设置特权加密口令 switch(config)#enable password xxa ;设置特权非密口令 switch(config)#line console 0 ;进入控制台口 switch(config-line)#line vty 0 4 ;进入虚拟终端 switch(config-line)#login ;允许登录 switch(config-line)#password xx ;设置登录口令xx switch#exit ;返回命令 交换机VLAN设置: switch#vlan database ;进入VLAN设置 switch(vlan)#vlan 2 ;建VLAN 2 switch(vlan)#no vlan 2 ;删vlan 2 switch(config)#int f0/1 ;进入端口1 switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2 switch(config-if)#switchport mode trunk ;设置为干线 switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继 switch(config)#vtp domain ;设置发vtp域名 switch(config)#vtp password ;设置发vtp密码 switch(config)#vtp mode server ;设置发vtp模式 switch(config)#vtp mode client ;设置发vtp模式 交换机设置IP地址: switch(config)#interface vlan 1 ;进入vlan 1 switch(config-if)#ip address ;设置IP地址 switch(config)#ip default-gateway ;设置默认网关 switch#dir flash: ;查看闪存 交换机显示命令: switch#write ;保存配置信息 switch#show vtp ;查看vtp配置信息 switch#show run ;查看当前配置信息 switch#show vlan ;查看vlan配置信息 switch#show interface ;查看端口信息 switch#show int f0/0 ;查看指定端口信息 交换机命令总结基本配置命令Switch enable 进入特权模式Switch #config terminal 进入全局配置模式Switch (config)#hostname 设置交换机的主机名Switch(config)#enable password 进入特权模式的密码(明文形式保存)Switch(config)#enable secret 加密密码(加密形式保存) (优先)Switch(config)#ip default-gateway 配置交换机网关Switch(config)#show mac-address-table 查看MAC地址Switch(config)logging synchronous 阻止控制台信息覆盖命令行上的输入Switch(config)no ip domain-lookup 关闭DNS查找功能Switch(config)exec-timeout 0 0 阻止会话退出使用Telnet远程式管理Switch (config)#line vty 0 4 进入虚拟终端Switch (config-line)# password 设置登录口令Switch (config-line)# login 要求口令验证控制台口令switch(config)#line console 0 进入控制台口switch(config-line)# password xx switch(config-line)# 设置登录口令login 允许登录Cisco发现协议(CDP)Switch(config)#show cdp 显示Cisco设备全局配置信息Switch(config)#show cdp interface 端口查看CDP配置下端口信息Switch(config)#show cdp neighbors 显示直连Cisco设备信息Switch(config)#show cdp neighbors detail 查看邻居详细信息恢复出厂配置Switch(config)#erase startup-configSwitch(config)delete vlan.dat配置接口标识接口标识用于区分路由器的各个接口。switch(config)#interface fastethernet 0/1 以0/1 接口为例switch(config)# description this is a fast Ethernet port used to connecting the companys intranet! Vtp配置switch(config)#vtp domain 设置vtp域名switch(config)#vtp password 设置vtp密码switch(config)#vtp mode server/client/transparent 设置vtp服务器模式switch(config)#vtp version 设置vtp版本switch(config)#vtp pruning 启用vtp修解注:要想从vtp中减少一台交换机只需将该交换机vtp 域名更改Vlan基本配置 Switch#vlan database 进去vlan配置模式 Switch(vlan)#vlan 号码 name 名称 创建vlan及vlan名 Switch(vlan)#vlan号码 mtu数值 修改MTU大小 Switch(vlan)#exit 更新vlan数据并推出 Switch#show vlan 查看验证 Switch#copy running-config startup-config 保存配置 叫NO 删除VLANVLAN 中添加 删除端口 Switch#config terminal 进入全局配置 Switch(config)#interface fastethernet0/1 进入要分配的端口 Switch(config-if)#Switchport mode access 定义二层端口 Switch(config-if)#Switchport acces vlan 号 把端口分给一个vlanSwitch(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中添加vlansSwitch(config-if)#switchport trunk allowed vlan remove 1,2 从Trunk中删除vlanSwitch(config-if)#switchport trunk pruning vlan remove 1,2 ;从Trunk中关闭局部修剪查看vlan信息 Switch#show vlan brief 所有vlan信息查看vlan信息 Switch#show vlan id 某个vlan信息注:Switch#show int trunk 查看trunk协议注:可以使用default interface interface-id 还原接口到默认配置状态 Trunk 开启(no) 将端口设置为永久中继模式 关闭(off) 将端口设置为永久非中继模式,并且将链路转变为非中继链路企望(desirable)让端口主动试图将链路转换成中继链路 自动(auto) 使该端口愿意将链路变成中继链路 配置接口为动态协商模式 Switch(config)#interface 接口号 Switch(config)#switchport mode dynamic desirable/auto生成树stp:Switch(config)#spanning-tree vlan 启用stp生成树(基于vlan)Switch(config)#spanning-tree vlan root primary 指定根交换机(基于vlan)Switch(config)#spanning-tree vlan root secondary 指定备用根交换机(基于vlan)Switch(config)#spanning-tree vlan priority 指定交换机优先级(基于vlan)Switch(config)#no spanning-tree vlan priority 将交换机的优先级恢复默认值(基于vlan)Switch(config-if)#spanning-tree vlan cost 指定端口成本(起用trunk的端口模式下)Switch(config-if)#spanning-tree vlan port-prioty 指定交换机端口优先级(基于vlan)Switch(config-if)#spanning-tree portfast 配置速端口(连接终端设备的端口状态)如pc机Switch(config)#spanning-tree uplinkfast 配置上行速端口注:在配置上行速端口前要先将基于vlan上的网桥优先级,网桥成本恢复默认值。起用了该命令后在进行优先级更改,注:vlan为可选参数,当没有该参数时将修改所有vlan网桥的优先级及所有的vlan端口成本Switch#show spanning-tree summery 检测vlan生成树配置Switch#show spanning-tree vlan detail 浏览详细生成树配置信息Switch#show spanning-tree interface detail 浏览详细生成树端口配置信息以太网通道配置switch(config)#interface range fasternet0/1 - 2 将fasternet0/1和0/2 口捆绑switch(config-if)#channel-group 1 mode on 配置以太通道模式switch(config-if)#port-channel load-balance dst-mac | src-mac在链路间实现负载均衡switch#show etherchannel 1 summary 查看通道信息 switch#show etherchannel load-balance 查看通道信息 交换机显示命令:switch#show vtp status 查看vtp配置信息switch#show running-config 查看当前配置信息switch#show vlan 查看vlan配置信息switch#show interface 查看端口信息switch#show int f0/0 查看指定端口信息
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 民法学江平第三十章课件
- 民族风土人情课件教学
- 自媒体:新质生产力的新赛道
- 建筑施工企业新质生产力的场景
- 施工企业评价标准讲解
- 师德师风考核奖惩方案
- 2025年血液科淋巴瘤诊断治疗进展考核答案及解析
- 工程力学 课件 挠度和转角
- 2025年心血管内科冠心病患者心电图分析考试卷答案及解析
- 2025年心脏科急诊护理案例分析模拟考试答案及解析
- 环保设备介绍
- 天气学原理和方法知识点梳理
- 麻醉期间体温监测
- 公司第三方回款管理制度
- 海上风电场集电线路方案的选择
- 县人民医院(三级乙等)“十五五”规划
- 会展经济与管理课件
- 中国民用航空飞行学院《力学(一)》2023-2024学年第二学期期末试卷
- 家庭健康知识课件
- 停车场保安门岗岗位职责
- 拍卖保留价协议
评论
0/150
提交评论