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

相关推荐
星恒讯工业路由器8 小时前
4G(LTE)基础技术解析:从频段划分到网络架构的核心知识点
大数据·网络·信息与通信·工业物联网·4g lte·lte网络架构·无线通信基础
深念Y9 小时前
ZTE_UZ901_NVRAM经验总结
linux·服务器·网络·嵌入式硬件·嵌入式·随身wifi
似水এ᭄往昔9 小时前
【Linux网络编程】--TCP_Socket
linux·网络·tcp/ip
若汝棋茗9 小时前
UDP 调试难复现?先把目标端点、广播和消息记录管起来
网络·网络协议·udp
云端漫步19879 小时前
HarmonyOS NEXT AI 智能生活助手:设置中心开发
人工智能·华为·生活·harmonyos
ACP广源盛1392462567310 小时前
2026 PCIe互连芯片@ACP#国产替代格局解析:芯动科技领跑高端交换芯片赛道
大数据·网络·数据库·人工智能·分布式·嵌入式硬件
Kina_C10 小时前
Keepalived 单播模式实战:跨网络高可用的关键配置
linux·服务器·网络·keepalived
wWYy.10 小时前
阻塞和非阻塞
服务器·网络
zhang1338308907511 小时前
CG-85D 水工大坝渗压监测振弦式传感器
运维·服务器·网络·人工智能·自动化
pt104311 小时前
网络自动化Python课程:Git版本控制基础入门与实验演示
网络·python·自动化