Packet Tracer - 为系统日志、NTP 和 SSH 操作配置思科路由器

Packet Tracer - 为系统日志、NTP 和 SSH 操作配置思科路由器

拓扑图

地址分配表

设备

接口

IP 地址

子网掩码

默认网关

交换机端口

R1

G0/1

192.168.1.1

255.255.255.0

不适用

S1 F0/5

S0/0/0 (DCE)

10.1.1.1

255.255.255.252

不适用

不适用

R2

S0/0/0

10.1.1.2

255.255.255.252

不适用

不适用

S0/0/1 (DCE)

10.2.2.2

255.255.255.252

不适用

不适用

R3

G0/1

192.168.3.1

255.255.255.0

不适用

S3 F0/5

S0/0/1

10.2.2.1

255.255.255.252

不适用

不适用

PC-A

NIC

192.168.1.5

255.255.255.0

192.168.1.1

S1 F0/6

PC-B

NIC

192.168.1.6

255.255.255.0

192.168.1.1

S2 F0/18

PC-C

NIC

192.168.3.5

255.255.255.0

192.168.3.1

S3 F0/18

目标

· 配置 OSPF MD5 认证。

· 配置 NTP。

· 配置路由器,以将消息记录到系统日志服务器中。

· 配置 R3,以支持 SSH 连接。

背景/ 场景

在本练习中,您需要为安全路由更新配置 OSPF MD5 认证。

NTP 服务器是本练习中的主 NTP 服务器。您将在 NTP 服务器和路由器中配置认证。您需要将 路由器配置为允许 NTP 将软件时钟与 时间服务器同步。此外,您还需要将路由器配置为根据从 NTP 获知的时间定期更新 硬件时钟。

系统日志服务器将提供本练习中的消息日志记录。 您需要配置路由器,以确定 将接收日志记录消息的远程主机(系统日志服务器)。

您需要为路由器上的日志记录 配置时间戳服务。使用系统日志 (syslog) 监控网络时,在系统日志 (syslog) 消息中显示正确的时间和日期 至关重要。

您需要将 R3 配置为使用 SSH (而不是 Telnet)进行安全管理。已分别针对 NTP 和系统日志 服务对服务器进行了预配置。NTP 不需要认证。 已使用以下密码对路由器进行了预配置:

· 启用密码:ciscoenpa55

· vty 线路密码:ciscovtypa55

注意:MD5 是用于开发本练习的 Packet Tracer 版本 (v6.2) 支持 的最强加密方法。 虽然 MD5 存在已知漏洞,但是您应使用 符合组织安全要求的加密方法。在本练习中, 安全要求指定使用 MD5。

拓扑图:

第 1 部分:配置 OSPF MD5 认证

步骤 1:测试连接。 所有设备都应能够对所有其他 IP 地址执行 ping 操作。

步骤 2:为区域 0 中的所有路由器配置 OSPF MD5 认证。

为 区域 0 中的所有路由器配置 OSPF MD5 认证。

R1(config)# router ospf 1

R1(config-router)# area 0 authentication message-digest

步骤 3:为区域 0 中的所有路由器配置 MD5 密钥。

在 R1、 R2 和 R3 上的串行接口上配置 MD5 密钥。将密码 MD5pa55 用于密钥 1

R1(config)# interface s0/0/0

R1(config-if)# ip ospf message-digest-key 1 md5 MD5pa55

步骤 4:验证 配置。

a. 使用命令 show ip ospf interface 验证 MD5 认证配置。

b. 验证端到端连接。

第 2 部分:配置 NTP

步骤 1:在 PC-A 上启用 NTP 认证。

a. 在 PC-A 上,点击“Services(服务)”选项卡下方的 NTP,验证是否已启用 NTP 服务。

b. 要配置 NTP 认证,请点击 “Authentication(认证)”下方的 Enable(启用)。使用密钥 1 和密码 NTPpa55 进行 认证。

步骤 2:将 R1、 R2 和 R3 配置为 NTP 客户端。

使用命令 show ntp status 验证客户端配置。

步骤 3:配置路由器 以更新硬件时钟。

配置 R1R2 和 R3,以根据从 NTP 获知的时间定期 更新硬件时钟。

退出全局配置并使用命令 show clock 验证硬件 时钟是否已更新。

步骤 4:在路由器上配置 NTP 认证。

使用密钥 1 和密码 NTPpa55,在 R1R2 和 R3 上配置 NTP 认证。

