H3C MSR系列路由器IPsec典型配置举例(V7).doc

上传人:豆**** 文档编号:33555805 上传时间:2022-08-11 格式:DOC 页数:33 大小:566.50KB
返回 下载 相关 举报
H3C MSR系列路由器IPsec典型配置举例(V7).doc_第1页
第1页 / 共33页
H3C MSR系列路由器IPsec典型配置举例(V7).doc_第2页
第2页 / 共33页
点击查看更多>>
资源描述

《H3C MSR系列路由器IPsec典型配置举例(V7).doc》由会员分享,可在线阅读,更多相关《H3C MSR系列路由器IPsec典型配置举例(V7).doc(33页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、1简介2配置前提3使用iNode客户端基于证书认证的L2TP over IPsec功能配置举例3.1组网需求3.2配置思路3.3使用版本3.4配置步骤3.4.1 Device的配置3.4.2 Host的配置3.5验证配置3.6配置文件4 IPsec over GRE的典型配置举例4.1组网需求4.2配置思路4.3使用版本4.4配置步骤4.4.1 Device A的配置4.4.2 Device B的配置4.5验证配置4.6配置文件5 GRE over IPsec的典型配置举例5.1组网需求5.2配置思路5.3使用版本5.4配置步骤5.4.1 Device A的配置5.4.2 Device B的配

2、置5.5验证配置5.6配置文件6 IPsec同流双隧道的典型配置举例6.1组网需求6.2使用版本6.3配置步骤6.3.1 Device A的配置6.3.2 Device B的配置6.4验证配置6.5配置文件7相关资料1简介本文档介绍IPsec的典型配置举例。2配置前提本文档适用于使用Comware V7软件版本的MSR系列路由器,如果使用过程中与产品实际情况有差异,请参考相关产品手册,或以设备实际情况为准。本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。本文档假设

3、您已了解IPsec特性。3使用iNode客户端基于证书认证的L2TP over IPsec功能配置举例3.1组网需求如所示,PPP用户Host与Device建立L2TP隧道,Windows server 2003作为CA服务器,要求:通过L2TP隧道访问Corporate network。用IPsec对L2TP隧道进行数据加密。采用RSA证书认证方式建立IPsec隧道。图1基于证书认证的L2TP over IPsec配置组网图3.2配置思路由于使用证书认证方式建立IPsec隧道,所以需要在ike profile中配置local-identity为dn,指定从本端证书中的主题字段取得本端身份。3

4、.3使用版本本举例是在R0106版本上进行配置和验证的。3.4配置步骤3.4.1Device的配置(1)配置各接口IP地址#配置接口GigabitEthernet2/0/1的IP地址。 system-viewDevice interface gigabitethernet 2/0/1Device-GigabitEthernet2/0/1 ip address 192.168.100.50 24Device-GigabitEthernet2/0/1 quit#配置接口GigabitEthernet2/0/2的IP地址。Device interface gigabitethernet 2/0/2D

5、evice-GigabitEthernet2/0/2 ip address 102.168.1.11 24Device-GigabitEthernet2/0/2 quit#配置接口GigabitEthernet2/0/3的IP地址。Device interface gigabitethernet 2/0/3Device-GigabitEthernet2/0/3 ip address 192.168.1.1 24Device-GigabitEthernet2/0/3 quit(2)配置L2TP#创建本地PPP用户l2tpuser,设置密码为hello。Device local-user l2tp

6、user class networkDevice-luser-network-l2tpuser password simple helloDevice-luser-network-l2tpuser service-type pppDevice-luser-network-l2tpuser quit#配置ISP域system对PPP用户采用本地验证。Device domain systemDevice-isp-system authentication ppp localDevice-isp-system quit#启用L2TP服务。Device l2tp enable#创建接口Virtual-

7、Template0,配置接口的IP地址为172.16.0.1/24。Device interface virtual-template 0Device-Virtual-Template0 ip address 172.16.0.1 255.255.255.0#配置PPP认证方式为PAP。Device-Virtual-Template0 ppp authentication-mode pap#配置为PPP用户分配的IP地址为172.16.0.2。Device-Virtual-Template0 remote address 172.16.0.2Device-Virtual-Template0 q

8、uit#创建LNS模式的L2TP组1。Device l2tp-group 1 mode lns#配置LNS侧本端名称为lns。Device-l2tp1 tunnel name lns#关闭L2TP隧道验证功能。Device-l2tp1 undo tunnel authentication#指定接收呼叫的虚拟模板接口为VT0。Device-l2tp1 allow l2tp virtual-template 0Device-l2tp1 quit(3)配置PKI证书#配置PKI实体security。Device pki entity securityDevice-pki-entity-securit

9、y common-name deviceDevice-pki-entity-security quit#新建PKI域。Device pki domain headgateDevice-pki-domain-headgate ca identifier LYQDevice-pki-domain-headgate certificate request url http:/192.168.1.51/certsrv/mscep/mscep.dllDevice-pki-domain-headgate certificate request from raDevice-pki-domain-headga

10、te certificate request entity securityDevice-pki-domain-headgate undo crl check enableDevice-pki-domain-headgatepublic-key rsa general name abc length 1024Device-pki-domain-headgate quit#生成RSA算法的本地密钥对。Device public-key local create rsa name abcThe range of public key modulus is (512 2048).If the key

11、 modulus is greater than 512,it will take a few minutes.Press CTRL+C to abort.Input the modulus length default = 1024:Generating Keys.+.+Create the key pair successfully.#获取CA证书并下载至本地。Device pki retrieve-certificate domain headgate caThe trusted CAs finger print is: MD5 fingerprint:8649 7A4B EAD5 42

12、CF 5031 4C99 BFS3 2A99 SHA1 fingerprint:61A9 6034 181E 6502 12FA 5A5F BA12 0EA0 5187 031CIs the finger print correct?(Y/N):yRetrieved the certificates successfully.#手工申请本地证书。Device pki request-certificate domain headgateStart to request general certificate .Certificate requested successfully.(4)配置IP

13、sec隧道#创建IKE安全提议。Device ike proposal 1Device-ike-proposal-1 authentication-method rsa-signatureDevice-ike-proposal-1 encryption-algorithm 3des-cbcDevice-ike-proposal-1 dh group2Device-ike-proposal-1 quit#配置IPsec安全提议。Device ipsec transform-set tran1Device-ipsec-transform-set-tran1 esp authentication-a

14、lgorithm sha1Device-ipsec-transform-set-tran1 esp encryption-algorithm 3desDevice-ipsec-transform-set-tran1 quit#配置IKE profile。Device ike profile profile1Device-ike-profile-profile1 local-identity dnDevice-ike-profile-profile1 certificate domain headgateDevice-ike-profile-profile1 proposal 1Device-i

15、ke-profile-profile1 match remote certificate deviceDevice-ike-profile-profile1 quit#在采用数字签名认证时,指定总从本端证书中的主题字段取得本端身份。Deviceike signature-identity from-certificate#创建一条IPsec安全策略模板,名称为template1,序列号为1。Deviceipsec policy-template template1 1Device-ipsec-policy-template-template1-1 transform-set tran1Devi

16、ce-ipsec-policy-template-template1-1 ike-profile profile1Device-ipsec-policy-template-template1-1 quit#引用IPsec安全策略模板创建一条IPsec安全策略,名称为policy1,顺序号为1。Device ipsec policy policy1 1 isakmp template template1#在接口上应用IPsec安全策略。Device interface gigabitethernet 2/0/2Device-GigabitEthernet2/0/2 ipsec apply pol

17、icy policy1Device-GigabitEthernet2/0/2 quit3.4.2Host的配置(1)从证书服务器上申请客户端证书#登录到证书服务器:http:/192.168.1.51/certsrv,点击“申请一个证书”。图1进入申请证书页面#点击“高级证书申请”。图2高级证书申请#选择第一项:创建并向此CA提交一个申请。图3创建并向CA提交一个申请#填写相关信息。需要的证书类型,选择“客户端身份验证证书”;密钥选项的配置,勾选“标记密钥为可导出”前的复选框。#点击,弹出一提示框:在对话框中选择“是”。#点击安装此证书。图4安装证书(2)iNode客户端的配置(使用iNode

18、版本为:iNode PC 5.2(E0409))#打开L2TP VPN连接,并单击“属性(Y)”。图5打开L2TP连接#输入LNS服务器的地址,并启用IPsec安全协议,验证证方法选择证书认证。图6基本配置#单击按钮,进入“L2TP设置”页签,设置L2TP参数如下图所示。图7L2TP设置#单击“IPsec设置”页签,配置IPsec参数。图8IPsec参数设置#单击“IKE设置”页签,配置IKE参数。图9IKE参数设置#单击“路由设置”页签,添加访问Corporate network的路由。图10路由设置#完成上述配置后,单击按钮,回到L2TP连接页面。3.5验证配置#在L2TP连接对话框中,输

