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

相关推荐
Xの哲學5 小时前
Linux多级时间轮:高精度定时器的艺术与科学
linux·服务器·网络·算法·边缘计算
FlourishingMind5 小时前
蓝牙授时CTS (Current Time Service)、PTP、NTP
运维·服务器·网络
不爱吃糖的程序媛5 小时前
ArkUI-X 6.0.0 Release发布
华为·harmonyos
Winner13006 小时前
查看rk3566摄像头设备、能力、支持格式
linux·网络·人工智能
w139548564227 小时前
Flutter跨平台组件集成框架鸿蒙化使用指南
flutter·华为·harmonyos
微爱帮监所写信寄信7 小时前
微爱帮监狱写信寄信工具信件加密技术方案
网络
专业开发者8 小时前
蓝牙技术联盟推出网络照明控制(NLC)规范
网络·物联网
Kiyra8 小时前
阿里云 OSS + STS:安全的文件上传方案
网络·人工智能·安全·阿里云·系统架构·云计算·json
小趴菜不能喝9 小时前
Docker 网络
网络·docker·容器
DARLING Zero two♡10 小时前
拒绝“环境劝退”:Llama-2-7b 在昇腾 NPU 上的工程化部署与深度故障排查实录
华为·llama·gpu算力