R1(config)# ntp authenticate

R1(config)# ntp trusted-key 1

R1(config)# ntp authentication-key 1 md5 NTPpa55

步骤 5:配置路由器, 为日志消息添加时间戳。

配置时间戳服务,以登录路由器。

第 3 部分:配置路由器, 以将消息记录到系统日志服务器中。

步骤 1:配置路由器,以确定将接收日志记录消息的远程主机 (系统日志服务器)。

路由器控制台将会显示一条消息,指示已 开始日志记录。

步骤 2:验证 日志记录配置。

使用命令 show logging 验证是否 已启用日志记录。

步骤 3:检查系统日志服务器的日志 。

从 Syslog Server(系统日志服务器)对话框的 Services(服务)选项卡中,选择 Syslog(系统日志)服务按钮。观察从路由器接收的日志记录 消息。

注意:通过在路由器上执行命令,可以在服务器上生成日志消息。 例如,进入和退出全局 配置模式将生成信息性配置消息。您 可能需要点击其他服务,然后再次点击 Syslog(系统日志)以 刷新消息显示。

第 4 部分:配置 R3 以支持 SSH 连接。

步骤 1:配置 域名。

在 R3 上配置域名 ccnasecurity.com

步骤 2:在 R3 上配置用户 ,以登录 SSH 服务器。

创建具有最高 可能权限级别的用户 ID SSHadmin 和加密密码 ciscosshpa55

R3(config)# username SSHadmin privilege 15 secret ciscosshpa55

步骤 3:在 R3 上配置 传入 vty 线路。

使用本地用户账户进行强制登录和 验证。仅接受 SSH 连接。

步骤 4:清除 R3 上的现有密钥对。

应在路由器上清除任何现有 RSA 密钥对。

注意:如果不存在密钥,您可能会收到以下 消息:% No Signature RSA Keys found in configuration(% 配置中未找到签名 RSA 密钥)

步骤 5:生成 R3 的 RSA 加密密钥对。

路由器使用 RSA 密钥对,来对所传输的 SSH 数据进行认证和 加密。使用模数 1024 配置 RSA 密钥。 默认值为 512,范围为 360 至 2048。

R3(config)# crypto key generate rsa

The name for the keys will be: R3.ccnasecurity.com

Choose the size of the key modulus in the range of 360 to 2048 for your

General Purpose Keys. Choosing a key modulus greater than 512 may take

a few minutes.

How many bits in the modulus [512]: 1024

% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

注意:在 Packet Tracer 中生成 R3 的 RSA 加密密钥 对所使用的命令与本实验中使用的命令不同。

步骤 6:验证 SSH 配置。

使用 show ip ssh 命令查看当前设置 。验证认证超时值和重试次数是否为 默认值 120 和 3。

步骤 7:配置 SSH 超时和认证参数。

可以将默认 SSH 超时和认证参数 改为更严格的设置。将超时值设置为 90 秒、将 认证重试次数设置为 2 并将版本设置为 2

再次发出 show ip ssh 命令以确认 值是否已更改。

步骤 8:尝试从 PC-C 通过 Telnet 连接 到 R3。

打开 PC-C 的桌面。选择“Command Prompt”(命令提示符) 图标。在 PC-C 中,输入命令,以通过 Telnet 连接到 R3

PC> telnet 192.168.3.1

此连接应该会失败,因为已将 R3 配置为仅接受虚拟终端线路上的 SSH 连接。

步骤 9:在 PC-C 上 使用 SSH 连接到 R3。

打开 PC-C 的桌面。选择“Command Prompt”(命令提示符) 图标。在 PC C 中,输入命令,以通过 SSH 连接到 R3。当 系统提示输入密码时,请输入为管理员配置的密码 ciscosshpa55

PC> ssh –l SSHadmin 192.168.3.1

步骤 10:在 R2 上使用 SSH 连接到 R3。

要对 R3 进行故障排除和维护操作,ISP 的管理员 必须使用 SSH 访问路由器 CLI。在 R2 的 CLI 中,输入 命令,以使用 用户账户 SSHadmin 通过 SSH 第 2 版连接到 R3。当系统提示输入密码时,请输入为 管理员配置的密码:ciscosshpa55

R2# ssh –v 2 –l SSHadmin 10.2.2.1

步骤 11:检查 结果。