19、入用户名“l2tpuser”和密码“hello”,单击按钮。图11连接L2TP#在弹出的对话框中选择申请好的证书,单击按钮。图12证书选择#通过下图可以看到L2TP连接成功。图13连接成功图14连接成功#在Device上使用display ike sa命令,可以看到IPsec隧道第一阶段的SA正常建立。 display ike sa Connection-ID Remote Flag DOI- 10 102.168.1.1 RD IPSECFlags:RD-READY RL-REPLACED FD-FADING#在Device上使用display ipsec sa命令可以看到IPsec SA的

20、建立情况。 display ipsec sa-Interface: GigabitEthernet2/0/2- - IPsec policy: policy1 Sequence number: 1 Mode: template - Tunnel id: 0 Encapsulation mode: tunnel Perfect forward secrecy: Path MTU: 1443 Tunnel: local address: 102.168.1.11 remote address: 102.168.1.1 Flow: sour addr: 102.168.1.11/255.255.25

21、5.255 port: 1701 protocol: udp dest addr: 102.168.1.1/255.255.255.255 port: 0 protocol: udp Inbound ESP SAs SPI: 2187699078 (0x8265a386) Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-SHA1 SA duration (kilobytes/sec): 1843200/3600 SA remaining duration (kilobytes/sec): 1843197/3294 Max received sequen

