多语言展示
当前在线:1178今日阅读:172今日分享:19

思科交换机常用命令及配置

switch> 用户模式1:进入特权模式enableswitch> enableswitch# 2:进入全局配置模式configure terminalswitch> enableswitch#configure terminalswitch(conf)# 3:交换机命名hostname name 以cisco001 为例switch> enableswitch#c onfigure terminalswitch(conf)#hostname cisco001cisco001(conf)# 4:配置使能口令(未加密)enable password cisco 以cisco 为例switch> enableswitch#configure terminalcisco001(conf)# enable password cisco 5:配置使能密码(加密)enable secret ciscolab 以cicsolab 为例switch> enableswitch#configure terminalswitch(conf)# enable secret ciscolab 6:设置虚拟局域网vlan 1 interface vlan 1switch> enableswitch#configure terminalswitch(conf)# interface vlan 1switch(conf)# ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码switch (conf-if)#no shut 激活端口switch (conf-if)#exitswitch (conf)#ip default-gateway 192.168.254 设置网关地址 7:进入交换机某一端口interface fastehernet 0/17 以17 端口为例switch> enableswitch#configure terminalswitch(conf)# interface fastehernet 0/17switch(conf-if)# 8:查看命令showswitch> enableswitch# show version 察看系统中的所有版本信息show interface vlan 1 查看交换机有关ip 协议的配置信息show running-configure 查看交换机当前起作用的配置信息show interface fastethernet 0/1 察看交换机1 接口具体配置和统计信息show mac-address-table 查看mac 地址表 9:交换机恢复出厂默认恢复命令switch> enableswitch# erase startup-configureswitch# reload 10:交换机的密码恢复拔下交换机电源线。用手按着交换机的MODE 键,插上电源线在switch:后执行flash_ini 命令:switch: flash_ini查看flash 中的文件: switch: dir flash:把“config.text”文件改名为“config.old”: switch: rename flash: config.text flash: config.old执行boot: switch: boot交换机进入是否进入配置的对话,执行no :进入特权模式察看flash 里的文件: show flash :把“config.old”文件改名为“config.text”: switch: rename flash: config.old flash: config.text把“ config.text ” 拷入系统的“ running-configure ”: copy flash: config.text system :running-configure重新设置密码并保存。 11.交换机telnet 远程登录设置:switch>enswitch#configure terminalswich(conf)#enable password cisco 以cisco 为特权模式密码swich(conf)#interface vlan 1 以vlan 1端口作为远程登录的接口,其他端口亦可swich(conf-if)#ip address 192.168.1.1 255.255.255.0swich(conf-if)#no shutswich(conf-if)#exitswich(conf)line vty 0 4 设置0-4 个用户可以telnet 远程登陆swich(conf-line)#loginswich(conf-line)#password 123456 12.交换机ssh远程登录设置: a.设定一个非默认的hostnameSwitch(config)#hostname cisco b.配置域名:cisco(config)#ip domain-name testc.指定加密长度:cisco(config)#crypto key generate rsaHow many bits in the modulus [512]: 1024% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]d.将vty线路下的登录方式改为 sshcisco(config)#line vty 0 4cisco(config-line)#transport in ssh 13.配置vtp同步说明:VTP(VLAN Trunking Protocol):是VLAN中继协议,它是思科私有协议。作用是同步各个交换机之间的VLAN信息。要使用VTP,首先必须建立一个VTP管理域,在同一个管理域中交换机共享vlan信息,并且一个交换机只能参加一个管理域,交换机之间使用trunk口连接。
方法/步骤
1

配置实例:    要求配置茄裕switch0、捕召撤沫驼switch1、switch2实现vlan共享,并在switch0上添加、删除vlan,查看switch1、switch2是否同步

推荐信息