考点1:交换机基本配置Switch〉enable (进入特权模式)Switch#config terminal (进入全局配置模式)Switch#copy running-config startup-config (保存配置文件)1、 在全局配置模式下:Swi tch(config)#hos tname〈name〉(修改交换机主机名)Swit ch(config)#no hos tn ame〈name〉(删除交换机的主机名,恢复默认值)Switch(config)#enable secret 5〈password〉(配置超级用户加密口令)Switch(config)#enable password〈password〉(配置超级用户明文口令)Switch(config)#enable password 7〈password〉(配置超级用户加密口令)Swi tch(config)#clock set (修改系统时间)Switch(config)#line vty 0 4 (进入虚拟终端配置模式也即进程模式)2、 在进程配置模式下:Switch(config-line)#password 7〈password〉(配置远程登录加密口令)Switch(config-line)#password (配置远程登录明文口令)Swit ch(config-line)#ex it (退出到全局配置模式)Swit ch(config)#i nt erface range fas tet herne tO /1—20(进入组配置端口)Switch(config—if—range)#spaning-tree portfast (设置端口 1—20 为快速端口)Switch(config-if-range)#switchport mode access (设置端口为访问(接入)模式或静 态VLAN模式)Switch(config-if-range)#switchport access vlan 10 (将端口 1-20 分配给 vlan10)Switch(config)#interface (配置交换机的设备管理地址)Switch(config-if)#duplex full/half/auto (设置端口通信方式为全双工/半双工/自适 应方式)Switch(config-if)#speed 10/100/1000/auto (设置端 口传输速率为10Mbps/100Mbps/1000bps/ 自适应)Switch(config-if)#no shutdown (开启当前交换机端口)Switch(config-if)#shutdown (关闭当前交换机端口)Switch(config-if)#description〈text〉(配置端口描述信息)Switch(config-if)#ip default-gateway〈ip〉(设置交换机自身使用的默认网关)Switch(config-if)#ip domain-name (设置交换机自身使用的域名)Switch(config-if)#ip name-server (设置交换机自身使用的域名服务器IP地址) 考点2: VLAN和VTP配置1、 VLAN基本配置Switch(config)#vlan database (进入 VLAN 配置子模式)在VLAN配置子模式下:Switch(vlan)#vlan name (创建 vlan (删除 vlan〈id〉)Switch(vlan)#vtp server (设置本交换机为 Server 模式)Switch(vlan)#vtp domain vtpserver (设置 VTP 的管理域名为 vtpserver)Switch(vlan)#vtp pruning (启用修剪功能)Switch(vlan)#vtp version 2 (配置 VTP 协议版本为 2)Switch(vlan)#end (保存VLAN配置退出到特权模式)Switch#vtp status (查看 VTP 设置信息)2、 VTP基本配置Switch(config)#vtp domain-name (设置 VTP 域名)Switch(config)#ip name-server (设置交换机自身使用的域名服务器)Switch(config)#vtp mode server/client/transparent (设置当前交换机的 VTP 工作模 式)Switch(config)#Switch(config)#vtppruning (启用动态修剪功能)当交换机端口加入 一个新的VLAN时,则立即向周边交换机发送VTP连接报文3、 EthderChannel (以太通道)Switch(config)#interface port-channel〈1-6〉(创建以太通道,通道组号范围是 1-6 的正整数)Switch(config)#no interface port-channel〈1-6〉(取消相应的以太通道)Switch(config-if)#channel-group〈1-6〉mode