22、ce-number: 51 Anti-replay check enable: Y Anti-replay window size: 64 UDP encapsulation used for NAT traversal: N Status: Active Outbound ESP SAs SPI: 3433374591 (0xcca5237f) Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-SHA1 SA duration (kilobytes/sec): 1843200/3600 SA remaining duration (kilobytes/

23、sec): 1843197/3294 Max sent sequence-number: 52 UDP encapsulation used for NAT traversal: N Status: Active3.6配置文件#interface Virtual-Template0ppp authentication-mode papremote address 172.16.0.2ip address 172.16.0.1 255.255.255.0#interface GigabitEthernet2/0/1ip address 192.168.100.50 255.255.255.0#i

24、nterface GigabitEthernet2/0/2ip address 102.168.1.11 255.255.255.0ipsec apply policy policy1#interface GigabitEthernet2/0/3ip address 192.168.1.1 255.255.255.0#domain systemauthentication ppp local#local-user l2tpuser class networkpassword cipher $c$3$nl46fURLtkCkcbdnB6irTXma+E6u0c+hservice-type ppp

25、authorization-attribute user-role network-operator#pki domain headgateca identifier LYQcertificate request url http:/192.168.1.51/certsrv/mscep/mscep.dllcertificate request from racertificate request entity securitypublic-key rsa general name abcundo crl check enable#pki entity securitycommon-name h

26、ost#ipsec transform-set tran1esp encryption-algorithm 3des-cbcesp authentication-algorithm sha1#ipsec policy-template template1 1transform-set tran1ike-profile profile1#ipsec policy policy1 1 isakmp template template1#l2tp-group 1 mode lnsallow l2tp virtual-template 0undo tunnel authenticationtunnel

