ENSP Demo 015.0 GRE


sys
sys R3

int g0/0/0
ip add 13.0.0.2 30
int g0/0/1
ip add 23.0.0.2 30
int lo 3
ip add 3.3.3.3 32

sys
sys R1

dhcp enable
ip route-static 0.0.0.0 0 13.0.0.2 

acl 2000
rule 10 permit so 192.168.10.0 0.0.0.255

int g0/0/0
ip add 13.0.0.1 30
nat outbound 2000
int g0/0/1
ip add 192.168.10.254 24
dhcp select interface

int t0/0/0
tunnel-protocol gre
source 13.0.0.1
destination 23.0.0.1
ip add 192.168.20.1 24
keepalive p 1 r 5

ip route-static 172.16.20.0 24 t0/0/0
ip route-static 172.16.10.0 24 t0/0/0

sys
sys R2

dhcp enable
ip route-static 0.0.0.0 0 23.0.0.2 

acl 2000
rule 10 permit so 172.16.0.0 0.0.0.255

int g0/0/0
ip add 23.0.0.1 30
nat outbound 2000
int g0/0/1
ip add 172.16.0.254 24
dhcp select interface

int t0/0/0
tunnel-protocol gre
source 23.0.0.1
destination 13.0.0.1
ip add 172.16.20.1 24
keepalive p 1 r 5

ip route-static 192.168.20.0 24 t0/0/0
ip route-static 192.168.10.0 24 t0/0/0

keepalive p 1 r 5用于隧道检测,检测间隔1s,超过5s无响应接口down掉

GRE隧道两端IP地址不是同一网段,所以需要添加静态路由

GRE可以封装组播,所以也可以选择OSPF、RIPv2代替静态路由

ip route-static 172.16.20.0 24 t0/0/0
ip route-static 172.16.10.0 24 t0/0/0
R1可以将静态路由替换为OSPF
ospf 1 router-id 1.1.1.1
a 0
net 192.168.10.0 0.0.0.255
net 192.168.20.0 0.0.0.255
ip route-static 192.168.20.0 24 t0/0/0
ip route-static 192.168.10.0 24 t0/0/0
R2可以将静态路由替换为OSPF
ospf 1 router-id 2.2.2.2
a 0
net 172.16.0.0 0.0.0.255
net 172.16.20.0 0.0.0.255

 

posted @   让我读个条  阅读(11)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
点击右上角即可分享
微信分享提示