ospf实现不同区域互通实验

 

要求:

使用ospf协议实现全网可达 

第一步:

给各路由器接口配置ip地址,配置环回

第二步:

由于r4、r7为isp只能配置IP地址无法运行ospf协议,所以我需要先在与isp相连的路由器上创建tunnel接口,让它们之间传递ospf协议信息

 r3-r5tunnel接口配置

[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip ad 10.1.1.1 24
[r3-Tunnel0/0/0]tunnel-protocol gre 
[r3-Tunnel0/0/0]source g0/0/1
[r3-Tunnel0/0/0]destination 45.1.1.2
[r3-Tunnel0/0/0]ospf network-type broadcast 
[r3-Tunnel0/0/0]q
[r3]ip route-static 45.1.1.0 24 34.1.1.1
[r5]int Tunnel 0/0/0
[r5-Tunnel0/0/0]ip ad 10.1.1.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre 
[r5-Tunnel0/0/0]source g0/0/0
[r5-Tunnel0/0/0]destination 34.1.1.2
[r5-Tunnel0/0/0]ospf network-type broadcast 
[r5-Tunnel0/0/0]q
[r5]ip route-static 34.1.1.0 24 45.1.1.1

 r3-r5之间隧道测试

[r5]ping 10.1.1.1
  PING 10.1.1.1: 56  data bytes, press CTRL_C to break
    Request time out
    Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=255 time=40 ms
    Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 10.1.1.1 ping statistics ---
    5 packet(s) transmitted
    4 packet(s) received
    20.00% packet loss
    round-trip min/avg/max = 20/27/40 ms

[r5]

 r6-r8-r10-r12之间tunnel口配置

[r6]int Tunnel 0/0/0
[r6-Tunnel0/0/0]ip ad 20.1.1.1 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r6-Tunnel0/0/0]source g0/0/1
Jan  1 2023 14:05:39-08:00 r6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r6-Tunnel0/0/0]nhrp entry multicast dynamic 
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]ospf network-type broadcast 
[r6-Tunnel0/0/0]q
[r6]ip route-static 78.1.1.0 24 67.1.1.1
[r6]ip route-static 17.1.1.0 24 67.1.1.1
[r6]ip route-static 27.1.1.0 24 67.1.1.1
[r8]int Tunnel 0/0/0
[r8-Tunnel0/0/0]ip ad 20.1.1.2 24
[r8-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r8-Tunnel0/0/0]source g0/0/0
Jan  1 2023 14:17:44-08:00 r8 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface Tunnel0/0/0 has entered the UP state. 
[r8-Tunnel0/0/0]nhrp entry 20.1.1.1 67.1.1.2 register 
[r8-Tunnel0/0/0]nhrp network-id 100
[r8-Tunnel0/0/0]ospf network-type broadcast 
[r8-Tunnel0/0/0]q
[r8]ip route-static 67.1.1.0 24 78.1.1.1
[r8]ip route-static 17.1.1.0 24 78.1.1.1
[r8]ip route-static 27.1.1.0 24 78.1.1.1
[r10]int Tunnel 0/0/0
[r10-Tunnel0/0/0]ip ad 20.1.1.3 24
[r10-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r10-Tunnel0/0/0]nhrp entry 20.1.1.1 67.1.1.2 register 
[r10-Tunnel0/0/0]nhrp network-id 100
[r10-Tunnel0/0/0]ospf network-type broadcast 
[r10-Tunnel0/0/0]source g0/0/0
Jan  1 2023 14:22:31-08:00 r10 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface Tunnel0/0/0 has entered the UP state. 
[r10-Tunnel0/0/0]q
[r10]ip route-static 67.1.1.0 24 17.1.1.1
[r10]ip route-static 78.1.1.0 24 17.1.1.1
[r10]ip route-static 27.1.1.0 24 17.1.1.1
[r12]int Tunnel 0/0/0
[r12-Tunnel0/0/0]ip ad 20.1.1.3 24
[r12-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r12-Tunnel0/0/0]source g0/0/0
Jan  1 2023 14:24:40-08:00 r12 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface Tunnel0/0/0 has entered the UP state. 
[r12-Tunnel0/0/0]nhrp entry 20.1.1.1 67.1.1.2 register 
[r12-Tunnel0/0/0]nhrp network-id  100
[r12-Tunnel0/0/0]ospf network-type broadcast 
[r12-Tunnel0/0/0]q
[r12]ip route-static 67.1.1.0 24 27.1.1.1
[r12]ip route-static 78.1.1.0 24 27.1.1.1
[r12]ip route-static 17.1.1.0 24 27.1.1.1

第三步:

在各路由器上启用ospf协议,按照图示宣告接口

第四步:

对于ospf1进程area0与ospf100进程之间的互通我们使用tunnle隧道实现,将r3上的tunnel隧道接口地址宣告到ospf1 area0,r5上的tunnel隧道接口地址宣告到ospf100  area0,即可实现互通相互学习。对于area2与area0非直连的情况我们在这选择在r13-r14上配置ospf虚链路vlink,配置如下

r13]ospf 100
[r13-ospf-100]are	
[r13-ospf-100]area 1
[r13-ospf-100-area-0.0.0.1]v	
[r13-ospf-100-area-0.0.0.1]vlink-peer 14.14.14.14
[r14]ospf 100 
[r14-ospf-100]are	
[r14-ospf-100]area 1
[r14-ospf-100-area-0.0.0.1]v	
[r14-ospf-100-area-0.0.0.1]vlink-peer 13.13.13.13

最后:

全网可达已经实现了,结果展示

r1上已经学到所有网段路由

 r15上也已经学到所有网段路由

ping测试

 试验结束!!!

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值