27、 name lns#l2tp enable#ike signature-identity from-certificate#ike profile profile1certificate domain headgatelocal-identity dnmatch remote certificate deviceproposal 1#ike proposal 1authentication-method rsa-signatureencryption-algorithm 3des-cbcdh group2#4IPsec over GRE的典型配置举例4.1组网需求如所示,企业远程办公网络通过I

28、Psec VPN接入企业总部,要求:通过GRE隧道传输两网络之间的IPsec加密数据。图15IPsec over GRE组网图4.2配置思路为了对数据先进行IPsec处理,再进行GRE封装,访问控制列表需匹配数据的原始范围,并且要将IPsec应用到GRE隧道接口上。为了对网络间传输的数据先进行IPsec封装,再进行GRE封装,需要配置IPsec隧道的对端IP地址为GRE隧道的接口地址。4.3使用版本本举例是在R0106版本上进行配置和验证的。4.4配置步骤4.4.1Device A的配置(1)配置各接口IP地址#配置接口GigabitEthernet2/0/1的IP地址。 system-vie

29、wDeviceA interface gigabitethernet 2/0/1DeviceA-GigabitEthernet2/0/1 ip address 192.168.1.1 255.255.255.0DeviceA-GigabitEthernet2/0/1 tcp mss 1350DeviceA-GigabitEthernet2/0/1 quit#配置接口GigabitEthernet2/0/2的IP地址。DeviceA interface gigabitethernet 2/0/2DeviceA-GigabitEthernet2/0/2 ip address 202.115.22.

30、48 255.255.255.0DeviceA-GigabitEthernet2/0/2 quit(2)配置GRE隧道#创建Tunnel0接口,并指定隧道模式为GRE over IPv4隧道。DeviceA interface tunnel 0 mode gre#配置Tunnel0接口的IP地址为10.1.1.1/24。DeviceA-Tunnel0 ip address 10.1.1.1 255.255.255.0#配置Tunnel0接口的源端地址为202.115.22.48/24(Device A的GigabitEthernet2/0/2的IP地址)。DeviceA-Tunnel0 sou

31、rce 202.115.22.48#配置Tunnel0接口的目的端地址为202.115.24.50/24(Device B的GigabitEthernet2/0/2的IP地址)。DeviceA-Tunnel0 destination 202.115.24.50DeviceA-Tunnel0 quit#配置从Device A经过Tunnel0接口到Remote office network的静态路由。DeviceA ip route-static 192.168.2.1 255.255.255.0 tunnel 0(3)配置IPsec VPN#配置IKE keychain。DeviceA ike

32、 keychain keychain1DeviceA-ike-keychain-keychain1 pre-shared-key address 10.1.1.2 255.255.255.0 key simple 123DeviceA-ike-keychain-keychain1 quit#创建ACL3000,定义需要IPsec保护的数据流。DeviceA acl number 3000DeviceA-acl-adv-3000 rule 0 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255Devic

33、eA-acl-adv-3000 quit#配置IPsec安全提议。DeviceA ipsec transform-set tran1DeviceA-ipsec-transform-set-tran1 esp encryption-algorithm desDeviceA-ipsec-transform-set-tran1 esp authentication-algorithm sha1DeviceA-ipsec-transform-set-tran1 quit#创建一条IKE协商方式的IPsec安全策略,名称为policy1,序列号为1。DeviceA ipsec policy policy

34、1 1 isakmpDeviceA-ipsec-policy-isakmp-policy1-1 security acl 3000DeviceA-ipsec-policy-isakmp-policy1-1 remote-address 10.1.1.2DeviceA-ipsec-policy-isakmp-policy1-1 transform-set tran1DeviceA-ipsec-policy-isakmp-policy1-1 quit#在GRE隧道接口上应用安全策略。DeviceA interface tunnel 0DeviceA-Tunnel0 ipsec apply poli

