实验2思科网院项目2.7.2-packet-tracer---configure-single-area-ospfv2---实践练习

实践练习 

2.7.2-packet-tracer---configure-single-area-ospfv2---实践练习physical-mode

实验拓扑

相关设备配置

实验目标:

第 1 部分:构建网络并配置设备的基本设置

第 2 部分:配置和验证单区域 OSPFv2 的基本部署

第 3 部分:优化和验证单区域 OSPFv2 的配置

背景/场景

 您的任务是为小型企业网络配置OSPFv2。R1 将向 R2 共享默认路由信息。完成初始配置后,组织机构要对配置进行优化,减少协议流量并保留R1对路由的控制。

注意:本练习所需的设备位于公用设备架上的配线间中。

实验步骤: 

说明
第 1部分: 建立网络并配置设备的基本设置

步骤 1: 建立如拓扑图所示的网络。 

将所需的设备放在机架和桌子上。打开 PC 电源,然后根据拓扑结构连接设备。要想选择正确的交换机端口,右键点击并选择 检查正面。如有需要,使用缩放工具。将鼠标悬停在端口上,以查看端口号。Packet Tracer 会为正确的线缆和端口连接评分。

a.     架子上有各种交换机、路由器和其他设备。点击路由器 R1 和 R2 以及交换机 S1 和 S2 ,并将其拖拽到机架上。单击并将 Web 服务器 拖拽到 机架上。单击并将 笔记本电脑 拖拽到 桌子上。

b.     打开路由器和笔记本电脑的电源。

c.     在 电缆插板上,单击 铜直通 电缆。单击 S1 上的 GigabitEthernet0/1 端口,然后单击 R1 上的 GigabitEthernet0/1端口以连接它们。

d.     在 线缆插板 上,点击 铜缆直通 线缆。单击 S2 上的 GigabitEthernet0/1 端口,然后单击 R2 上的 GigabitEthernet0/1 端口以连接它们。

e.     在 线缆插板 上,点击 铜缆交叉 线缆。单击 S1 上的 GigabitEthernet0/2 端口,然后单击 S2 上的 GigabitEthernet0/2 端口以连接它们。您应该会看到这条电缆连接了两个端口。

f.       在 线缆插板 上,点击 铜缆直通 线缆。单击 R1 上的 GigabitEthernet0/0 端口,然后单击 Web 服务器 上的 FastEthernet0 端口以连接它们。

g.     在 线缆插板 上,点击 铜缆直通 线缆。单击 R2 上的 GigabitEthernet0/0 端口,然后单击 笔记本电脑 上的 FastEthernet0 端口以连接它们。

目视检查网络连接。一开始,在您将设备连接到交换机端口时,链路灯会是琥珀色。1 分钟左右,链路灯会变为绿色。

如下图所示(记得打开所有开关)

到这里得分17分

步骤 2: 为路由器和交换机配置基本设置。

 打开配置窗口

a.     在 线缆插板 上,点击 控制台 线缆。

b.     在设备和 笔记本电脑 之间连接控制台电缆。对于交换机,请 检查背面 以找到 控制台 端口。

c.     根据 拓扑为设备分配名称。

脚本如下:

R1

en

conf t

hostname R1

R2

en

conf t

hostname R2

S1

en

conf t

hostname S1

S2 

en

conf t

hostname S2

d.     为了防止路由器尝试将错误输入的命令视为主机名,禁用 DNS 查找。

R1(config)# no ip domain–lookup

e.     指定 class 作为特权EXEC加密密码。

R1(config)# enable secret class

f.       指定 cisco 作为控制台密码并启用登录。

R1(config)# line console 0
R1(config-line)# password cisco
R1(config-line)# login

g.     指定 cisco 作为 vty 密码并启用登录。

R1(config)# line vty 0 4
R1(config-line)# password cisco
R1(config-line)# login

h.     加密明文密码。

R1(config)# service password-encryption

i.       创建一个向访问设备者发出警告的标语:未经授权,禁止访问。

R1(config)# banner motd $ Authorized Users Only! $

j.       将运行配置保存到启动配置文件中。

R1# copy running-config startup-config

上述内容脚本如下: 

脚本如下:

no ip domain-lookup

enable secret class

line console 0

password cisco

login

line vty 0 4

password cisco

login

service password-encryption

banner motd $ Authorized Users Only! $

