实验二 交换机基本配置.docx
- 文档编号:9254968
- 上传时间:2023-02-03
- 格式:DOCX
- 页数:18
- 大小:241.24KB
实验二 交换机基本配置.docx
《实验二 交换机基本配置.docx》由会员分享,可在线阅读,更多相关《实验二 交换机基本配置.docx(18页珍藏版)》请在冰豆网上搜索。
实验二交换机基本配置
交换机基本配置
学号姓名班级1002实验时间______2012-12-12_________
【课程名称】:
计算机网络
【辅导教师】:
姜忠海
【实验内容】
交换机的基础配置实验;
【实验目的】
掌握交换机的本地配置方法,配置交换机支持Telnet,实现远程管理。
【实验设备】
本实验主要通过PacketTrace5.0模拟软件来实现交换机的的基本配置,通过一台PC机连接交换机来实现交换机的基本配置,设备连接图如下:
图1交换机基本配置实验设备图
【实验分组】
每名同学为一组,通过PacketTrace5.0模拟软件各自独立完成实验。
【实验原理及内容】
首先来了解交换机配置的一些基础知识。
一、几种配置命令模式
switch>这种提示符表示是在用户命令模式,只能使用一些查看命令。
switch# 这种提示符表示是在特权命令模式。
switch(config)# 这种提示符表示是全局配置模式
switch(config-if)# 端口配置命令模式
switch(config)#lineconsole0line模式:
二、几种配置命令模式的切换
switch>enable由用户模式进入特权模式,
switch#configterminal由特权模式进入全局配置模式
switch(config)#interfacevlan1!
进入交换机管理端口配置模式
switch(config)#lineconsole0端口配置模式进入line模式
【步骤1】:
连接设备
按照如下图所示在PacketTrace工作区内连接好设备。
图1连接交换机和控制主机
【步骤2】:
配置交换机名称
进入控制主机PC0,如下图所示,在进入终端为交换机上配置名称。
键入下述命令:
图2控制主机PC0界面
switch>enable!
从用户模式进入特权模式
switch#configureterminal!
从特权模式进入全局配置模式
switch(config)#hostnamejiang!
设置交换机名称为“jiang”,名称可自定
jiang(config)#!
自动进入交换机
运行结果如下图所示:
Switch>en
Switch#configt
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Switch(config)#hostnamef
【步骤3】:
配置交换机密码
jiang(config)#enablesecretcollin-ts;设置特权加密口令为collin-ts
jiang(config)#enablepasswordcollin-t;设置特权非密口令为collin-t
jiang(config)#lineconsole0;进入控制台口(Rs232)
jiang(config-line)#passwordcollin-c;设置登录口令collin-c
jiang(config-line)#login;登录要求口令验证
jiang(config-line)#linevty04;进入虚拟终端virtualtty
jiang(config-line)#passwordcollin-v;设置登录口令collin-v
jiang(config-line)#login;登录要求口令验证
jiang(config-line)#exit;返回上一层
jiang(config)#exit;返回上一层
密码设置运行效果如下
f(config)#enablesecret123ts
f(config)#enablepassword123tp
f(config)#exit
f#shrun
Buildingconfiguration...
Currentconfiguration:
929bytes
!
version12.1
noservicepassword-encryption
!
hostnamef
!
enablesecret5$1$mERr$r5rHzsje6qQpl0QKHYKZt.
enablepassword123tp
!
!
!
interfaceFastEthernet0/1
!
interfaceFastEthernet0/2
!
interfaceFastEthernet0/3
!
interfaceFastEthernet0/4
!
interfaceFastEthernet0/5
!
interfaceFastEthernet0/6
!
interfaceFastEthernet0/7
!
interfaceFastEthernet0/8
!
interfaceFastEthernet0/9
!
interfaceFastEthernet0/10
!
f(config)#lineconsole0
f(config-line)#password12
f(config-line)#login
f(config-line)#linevty04
f(config-line)#password123
f(config-line)#login
f(config-line)#exit
f(config)#exit
jiang#shrun;看配置信息
运行结果如下图所示:
f#shrun
Buildingconfiguration...
Currentconfiguration:
963bytes
!
version12.1
noservicepassword-encryption
!
hostnamef
!
enablesecret5$1$mERr$r5rHzsje6qQpl0QKHYKZt.
enablepassword123tp
!
!
!
interfaceFastEthernet0/1
!
interfaceFastEthernet0/2
!
interfaceFastEthernet0/3
!
interfaceFastEthernet0/4
!
interfaceFastEthernet0/5
!
interfaceFastEthernet0/6
!
interfaceFastEthernet0/7
!
interfaceFastEthernet0/8
!
interfaceFastEthernet0/9
!
interfaceFastEthernet0/10
!
interfaceFastEthernet0/11
!
interfaceFastEthernet0/12
!
interfaceFastEthernet0/13
!
interfaceFastEthernet0/14
!
interfaceFastEthernet0/15
!
interfaceFastEthernet0/16
!
interfaceFastEthernet0/17
!
interfaceFastEthernet0/18
!
interfaceFastEthernet0/19
!
interfaceFastEthernet0/20
!
interfaceFastEthernet0/21
!
interfaceFastEthernet0/22
!
interfaceFastEthernet0/23
!
interfaceFastEthernet0/24
!
interfaceVlan1
noipaddress
shutdown
!
linecon0
password12
login
!
linevty04
password123
login
linevty515
login
!
!
end
jiang#exit;返回命令验证
验证加密:
password:
;输入进入控制台密码(collin-c)
jiang>en
password:
;输入进入特权模式密码(collin-ts),因为sectet优先级最高
Password:
f>en
Password:
f#configt
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
f(config)#
secret是设置加密口令,一般都使用这种口令设置方式,它优先级高,
即没设置secret口令时,非加密口令才有效。
【步骤4】:
为交换机分配管理IP地址
jiang(config)#interfacevlan1!
进入交换机管理接口配置模式
jiang(config-if)#ipaddress192.168.0.1255.255.255.0!
配置交换机的IP地址
jiang(config-if)#noshutdown!
启用端口
说明:
为VLAN1的管理接口分配IP地址(表示通过VLAN1来管理交换机),设置交换机的IP地址为192.168.0.1,对应的子网掩码为255.255.255.0
运行结果如下图所示:
f#configt
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
f(config)#interfacevlan1
f(config-if)#ipaddress192.168.15.2255.255.255.0
f(config-if)#noshutdown
验证交换机的配置:
jiang#showipinterface!
验证交换机IP地址已经配置,管理端口已经开启
运行结果如下:
验证如下:
f(config-if)#exit
f(config)#exit
%SYS-5-CONFIG_I:
Configuredfromconsolebyconsole
f#showipinterface
Vlan1isup,lineprotocolisup
Internetaddressis192.168.15.2/24
Broadcastaddressis255.255.255.255
Addressdeterminedbysetupcommand
MTUis1500bytes
Helperaddressisnotset
Directedbroadcastforwardingisdisabled
Outgoingaccesslistisnotset
Inboundaccesslistisnotset
ProxyARPisenabled
LocalProxyARPisdisabled
Securitylevelisdefault
Splithorizonisenabled
ICMPredirectsarealwayssent
ICMPunreachablesarealwayssent
ICMPmaskrepliesareneversent
IPfastswitchingisdisabled
IPfastswitchingonthesameinterfaceisdisabled
IPNullturbovector
IPmulticastfastswitchingisdisabled
IPmulticastdistributedfastswitchingisdisabled
IProute-cacheflagsareNone
RouterDiscoveryisdisabled
IPoutputpacketaccountingisdisabled
IPaccessviolationaccountingisdisabled
TCP/IPheadercompressionisdisabled
RTP/IPheadercompressionisdisabled
Probeproxynamerepliesaredisabled
Policyroutingisdisabled
Networkaddresstranslationisdisable
WCCPRedirectoutboundisdisabled
WCCPRedirectinboundisdisabled
WCCPRedirectexcludeisdisabled
BGPPolicyMappingisdisabled
f#
【步骤5】:
查看、保存交换机配置
交换机的当前配置可以使用showrunning-configure查看:
jiang#showrunning-configure
验证结果显示:
f#showrunning-configure
^
%Invalidinputdetectedat'^'marker.
保存配置的命令如下:
Jiang#copyrunning-configstartup-config或Jiang#writememory
执行过程如下:
f#copyrunning-configstartup-config
Destinationfilename[startup-config]?
Buildingconfiguration...
[OK]
f#
【步骤6】:
验证计算机可以经由telnet远程登录到交换机
在进行验证之前,要先对控制主机PC0的2#网卡配置为与交换机相同网段的IP地址,如下图所示的192.168.0.100。
然后进入PC0控制主机的Dos命令窗口,如下图所示:
图3Telnet操作界面示意
说明:
先输入的是远程登录密码:
collin-v
后输入的是特权模式密码;collint-s
【步骤7】:
查看交换机当前配置
在交换机特权模式下,分别执行下列检测命令,查看交换机当前配置状况
这些命令通常是以show(sh)为开始的命令。
showversion查看IOS的版本、
showflash查看flash内存使用状况、
showmac-address-table查看MAC地址列表
jiang#showmac-address-table
showinterfacefastethernet0/1!
该命令查看接口设置和统计信息
showipinterface!
该命令显示三层IP接口的各个属性
showrunning-config!
该命令显示当前的全部配置信息
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 实验二 交换机基本配置 实验 交换机 基本 配置