实验一 口令和主机名设置
1.交换机的初始化
    当交换机没有进行配置时,接入超级终端会提示是否以对话方式进行配置,初始化内容主要有IP地址、网关、主机名和口令等。配置文件是。
    2924交换机进入ROM方式是在上电时按住其mode键,本软件是按Ctrl+Break键,出现:
switch>                                ;按Ctrl+Break键
switch:reset                            ;或用boot命令
    如果有配置文件进入用户模式,否则提交对话:
        --- System Configuration Dialog ---
At any point you may enter a question mark '?' for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets '[]'.
Continue with configuration dialog? [yes/no]:y
Enter IP address:10.65.1.8
Enter IP netmask:255.255.0.0
Would you like to enter a default gateway address? [yes]:
IP address of default gateway:
Enter host name [Switch]:swa
The enable secret is a one-way cryptographic secret used instead of the enable password when it exists.
Enter enable secret:aaa
Would you like to configure a Telnet password? [yes]:
Enter Telnet password:a
Would you like to enable as a cluster command switch? [no]:
The following configuration command script was created:
......
Press RETURN to get started.
swa>en
password:aaa
swa#copy run start      (保存配置信息)
swa#dir flash:          (查看闪存中的文件)
root的初始密码
再次进入对话方式:
swa#setup
2.路由器的初始化(路由器初始化与交换机类似)
router>                                ;用户模式,按Ctrl+Break
rommon>reset                          ;进入ROM监控状态,复位引导
Continue with configuration dialog? [yes/no]:yes
At any point you may enter a question mark '?' for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets '[ ]'.
Would you like to enter basic management setup? [yes/no]:yes
Configuring global parameters:
  Enter host name [router]:ra回车
  The enable secret is a password used to protect access to
  privileged EXEC and configuration modes. This password,
  after entered, becomes encrypted in the configuration.
  Enter enable secret:aaa回车
  The enable password is used when you do not specify an
  enable secret password,with some older software versions,
  and some boot images.
  Enter enable password:aa回车
  The virtual terminal password is used to protect
  access to the router over a network interface.
  Enter virtual terminal password :a回车
  Enter interface name used to connect to the management
  network from the above interface summary:FastEthernet0/0回车
  Configuring interface FastEthernet0/0:回车
  Use the 100 Base-TX (RJ-45) connector? [yes]:回车
  Operate in full-duplex mode? [no]:回车
  Configure IP on this interface? [yes]:回车
  IP address for this interface [ ]:10.1.1.1回车
  Subnet mask for this interface [ ]:255.0.0.0回车
[0] Go to the IOS command prompt without saving this config.
[1] Return back to the setup without saving this config.
[2] Save this configuration to nvram and exit.
Enter your selection [2]:回车
ra>en
password aaa              (进入特权模式)
ra#show run              (显示配置信息)
ra#w                      (保存配置信息)
ra#dir flash:            (显示配置文件)
  (配置文件在2621路由器不能删除,放弁配置文件要用寄存器设置0x2142);
3. 用命令行设置交换机和路由器的口令和主机名
  先对交换机进行操作,双击SwitchA,出现:
switch>en                            ;第一次密码为空
switch#conf t                          ;进入全局配置模式
switch(config)#hostname swa            ;设置交换机名
swa(config)#enable secret aaa            ;设置特权加密口令为 aaa
swa(config)#enable password aax          ;设置特权非密口令为 aax
swa(config)#line console 0              ;进入控制台口(Rs232)
swa(config-line)#password aa            ;设置console登录口令为aa
swa(config-line)#login                  ;登录要求口令验证
swa(config-line)#line vty 0 4              ;进入虚拟终端virtual tty
swa(config-line)#password a              ;设置vty的登录口令为a
swa(config-line)#login                  ;登录要求口令验证
swa(config-line)#exit                    ;返回上一层
swa(config)#exit                        ;返回上一层
swa#sh run                            ;看配置信息
swa#exit                              ;返回命令
swa>en
password:                            ;请问输入哪个口 (aaa)
  secret是设置加密口令,一般都使用这种口令设置方式,它优先级高,即没设置secret口令时,非加密口令才有效。
4. 备份IOS和配置文件
  在实际工作中经常需要备份路由器的IOS和配置文件,以备系统有问题时的恢复。可以这样操作:
router#dir nvram:
router#copy flash:c2621.bin tftp:
router#copy startup-config tftp:
router#
实验二 计算机与交换机IP地址设置
1. 双击HostA, 输入用户名和口令。
PCA login:root
Password:linux
[root#PCA root]# ifconfig eth0 10.65.1.1 netmask 255.255.0.0    设置 IP

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。