end

R1#copy running-config startup-config

k.     单击 控制台电缆 并将其拖到 线缆插板上。

l.       对每台设备重复步骤 2,直到 R2、 S1和 S2 都配置了基本设置。

R2

脚本如下:

no ip domain-lookup

enable secret class

line console 0

password cisco

login

line vty 0 4

password cisco

login

service password-encryption

banner motd $ Authorized Users Only! $

end

R1#copy running-config startup-config

S1

补充:

脚本如下:

no ip domain-lookup

enable secret class

line console 0

password cisco

login

line vty 0 4

password cisco

login

line vty 0 15

password cisco

login

service password-encryption

banner motd $ Authorized Users Only! $

end

R1#copy running-config startup-config

S2

补充:

脚本如下:

no ip domain-lookup

enable secret class

line console 0

password cisco

login

line vty 0 4

password cisco

login

line vty 0 15

password cisco

login

service password-encryption

banner motd $ Authorized Users Only! $

end

R1#copy running-config startup-config

步骤 3: 配置服务器和笔记本电脑的设置。

根据地址分配表为 Web 服务器 和 笔记本电脑 配置静态 IP 地址信息。

a.     点击 Web 服务器 > 桌面 > IP 配置。根据地址分配表,输入 Web 服务器 的 IPv4 地址、子网掩码和默认网关信 息。

b.     关闭或最小化 Web 服务器 窗口。

c.     重复上述步骤,为便 笔记本电脑 分配 IPv4 地址信息,如 地址分配表中所列。

关闭配置窗口

 web服务器:

笔记本电脑:

第 2部分: 配置和验证单区域 OSPFv2 的基本部署

步骤 1: 在每台路由器上配置接口地址和 OSPFv2 基本设置。
a.     在 R1 和 笔记本电脑 之间连接 控制台 电缆。

b.     按照地址分配表所示地址,在每台路由器上配置接口地址。

R1

 R2

脚本如下:

R1

interface g0/0/1
ip address 10.53.0.1 255.255.255.0
no shut
exit
interface g0/0/0
ip address 172.16.1.1 255.255.255.0
no shut
exit

R2 
interface g0/0/1
ip address 10.53.0.2 255.255.255.0
no shut
exit
g0/0/0
ip address 192.168.1.1 255.255.255.0
no shut
exit

打开配置窗口

c.     进入OSPF路由器配置模式,使用56作为进程ID。

R1(config)#router ospf 56
R2(config)#router ospf 56

d.     为每台路由器手动配置路由器 ID(R1 为 1.1.1.1,R2 为 2.2.2.2)。

R1(config-router)#router-id 1.1.1.1

R2(config-router)#router-id 2.2.2.2

e.     为 R1 和 R2 之间的网络配置 network 命令,将其置于区域 0 中。

R1(config-router)#network 172.16.1.0 0.0.0.255 area 0

R2(config-router)# network 10.53.0.0 0.0.0.255 area 0

f.       为连接到 R1 和 R2 的其他网络配置 network 语句,然后将它们放在区域 0 中。请注意,连接到 R1 的 LAN 的 network 命令不会被评分,因为本练习稍后将删除此网络。

R1(config-router)#network 172.16.1.0 0.0.0.255 area 0

R2(config-router)# network 192.168.1.0 0.0.0.255 area 0

g.     将控制台电缆切换到 R2 ,然后对 R2重复子步骤 b 到 f。配置 R1 和 R2 后,如果愿意,您可以简单地在两者之间使用 Telnet,而不是每次移动控制台电缆。

h.     验证路由器之间的 OSPFv2 运行是否正常。使用命令来确认 R1 和 R2 之间是否形成了邻接关系。

R1

R2

脚本如下: 

R1
router ospf 56
router-id 1.1.1.1
network 10.53.0.0 0.0.0.255 area 0
network 172.16.1.0 0.0.0.255 area 0

R2

router ospf 56
router-id 2.2.2.2
network 10.53.0.0 0.0.0.255 area 0
network 192.168.1.0 0

问题:
哪一台路由器是 DR?哪一台路由器是 BDR?选择标准是什么?

i.       我们可以在R1上使用 show ip route ospf 命令来验证 R2 G0/0/0 网络已经出现在路由表中。

