IPSec Over GRE :是先 IPSec 后 GRE —— 即数据包中内层是 IPSec ,外层是 GRE ;(本篇说明的是这个)
GRE Over IPSec :是先 GRE 后 IPSec —— 即数据包中内层是 GRE ,外层是 IPSec 。
实验环境:
操作系统:Mac OS X 10.11.5 Beta 1(当时最新测试版),模拟器:GNS3 IOU for Mac 1.4.5(当时最新版本)
注:当然,只要有思科模拟器都可以做这个实验
实验需求:
site 1 和 site 2 均需要开启 OSPF ,实现 R1 到 R5 的内网通信,同时穿过 Internet 的流量需要加密。
实验步骤:
我们首先使用【实验】IPSec LAN to LAN(附有关于 IPSec 的一些 ACL 应用)这个实验的基础配置进行底层配置。
R1:
interface Loopback0 interface FastEthernet1/0 router ospf 12 |
R3:
interface FastEthernet1/0 interface FastEthernet1/1 |
R5:
interface Loopback0 interface FastEthernet1/1 router ospf 45 |
R2:
interface Loopback0 interface FastEthernet1/0 interface FastEthernet1/1 ip route 0.0.0.0 0.0.0.0 23.1.1.3 router ospf 12 |
R4:
interface Loopback0 interface FastEthernet1/0 interface FastEthernet1/1 ip route 0.0.0.0 0.0.0.0 34.1.1.3 router ospf 45 |
IPSec 的配置:
R2 :
conf t cry is en —— 开启 isakmp crypto keyring T4 —— 认证密钥 pre-shared-key address 34.1.1.4 255.255.255.0 key CCIE.LOL crypto isakmp policy 10 —— isakmp 策略 encr 3des hash md5 authentication pre-share group 2 crypto isakmp profile R4 —— isakmp 模板 keyring T4 match identity address 34.1.1.4 255.255.255.0 cry ipsec transform-set T4 esp-3des esp-md5-hmac —— IPSec SA 策略 mode tunnel —— 详情请见《 IPSec 的两种工作模式及其报文封装格式》 crypto ipsec profile VPN —— IPSec 模板 set transform-set T4 set isakmp-profile R4 interface Tunnel24 —— 配置 Tunnel ip address 10.1.1.2 255.255.255.0 tunnel mode ipsec ipv4 tun source f 1/1 tunnel destination 34.1.1.4 tunnel protection ipsec profile VPN —— 捕捉 IPSec 流然后放入 GRE ,也就是先 IPSec 后 GRE ip ospf network point-to-point —— 设置 OSPF 点对点链路 ip os 12 a 0 —— OSPF 通告 router ospf 12 no default-information originate —— 原来的初始配置是要下发默认路由的,但是这个实验不 需要,因为两个 site 之间已经通过 Tunnel 起了 OSPF
R4 :
conf t cry is en —— 开启 isakmp crypto keyring T2 —— 认证密钥 pre-shared-key address 23.1.1.2 255.255.255.0 key CCIE.LOL crypto isakmp policy 10 —— isakmp 策略 encr 3des hash md5 authentication pre-share group 2 crypto isakmp profile R2 —— isakmp 模板 keyring T2 match identity address 23.1.1.2 255.255.255.0 cry ipsec transform-set T2 esp-3des esp-md5-hmac —— IPSec SA 策略 mode tunnel crypto ipsec profile VPN —— IPSec 模板 set transform-set T2 set isakmp-profile R2 interface Tunnel24 —— 配置 Tunnel ip address 10.1.1.4 255.255.255.0 tunnel mode ipsec ipv4 tun source f 1/0 tunnel destination 23.1.1.2 tunnel protection ipsec profile VPN —— 捕捉 IPSec 流然后放入 GRE ,也就是先 IPSec 后 GRE ip ospf network point-to-point —— 设置 OSPF 点对点链路 ip os 45 a 0 —— OSPF 通告 router ospf 45 no default-information originate —— 原来的初始配置是要下发默认路由的,但是这个实验不 需要,因为两个 site 之间已经通过 Tunnel 起了 OSPF
测试:
R1#p 5.5.5.5 so l 0 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds: Packet sent with a source address of 1.1.1.1 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 68/81/92 ms
本文完。如有疑问,欢迎在下方留言;如本文有什么错误,欢迎在下方留言指正,谢谢。
其他相关文章:
发表评论?