学习目标:
掌握OSPF环境下的MGRE搭建
学习内容:
R1-R3-R4构建全连的MGRE环境
R1-R5-R6建立hub-spoke的MGRE环境,其中R1为中心
R1-R3...R6均存在环回网段模拟用户私网,使用OSPF使全网可达
其中R2为ISP路由器,仅配置IP地址
实验步骤:
第一步:IP规划及路由配置:
r1IP配置:
r2IP配置:
r3IP配置:
r4IP配置:
r5IP配置:
r6IP配置:
第二步:给所有路由器写缺省路由
r1: [r1]ip route-static 0.0.0.0 0 12.0.0.2
[r1]ip route-static 0.0.0.0 0 21.0.0.2
r3: [r3]ip route-static 0.0.0.0 0 23.0.0.2
r4: [r4]ip route-static 0.0.0.0 0 24.0.0.2
r5: [r5]ip route-static 0.0.0.0 0 25.0.0.2
r6: [r6]ip route-static 0.0.0.0 0 26.0.0.2
第三步:R1-R3-R4构建全连的MGRE环境
r1: [r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.2.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 21.0.0.1
[r1-Tunnel0/0/0]nhrp network-id 134
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp entry 192.168.2.3 23.0.0.1 register
[r1-Tunnel0/0/0]nhrp entry 192.168.2.4 24.0.0.1 register
r3: [r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 192.168.2.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 23.0.0.1
[r3-Tunnel0/0/0]nhrp network-id 134
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]nhrp entry 192.168.2.4 24.0.0.1 register
r4: [r4]int tun 0/0/0
[r4-Tunnel0/0/0]ip add 192.168.2.4 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source 24.0.0.1
[r4-Tunnel0/0/0]nhrp network-id 134
[r4-Tunnel0/0/0]nhrp entry multicast dynamic
第四步:检查R1-R3-R4之间是否全连
第五步:R1-R5-R6建立hub-spoke的MGRE环境,其中R1为中心
r1: [r1]int tun 0/0/1
[r1-Tunnel0/0/1]ip add 192.168.7.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 12.0.0.1
[r1-Tunnel0/0/1]nhrp network-id 156
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
r5: [r5]int tun 0/0/0
[r5-Tunnel0/0/0]ip add 192.168.7.5 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 25.0.0.1
[r5-Tunnel0/0/0]nhrp network-id 156
[r5-Tunnel0/0/0]nhrp entry 192.168.7.1 12.0.0.1 register
r6: [r6]int tun 0/0/0
[r6-Tunnel0/0/0]ip add 192.168.7.6 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source 26.0.0.1
[r6-Tunnel0/0/0]nhrp network-id 156
[r6-Tunnel0/0/0]nhrp entry 192.168.7.1 12.0.0.1 register
第六步:检查
第七步:R1-R3...R6私网使用OSPF使全网可达
r1: r3:
r4:
r5: r6:
[r1-Tunnel0/0/0]ospf network-type broadcast
[r3-Tunnel0/0/0]ospf network-type broadcast
[r4-Tunnel0/0/0]ospf network-type broadcast
[r1-Tunnel0/0/1]ospf network-type p2mp
[r5-Tunnel0/0/0]ospf network-type p2mp
[r6-Tunnel0/0/0]ospf network-type p2mp
文章来源:https://www.toymoban.com/news/detail-830148.html
至此实验结束文章来源地址https://www.toymoban.com/news/detail-830148.html
到了这里,关于OSPF环境下的MGRE的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!