- GRE
- 最简单的VPN,一般不单独使用
- Generic Routing Encapsulation,通用路由封装,是简单的VPN。GRE 是第三层隧道协议,采用了一种被称之为Tunnel(隧道)的技术
- 优点:支持IP 网络作为承载网络、支持多种协议、支持IP 组播,配置简单,容易布署。
- 缺点:缺少保护功能,不能执行如认证、加密、以及数据完整性检查这些任务。
- 工作原理
- 隧道起点路由查找--> 加封装-->承载协议路由转发-->公网转发--> 解封装-->隧道终点路由查找
- 配置命令
- 华为命令
- interface Tunnel0/0/0 //创建tunnel隧道
- ip address 192.168.3.1 255.255.255.0
- tunnel-protocol gre //配置隧道协议
- source 100.1.1.1 //隧道的源地址
- destination 100.1.1.2 //隧道目的地址
- ip route-static 192.168.2.0 24 Tunnel 0/0/0
- //配置路由协议让数据报文从tunnel口走
- tunnel口 up的条件
- tunnel口要配置地址
- tunnel destination 目的地址要可达
- tunnel口 up的条件
- 思科命令
- interface Tunnel0
- ip address 192.168.3.2 255.255.255.0
- tunnel source 100.1.1.2
- tunnel destination 100.1.1.1
- ip route 192.168.2.0 255.255.255.0 Tunnel 0
- tunnel口 up的条件 tunnel destination 目的地址要可达
- 华为命令
十六、GRE基本原理与配置
于 2022-03-17 21:33:15 首次发布