35、cy policy1DeviceA-Tunnel0 quit4.4.2Device B的配置(1)配置各接口IP地址#配置接口GigabitEthernet2/0/1的IP地址。 system-viewDeviceB interface gigabitethernet 2/0/1DeviceB-GigabitEthernet2/0/1 ip address 192.168.2.1 255.255.255.0DeviceB-GigabitEthernet2/0/1 tcp mss 1350DeviceB-GigabitEthernet2/0/1 quit#配置接口GigabitEthernet2

36、/0/2的IP地址。DeviceB interface gigabitethernet 2/0/2DeviceB-GigabitEthernet2/0/2 ip address 202.115.24.50 255.255.255.0DeviceB-GigabitEthernet2/0/2 quit(2)配置GRE隧道#创建Tunnel0接口,并指定隧道模式为GRE over IPv4隧道。DeviceB interface tunnel 0 mode gre#配置Tunnel0接口的IP地址为10.1.1.2/24。DeviceB-Tunnel0 ip address 10.1.1.2 255

37、.255.255.0#配置Tunnel0接口的源端地址为202.115.24.50/24(Device B的GigabitEthernet2/0/2的IP地址)。DeviceB-Tunnel0 source 202.115.24.50#配置Tunnel0接口的目的端地址为202.115.22.48/24(Device A的GigabitEthernet2/0/2的IP地址)。DeviceB-Tunnel0 destination 202.115.22.48DeviceB-Tunnel0 quit#配置从DeviceB经过Tunnel0接口到Corporate network的静态路由。Devi

38、ceB ip route-static 192.168.1.1 255.255.255.0 tunnel 0(3)配置IPsec VPN#配置IKE keychain。DeviceB ike keychain keychain1DeviceB-ike-keychain-keychain1 pre-shared-key address 10.1.1.1 255.255.255.0 key simple 123DeviceB-ike-keychain-keychain1 quit#创建ACL3000,定义需要IPsec保护的数据流。DeviceB acl number 3000DeviceB-ac

39、l-adv-3000 rule 0 permit ip source 192.168.2.0 0.0.0.255 destination 192.168.1.0 0.0.0.255DeviceB-acl-adv-3000 quit#配置IPsec安全提议。DeviceB ipsec transform-set tran1DeviceB-ipsec-transform-set-tran1 esp encryption-algorithm desDeviceB-ipsec-transform-set-tran1 esp authentication-algorithm sha1DeviceB-ip

40、sec-transform-set-tran1 quit#创建一条IKE协商方式的IPsec安全策略,名称为policy1,序列号为1。DeviceB ipsec policy policy1 1 isakmpDeviceB-ipsec-policy-isakmp-policy1-1 security acl 3000DeviceB-ipsec-policy-isakmp-policy1-1 remote-address 10.1.1.1DeviceB-ipsec-policy-isakmp-policy1-1 transform-set tran1DeviceB-ipsec-policy-i

41、sakmp-policy1-1 quit#在GRE隧道接口上应用安全策略。DeviceB interface tunnel 0DeviceB-Tunnel0 ipsec apply policy policy1DeviceB-Tunnel0 quit4.5验证配置#以Corporate network的主机192.168.1.2向Remote office network的主机192.168.2.2发起通信为例,从192.168.1.2 ping 192.168.2.2,会触发IPsec协商,建立IPsec隧道,在成功建立IPsec隧道后,可以ping通。C:Userscorporatenet

42、work ping 192.168.2.2Pinging 192.168.2.2 with 32 bytes of data:Request timed out.Reply from 192.168.2.2: bytes=32 time=2ms TTL=254Reply from 192.168.2.2: bytes=32 time=2ms TTL=254Reply from 192.168.2.2: bytes=32 time=1ms TTL=254Ping statistics for 192.168.2.2: Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),Approximate round trip times in milli-seconds:Minimum = 1ms, Maximum = 2ms, Average = 1ms#在Device A上使用display ike sa命令,可以看到第一阶段的SA正常建立。 display ike sa Connection-ID Remote Flag DOI- 1 10.1.1.2 RD IPSECFlags:

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com