思科2960配置方法
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
(一)使能口令(enable password),口令以明文显示
使能密码(enbale secret),口令以密文显示
Switch.> /*用户直行模式提示符
Switch.>enable /*进入特权模式
Switch.# /*特权模式(进入前要输入密文)
Switch.#config terminal /*进入全局配置模式
Switch.(config)# /*配置模式提示符
Switch.(config)# hostname Pconline /*设置主机名Pconline
Pconline(config)# enable password cisco3560 /*设置使能口令为pconline
Pconline(config)# enable secret cisco3560 /*设置使能密码为network
Pconline(config)# line vty 0 15 /*设置虚拟终端线
Pconline(config-line)# login /*设置登陆验证
Pconline(config-line)# password cisco3560 /*设置虚拟终端登陆密码
二、交换机VLAN设置
Switch.> /*用户直行模式提示符
Switch.>enable /*进入特权模式
switch#vlan database ;进入VLAN设置
switch(vlan)# vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;删vlan 2
switch(config)#int f0/1 ;进入网络端口1
switch(config)#int giga0/1 ; 进入汇聚千兆口1
switch(config-if)# duplex {auto | full | half} 设置端口为---自动/全双工/半双工
switch(config-if)#switchport mode trunk ;当前端口设置为汇聚口
switch(config-if)#switchport mode access ;当前端口设置为接入模式
switch(config-if)#switchport trunk allowed vlan 1,2 ;设置1,2号口允许的vlan组
switch(config-if)#switchport trunk vlan 2 ;设置1号口允许的vlan
switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2
switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继
cisco网络中,交换机在局域网中最终稳定状态的接口类型主要有四种:
access/ trunk/ multi/ dot1q-tunnel。
1、access: 主要用来接入终端设备,如PC机、服务器、打印服务器等。
2、trunk: 主要用在连接其它交换机,以便在线路上承载多个vlan。
3、multi: 在一个线路中承载多个vlan,但不像trunk,它不对承载的数据打标签。主要用于接入支持多vlan的服务器或者一些网络分析设备。现在基本不使用此类接口,在cisco的网络设备中,也基本不支持此类接口了。
4、dot1q-tunnel: 用在Q-in-Q隧道配置中。
switch(config)#vtp domain ;设置发vtp域名
switch(config)#vtp password ;设置发vtp密码
switch(config)#vtp mode server ;设置发vtp模式
switch(config)#vtp mode client ;设置发vtp模式
三. 交换机设置IP地址
switch(config)#interface vlan 1 进入vlan 1
switch(config-if)#ip address 132.37.48.3 255.255.255.0;设置交换机管理IP
switch(config)#ip default-gateway 132.37.48.1 ;设置交换机默认网关
switch(config)#end;退出当前模式
Switch#conf t 进入特权模式
Switch(config)# interface fa0/5
Switch(config-if)# shutdown 关闭端口
Switch(config-if)# no shutdown 打开端口
四. 交换机显示命令
特权模式下:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看当前配置信息
switch#show vtp ; 查看交换机vtp信息
switch#show vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
Switch#show interfaces fastethernet 0/1 switchport ;显示二层端口的状态,可以用来决定此口是否为二层或三层口。
switch#show int f0/0 ;查看指定端口信息
sw1924_b#show ip;查看上述设置环境
sw1924_b#show versi;查看交换机的版本等信息
sw1924_b#show running-config;查看交换机的当前运行配置等全部信息
sw1924_b#show int e0/1;查看交换机的第1个端口信息
基于端口的MAC地址绑定
Switch#config terminal #进入配置模式
Switch(config)# Interface fastethernet 0/1 #进入具体端口配置模式
Switch(config-if)#Switchport port-secruity #配置端口安全模式
Switch(config-if )switchport port-security mac-address MAC(主机的MAC地址)
#配置该端口要绑定的主机的MAC地址