思科2960交换机配置命令

上传人:油条 文档编号:20497919 上传时间:2017-11-22 格式:DOCX 页数:8 大小:69.14KB
返回 下载 相关 举报
思科2960交换机配置命令_第1页
第1页 / 共8页
思科2960交换机配置命令_第2页
第2页 / 共8页
思科2960交换机配置命令_第3页
第3页 / 共8页
思科2960交换机配置命令_第4页
第4页 / 共8页
思科2960交换机配置命令_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《思科2960交换机配置命令》由会员分享,可在线阅读,更多相关《思科2960交换机配置命令(8页珍藏版)》请在金锄头文库上搜索。

1、交换机基本状态:switch: ;ROM 状态,路由器是 rommonhostname;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switchenable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname xxx;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令 -设置进入 en 特权模式的口令switch(config)#enable password

2、 xxa ;设置特权非密口令enable secret 乱码显示enable password 明文显示设置完后用 show run 可以看出当特权非加密口令和特权加密口令同时设置时,enable secret 的级别 高于 enable password ,也即此时 enable password 自动失去效用,只有 enable secret 起作用,在没有设置 secret 口令时,非加密口令才有效。switch(config)#line console 0 ;进入控制台口line console 0 可以设置控制台的一些状态,比如在 line console 0 可以设置 exec-t

3、imeout 和 logging synchronous,前者可以设置不输入命令多长时间系统弹出,而后一个命令则可以设置在输入命令时不会被系统日志消息打断。Switch(config-line)#password 123456 设置 telnet 时的登陆密码Switch(config-line)#login 使登陆密码生效Switch(config-line)#Ctrl+Z 退出到特权模式switch(config-line)#line vty 0 4 ;进入虚拟终端 0 和 4 为 VTP 接口的编号,0 代表 0 号,4 代表 4 号vty 0 4 表示下面是对 VTY 的 0 到 4

4、号端口(即 0 号、1 号、2 号、3 号、4 号)进行配置 vty 线路指的是我们进行 telnet 的时候使用的线路。这里的 0 4 指的是对从第一个 telnet 的到第五个 telnet 线路进行设置,因此同时进入虚拟终端的人数 0 4 代表 5 个人 0 3 代表 4 个人 以此类推。line vty 0 0 是只启用一个 telnet 会话的意思,也就是说只能有一个人进行 telnet。telnet 密码虽然配置成功了,可是一想,IP 还没配置啊,telnet 登陆谁呢?! 所以这个时候需要开启交换机的管理 vlan,给管理 vlan 配置 Ip,一般交换机都有初始的默认 vlan

5、1,用他来做管理 vlan 吧【说说管理 vlan 的作用:管理 VLAN 是指设备的 IP 地址所在的 VLAN ,主要用来远程连接这个设备进行管理使用 如果不配置这个,你将无法通过网络管理这台设备,业务 VLAN 就是普通的接台式机的 VLAN, 接业务使用.】,下面配置二层交换机的管理 vlan 的 Ip:switch#conf t 特权模式进入配置模式Enter configuration commands, one per line. End with CNTL/Z.switch(config)#int vlan 1 进入 vlan1 虚拟口 switch(config-if)#ip

6、 add 192.168.99.1 255.255.255.0给 vlan1 设置 IP 地址switch(config)#ip default-gateway 192.168.99.254 设置 switch 的网关(为了提供从交换机连接到其它设备的路由)switch(config-if)#no shutdown vlan1%LINK-5-CHANGED: Interface Vlan1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to upswitch(co

7、nfig-if)#Z 由配置模式推出到特权模式;%SYS-5-CONFIG_I: Configured from console by consoleswitch#cop r s 保存配置文件;交换机 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

8、(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 m

9、ode 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#sho

10、w int (interface);查看端口信息(详细)switch#show int f0/1 详细;show inter fa0/1 status 简明 -查看指定端口信息交换机命令总结基本配置命令Switch enable 进入特权模式Switch #config terminal 进入全局配置模式Switch (config)#hostname 设置交换机的主机名Switch(config)#enable password 进入特权模式的密码(明文形式保存)Switch(config)#enable secret 加密密码(加密形式保存)(优先)Switch(config)#ip de

11、fault-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 (confi

12、g-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(con

13、fig)#show cdp neighbors detail 查看邻居详细信息恢复出厂配置Switch(config)#erase startup-configSwitch(config)delete vlan.dat配置接口标识 接口标识用于区分路由器的各个接口。switch(config)#interface fastethernet 0/1 以 0/1 接口为例switch(config-if)#shutdown -关闭端口switch(config-if)#no shutdown -开启端口switch(config)# description this is a fast Ether

14、net 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

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

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

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