【OSPF_1】

实验要求

1、R6为ISP只能配置ip地址,R1-5的环回为私有网段
2、R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点
3、所有私有网段可以互相通讯,私有网段使用OSPF协议完成

实验拓扑

在这里插入图片描述

实验配置

[R1]ip route-static 0.0.0.0 0 192.168.1.2
[R1]ip route-static 0.0.0.0 0 172.16.1.2
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 172.16.1.1
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R1-Tunnel0/0/0]nhrp network-id 100
[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]ip address 10.1.2.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp
[R1-Tunnel0/0/1]source 192.168.1.1
[R1-Tunnel0/0/1]nhrp entry multicast dynamic
[R1-Tunnel0/0/1]nhrp network-id 101
[R1-Tunnel0/0/1]
[R1]ospf 100 router-id 1.1.1.1
[R1-ospf-100]area 0
[R1-ospf-100-area-0.0.0.0]network 10.1.0.0 0.0.255.255
[R1-ospf-100-area-0.0.0.0]network 1.1.1.1 0.0.0.0

[R2]ip route-static 0.0.0.0 0 192.168.2.2
[R2]interface Tunnel 0/0/0
[R2-Tunnel0/0/0]ip address 10.1.1.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]source GigabitEthernet 0/0/0
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 10.1.1.1 172.16.1.1 register
[R2]ospf 100 router-id 2.2.2.2
[R2-ospf-100]area 0
[R2-ospf-100-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[R2-ospf-100-area-0.0.0.0]network 2.2.2.2 0.0.0.0

[R3]ip route-static 0.0.0.0 0 192.168.3.2
[R3]interface Tunnel 0/0/0
[R3-Tunnel0/0/0]ip address 10.1.1.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source GigabitEthernet 0/0/0
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 10.1.1.1 172.16.1.1 register
[R3-Tunnel0/0/0]

[R4]ip route-static 0.0.0.0 0 192.168.4.2
[R4]interface Tunnel 0/0/0
[R4-Tunnel0/0/0]ip address 10.1.2.2 24
[R4-Tunnel0/0/0]tunnel-protocol gre p2mp
[R4-Tunnel0/0/0]source g0/0/0
[R4-Tunnel0/0/0]nhrp network-id 101
[R4-Tunnel0/0/0]nhrp entry 10.1.1.1 192.168.1.1 register
[R4-Tunnel0/0/0]nhrp entry 10.1.2.3 192.168.5.1 register
[R4]ospf 100 router-id 4.4.4.4
[R4-ospf-100]area 0
[R4-ospf-100-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[R4-ospf-100-area-0.0.0.0]network 10.1.2.0 0.0.0.255

[R5]ip route-static 0.0.0.0 0 192.168.5.2
[R5]interface Tunnel 0/0/0
[R5-Tunnel0/0/0]ip address 10.1.2.3 24
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source g0/0/0
[R5-Tunnel0/0/0]nhrp network-id 101
[R5-Tunnel0/0/0]nhrp entry 10.1.2.1 192.168.1.1 register
[R5-Tunnel0/0/0]nhrp entry 10.1.2.2 192.168.4.1 register
[R5]ospf 100 router-id 5.5.5.5
[R5-ospf-100]area 0
[R5-ospf-100-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[R5-ospf-100-area-0.0.0.0]network 5.5.5.5 0.0.0.0

需要注意!!!

在这里插入图片描述
在这里插入图片描述

  • 在OSPF中Tunnel的默认工作方式为P2P,该方式下不选举DR、BDR。只能建立一个邻居关系,故而在MGRE环境中是无法工作的。

  • 需要更改接口的默认工作方式类型。

  • 切记:一个网段中所有的接口的ospf工作方式要一致,否则无法建立邻居关系,或者是因为不同工作方式的hello time一致,错误建邻,无法收敛。

  • 当MGRE环境中,使用OSPF,且所有的Tunnel接口修改为broadcast工作方式后,必须基于拓扑接口考虑DR的位置问题。

  • MGRE可以构建不同的拓扑结构:

      	1.星型——中心到站点——轴辐状		中心站点为DR,取消BDR
      	2.全连网状——不需要关注DR
      	3.部分网状——基于可以全网段内共享LSA来考虑最佳DR位置
    

[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]ospf network-type broadcast
[R1-Tunnel0/0/0]quit
[R1]interface Tunnel 0/0/1
[R1-Tunnel0/0/1]ospf network-type broadcast
[R1-Tunnel0/0/1]

[R2-Tunnel0/0/0]ospf network-type broadcast
[R2-Tunnel0/0/0]ospf dr-priority 0

[R3-Tunnel0/0/0]ospf network-type broadcast
[R3-Tunnel0/0/0]ospf dr-priority 0

[R4-Tunnel0/0/0]ospf network-type broadcast
[R4]interface Tunnel 0/0/0
[R4-Tunnel0/0/0]ospf dr-priority 0
[R4-Tunnel0/0/0]nhrp entry multicast dynamic 这是为了让R5和R4相互注册,可以相互发送Hello

[R5-Tunnel0/0/0]ospf network-type broadcast
[R5]interface Tunnel 0/0/0
[R5-Tunnel0/0/0]ospf dr-priority 0

[R6-Tunnel0/0/0]ospf network-type broadcast
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值