j.       单击 笔记本电脑 > 命令提示符,然后在 ping Web 服务器 172.16.1.10。在一两次超时之后,ping 应该成功。否则,请对物理连接和配置进行故障排除。

关闭配置窗口

第 3部分: 优化单区域 OSPFv2 的配置

步骤 1: 在每台路由器上实施各种优化。

打开配置窗口

a.     在 R1 上,将接口 G0/0/1 的 OSPF 优先级配置为 50,以确保 R1 成为 指定路由器。

R1(config)# interface g0/0/1
R1(config-if)# ip ospf priority 50

b.     在 G0/0/1 上配置 OSPF 的 Hello 计时器为 30 秒,Dead 计时器为 120 秒。

R1

R1(config)# interface g0/0/1
R1(config-if)# ip ospf hello-interval 30
R1(config-if)# ip ospf dead-interval 120

R2

R2(config)# interface g0/0/1
R2(config-if)# ip ospf hello-interval 30
R2(config-if)# ip ospf dead-interval 120

c.     在 R1 上,删除 172.16.1.0 的 OSPF network 命令,然后配置使用 接口 G0/0/0 作为默认静态路由的出接口。然后,将默认路由传播到 OSPF 中。注意查看设置了默认路由后的控制台消息。

R1(config)# router ospf 56
R1(config-router)# no network 172.16.1.0 0.0.0.255 area 0
R1(config-router)# exit
R1(config)# ip route 0.0.0.0 0.0.0.0 g0/0/0
R1(config)# router ospf 56
R1(config-router)# default-information originate

d.     在每台路由器上把参考带宽更改为1Gbs。完成此配置后,使用 clear ip ospf process 命令重新启动 OSPF。注意查看设置了新的参考带宽后的控制台消息。

R1

R1(config)# router ospf 56
R1(config-router)# auto-cost reference-bandwidth 1000
R1(config-router)# end
R1# clear ip ospf process
yes

R2
R2(config)# router ospf 56
R2(config-router)# auto-cost reference-bandwidth 1000
R2(config-router)# end
R2# clear ip ospf process
yes

 R1

R2

脚本如下:

R1

int g0/0/1
ip ospf priority 50
interface g0/0/1
ip ospf hello-interval 30
ip ospf dead-interval 120
exit
router ospf 56
no network 172.16.1.0 0.0.0.255 area 0
exit
ip route 0.0.0.0 0.0.0.0 g0/0/0
router ospf 56
default-information originate
router ospf 56
auto-cost reference-bandwidth 1000
end
yes


RB

interface g0/0/1
#ip ospf hello-interval 30
ip ospf dead-interval 120
exit
router ospf 56
auto-cost reference-bandwidth 1000
end
yes

步骤 2: 验证 OSPFv2 的优化是否到位。

a.     在 R1 上使用 show ip ospf interface g0/0/1 命令,验证接口优先级是否已设置为 50、Hello 间隔为 30、Dead 间隔为 120,并且默认网络类型为广播。

b.     我们可以在 R1上使用 show ip route ospf 命令来验证 R2 G0/0/0 的网络已经出现在路由表中。注意观察本输出和前文输出中度量值的差异。

c.     在 R2 上使用 show ip route ospf 命令。唯一的 OSPF 路由信息应该是 R1 传播的默认路由。

 

d.     在 笔记本电脑上,再次 ping Web 服务器 。该 ping 操作应该能够成功。

不知道为什么我的不能ping通求解

ping Web服务器

ping 笔记本电脑

 

O 192.168.1.0/24 [110/11] via 10.53.0.2, 00:04:28, GigabitEthernet0/0/1

O*E2 0.0.0.0/0 [110/1] via 10.53.0.1, 00:00:08, GigabitEthernet0/0/1

问题:
为什么默认路由的OSPF开销与R1上192.168.1.0/24网络的OSPF开销不同?

答:默认情况下,导入 OSPF 的默认静态路由的度量类型为“E2”或外部类型 2。默认情况下,“E2”在整个 OSPF 网络中保持相同的 OSPF 成本。在这种情况下,默认路由的度量为 1,因此它在 OSPF 56 网络内所有位置的度量均为 1。192.168.1.0 /24 网络是内部 OSPF 路由,其度量为累积指标。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

亚力山大抵

谢谢你的帮助,这是我最大的动力

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

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

打赏作者

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

抵扣说明:

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

余额充值