OSPF实验

要求:

  1. 如图连接,合理规划IP地址,所有路由器各自创建一个loopback接口

2.R1再创建三个接口IP地址为201.1.1.1/24、201.1.2.1/24、201.1.3.1/24

  R5再创建三个接口IP地址为202.1.1.1/24、202.1.2.1/24、202.1.3.1/24

  R7再创建三个接口IP地址为203.1.1.1/24、203.1.2.1/24、203.1.3.1/24

3.如图运行路由协议

  R1 -R2  -R3之间使用MGRE网络,为hub-spoke 网络结构,R1为hub端 ,部署OSPF网

络,MGRE修改为BMA网络类型

4.area  1  区域不得出现4.5类LSA

5.其他区域优先通过R3访问R1 三个环回接口

6.尽量减少路由条目数量

7.area 1 区域增加安全性

8.全网可达

配置:

R1:

undo t m

sys

sys R1

user-interface con 0

idle-timeout 0 0

ip route-static 0.0.0.0 0 18.1.1.2

int l1

ip add 1.1.1.1 24

int g0/0/0

ip add 18.1.1.1 24

int l11

ip add 201.1.1.1 24

int l12

ip add 201.1.2.1 24

int l13

ip add 201.1.3.1 24

interface Tunnel0/0/1

 ip address 10.1.1.1 255.255.255.0

 tunnel-protocol gre p2mp

 source 18.1.1.1

 ospf network-type broadcast

 ospf dr-priority 255

 nhrp entry multicast dynamic

 nhrp network-id 100

ospf 100 router-id 91.1.1.1

 area 0.0.0.0

  network 1.1.1.1 0.0.0.0

  network 10.1.1.1 0.0.0.0

  network 201.1.0.0 0.0.255.255

R8:

undo t m

sys

sys ISP

int g0/0/0

ip add 18.1.1.2 24

int g0/0/1

ip add 28.1.1.2 24

int g0/0/2

ip add 38.1.1.2 24

R2:

undo t m

sys

sys R2

user-interface con 0

idle-timeout 0 0

ip route-static 0.0.0.0 0 28.1.1.2

int g0/0/1

ip add 28.1.1.1 24

int ser4/0/0

ip add 24.1.1.1 24

int l2

ip add 2.2.2.2 24

interface Tunnel0/0/2

 ip address 10.1.1.2 255.255.255.0

 tunnel-protocol gre p2mp

 source 28.1.1.1

 ospf network-type broadcast

 ospf dr-priority 0

 nhrp network-id 100

 nhrp entry 10.1.1.1 18.1.1.1 register

ospf 100 router-id 92.1.1.1

 area 0.0.0.0

  abr-summary 201.1.0.0 255.255.252.0

  network 10.1.1.2 0.0.0.0

 area 0.0.0.1

  authentication-mode simple plain 123

  network 2.2.2.2 0.0.0.0

  network 24.1.1.1 0.0.0.0

  nssa

R3:

undo t m

sys

sys R3

user-interface con 0

idle-timeout 0 0

ip route-static 0.0.0.0 0 38.1.1.2

int g0/0/2

ip add 38.1.1.1 24

int ser4/0/1

ip add 34.1.1.1 24

int l3

ip add 3.3.3.3 24

interface Tunnel0/0/3

 ip address 10.1.1.3 255.255.255.0

 tunnel-protocol gre p2mp

 source 38.1.1.1

 ospf network-type broadcast

 ospf dr-priority 0

 nhrp network-id 100

 nhrp entry 10.1.1.1 18.1.1.1 register

ospf 100 router-id 93.1.1.1

 asbr-summary 203.1.0.0 255.255.252.0

 asbr-summary 202.1.0.0 255.255.252.0

 area 0.0.0.0

  abr-summary 201.1.0.0 255.255.252.0

  network 10.1.1.3 0.0.0.0

 area 0.0.0.1

  authentication-mode simple plain 123

  network 3.3.3.3 0.0.0.0

  network 34.1.1.1 0.0.0.0

  nssa

R4:

undo t m

sys

sys R4

user-interface con 0

idle-timeout 0 0

int l4

ip add 4.4.4.4 24

int ser4/0/0

ip add 24.1.1.2 24

int ser4/0/1

ip add 34.1.1.2 24

int g0/0/0

ip add 45.1.1.1 24

int g0/0/1

ip add 46.1.1.1 24

