锐捷实战系列

锐捷实战系列(五十九) IPSec Over GRE点对点安全连

2018-04-24  本文已影响464人  3c21cb88ae2b

实训目的

实训背景

通过应用IPSec可以保证端对端的安全性,它可以提供主动的保护以防止专用网络与Internet的攻击,在网络传输中不易被黑客截获破解窃取,保证资料的安全保密,即直接访问资源,又能对数据传输进行加密,保证了数据的安全性。

随着物联网设备不断融入人们的日常生活,物联网设备与互联网的连接就成为不可缺少的条件。那么物联网设备接入互联网时,又如何确保网络通讯的安全呢?而早已演进成熟的IPSec(Internet Protocol Security,Internet协议安全性)就成为众多物联网设备确保网络通讯安全的选择。

IPSec有如下两个目标:

  1. 保护IP数据包的内容。
  2. 通过数据包筛选及受信任通讯的实施来防御网络攻击。

这两个目标都是通过使用基于加密的保护服务、安全协议与动态密钥管理来实现的。这个基础为专用网络计算机、域、站点、远程站点、Extranet和拨号用户之间的通信提供了既有力又灵活的保护。它甚至可以用来阻碍特定通讯类型的接收和发送。

IPSec静态隧道工作原理

IPSec VPN分为两个协商阶段,ISAKMP阶段及IPSec阶段,ISAKMP阶段主要是协商两端的保护策略,验证对等体的合法性,产生加密密钥,保护第二阶段IPSec SA的协商。第二阶段IPSec阶段,主要是确定IPSec SA的保护策略,使用AH还是ESP、传输模式还是隧道模式、被保护的数据是什么等等。第二阶段协商的目标就是产生真正用于保护IP数据的IPSec SA。IPSec通信实体双方对于一、二阶段的这些安全策略必须达成一致,否则IPSec协商将无法通过。

实训拓扑

IPSec 0ver GRE实现站点到站点的安全连接-聚星云学院

实验所需设备:

设备类型 设备型号 数量
路由器 RSR20 2
主机 Windows 10 2

实训步骤

步骤1:基本配置。

R1:

Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#hostname R1
R1(config)#

R2:

Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#hostname R2
R2(config)#

步骤2:全网基本IP地址配置。

R1(config)#interface fastEthernet 0/0
R1(config-if-FastEthernet 0/0)#ip address 192.168.3.1 255.255.255.0
R1(config-if-FastEthernet 0/0)#exit
R1(config)#interface fastEthernet 0/1
R1(config-if-FastEthernet 0/1)#ip address 192.168.1.1 255.255.255.0
R1(config-if-FastEthernet 0/1)#exit
R1(config)#
R2(config)#interface fastEthernet 0/0
R2(config-if-FastEthernet 0/0)#ip address 192.168.3.2 255.255.255.0
R2(config-if-FastEthernet 0/0)#exit
R2(config)#interface fastEthernet 0/1
R2(config-if-FastEthernet 0/1)#ip address 192.168.2.1 255.255.255.0
R2(config-if-FastEthernet 0/1)#exit
R2(config)#

PC1:

IPSec 0ver GRE实现站点到站点的安全连接-聚星云学院

PC2:

IPSec 0ver GRE实现站点到站点的安全连接-聚星云学院

步骤3:配置静态路由,使R1和R2能够相互访问。

R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.2
R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1

步骤4:在R1上配置静态IPSec VPN隧道。

1.配置IPSec感兴趣流。

R1(config)#access-list 101 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255

2.配置isakmp策略。

R1(config)#crypto isakmp keepalive 5 periodic
R1(config)#crypto isakmp policy 1
R1(isakmp-policy)#authentication pre-share
R1(isakmp-policy)#encryption 3des
R1(isakmp-policy)#exit
R1(config)#

3.配置共享密钥为:juxing。

R1(config)#crypto isakmp key 0 juxing address 192.168.3.2

4.配置IPSec加密转换集。

R1(config)#crypto IPSec transform-set myset esp-des esp-md5-hmac
R1(cfg-crypto-trans)#exit
R1(config)#

5.配置IPSec加密图。

R1(config)#crypto map mymap 5 IPSec-isakmp
R1(config-crypto-map)#set peer 192.168.3.2
R1(config-crypto-map)#set transform-set myset
R1(config-crypto-map)#match address 101
R1(config-crypto-map)#exit
R1(config)#

6.将加密应用到接口。

R1(config)#interface gigabitEthernet 0/0
R1(config-if-GigabitEthernet 0/0)#crypto map mymap
R1(config-if-GigabitEthernet 0/0)#exit
R1(config)#

步骤5:在R2上配置静态IPSec VPN隧道。

1.配置IPSec感兴趣流。

R2(config)# access-list 101 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255

2.配置isakmp策略。

R2(config)#crypto isakmp keepalive 5 periodic
R2(config)#crypto isakmp policy 1
R2(isakmp-policy)#authentication pre-share
R2(isakmp-policy)#encryption 3des
R2(isakmp-policy)#exit
R2(config)#

3.配置共享密钥。

R2(config)#crypto isakmp key 0 juxing address 192.168.3.1

4.配置IPSec加密转换集。

R2(config)#crypto IPSec transform-set myset esp-des esp-md5-hmac
R2(cfg-crypto-trans)#exit
R2(config)#

5.配置IPSec加密图。

R2(config)#crypto map mymap 5 IPSec-isakmp
R2(config-crypto-map)#set peer 192.168.3.1
R2(config-crypto-map)#set transform-set myset
R2(config-crypto-map)#match address 101
R2(config-crypto-map)#exit
R2(config)#

6.将加密应用到接口。

R2(config)#interface fastethernet 0/0
R2(config-if-FastEthernet0/0)#crypto map mymap
R2(config-if-FastEthernet 0/0)#exit
R2(config)#

步骤6:在R1上配置GRE隧道。

R1(config)#interface tunnel 1
R1(config-if-Tunnel 1)# ip address 172.16.100.1 255.255.255.0
R1(config-if-Tunnel 1)#tunnel source 192.168.3.1
R1(config-if-Tunnel 1)#tunnel destination 192.168.3.2
R1(config-if-Tunnel 1)# cryto map mymap
R1(config-if-Tunnel 1)#end
R1#

步骤7:在R2上配置GRE隧道。

R2(config)#interface tunnel 1
R2(config-if-Tunnel 1)# ip address 172.16.100.2 255.255.255.0
R2(config-if-Tunnel 1)#tunnel source 192.168.3.2
R2(config-if-Tunnel 1)#tunnel destination 192.168.3.1
R2(config-if-Tunnel 1)# cryto map mymap
R2(config-if-Tunnel 1)#end
R2#

步骤8:使用PC1 Ping PC2。

IPSec 0ver GRE实现站点到站点的安全连接-聚星云学院

步骤9:在R1上查看isakmp sa和IPSec sa是否已经协商成功。

R1#show crypto isakmp sa

我们可以看到isakmp协商成功,状态为IKE_IDLE。

IPSec 0ver GRE实现站点到站点的安全连接-聚星云学院
R1#show crypto ipsec sa
IPSec 0ver GRE实现站点到站点的安全连接-聚星云学院

步骤10:到R2查询GRE隧道状态,可以看到有数据从GRE隧道进入。

R2#show interfaces tunnel 1
IPSec 0ver GRE实现站点到站点的安全连接-聚星云学院
上一篇下一篇

猜你喜欢

热点阅读