华为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

相关推荐
大隐隐于野6 小时前
tcp 丢包分析
linux·服务器·网络
爱笑的眼睛117 小时前
HarmonyOS数据存储Kit深度实践:从架构设计到性能优化
华为·harmonyos
爱笑的眼睛117 小时前
HarmonyOS后台代理提醒Agent:构建智能提醒功能的深度解析
华为·harmonyos
爱笑的眼睛117 小时前
ArkTS可选链与空值合并:提升HarmonyOS应用开发的安全性与简洁性
华为·harmonyos
qqxhb8 小时前
系统架构设计师备考第64天——网络构建关键技术
网络·系统架构·mtbf·mttr·冗余硬件·软件热备·快速检测
星释9 小时前
鸿蒙Flutter三方库适配指南:11.插件发布上线及使用
flutter·华为·harmonyos
奔跑的露西ly11 小时前
【HarmonyOS NEXT】常见的性能优化
华为·性能优化·harmonyos
哈乐12 小时前
网工应用题:配置命令补全类题目
服务器·前端·网络
梁正雄12 小时前
19、docker跨主机网络 Overlay\Underlay
网络·docker·容器
沧澜sincerely12 小时前
运输层协议概述及UDP
网络·udp·运输层