前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >经典GRE Over IPSec配置 (

经典GRE Over IPSec配置 (

作者头像
py3study
发布2020-01-14 10:22:07
4.4K0
发布2020-01-14 10:22:07
举报
文章被收录于专栏:python3python3

本文继上文继续讨论gre over ipsec,上次我们是在两站点之间先建立IPSec连接(transport方式),然后再IPSec连接上再建立gre隧道,进行加密通信;本次我们换种方式来配置与上文相同的效果。这里我们用到了cisco路由器ipsec配置的一个技术:profile。

==============================R0配置==============================

crypto isakmp policy 1

encr 3des

hash md5

authentication pre-share

group 2

lifetime 3600

crypto isakmp key 1234 address 192.168.8.1

!

!

crypto ipsec transform-set 1 esp-3des esp-md5-hmac

mode transport

!

crypto ipsec profile 1                           //本文的精髓,配置Profile来代替map

set transform-set 1

set pfs group2

!

interface Tunnel1

ip address 192.168.10.1 255.255.255.0

tunnel source 192.168.1.1

tunnel destination 192.168.8.1

tunnel protection ipsec profile 1

!

interface Serial1/0

ip address 192.168.1.1 255.255.255.0

serial restart-delay 0

R0的路由:

Router#show ip route

C    192.168.10.0/24 is directly connected, Tunnel1

C    192.168.1.0/24 is directly connected, Serial1/0

S*   0.0.0.0/0 is directly connected, Serial1/0

===========================================================================

============================R2配置===============================

!

crypto isakmp policy 1

encr 3des

hash md5

authentication pre-share

group 2

lifetime 3600

crypto isakmp key 1234 address 192.168.1.1

!

!

crypto ipsec transform-set 1 esp-3des esp-md5-hmac

mode transport

!

crypto ipsec profile 1

set transform-set 1

set pfs group2

!

interface Tunnel1

ip address 192.168.10.2 255.255.255.0

tunnel source 192.168.8.1

tunnel destination 192.168.1.1

tunnel protection ipsec profile 1

!

interface Serial1/0

ip address 192.168.8.1 255.255.255.0

serial restart-delay 0

R2的路由:

Router#show ip route

C    192.168.8.0/24 is directly connected, Serial1/0

C    192.168.10.0/24 is directly connected, Tunnel1

S*   0.0.0.0/0 is directly connected, Serial1/0

=================================================================

看到这里,我们在R0和R2的配置中没有看到map,在接口上也没有看到map的加载,这与我们传统的ipsec的连接不一致,而且R0和R2的配置中均没有看到感兴趣流的配置,这与我们配置的传统的ipsec配置不一致。

现在来看配置,首先我们在完成一系列的ipsec配置后(第一阶段参数,预共享密钥,第二段加密测试等),按流程应该配置map并将map运用到接口上;本处就以profile来代替。“Profile”中只有两个参数“pfs”和“transport”,但并没有感兴趣流和加密接口。我们再看gre隧道的配置跟以往的配置的区别“tunnel protection ipsec profile 1”,顾名思义就是在gre隧道上配置ipsec保护,保护的具体策略就是profile1.

就因为在gre接口上我们配置了ipsec保护,我们就可以确定建立ipsec的两个站点:tunnel source和tunnel destination(就相当于在source和destination上配置了map);加密的感兴趣流就是tunnel source和tunnel destination之间的gre通信,而且仅仅是gre通信。

通过一个简单的profile,我们就完成了整个的gre overipsec,该方法目前是非常流行的一种配置,被广泛使用!

在完成配置之后,我们在R0上进行ping 192.168.10.2的操作,查看是否能够pint通,及两者之间的通信是否已经被加密。

Router#ping 192.168.10.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.10.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 16/36/96 ms

可以ping成功,我们再来看两者之间的加密:

通信已被加密,我们的gre over ipsec建立成功!

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-07-12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档