交換器口令設定:
switch>enable 進入特權模式
switch#config terminal 進入全域配置模式
switch(config)#hostname 設定交換器的主機名稱
switch(config)#enable secret xxx 設定特權加密口令
switch(config)#enable password xxa 設定特權非密口令
使用Telnet遠程式管理
switch(config)#interface vlan 1 進入vlan 1
switch(config-if)#ip address 設定IP地址
switch(config-if)#ip default-gateway 設定預設閘道
switch(config)#line vty 0 4 進入虛擬終端
switch(config-line)#login 允許登入
switch(config-line)#password xx 設定登入口令
switch#exit 返回命令
控制台口令
switch(config)#line console 0 進入控制台口
switch(config-line)#login 允許登入
switch(config-line)#password xx 設定登入口令
switch#exit 返回命令
基本介面配置
switch(config)#interface f0/1 進入f0/1介面
switch(config-if)#duplex full 配置全雙工系統模式
switch(config-if)#speed 100 配置速率
switch(config-if)#description to ***** 介面描述
switch(config)#ip domain-name ***.com 設定或名伺服器
switch(config)#mac-address-table aging-time 設定mac表逾時時間
switch#write 儲存配置資訊
switch#copy running-config startup-config 儲存當前配置nvram
switch#erase startup-config 清除設定檔
交換器VLAN設定:
switch#vlan database 進入VLAN設定
switch(vlan)#vlan 2 建VLAN 2
switch(vlan)#name 名字 建VLAN 2的名稱
switch(vlan)#no vlan 2 刪vlan 2
註:刪除vlan時原屬於此vlan的連接埠處於非啟用狀態,直到重新分配為止
switch(config)#int f0/1 進入連接埠1
switch(config-if)#switchport mode access 當前連接埠工作莫試
switch(config-if)#switchport access vlan 2 當前連接埠加入vlan 2
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 allowed vlan add 1,2 ;從Trunk中添加vlans
switch(config-if)#switchport trunk allowed vlan remove 1,2 ;從Trunk中刪除vlans
switch(config-if)#switchport trunk pruning vlan remove 1,2 ;從Trunk中關閉局部修剪
乙太網路通道配置
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}在鏈路間實現負載平衡
switch#show etherchannel 1 summary 查看通道資訊
switch#show etherchannel load-balance 查看通道資訊
vtp配置
switch(config)#vtp domain 設定vtp網域名稱
switch(config)#vtp password 設定vtp密碼
switch(config)#vtp mode server 設定vtp伺服器模式
switch(config)#vtp mode client 設定vtp客戶機模式
switch(config)#vtp mode transparent 設定vtp 透明模式
switch(config)#vtp version 設定vtp版本
switch(config)#vtp pruning 啟用vtp修解
switch(config)#no vtp pruning 關閉vtp修解
註:要想從vtp中減少一台交換器只需將該交換器vtp 名更改