MGRE环境下的OSPF综合实验

在这里插入图片描述
1, R6为ISP只能配置Ip地址,R1- R5的环回为私有网段,
2, R1/4/5为全连的MGRE结构,R1/2/3为星 型的拓扑结构,R1为中心站点
3,所有私有网段可以互相通讯,私有网段使用OSPF完成。

[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 16.0.0.1 24
[r1-GigabitEthernet0/0/0]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip add 116.0.0.1 24
[r1-GigabitEthernet0/0/1]int l0
[r1-LoopBack0]ip add 192.168.1.1 24

[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 26.0.0.1 24
[r2-GigabitEthernet0/0/0]int l0
[r2-LoopBack0]ip add 192.168.2.1 24

[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 36.0.0.1 24
[r3-GigabitEthernet0/0/0]int l0
[r3-LoopBack0]ip add 192.168.3.1 24

[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 46.0.0.1 24
[r4-GigabitEthernet0/0/0]int l0
[r4-LoopBack0]ip add 192.168.4.1 24
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip add 56.0.0.1 24
[r5-GigabitEthernet0/0/0]int l0
[r5-LoopBack0]ip add 192.168.5.1 24

[isp]int g 0/0/0
[isp-GigabitEthernet0/0/0]ip add 16.0.0.2 24
[isp-GigabitEthernet0/0/0]int g 0/0/1
[isp-GigabitEthernet0/0/1]ip add 116.0.0.2 24
[isp-GigabitEthernet0/0/1]int g 3/0/0
[isp-GigabitEthernet3/0/0]ip add 26.0.0.2 24
[isp-GigabitEthernet3/0/0]int g 2/0/0
[isp-GigabitEthernet2/0/0]ip add 36.0.0.2 24
[isp-GigabitEthernet2/0/0]int g 4/0/0
[isp-GigabitEthernet4/0/0]ip add 46.0.0.2 24
[isp-GigabitEthernet4/0/0]int g 0/0/2
[isp-GigabitEthernet0/0/2]ip add 56.0.0.2 24

测试:
ping直连网关ip
RI:
ping 116.0.0.2
Ping 16.0.0.2
R2:
Ping 26.0.0.2
R3456同理

[r1]ip route-static 0.0.0.0 0 16.0.0.2
[r1]ip route-static 0.0.0.0 0 116.0.0.2

[r2]ip route-static 0.0.0.0 0 26.0.0.2
[r3]ip route-static 0.0.0.0 0 36.0.0.2
[r4]ip route-static 0.0.0.0 0 46.0.0.2
[r5]ip route-static 0.0.0.0 0 56.0.0.2

测试:
这时可以跨过公网路由ping通网关
ping 23.0.0.1
ping 56.0.0.1
ping 46.0.0.1
ping 36.0.0.1
ping 26.0.0.1

[r1]int t 0/0/0
[r1-Tunnel0/0/0]ip add 10.0.0.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 16.0.0.1
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry multicast dynamic

[r2]int t 0/0/0
[r2-Tunnel0/0/0]ip add 10.0.0.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source g 0/0/0
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 10.0.0.1 16.0.0.1 register

[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip add 10.0.0.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source g 0/0/0
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.0.0.1 16.0.0.1 register

既是中心也是分支,所中心和分支的相关配置都要配
[r1]int t 0/0/1
[r1-Tunnel0/0/1]ip add 11.0.0.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 116.0.0.1
[r1-Tunnel0/0/1]nhrp network-id 110
[r1-Tunnel0/0/1]nhrp entry multicast dynamic

[r4]int t 0/0/0
[r4-Tunnel0/0/0]ip add 11.0.0.4 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]nhrp network-id 110
[r4-Tunnel0/0/0]nhrp entry multicast dynamic
[r4-Tunnel0/0/0]source 46.0.0.1

[r5]int t 0/0/0
[r5-Tunnel0/0/0]ip add 11.0.0.5 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 56.0.0.1
[r5-Tunnel0/0/0]nhrp network-id 110
[r5-Tunnel0/0/0]nhrp entry multicast dynamic

[r1-Tunnel0/0/1]nhrp entry 11.0.0.4 46.0.0.1 register
[r1-Tunnel0/0/1]nhrp entry 11.0.0.5 56.0.0.1 register

[r4-Tunnel0/0/0]nhrp entry 11.0.0.1 16.0.0.1 register
[r5-Tunnel0/0/0]nhrp entry 11.0.0.4 46.0.0.1 register

在这里插入图片描述
在这里插入图片描述
把所有的ospf设置在单区域里面
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 10.0.0.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 11.0.0.0 0.0.0.255

[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]network 10.0.0.0 0.0.0.255

[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 10.0.0.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]
Sep 28 2021 21:16:13-08:00 r3 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.10, NeighborE
vent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)
[r3-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255

[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]a 0
[r4-ospf-1-area-0.0.0.0]network 11.0.0.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255

[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]a 0
[r5-ospf-1-area-0.0.0.0]network 11.0.0.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]
Sep 28 2021 21:19:39-08:00 r5 %%01OSPF/4/NBR_CHANGE_E(l)[0]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=1.0.0.11, NeighborE
vent=HelloReceived, NeighborPreviousState=Down, NeighborCurrentState=Init)
[r5-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255

在这里插入图片描述
在这里插入图片描述
P2P不需要选DR和BDR,只有两台设备在点到点的P2P网络里
在这里插入图片描述
在这里插入图片描述
华为的逻辑是谁先发送hello把,就先和谁建立邻居关系

brodcast一个点家里多个邻居关系,

[r1]int t 0/0/0
[r1-Tunnel0/0/0]ospf network-type broadcast

[r2]int t 0/0/0
[r2-Tunnel0/0/0]ospf ne
[r2-Tunnel0/0/0]ospf network-type br
[r2-Tunnel0/0/0]ospf network-type broadcast

[r3]int t0/0/0
[r3-Tunnel0/0/0]osp
[r3-Tunnel0/0/0]ospf net
[r3-Tunnel0/0/0]ospf network-type br
[r3-Tunnel0/0/0]ospf network-type broadcast

在这里插入图片描述
方法1:放弃选举
方法二: P2MP没有选择DR和BDR的需求

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值