600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > HCIE-Security Day28:IPSec:实验(三)总部采用ISAKMP方式安全策略组与分支机构之间建立IPSec PN

HCIE-Security Day28:IPSec:实验(三)总部采用ISAKMP方式安全策略组与分支机构之间建立IPSec PN

时间:2019-04-27 02:49:39

相关推荐

HCIE-Security Day28:IPSec:实验(三)总部采用ISAKMP方式安全策略组与分支机构之间建立IPSec PN

ISAKMP方式IPSec安全策略适用于对端IP地址固定的场景,一般用于分支的配置

ISAKMP方式IPSec安全策略直接在IPSec安全策略视图中定义需要协商的各参数,协商发起方和响应方参数必须配置相同。配置了ISAKMP方式IPSec安全策略的一端可以主动发起协商。

如果说isakmp方式中ike的协商过程让我们感觉到采用手工配置的方法更简单,更好理解ipsec,那么我们使用总部分支的结构来理解isakmp的方式,就会发现比手工方式还是简单一些的。

需求和拓扑

某企业分为总部和两个分支机构。组网如下:

分支机构1和分支机构2分别通过FW_B和FW_C与Internet相连。

FW_A和FW_B、FW_A和FW_C相互路由可达。

总部FW_A、分支FW_B和FW_C为固定公网地址。

要求实现如下需求:

分支机构PC2、PC3能与总部PC1之间进行安全通信。FW_A、FW_B以及FW_A、FW_C之间分别建立IPSec隧道。FW_B、FW_C不建立IPSec隧道。

操作步骤

1、配置接口地址和安全区域

2、配置公网路由可达

3、配置安全策略全通(暂时)

4、配置ipsec策略

4.1、定义被保护的数据流

//f1acl number 3000rule 5 permit ip source 10.1.1.0 0.0.0.255 destination 10.1.2.0 0.0.0.255acl number 3001rule 5 permit ip source 10.1.1.0 0.0.0.255 destination 10.1.3.0 0.0.0.255//f2acl number 3000rule 5 permit ip source 10.1.2.0 0.0.0.255 destination 10.1.1.0 0.0.0.255//f3acl number 3000rule 5 permit ip source 10.1.3.0 0.0.0.255 destination 10.1.1.0 0.0.0.255

4.2、配置ipsec安全提议

//f1f2f3ipsec proposal tran1esp authentication-algorithm sha2-256esp encryption-algorithm aes-256

4.3、配置ike安全提议

//f1f2f3ike proposal 10encryption-algorithm aes-256dh group14authentication-algorithm sha2-256authentication-method pre-shareintegrity-algorithm hmac-sha2-256prf hmac-sha2-256

4.4、配置ike peer

要求对端公网地址是确定的,否则无法配置ike peer

//f1ike peer bpre-shared-key Test!1234ike-proposal 10remote-address 1.1.5.1ike peer cpre-shared-key Test!1234ike-proposal 10remote-address 1.1.6.254//f2f3ike peer apre-shared-key Test!1234ike-proposal 10remote-address 1.1.3.1

4.5、配置ipsec策略组(f1包含两个安全策略,f2f3各一个)

//f1ipsec policy map1 9 isakmpsecurity acl 3001ike-peer cproposal tran1ipsec policy map1 10 isakmpsecurity acl 3000ike-peer bproposal tran1//f2f3ipsec policy map1 10 isakmpsecurity acl 3000ike-peer aproposal tran1

4.6、接口下应用ipsec

//f1f2f3interface GigabitEthernet1/0/1ipsec policy map1

验证和分析

1、配置完成后,r1分别和r3、r5互访,但是r3和r5是无法访问的。

2、访问后,检查f1的ike sa

有两对ike sa。

f2和f3上分别只有一对ike sa

3、检查ipsec sa的建立情况

可以看到spi是分别对应的,同时可以了解到通过源目地址、spi、协议可以确定一个sa的问题。

4、在公网上,如果我们采用了tunnel模式,那么源目地址是隧道地址,即pn设备的对外公网接口地址(我们是这么配置的,也可以采用loopback接口做隧道地址)

下面是一次ping过程产生的icmp包在公网上传输的抓包情况。

这里我们再一次理解一下sa的三元组,隧道源目地址、协议类型、spi值。在公网上,就只能通过这三个要素来区分报文流。

5、ipsec隧道的建立过程,我们也抓包看一下。

6、如果采用手工配置

牢记:镜像出入、多流互异、进制有别、源目地址。

//f1ipsec policy map1 10 manualsecurity acl 3000proposal tran1tunnel local 1.1.3.1//配置ipsec隧道的起点和终点tunnel remote 1.1.5.1sa spi inbound esp 12345678sa string-key inbound esp abcdefgsa spi outbound esp 87654321sa string-key outbound esp gfedcbaipsec policy map1 9 manualsecurity acl 3001proposal tran1tunnel local 1.1.3.1//配置ipsec隧道的起点和终点tunnel remote 1.1.6.1sa spi inbound esp 23456789//不同数据流间互不相同,spi是区分sa的要素之一sa string-key inbound esp abcdefg//可以相同,但是相同存在隐患sa spi outbound esp 98765432sa string-key outbound esp gfedcba//f2ipsec policy map1 10 manualsecurity acl 3000proposal tran1tunnel local 1.1.5.1tunnel remote 1.1.3.1sa spi inbound esp 87654321//inbound和outbound镜像对应sa string-key inbound esp gfedcba//inbound和outbound镜像对应sa spi outbound esp 12345678//inbound和outbound镜像对应sa string-key outbound esp abcdefg//inbound和outbound镜像对应//f3ipsec policy map1 10 manualsecurity acl 3000proposal tran1tunnel local 1.1.6.1tunnel remote 1.1.3.1sa spi inbound esp 98765432//inbound和outbound镜像对应sa string-key inbound esp gfedcba//inbound和outbound镜像对应sa spi outbound esp 23456789//inbound和outbound镜像对应sa string-key outbound esp abcdefg//inbound和outbound镜像对应

这只是两个分支的情况,如果分支更多,作为总部的配置,光spi的区分就是一件大工程了。还是交给ike来协商更加方便。只需要配置了ike peer,再配置ipsec policy中引用感兴趣流、安全提议、ike peer就可以了,不用再考虑什么spi的镜像出入和多流互异。统统交给ike。而且ike peer的配置只需要配置预共享密钥就可,定义一下目的隧道地址,引用ike的安全提议就可以,相对简单了很多。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。