ospf-gre隧道小练习

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

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

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

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

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

实现代码:

首先将各个接口IP配好

边上3个路由器:[R6][R7][R8]

例:[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个用隧道的路由器:[R2][R3][R4]

例:[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/0\]display ip interface brief 查看接口IP表

相关推荐
tingshuo291715 小时前
S001 【模板】从前缀函数到KMP应用 字符串匹配 字符串周期
笔记
西岸行者6 天前
学习笔记:SKILLS 能帮助更好的vibe coding
笔记·学习
starlaky6 天前
Django入门笔记
笔记·django
勇气要爆发6 天前
吴恩达《LangChain LLM 应用开发精读笔记》1-Introduction_介绍
笔记·langchain·吴恩达
悠哉悠哉愿意6 天前
【单片机学习笔记】串口、超声波、NE555的同时使用
笔记·单片机·学习
勇气要爆发6 天前
吴恩达《LangChain LLM 应用开发精读笔记》2-Models, Prompts and Parsers 模型、提示和解析器
android·笔记·langchain
qianshanxue116 天前
计算机操作的一些笔记标题
笔记
土拨鼠烧电路6 天前
笔记11:数据中台:不是数据仓库,是业务能力复用的引擎
数据仓库·笔记
土拨鼠烧电路6 天前
笔记14:集成与架构:连接孤岛,构建敏捷响应能力
笔记·架构
烟花落o6 天前
栈和队列的知识点及代码
开发语言·数据结构·笔记·栈和队列·编程学习