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
分类:
华为ENSP各种实验
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)