完成比例应为 100%。点击 Check Results(检查结果)以查看反馈并验证已完成的所需组件 。

详细实验步骤:

NTP服务器配置:

R1配置:

R1>en

Password: ciscoenpa55

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#router ospf 1

R1(config-router)#area 0 authentication message-digest

R1(config-router)#exit

R1(config)#interface s0/0/0

R1(config-if)#ip ospf message-digest-key 1 md5 MD5pa55

R1(config-if)#exit

R1(config)#ntp server 192.168.1.5 key 1

R1(config)#ntp update-calendar

R1(config)#ntp authenticate

R1(config)#ntp authentication-key 1 md5 NTPpa55

R1(config)#ntp trusted-key 1

R1(config)#service timestamps log datetime msec

R1(config)#logging host 192.168.1.6

R1(config)#exit

R2配置:

R2>en

Password: ciscoenpa55

R2#conf

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

R2(config)#router ospf 1

R2(config-router)#area 0 authentication message-digest

R2(config-router)#ex

R2(config)#interface s0/0/0

R2(config-if)#ip ospf message-digest-key 1 md5 MD5pa55

R2(config-if)#interface s0/0/1

R2(config-if)#ip ospf message-digest-key 1 md5 MD5pa55

R2(config-if)#exit

R2(config)#ntp server 192.168.1.5 key 1

R2(config)#ntp update-calendar

R2(config)#ntp authenticate

R2(config)#ntp trusted-key 1

R2(config)#ntp authentition-key 1 md5 NTPpa55

R2(config)#service timestamps log datetime msec

R2(config)#logging host 192.168.1.6

R2(config)#end

R3配置:

R3>en

Password: ciscoenpa55

R3#conf

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

R3(config)#router ospf 1

R3(config-router)#area 0 authentication message-digest

R3(config-router)#ex

R3(config)#interface s0/0/1

R3(config-if)#ip ospf message-digest-key 1 md5 MD5pa55

R3(config-if)#exit

R3(config)#ntp server 192.168.1.5 key 1

R3(config)#ntp update-calendar

R3(config)#ntp authenticate

R3(config)#ntp trusted-key 1

R3(config)#ntp authentication-key 1 md5 NTPpa55

R3(config)#logging host 192.168.1.6

R3(config)#service timestamps log datetime msec

R3(config)#ip domain-name ccnasecurity.com

R3(config)#username SSHadmin privilege 15 secret ciscosshpa55

R3(config)#line vty 0 4

R3(config-line)#login local

R3(config-line)#transport input ssh

R3(config-line)#exit

R3(config)#crypto key generate rsa

The name for the keys will be: R3.ccnasecurity.com

Choose the size of the key modulus in the range of 360 to 2048 for your

General Purpose Keys. Choosing a key modulus greater than 512 may take

a few minutes.



How many bits in the modulus [512]: 1024

% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]



R3(config)#ip ssh version 2

R3(config)#ip ssh time-out 90

R3(config)#ip ssh authentication-retries 2

R3(config)#end

R3#

实验脚本:

R1:

conf t

interface s0/0/0

ip ospf message-digest-key 1 md5 MD5pa55

router ospf 1

area 0 authentication message-digest

service timestamps log datetime msec

logging 192.168.1.6

ntp server 192.168.1.5

ntp update-calendar

ntp authentication-key 1 md5 NTPpa55

ntp authenticate

ntp trusted-key 1

end

\\R2

conf t

interface s0/0/0

ip ospf message-digest-key 1 md5 MD5pa55

interface s0/0/1

ip ospf message-digest-key 1 md5 MD5pa55

router ospf 1

area 0 authentication message-digest

service timestamps log datetime msec

logging 192.168.1.6

ntp server 192.168.1.5

ntp update-calendar

ntp authentication-key 1 md5 NTPpa55

ntp authenticate

ntp trusted-key 1

end

\\R3

conf t

interface s0/0/1

ip ospf message-digest-key 1 md5 MD5pa55

router ospf 1

area 0 authentication message-digest

service timestamps log datetime msec

logging 192.168.1.6

ntp server 192.168.1.5

ntp update-calendar

ntp authentication-key 1 md5 NTPpa55

ntp authenticate

实验链接:https://pan.baidu.com/s/1SDkfX_2kzKrGm3eEqfIYxA?pwd=2613

提取码:2613

--来自百度网盘超级会员V2的分享

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

傻傻的心动

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值