您的位置:首页 > 其它

配置思科2960G交换机

2012-08-08 07:15 316 查看
[align=center]配置思科2960G交换机[/align]

一 交换机命名及特权密码设置
(config)#hostname MLK-sw2960 //交换机命名
(config)#enable seret morning //设置特权加密口令,为方便管理,此处使用下面的明码
(config)#enable password morning //给交换机配置特权管理口令(明码)

二 Console口连接设置
(config)#line console 0 //进入控制台口(RS232)
(config-line)#password morning //设置登录口令
(config-line)#login //登录要求口令验证
(config-line)#exit //退出到上级目录

三 远程管理设置
(config)#line vty 0 15 //开启远程管理
(config-line)#login //登录要求口令验证
(config-line)#pass morning //设置登录口令
(config-line)#exec-timeout 6 0 //远程登录后6分0秒无操作则超时登出
(config-line)#exit //退出到上级目录

四 交换机同步北京时间设置
MLK-sw2960(config)#clock timezone bj 8 //设置北京时间
MLK-sw2960 (config)#service timestamps log datetime msec localtime show-timezone //[b]配置系统日志记录时间[/b]
MLK-sw2960 (config)#service timestamps debug datetime msec localtime show-timezone //[b]配置系统debug记录时间[/b]
(config)#end //退出回到特权模式以设置系统时间
MLK-sw2960#clock set 8:49:00 27 Jul 2012 //设置系统时间

五 创建VLAN
MLK-sw2960#vlan database //特权模式下创建VLAN
MLK-sw2960(vlan)#vlan 20 name BainiukaOffice //创建VLAN20,命名为BainiukaOffice
MLK-sw2960(vlan)#vlan 15 name ManagementVLAN //创建管理VLAN VLAN15
MLK-sw2960(vlan)#vlan 104 name Mainbuilding4F //创建4楼使用的VLAN
MLK-sw2960(vlan)#apply //使创建VLAN生效
MLK-sw2960(vlan)#(Ctrl+C) //退出
MLK-sw2960#show vlan brief //查看全部VLAN信息

六 创建交换机管理地址
(config)#int vlan 1 //进入VLAN1接口
(config)#shut //关闭此接口
(config)#int vlan 15 //进入VLAN15接口
(config-if)#no shut //开启此接口
(config-if)#ip add 192.168.15.11 255.255.255.0 //设置接口地址
(config-if)#end //退出
(config)#ip default-gateway 192.168.15.254 //设置默认网关
(config)#exit //退出到上一层

七 设置trunk口
(config)#default interface GigabitEthernet 0/45 //端口恢复默认值
(config)#int gi0/45 //进入45号端口
(config-if)#switchport mode trunk //设置端口为trunk模式
(config-if)#switchport nonegotiate //设置端口为不协商模式
(config-if)#switchport trunk allowed vlan all //允许所有VLAN通过干端口
(config-if)#exit //退出到上一层

八 设置access口并划分给VLAN
(config)# int range gi0/1 – 24 //批量设置端口1到24
(config-range)#switchport mode access //设置为acces端口
(config-range)#spanning-tree portfast //批量设置端口1到24
(config-range)#switchport access vlan 20//把端口划分到VLAN20
(config-range)# exit //退出到上一层
(config)#end //退回特权模式
MLK-sw2960#show ip interface brief //查看全部接口信息
MLK-sw2960#show running-config //显示所有配置

九 保存退出
MLK-sw2960#write memory//保存配置
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: