华为gre隧道全部跑静态路由

最终实现:

1、pc1能用nat上网ping能pc3

2、pc1能通过gre访问pc2

3、全部用静态路由做,没有用ospf,如果要用ospf,那么两边除了路由器上跑ospf,核心交换机也得用ospf

r2配置:

acl number 3000

rule 5 deny gre //把要gre的数据先拿掉不做nat

rule 10 permit ip

interface GigabitEthernet0/0/0

ip address 100.0.0.2 255.255.255.0

nat outbound 3000 //上外网nat

interface GigabitEthernet0/0/1

ip address 10.0.0.1 255.255.255.0

interface GigabitEthernet0/0/2

interface Tunnel0/0/0

ip address 100.100.0.1 255.255.255.0

tunnel-protocol gre

keepalive

source 100.0.0.2

destination 200.0.0.2

gre key 6666

gre checksum

ip route-static 0.0.0.0 0.0.0.0 100.0.0.1 //外网默认路由

ip route-static 172.16.0.0 255.255.255.0 Tunnel0/0/0 100.100.0.2 //不指定下一跳不通

ip route-static 192.168.0.0 255.255.255.0 10.0.0.2 //内网回程路由

R3配置:

interface GigabitEthernet0/0/0

ip address 200.0.0.2 255.255.255.0

interface GigabitEthernet0/0/1

ip address 3.3.3.1 255.255.255.0

interface GigabitEthernet0/0/2

interface NULL0

interface Tunnel0/0/0

ip address 100.100.0.2 255.255.255.0

tunnel-protocol gre

keepalive

source 200.0.0.2

destination 100.0.0.2

gre key 6666

gre checksum

ip route-static 0.0.0.0 0.0.0.0 200.0.0.1

ip route-static 172.16.0.0 255.255.255.0 3.3.3.3

ip route-static 192.168.0.0 255.255.255.0 Tunnel0/0/0 100.100.0.1

相关推荐
普马萨特5 小时前
实体与位置关系的数据从哪里来:获取、治理与仍待解决的问题
网络·数据库
sunshine8855 小时前
智能费控3.0:从合规审核到预算实时控制的进化之路
网络
加农炮手Jinx5 小时前
Flutter for OpenHarmony 实战:flutter_animate 声明式动画让 UI 灵动如原生
flutter·ui·华为·harmonyos·鸿蒙
里欧跑得慢6 小时前
Flutter 三方库 function_tree — 鸿蒙应用开发中的动态数学公式解析与计算神器,实现鸿蒙深度适配下的复杂函数逻辑运行时求值实战(适配鸿蒙 HarmonyOS Next ohos)
android·前端·安全·flutter·华为·harmonyos
范什么特西6 小时前
回答网络-01
网络
Zenova EdgeOS8 小时前
工业网关心跳机制:从 Keepalive 到健康判定的工程实战
大数据·网络·数据库·边缘计算·工业网关
2501_919749038 小时前
华为鸿蒙免费制定规则软件—小羊规则
华为·harmonyos·鸿蒙
郝学胜-神的一滴8 小时前
Effective Python 条款4:字符串格式化大乱斗
开发语言·网络·python·程序人生·软件工程
lilian2339 小时前
HarmonyOS 7 新特性(四)|沉浸光感:空间材质、性能分级与降级策略
前端·pytorch·华为·harmonyos·材质
云絮.9 小时前
网络编程套接字
网络