S3750>enable 特权模式
S3750#configure terminal 全局模式
S3750(config)#hostname SW1 将交换机命名为SW1
SW1(config)#vlan 10 创建VLAN 10
SW1(config-vlan)#name 1 命名VLAN 10 为1
SW1(config-vlan)#exit 退出到上一级
SW1(config)#vlan 20 创建VLAN 20
SW1(config-vlan)#name 2命名VLAN 20 为2
SW1(config-vlan)#exit退出到上一级
SW1(config)#interface fastEthernet 0/1进入端口0/1 SW1(config-if)#no shutdown启用端口
SW1(config-if)#shutdown禁用端口
SW1(config-if)#exit退出到上一级
SW1(config)#interface range fastEthernet 0/2-5进入端口2-5端口
SW1(config-if-range)#switchport mode access将端口配置为access模式
SW1(config-if-range)#switchport access vlan 1 将端口划分给VLAN 1
SW1(config-if-range)#exit 退出到上一级
SW1(config)#interface range fastEthernet 0/6-10 进入6-10端口
SW1(config-if-range)#switchport mode access 将端口配置为access模式
SW1(config-if-range)#switchport access vlan 2 将端口划分给VLAN2
SW1(config-if-range)#exit 退出到上一级
SW1(config)#interface fastEthernet 0/1 进入端口0/1 SW1(config-if)#switchport mode trunk 将端口配置为trunk链路
SW1(config-if)#switchport trunk allowed vlan all trunk链路允许所有VLAN数据通过
SW1(config-if)#exit 退出到上一级
SW1(config)#interface aggregateport 1 创建聚合接口AGI SW1(config-if)#switchport mode trunk 配置AGI模式为trunk
SW1(config-if)#exit 退出到上一级
SW1(config)#interface range fastEthernet 0/23-24 进入f0/23和f0/24端口
SW1(config-if-range)#port-group 1 配置属于f0/23和f0/24端口属于AGI
SW1(config-if-range)#end 退出到特权模式下
SW1#write 保存当前配置
Building configuration...
[OK]。