通过IKE协商方式建立IPSec隧道示例

通过IKE协商方式建立IPSec隧道示例

一、组网需求

如图所示,HX为企业分支网关,GY为企业总部网关,分支与总部通过公网建立通信。分支子网为10.1.2.0/24,总部子网为10.1.1.0/24。GY和HX两个站点用户均可以正常访问互联网2.2.2.2。

企业希望对分支子网与总部子网之间相互访问的流量进行安全保护。分支与总部通过公网建立通信,可以在分支网关与总部网关之间建立一个IPSec隧道来实施安全保护。

 

二、操作步骤

采用如下步骤配置采用IKE协商方式建立IPSec隧道:

1、分别在GY和HX上配置接口的IP地址和默认路由

2、分别在GY和HX上配置ACL,定义各自要保护的数据流

3、分别在GY和HX上创建IPSec安全提议,定义IPSec的保护方法。

4、分别在GY和HX上上配置IKE对等体,定义对等体间IKE协商时的属性。

5、创建安全策略,并引用ACL、IPSec安全提议和IKE对等体,确定对何种数据流采取何种保护方法。

6、分别在GY和HX的接口上应用各自的安全策略组,使接口具有IPSec的保护功能。

三、配置文件

1、GY相关配置文件

#
acl number 3101  
 rule 5 permit ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255 
acl number 3102  
 rule 10 deny ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255 
 rule 20 permit ip 
#
ipsec proposal tran1
 esp authentication-algorithm sha2-256 
 esp encryption-algorithm aes-128
#
ike proposal 5
 encryption-algorithm aes-cbc-128
 dh group14
 authentication-algorithm md5
#
ike peer spub v1
 pre-shared-key cipher %$%$HqV9'^.AY<;@@wEMv,CQ,.2n%$%$
 ike-proposal 5
 local-address 100.1.1.1
 remote-address 200.1.1.1
#
ipsec policy map1 10 isakmp
 security acl 3101
 ike-peer spub
 proposal tran1
#
interface GigabitEthernet0/0/0
 ip address 10.1.1.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 100.1.1.1 255.255.255.252 
 ipsec policy map1
 nat outbound 3102
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 100.1.1.2

2、HX相关配置文件

#
acl number 3101  
 rule 5 permit ip source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255 
#
ipsec proposal tran1
 esp authentication-algorithm sha2-256 
 esp encryption-algorithm aes-128
#
ike proposal 5
 encryption-algorithm aes-cbc-128
 dh group14
 authentication-algorithm md5
#
ike peer spua v1
 pre-shared-key cipher %$%$HqV9'^.AY<;@@wEMv,CQ,.2n%$%$
 ike-proposal 5
 local-address 200.1.1.1
 remote-address 100.1.1.1
#
ipsec policy use1 10 isakmp
 security acl 3101
 ike-peer spua
 proposal tran1
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 10.1.2.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 200.1.1.1 255.255.255.252 
 ipsec policy use1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 200.1.1.2

 

posted @ 2024-04-12 17:08  dachenyi  阅读(40)  评论(0编辑  收藏  举报