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

相关推荐
阿部多瑞 ABU10 分钟前
国内外大模型安全红队实测:角色越狱与分步诱导双路径可稳定绕过政治与技术防护
网络·安全·ai
青果全球http36 分钟前
HTTP代理原理揭秘:如何实现高效数据中转?
网络·网络协议·http
赵财猫._.1 小时前
【Flutter x 鸿蒙】第四篇:双向通信——Flutter调用鸿蒙原生能力
flutter·华为·harmonyos
渡我白衣1 小时前
计算机组成原理(1):计算机发展历程
java·运维·开发语言·网络·c++·笔记·硬件架构
赵财猫._.2 小时前
【Flutter x 鸿蒙】第五篇:导航、路由与多设备适配
flutter·华为·harmonyos
Henry Zhu1232 小时前
VPP中FIB(转发信息库)和VRF(虚拟路由转发)详解:从设计理念到实际应用
网络·计算机网络·云原生·云计算·智能路由器
科技块儿3 小时前
在线IP归属地查询工具有哪些?
服务器·网络·tcp/ip
谷粒.3 小时前
自动化测试覆盖率从30%到80%的演进历程:策略、挑战与未来展望
运维·网络·深度学习·架构·自动化·transformer·测试覆盖率
Chaunceyin3 小时前
浅谈Openharmony 和 HarmonyOS
华为·harmonyos