交换机的基本配置:
1、配置enable口令和主机名
Switch> 用户执行模式提示符
Switch>enable 进入特权模式
Switch# 特权模式提示符
Switch#config terminal 进入配置模式
Switch(config)# 配置模式提示符
Switch(config)#enable password cisio 设置enable password为cisio
Switch(config)#enable secret cisco1 设置enable secret 为cisio
Switch(config)#hostname C2950 设置主机名为C2950
C2950(config)#end 退回到特权模式
C2950#
2、配置交换机IP地址、默认网关,域名、域名服务器
C2950(config)#ip address 192.168.1.1 255.255.255.0 设置交换机IP地址
C2950(config)#ip default-gateway 192.168.1.254 设置默认网关
C2950(config)#ip domain-name cisio.com 设置域名
C2950(config)#ip domain-server 200.0.0.1 设置域名服务器
C2950(config)#end
3、设置交换机的端口属性
C2950(config)#interface fastethernet0/1进入接口0/1的配置模式
C2950(config-if)# speed ? 查看speed命令的子命令
……(省略)
C2950(config-if)#speed 100 设置该端口速率为100Mbps
C2950(config-if)#deplex ? 查看deplex命令的子命令
……(省略)
C2950(config-if)#deplex full 设置端口为全双工
C2950(config-if)#description TO_PC1 设置端口描述为TO_PC1
C2950(config-if)#end (或^Z) 返回特权模式
C2950#show interface fastethernet0/1 查看端口0/1的配置结果
……(结果省略)
C2950#show interface fastethernet0/1 status 查看端口0/1的状态
……(结果省略)
4、配置和查看MAC地址表
C2950(config)#mac-address-table ? 查看mac-address-table的子命令
……(省略)
C2950(config)#mac-address-table aging-time 100 设置超时时间为100s
C2950(config)#mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址
C2950(config)#mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入静态地址
C2950(config)#end
C2950#show mac-address-table 查看整个MAC地址表
……
C2950#clear mac-address-table restricted static 清除限制性地址
5、配置VTP协议(VLAN Trunking Protocal)
配置2950A交换机为服务器模式
Switch>enable 进入特权模式
Switch#config terminal 进入配置子模式
Switch(config)#hostname 2950A 修改主机名为2950A
2950A(config)#end
2950A#
2950A#vlan dataBase 进入VLAN配置子模式
2950A(vlan)#vtp ? 查看和VTP配合使用的命令
2950A(vlan)#vtp server 配置本交换机为Server模式
Setting device to VTP SERVER mode