Cisco 交换机培训资料.docx
- 文档编号:18585136
- 上传时间:2023-08-19
- 格式:DOCX
- 页数:30
- 大小:264.70KB
Cisco 交换机培训资料.docx
《Cisco 交换机培训资料.docx》由会员分享,可在线阅读,更多相关《Cisco 交换机培训资料.docx(30页珍藏版)》请在冰点文库上搜索。
Cisco交换机培训资料
配置CISCO交换机
1交换机加电
交换机接入电源后,如果成功地完成了POST,系统LED就会变绿;如果POST失败了,系统LED就会变成琥珀色。
连接交换机的控制台端口至计算机的串口,可以通过超级终端对交换机进行配置(在交换机加电之前连接交换机和计算机,可以看到交换机的启动过程)。
2配置超级终端
打开超级终端如图
名称中输入cisco(可任意输入),点击“确定”
连接时使用选择COM1(根据实际连接的COM端口而定),点击“确定”,然后点击“还原为默认值”
点击确定后显示交换机的启动过程,随即打开交换机的配置界面,然后就可以对交换机进行相应的配置
3交换机配置基础
帮助命令
在任何情况下都可以通过输入“?
”来获得下一步的操作指导,按“TAB”键可以补全输入不完整的命令。
输入en,按“TAB”后
交换机常用命令
改变交换机名字
依次输入下列命令#后为相应操作或注释,改变了交换机的名字,如图
345#>en#按TAB键
345#>enable
Password:
#输入进入交换机的密码
345##config #按TAB键
345##configureter #按TAB键
345##configureterminal
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
345#(config)#host #按TAB键
345#(config)#hostnamecisco
cisco(config)#
可以通过输入“?
”来查看在全局配置模式下的可用命令
cisco(config)#?
Configurecommands:
aaaAuthentication,AuthorizationandAccounting.
access-listAddanaccesslistentry
aliasCreatecommandalias
arpSetastaticARPentry
bannerDefinealoginbanner
bootBootCommands
bridgeBridgeGroup.
buffersAdjustsystembufferpoolparameters
cdpGlobalCDPconfigurationsubcommands
class-mapConfigureQoSClassMap
clockConfiguretime-of-dayclock
clusterClusterconfigurationcommands
cnsCNSagents
defaultSetacommandtoitsdefaults
default-valueDefaultcharacter-bitsvalues
defineinterfacerangemacrodefinition
dnsix-dmdpProvideDMDPserviceforDNSIX
dnsix-natProvideDNSIXserviceforaudittrails
doTorunexeccommandsinconfigmode
dot1x Dot1xGlobalConfigurationCommands
downward-compatible-configGenerateaconfigurationcompatiblewitholder
--More—
最后显示 --More— 表示还有未显示完整的信息,“Enter”键单行向下滚动,“Space”整屏向下滚动,“CTRL+C”中断当前操作。
设置交换机密码
cisco>en
cisco#conft
cisco(config)#enablepassword123456
cisco(config)#enablesecret654321
cisco(config)#linevty015
cisco(config-ling)#passwordtelnet
cisco(config-line)#login
cisco(config)#intvlan1
cisco(config-if)#ipaddress192.168.0.2255.255.255.0
cisco(config-if)#noshut
cisco(config-if)#exit
cisco(config)#lineconsole0
cisco(config-if)#passwordconsole
cisco(conifg-if)#login
cisco(config-if)#end
cisco#copyrunstartup
说明:
password为不加密的密码,在交换机配置里可以看到密码明文,secret为加密的密码,在交换机配置里看到的是加密的密码,当两者同时配置时,secret生效。
Linevty配置telnet连接时的密码,lineconsole配置直接用计算机COM口连接交换机控制口时的密码。
配置linevty时必须配置VLAN 1的IP地址。
cisco(config)#end
cisco#showrun#查看交换机的配置信息如下
Currentconfiguration:
38417bytes
!
version12.1
noservicepad
servicetimestampsdebuguptime
servicetimestampsloguptime
noservicepassword-encryption
!
hostnamecisco
!
enablesecret5$1$LE./$69qho/L1.6GRmWs/.a3FW.
enablepassword123456
!
ipsubnet-zero
iprouting
!
!
spanning-treemodepvst
spanning-treeextendsystem-id
!
!
!
interfaceFastEthernet0/1
switchportmodedynamicdesirable
!
interfaceFastEthernet0/2
switchportmodedynamicdesirable
!
interfaceFastEthernet0/3
switchportmodedynamicdesirable
!
interfaceFastEthernet0/4
switchportmodedynamicdesirable
!
interfaceFastEthernet0/5
switchportmodedynamicdesirable
!
interfaceFastEthernet0/6
switchportmodedynamicdesirable
对交换机的端口进行配置
cisco>en
cisco#conft
cisco(config)#intf0/1
cisco(config-if)#descriptionf0/1
cisco(config-if)#switchportaccessvlan2
cisco(config-if)#noshut
cisco(config-if)#intrangef0/2–4
cisco(config-if-range)#descriptionf0/2-4
cisco(config-if-range)#switchportaccessvlan4
cisco(config-if-range)#shutdown
cisco(config-if-range)#intrangef0/5-6,f0/7-8
cisco(config-if-range)#descriptionf0/56789
cisco(config-if-range)#switchportaccessvlan6
cisco(config-if-range)#intf0/9
cisco(config-if-range)#speed10
cisco(config-if-range)#duplexhalf
cisco(config-if-range)#intf0/10
cisco(config-if-range)#duplexfull
cisco(config-if-range)#speed100
说明:
intf0/X用来配置交换机单个端口,intrange用来配置一系列端口,查看交换机配置后的信息如下:
cisco(config-if-range)#end
cisco#showrunning-config
Currentconfiguration:
38869bytes
!
version12.1
noservicepad
servicetimestampsdebuguptime
servicetimestampsloguptime
noservicepassword-encryption
!
hostnamecisco
!
enablesecret5$1$LE./$69qho/L1.6GRmWs/.a3FW.
enablepassword123456
!
ipsubnet-zero
iprouting
!
!
spanning-treemodepvst
spanning-treeextendsystem-id
!
!
interfaceFastEthernet0/1
descriptionf0/1
switchportaccessvlan2
switchportmodedynamicdesirable
!
interfaceFastEthernet0/2
descriptionf0/2-4
switchportaccessvlan4
switchportmodedynamicdesirable
shutdown
!
interfaceFastEthernet0/3
descriptionf0/2-4
switchportaccessvlan4
switchportmodedynamicdesirable
shutdown
!
interfaceFastEthernet0/4
descriptionf0/2-4
switchportaccessvlan4
switchportmodedynamicdesirable
shutdown
!
interfaceFastEthernet0/5
descriptionf0/56789
switchportaccessvlan6
switchportmodedynamicdesirable
!
interfaceFastEthernet0/6
descriptionf0/56789
switchportaccessvlan6
switchportmodedynamicdesirable
!
interfaceFastEthernet0/7
descriptionf0/56789
switchportaccessvlan6
switchportmodedynamicdesirable
!
interfaceFastEthernet0/8
descriptionf0/56789
switchportaccessvlan6
switchportmodedynamicdesirable
!
interfaceFastEthernet0/9
descriptionf0/56789
switchportaccessvlan6
switchportmodedynamicdesirable
speed10
duplexhalf
!
interfaceFastEthernet0/10
switchportmodedynamicdesirable
speed100
duplexfull
!
interfaceFastEthernet0/11
switchportmodedynamicdesirable
!
interfaceFastEthernet0/12
switchportmodedynamicdesirable
!
interfaceFastEthernet0/13
switchportmodedynamicdesirable
!
interfaceFastEthernet0/14
switchportmodedynamicdesirable
!
也可以用命令shointstatus来查看交换机端口状态
cisco#shointstatus
PortNameStatusVlanDuplexSpeedType
Fa0/1f0/1notconnect2autoauto10/100BaseTX
Fa0/2f0/2-4disabled4autoauto10/100BaseTX
Fa0/3f0/2-4disabled4autoauto10/100BaseTX
Fa0/4f0/2-4disabled4autoauto10/100BaseTX
Fa0/5f0/56789notconnect6autoauto10/100BaseTX
Fa0/6f0/56789notconnect6autoauto10/100BaseTX
Fa0/7f0/56789notconnect6autoauto10/100BaseTX
Fa0/8f0/56789notconnect6autoauto10/100BaseTX
Fa0/9f0/56789notconnect6half1010/100BaseTX
Fa0/10notconnect1full10010/100BaseTX
Fa0/11notconnect1autoauto10/100BaseTX
Fa0/12notconnect1autoauto10/100BaseTX
Fa0/13notconnect1autoauto10/100BaseTX
Fa0/14notconnect1autoauto10/100BaseTX
Fa0/15notconnect1autoauto10/100BaseTX
Fa0/16notconnect1autoauto10/100BaseTX
Fa0/17notconnect1autoauto10/100BaseTX
Fa0/18notconnect1autoauto10/100BaseTX
Fa0/19notconnect1autoauto10/100BaseTX
Fa0/20notconnect1autoauto10/100BaseTX
Fa0/21notconnect1autoauto10/100BaseTX
4配置交换机的端口安全
方式1:
手工绑定1个固定MAC地址,违犯规则时关闭端口
cisco#configt
config(config)#intf0/1
config(config)#switchportmodeaccess
cisco(config-if)#switchportport-securitymaximum1
cisco(config-if)#switchportport-securitymac-address001a.4d3f.67bb
cisco(config-if)#switchportport-securityviolationshutdown
方式2:
自动绑定多个固定MAC地址,违犯规则时阻止端口
cisco#configt
config(config)#intf0/2
config(config)#switchportmodeaccess
cisco(config-if)#switchportport-securitymaximum2
cisco(config-if)#switchportport-securitymac-address001a.4d3f.67aa
cisco(config-if)#switchportport-securitymac-address001a.4d3f.67bb
cisco(config-if)#switchportport-securityviolationprotect
cisco(config-if)#end
cisco#write
说明:
无论哪种方法配置,第3条命令不可少,cisco交换机默认情况下的端口模式是dymactic,在这种模式下无法绑定固定MAC地址。
查看交换机配置:
cisco#showstartup-config
Currentconfiguration:
39036bytes
!
version12.1
noservicepad
servicetimestampsdebuguptime
servicetimestampsloguptime
noservicepassword-encryption
!
hostnamecisco
!
enablesecret5$1$LE./$69qho/L1.6GRmWs/.a3FW.
enablepassword123456
!
ipsubnet-zero
iprouting
!
!
spanning-treemodepvst
spanning-treeextendsystem-id
!
!
!
!
!
interfaceFastEthernet0/1
descriptionf0/1
switchportaccessvlan2
switchportmodeaccess
switchportport-securitymac-address001a.4d3f.67bb
!
interfaceFastEthernet0/2
descriptionf0/2-4
switchportaccessvlan4
switchportmodeaccess
switchportport-securityviolationprotect
switchportport-securitymac-addresssticky
shutdown
!
!
interfaceFastEthernet0/3
descriptionf0/2-4
switchportaccessvlan4
switchportmodedynamicdesirable
shutdown
!
interfaceFastEthernet0/4descriptionf0/2-4
switchportaccessvlan4
switchportmodedynamicdesirable
shutdown
!
!
interfaceFastEthernet0/5
descriptionf0/56789
switchportaccessvlan6
switchportmodedynamicdesirable
!
!
interfaceFastEthernet0/6
descriptionf0/56789
switchportaccessvlan6
switchportmodedynamicdesirable
!
interfaceFastEthernet0/7
descriptionf0/56789
switchportaccessvlan6
switchportmodedynamicdesirable
!
interfaceFastEthernet0/8
descriptionf0/56789
switchportaccessvlan6
验证交换机配置
switch#showrunning-config
switch#showrunning-configintf0/1
switch#showintvlan1
switch#showintstatus
switch#showintstatusf0/1
5交换机VLAN配置及安全配置
VLAN(VirtualLocalAreaNetwork)的中文名为"虚拟局域网"。
LAN是从物理上划分局域网,VLAN是一种将局域网设备从逻辑上划分,成一个个网段,从而实现虚拟工作组的新兴数据交换技术。
这一新兴技术主要应用于交换机和路由器中,但主流应用还是在交换机之中。
通过将企业网络划分为虚拟网络VLAN网段,可以强化网络管理和网络安全,控制不必要的数据广播。
在共享网络中,一个物理的网段就是一个广播域。
而在交换网络中,广播域可以是有一组任意选定的第二层网络地址(MAC地址)组成的虚拟网段。
这样,网络中工作组的划分可以突破共享网络中的地理位置限制,而完全根据管理功能来划分。
这种基于工作流的分组模式,大大提高了网络规划和重组的管理功能。
在同一个VLAN中的工作站,不论它们实际与哪个交换机连接,它们之间的通讯就好象在独立的交换机上一样。
同一个VLAN中的广播只有VLAN中的成员才能听到,而不会传输到其他的VLAN中去,这样可以很好的控制不必要的广播风暴的产生。
同时,若没有路由的话,不同VLAN之间不能相互通讯,这样增加了企业网络中不同部门之间的安全性。
网络管理员可以通过配置VLAN之间的路由来全面管理企业内部不同管理单元之间的信息互访。
交换机是根据用户工作站的MAC地址来划分VLAN的。
所以,用户可以自由的在企业网络中移动办公,不论他在何处接入交换网络,他都可以与VLAN内其他用户自如通讯。
下面以台电公司实例介绍VLAN及其安全控制。
国华台电的VLAN现状为生活区每栋公寓划分一个VLAN,招待所与7栋公寓一个VLAN,管理学院单独一个VLAN,办公区每部门一个VLAN(存在多个小部门共用一个VLAN的情况),公司领导单独一个VLAN。
本例以生活
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Cisco 交换机培训资料 交换机 培训资料