2022年2022年交换机初始化配置

上传人:pu****.1 文档编号:567462658 上传时间:2024-07-20 格式:PDF 页数:6 大小:104.42KB
返回 下载 相关 举报
2022年2022年交换机初始化配置_第1页
第1页 / 共6页
2022年2022年交换机初始化配置_第2页
第2页 / 共6页
2022年2022年交换机初始化配置_第3页
第3页 / 共6页
2022年2022年交换机初始化配置_第4页
第4页 / 共6页
2022年2022年交换机初始化配置_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《2022年2022年交换机初始化配置》由会员分享,可在线阅读,更多相关《2022年2022年交换机初始化配置(6页珍藏版)》请在金锄头文库上搜索。

1、CISOC交换机基本配置命令全集交换机命令总结基本配置命令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 地址Swit

2、ch(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(conf

3、ig-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-

4、config Switch(config)delete vlan.dat 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 6 页 - - - - - - - - - 配置接口标识接口标识用于区分路由器的各个接口。switch(config)#interface fastethernet 0/1 以 0/1 接口为例switch(config)# description this is a fast Ethernet port used to connecting the

5、company s 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配置模

6、式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 删除 VLAN VLAN 中添加删除端口Switch#config terminal 进入全局配置Switch(config)#interface fastethernet0/1 进入要分配的端口Switch(config-if)#Swit

7、chport mode access 定义二层端口Switch(config-if)#Switchport acces vlan 号把端口分给一个vlan 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 allowe

8、d vlan add 1 ,2 从 Trunk中添加 vlans Switch(config-if)#switchport trunk allowed vlan rem ove 1,2 从 Trunk中删除 vlan Switch(config-if)#switchport trunk pruning vlan remove 1 ,2 ;从 Trunk中关闭局部修剪名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 6 页 - - - - - - - - - 查看 vlan信

9、息 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

10、)#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 priorit

11、y 指定交换机优先级 (基于 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(confi

12、g)#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 浏览详细生成树端口配置信息名师资料总结 - - -

13、精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 6 页 - - - - - - - - - 以太网通道配置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在链路间实现负载均衡switc

14、h#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 查看指定端口信息switch#dir flash: 查看闪存switch#show version 查看当前版本信息switch#sh

15、ow cdp cisco 设备发现协议(可以查看聆接设备)switch#show cdp traffic 杳看接收和发送的cdp 包统计信息switch#show cdp neighbors 查看与该设备相邻的cisco 设备switch#show interface f0/1 switchport 查看有关 switchport的配置switch#show cdp neighbors 查看与该设备相邻的cisco 设备编辑本 段VLAN的基本配置命令1、创建 vlan 方法 一switch#vlan database switch(vlan)#vlan 10 name wzswitch(vl

16、an)#exit 2、创 建 vlan 方法二switch(config)#vlan 10 switch(config-vlan)#name wz 3、删 除 vlan 方法一switch(vlan)#no vlan 10 switch(vlan)#exit 4、删 除 vlan 方法二switch(config)# no interface vlan 10 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 6 页 - - - - - - - - - switch(conf

17、ig)#no vlan 10 5、删 除 vlan 方法三switch#delete vlan.dat 6、将端口 加入到 vlan 中switch(config-if)#switchport access vlan 10 7、将一组 连续的端口加入到 vlan 中switch(config)# interface range f0/1 5 switch(config)#interface range f0/6-8,0/9-11,0/22 ( 将不连续多个端口加入到Vlan 中)switch(config-if-range)#switchport access vlan 10 8、将端口 从

18、vlan 中删除switch(config-if)#no switchport access vlan 10 switch(config-if)#switchport access vlan 1 switch(config-if-range)#no switchport access vlan 10 switch(config-if-range)#switchport access vlan 1 9、查看所 有 vlan 的摘要信息switch#show vlan brief 10、查看指定vlan 的信 息switch#show vlan id 10 11、指定端口成为 trunk swit

19、ch(config-if)#switchport mode trunk 12、Trunk 的自动协 商switch(config-if)#switchport mode dynamic desirable switch(config-if)#switchport mode dynamic auto 注 意:如果 中继链 路 两端都设置 成 auto 将不能成为trunk 13、查看端口状态switch#show interface f0/2 switchport 14、在 trunk上移出 vlan switch(config-if)#switchport trunk allowed vlan

20、 remove 20 15、在 trunk上添加 vlan switch(config-if)#switchport trunk allowed vlan add 20 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 6 页 - - - - - - - - - 初始化配置:查看 vlan 信息 Sw#show vlan Sw#Delete vlan.dat 用此命令将 vlan删除查看一下 NVRAM 是否保存了配置Sw#show startup-config Sw#er

21、ase 清空配置文件startup-config 重新启动交换机Sw#reload swenable sw#config terminal sw(config)#hostname sw1 sw1(config)#no ip domain-lookup 关闭域名查找sw1(config)#line console 0 sw1(config-line)#logging synchronous 命令输入达到同步sw1(config-line)#exec-timeout 0 0 设置永不超时sw1(config-line)#exit 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 6 页 - - - - - - - - -

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号