ospf 100 router-id 94.1.1.1

 asbr-summary 203.1.0.0 255.255.252.0

 asbr-summary 202.1.0.0 255.255.252.0

 asbr-summary 201.1.0.0 255.255.252.0

 import-route ospf 200

 import-route rip 200

 area 0.0.0.1

  authentication-mode simple plain 123

  network 4.4.4.4 0.0.0.0

  network 24.1.1.2 0.0.0.0

  network 34.1.1.2 0.0.0.0

  nssa

ospf 200 router-id 94.1.1.2

 asbr-summary 202.1.0.0 255.255.252.0

 asbr-summary 201.1.0.0 255.255.252.0

 import-route ospf 100

 import-route rip 200

 area 0.0.0.2

  network 46.1.1.1 0.0.0.0

rip 200

 version 2

 network 45.0.0.0

 import-route ospf 100

 import-route ospf 200

R5:

undo t m

sys

sys R5

user-interface con 0

idle-timeout 0 0

int l5

ip add 5.5.5.5 24

int g0/0/0

ip add 45.1.1.2 24

int l51

ip add 202.1.1.1 24

int l52

ip add 202.1.2.1 24

int l53

ip add 202.1.3.1 24

rip 200

 version 2

 network 5.0.0.0

 network 45.0.0.0

 network 202.1.1.0

 network 202.1.2.0

 network 202.1.3.0

R6

undo t m

sys

sys R6

user-interface con 0

idle-timeout 0 0

int l6

ip add 6.6.6.6 24

int g0/0/1

ip add 46.1.1.2 24

int g0/0/2

ip add 67.1.1.1 24

ospf 100 router-id 96.1.1.1

 asbr-summary 203.1.0.0 255.255.252.0

 import-route rip 100

 area 0.0.0.2

  network 6.6.6.6 0.0.0.0

  network 46.1.1.2 0.0.0.0

rip 100

 version 2

 network 67.0.0.0

 import-route ospf 100

R7:

undo t m

sys

sys R7

user-interface con 0

idle-timeout 0 0

int g0/0/2

ip add 67.1.1.2 24

int l7

ip add 7.7.7.7 24

int l71

ip add 203.1.1.1 24

int l72

ip add 203.1.2.1 24

int l73

ip add 203.1.3.1 24

rip 100

 version 2

 network 7.0.0.0

 network 67.0.0.0

 network 203.1.1.0

 network 203.1.2.0

 network 203.1.3.0

要求3:

要求4:

在R2上看ospf的lsdb表如图area1区域无4、5类lsa

要求5:

在R4上看路由表可知访问R1的3个环回下一跳为34.1.1.1,优先通过R3访问

要求6:

等等

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
OSPF(开放式最短路径优先协议)是一种常见的路由协议,可用于在企业网络中实现路由选择。下面是一个简单的 OSPF 实验,展示了如何在网络中配置 OSPF 路由器。 实验拓扑: ``` +----------------+ +----------------+ | | | | | Router 1 |------------| Router 2 | | | | | +----------------+ +----------------+ ``` 1. 配置 IP 地址 在 Router 1 和 Router 2 上分别配置 IP 地址。例如,Router 1 的 IP 地址为 192.168.1.1/24,Router 2 的 IP 地址为 192.168.1.2/24。 2. 启用 OSPF 在 Router 1 和 Router 2 上启用 OSPF。具体来说,需要完成以下步骤: - 在每个路由器上创建一个 OSPF 进程。例如,创建进程号为 1。 - 将每个路由器的 IP 地址添加到 OSPF 网络中。 - 配置每个路由器的 OSPF 路由器 ID。例如,将 Router 1 的路由器 ID 设置为 1.1.1.1,将 Router 2 的路由器 ID 设置为 2.2.2.2。 - 配置每个路由器的 OSPF 邻居。例如,将 Router 1 的邻居设置为 Router 2 的 IP 地址,将 Router 2 的邻居设置为 Router 1 的 IP 地址。 在 Router 1 上,可以使用以下命令启用 OSPF: ``` router ospf 1 network 192.168.1.0 0.0.0.255 area 0 router-id 1.1.1.1 neighbor 192.168.1.2 ``` 在 Router 2 上,可以使用以下命令启用 OSPF: ``` router ospf 1 network 192.168.1.0 0.0.0.255 area 0 router-id 2.2.2.2 neighbor 192.168.1.1 ``` 3. 验证 OSPF 连通性 通过 ping 命令验证 OSPF 连通性。例如,在 Router 1 上执行以下命令: ``` ping 192.168.1.2 ``` 如果一切正常,应该能够收到来自 Router 2 的回复。 这是一个简单的 OSPF 实验,可以帮助你了解如何在网络中配置 OSPF。在实际环境中,需要更复杂的配置才能实现更高级的路由选择和故障转移。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值