z作业

来源:百度文库 编辑:神马文学网 时间:2024/04/28 07:04:22
1 交换机基本配置
掌握交换机的管理特性,能够将交换机配置文件备份到TFTP服务器。
上面所选交换机型号为cisco switch2950,上图线路连接情况为:交换机的F0/1、F0/2、F0/3、F0/4端口分别和PC1、PC2、 PC3、PC4相连。
Switch2950(1台),PC机(4台)
本实验所用的命令
1.enable
2.configure terminal
3.enable password/secret password ;给交换机设置特权密码
4.IP address                        ;给交换机设IP地址
5.IP default-gateway                 ;给交换机设默认网关
6.Hostname                        ;给交换机设主机名
7.Write /write memory /copy run start   ;保存配置(此命令在Boson netsim模拟器上不能用)
8.Show run
9.Show mac-address-table
10.Show interfaces
二.基本配置:
1.配置交换机主机名
Switch>enable                (注:从用户模式进入特权模式)
Switch#configure terminal   (注:从特权模式进入全局配置模式)
Switch(config)#hostname   A   (注:将交换机名配置为“A”)
A(config)#
2.配置交换机远程登陆密码
A(config)#line vty 0 4 (注:进入交换机vty0至vty4虚拟终端线路模式)
A(config-line)#login(启用密码)
A(config-line)#password star(设置密码)
(注:将交换机远程登陆口令设置为“star”)
3.配置交换机特权模式口令
A(config)#enable password 密码star或:
A(config)#enable secret star
(注:将交换机特权模式口令配置为“star”)
激活(启用)
1.基本配置
交换机配置:
>enable
# ?              ;查看能够支持的命令
#configure terminal
(config)#hostname 2950switch
2950switch(config)#exit
2950switch#
2950switch#show run
>enable
#configure terminal
(config)#hostname 2950switch
2950switch(config)#enable password tequan    ;设置交换机的特权密码为“tequan”(该密码以明文显示)
2950switch(config)#end
2950switch#show run   ;查看交换机未被加密的密码
2950switch#exit
Press RETURN to get started.
>
>enable
Password:              ;验证登录密码(注意:输入密码时光标不后退)
>enable
#configure terminal
(config)#hostname 2950switch
2950switch(config)#enable secret tequan   ;设置交换机的特权密码(该密码以密文形式显示)
2950switch(config)#end
2950switch#show run      ;查看交换机被加密的密码
2950switch#configure terminal
2950switch(config)#interface vlan1
2950switch(config-if)#ip address 192.168.0.10 255.255.255.0   ;设置交换机的管理IP地址,该地址要激活。
2950switch(config-if)#ip default-gateway 192.168.0.254       ;网关为该交换机所连接路由器的Ethernet端口的IP地址,该图中无路由器,因而此处网关不起作用。
PC机设置:
(在Boson netsim模拟器上输入命令:winipcfg,然后可以设置各参数)
Pc1:IP address:192.168.0.1 netmask:255.255.255.0 default-gateway:192.168.0.254
Pc2::IP address:192.168.0.2 netmask:255.255.255.0 default-gateway:192.168.0.254en
Pc3:IP address:192.168.0.3 netmask:255.255.255.0 default-gateway:192.168.0.254
Pc4:IP address:192.168.0.4 netmask:255.255.255.0 default-gateway:192.168.0.254
验证测试:
2950switch#show interfaces
2950switch#show mac-address-table
在各PC机上测试与交换机管理IP地址的连通性:
C:>ping 192.168.0.l0(能ping通)
1.要求:用配置线,从主机的超级终端进行交换机配置
A.更改设备名称SW01。
B.设置密码ABC(明文或密文)
C.设置管理IP地址192.168.1.100
D.设置远程登录密码XYZ
2.最后,设置主机IP地址192.168.1.1,远程登录交换机,更改设备名称SW02。
Switch>EN
Switch#
Switch#
Switch#CONF  T
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#
Switch(config)#
Switch(config)#
Switch(config)#HOST S1
S1(config)#
S1(config)#ENA  PASS  ABC
S1(config)#ENA  SEC  ABC
S1(config)#
S1(config)#
S1(config)#
S1(config)#INTE VLAN 1
S1(config-if)#
S1(config-if)#
S1(config-if)#IP ADD 192.168.1.253 255.255.255.0
S1(config-if)#
S1(config-if)#NO SHUT
%LINK-5-CHANGED: Interface Vlan1, changed state to up
S1(config-if)#
S1(config-if)#LINE VTY 0 4
S1(config-line)#LOGIN
% Login disabled on line 1, until 'password' is set
% Login disabled on line 2, until 'password' is set
% Login disabled on line 3, until 'password' is set
% Login disabled on line 4, until 'password' is set
% Login disabled on line 5, until 'password' is set
S1(config-line)#PASS AAA
S1(config-line)#
S1(config-line)#
S1(config-line)#END