ospf-gre隧道小练习

全网可达,R5路由表没有其他路由器的路由条目

注:每个路由器都添加了自己的环回,如R1就是1.1.1.1

R1可以分别ping通与R2,R3,R4之间的隧道

R1路由表上有所有路由器环回的路由条目

R5路由表上没有其他路由器的路由条目

实现代码:

首先将各个接口IP配好

边上3个路由器:R6R7R8

例:r7

ospf 1 router-id 7.7.7.7

area 3

network 0.0.0.0 255.255.255.255 实际上是宣告了26.1.1.2和7.7.7.7两个属于area 3

DR:R1

例:r1

interface Tunnel0/0/0

ip address 10.1.1.1 24

tunnel-protocol gre p2mp

source 15.1.1.1

ospf network-type broadcast

nhrp entry multicast dynamic

nhrp network-id 100

ospf 1 router-id 1.1.1.1

area 0

network 1.1.1.1 0.0.0.0

network 10.1.1.1 0.0.0.0

二选一,尽量选择一个一个配而不做缺省:

ip route-static 25.1.1.0 24 15.1.1.2

ip route-static 26.1.1.0 24 15.1.1.2

ip route-static 35.1.1.0 24 15.1.1.2

ip route-static 38.1.1.0 24 15.1.1.2

ip route-static 45.1.1.0 24 15.1.1.2

ip route-static 47.1.1.0 24 15.1.1.2

or

ip route-static 0.0.0.0 0 15.1.1.2

其他3个用隧道的路由器:R2R3R4

例:r2

interface Tunnel0/0/0

ip address 10.1.1.2 24

tunnel-protocol gre p2mp

source 25.1.1.2

ospf network-type broadcast

ospf dr-priority 0 #该拓扑结构导致要考虑DR选举问题,让R2,R3,R4放弃选举,

#如果互为中心站点就不用考虑

nhrp entry multicast dynamic

nhrp network-id 100

nhrp entry 10.1.1.1 15.1.1.1 register

ospf 1 router-id 2.2.2.2

area 0.0.0.0

network 2.2.2.2 0.0.0.0

network 10.1.1.2 0.0.0.0

area 0.0.0.1

network 26.1.1.1 0.0.0.0

display ospf peer brief 查看邻居表

display ip routing-table 查看路由表

r1-GigabitEthernet0/0/0display ip interface brief 查看接口IP表

相关推荐
LinXunFeng8 小时前
Obsidian - 使用 Share Note 分享笔记并自部署
前端·笔记·github
闪闪发亮的小星星5 天前
高斯光以及高斯光公式解释
笔记
cqbzcsq5 天前
CellFlow虚拟细胞论文阅读
论文阅读·人工智能·笔记·学习·生物信息
阿米亚波5 天前
【Windows】QEMU 启动 openEuler aarch64/arm64 架构系统 + 离线软件源
linux·windows·经验分享·笔记·架构·arm
自传.5 天前
尚硅谷 Vibe Coding|第三章(1) Claude Code深度使用与进阶技巧 学习笔记
笔记·学习·尚硅谷·vibecoding
.千余5 天前
【C++】模板进阶全解:非类型参数|全特化|偏特化|分离编译完全指南
开发语言·c++·笔记·学习·其他
自传.5 天前
尚硅谷 Vibe Coding|第二章 AI编程工具生态 学习笔记
笔记·学习·ai编程·尚硅谷·vibe coding
秋波。未央5 天前
Java Agent 开发 · Day 1 学习笔记(含作业完整标准答案)
java·笔记·学习
中屹指纹浏览器5 天前
2026指纹浏览器字体指纹、字体渲染偏差检测与全维度虚拟字体池搭建方案
经验分享·笔记