H3C V7 ipsec配置
- 格式:docx
- 大小:95.82 KB
- 文档页数:3
H3C配置IPSEC教程实例介绍作为不同网络之间互相连接的枢纽,路由器系统构成了基于TCP/IP 的国际互联网络Internet 的主体脉络,也可以说,路由器构成了Internet的骨架。
这篇文章主要介绍了H3C配置IPSEC VPN教程实例(图文),需要的朋友可以参考下方法步骤H3C配置IPSEC VPN思路跟思科差不多,无非就是命令不一样的,下面就演示一下拓扑:RT1背后有个1.1.1.1网段,RT3背后有个3.3.3.3网段,ISP没有这两条路由RT2:system-viewSystem View: return to User View with Ctrl+Z.[RT2]int g0/0/0[RT2-GigabitEthernet0/0/0]ip add 12.1.1.2 24[RT2-GigabitEthernet0/0/0]quit[RT2]int g0/0/1[RT2-GigabitEthernet0/0/1]ip add 23.1.1.2 24[RT2-GigabitEthernet0/0/1]quitRT1:acl number 3000rule 0 permit ip source 1.1.1.0 0.0.0.255 destination 3.3.3.0 0.0.0.255ike proposal 1encryption-algorithm 3des-cbcauthentication-algorithm md5authentication-metod pre-sharedh group2ike peer ciscoid-type ippre-shared-key simple ciscoremote-address 23.1.1.3local-address 12.1.1.1#ipsec proposal ciscotransform espesp authentication-algorithm md5esp encryption-algorithm 3desipsec policy cisco 10 isakmpsecurity acl 3000ike-peer ciscoproposal ciscoint g0/0/0ipsec policy ciscoip route-static 0.0.0.0 0.0.0.0 12.1.1.2RT3:acl number 3000rule 0 permit ip source 3.3.3.0 0.0.0.255 destination 1.1.1.0 0.0.0.255ike proposal 1encryption-algorithm 3des-cbcauthentication-algorithm md5authentication-metod pre-sharedh group2ike peer ciscoid-type ippre-shared-key simple ciscoremote-address 12.1.1.1local-address 23.1.1.3#ipsec proposal ciscotransform espesp authentication-algorithm md5esp encryption-algorithm 3desipsec policy cisco 10 isakmpsecurity acl 3000ike-peer ciscoproposal ciscoint g0/0/1ipsec policy ciscoip route-static 0.0.0.0 0.0.0.0 23.1.1.2相关阅读:路由器安全特性关键点由于路由器是网络中比较关键的设备,针对网络存在的各种安全隐患,路由器必须具有如下的安全特性:(1)可靠性与线路安全可靠性要求是针对故障恢复和负载能力而提出来的。
Ipsec over gre配置RT1和RT3用环回口来模拟私网上的接口。
它们的封装方式是先封装ipsec,然后在进行gre的封装,所以在ipsec的ACL中要匹配的事两端私网的地址。
报文的封装格式:指定Tunnel口源接口地址[H3C-Tunnel0]source 10.1.1.1指定Tunnel口目的端地址[H3C-Tunnel0]destination 20.1.1.2[H3C-Tunnel0] quit创建访问控制列表[H3C]acl advanced 3000[H3C-acl-ipv4-adv-3000]rule 0 permit ip source 192.168.1.1 0.0.0.0 destination 1 92.168.2.1 0.0.0.0[H3C-acl-ipv4-adv-3000]quit创建ipsec安全提议tran1[H3C]ipsec transform-set tran1指定安全协议的工作模式为隧道模式[H3C]ike profile profile1绑定ike keychain[H3C-ike-profile-profile1]keychain ike1配置本地封装的IP地址[H3C-ike-profile-profile1]local-identity address 100.1.1.1配置对端封装的IP地址[H3C-ike-profile-profile1]match remote identity address 100.1.1.2 24 [H3C-ike-profile-profile1]quit创建一条ike协商方式的ipsec安全策略,序列号为1,名字为policy1 [H3C]ipsec policy policy1 1 isakmp指定引用ACL3000[H3C-ipsec-policy-isakmp-policy1-1]security acl 3000[H3C-rip-1]network 10.1.1.1RT2的主要配置:<H3C>system-view[H3C]interface GigabitEthernet 0/0[H3C-GigabitEthernet0/0]ip address 10.1.1.2 24[H3C-GigabitEthernet0/0]quit[H3C]interface GigabitEthernet 0/1[H3C-GigabitEthernet0/1] ip address 20.1.1.1 24 [H3C-GigabitEthernet0/1]quit配置rip路由协议[H3C]rip[H3C-rip-1]version 2[H3C-rip-1]undo summary[H3C-rip-1]network 10.1.1.2指定Tunnel口源接口地址[H3C-Tunnel0]source 20.1.1.2指定Tunnel口目的端地址[H3C-Tunnel0]destination 10.1.1.1[H3C-Tunnel0] quit创建访问控制列表[H3C]acl advanced 3000[H3C-acl-ipv4-adv-3000]rule 0 permit ip source 192.168.2.1 0.0.0.0 destination 192.168.1.1 0.0.0.0[H3C-acl-ipv4-adv-3000]quit创建ipsec安全提议tran1[H3C]ipsec transform-set tran1指定安全协议的工作模式为隧道模式[H3C]ike profile profile1绑定ike keychain[H3C-ike-profile-profile1]keychain ike1配置本地封装的IP地址[H3C-ike-profile-profile1]local-identity address 100.1.1.2配置对端封装的IP地址[H3C-ike-profile-profile1]match remote identity address 100.1.1.1 24[H3C-ike-profile-profile1]quit创建一条ike协商方式的ipsec安全策略,序列号为1,名字为policy1[H3C]ipsec policy policy1 1 isakmp指定引用ACL3000[H3C-ipsec-policy-isakmp-policy1-1]security acl 3000[H3C-rip-1]network 20.1.1.2测试从RT1的环回口来ping RT3的环回口[H3C]ping -a 192.168.1.1 192.168.2.1Ping 192.168.2.1 (192.168.2.1) from 192.168.1.1: 56 data bytes, press CTRL_C to breakRequest time out56 bytes from 192.168.2.1: icmp_seq=1 ttl=255 time=2.000 ms56 bytes from 192.168.2.1: icmp_seq=2 ttl=255 time=2.000 ms 56 bytes from 192.168.2.1: icmp_seq=3 ttl=255 time=2.000 ms 56 bytes from 192.168.2.1: icmp_seq=4 ttl=255 time=1.000 ms 说明VPN建立成功。
H3C华为-IPsecVPN配置教程H3C&华为-IPsecVPN配置教程第⼀篇:⽹关对⽹关IPSec-VPN⼀、H3C路由1、型号:MER5200;软件版本: version 7.1.064, Release 0809P07;固定外⽹IP;2、添加静态路由添加⾄对端公⽹和对端私⽹路由两条,如下图:3、创建IPsecVPN3.1 “虚拟专⽹”---“IPsecVPN”---新建-如下图:3.2 名称----⾃⾏编辑;接⼝---选择外⽹出⼝,组⽹⽅式---分⽀节点;对端⽹关---对端外⽹IP;认证⽅式---预共享密钥;预共享密钥要与对端路由⼀致;3.3 保护流配置H3C路由器下有个内⽹段需要与对端通信,就添加⼏个。
本例172.16.10.0/24与10.10.11.0/24为本地内⽹,172.24.0.0/24为对端内⽹。
注:H3C设备不需要单独再做NAT配置。
4、显⽰⾼级配置4.1 ike配置:主模式、本地外⽹、对端外⽹,关闭对等体检测,算法组推荐。
如下图:4.2 IPsec配置:按照默认配置即可。
5、监控信息待对端华为路由配置完成且正确后,监控会显⽰如下信息。
6、命令⾏检查[H3C]dis acl allDis ike saDis ipsec sa⼆、华为路由1、型号:AR1220-S,软件版本:[V200R007C00SPC900],固定外⽹IP。
2、添加静态路由添加⾄对端公⽹和对端私⽹路由两条,如下图:2、配置⾼级ACL2.1 新建“nonat”,添加⽬的地址10.10.11.0/24,172.16.10.0/24不做NAT转换两条,其他允许NAT转换;如下图2.2 新建“nj-g”,i添加本地内⽹172.24.0.0/24⾄⽬的内⽹10.10.11.0/24,172.16.10.0/24的acl,此路由⾛IPsec。
如下图2.3 创建“⽣效时间”3、NAT应⽤⾼级acl“ip业务”--“NAT”---“外⽹访问”---编辑----ACL名称选择“nonat”。
7 相关资料1 简介本文档介绍IPsec的典型配置举例。
2 配置前提本文档适用于使用Comware V7软件版本的MSR系列路由器,如果使用过程中与产品实际情况有差异,请参考相关产品手册,或以设备实际情况为准。
本文档中的配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。
如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下举例中的配置不冲突。
本文档假设您已了解IPsec特性。
3 使用iNode客户端基于证书认证的L2TP over IPsec功能配置举例3.1 组网需求如图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.3 使用版本本举例是在R0106版本上进行配置和验证的。
3.4 配置步骤3.4.1 Device的配置(1) 配置各接口IP地址# 配置接口GigabitEthernet2/0/1的IP地址。
<Device> system-view[Device] interface gigabitethernet 2/0/1[Device-GigabitEthernet2/0/1] ip address 192.168.100.50 24[Device-GigabitEthernet2/0/1] quit# 配置接口GigabitEthernet2/0/2的IP地址。
[Device] interface gigabitethernet 2/0/2[Device-GigabitEthernet2/0/2] ip address 102.168.1.11 24[Device-GigabitEthernet2/0/2] quit# 配置接口GigabitEthernet2/0/3的IP地址。
配置路由器:如图配置各个接口IP地址,具体略基本配置B(isakmp):IPSEC自动协商#RTA的配置#进入系统视图<RouteA>system-view#创建访问控制列表,定义由子网20.x.x.x去子网30.x.x.x的数据流[RouteA]acl number 3000[RouteA-acl-adv-3000]rule permit ip source 20.0.0.0 0.255.255.255 destination 30.0.0.00.255.255.255[H3C-acl-adv-3000]quit# 创IPsec建安全提议tran1。
[RouterA] ipsec transform-set tran1# 配置安全协议对IP报文的封装形式为隧道模式。
[RouterA-ipsec-transform-set-tran1] encapsulation-mode tunnel# 配置采用的安全协议为ESP。
[RouterA-ipsec-transform-set-tran1] protocol esp# 配置ESP协议采用的加密算法为DES,认证算法为HMAC-SHA1。
[RouterA-ipsec-transform-set-tran1] esp encryption-algorithm des-cbc[RouterA-ipsec-transform-set-tran1] esp authentication-algorithm sha1[RouterA-ipsec-transform-set-tran1] quit# 创建并配置IKE keychain,名称为keychain1。
[RouterA] ike keychain keychain1# 配置与IP地址为2.2.3.1的对端使用的预共享密钥为明文abcd。
[RouterA-ike-keychain-keychain1] pre-share-key address 10.1.1.2 255.255.255.0 key simple abcd [RouterA-ike-keychain-keychain1] quit# 创建并配置IKE profile,名称为profile1。
IPSEC野蛮模式跨越NAT的实验报告(v7)实验组网:实验需求:总部和分部通过ipsec VPN连接,现在分部通过nat上网,要求总部和分部还能建立VPN连接。
实验配置:Msr1上的配置:interface LoopBack0 写loopback地址做模拟内网ip address 192.168.0.1 255.255.255.0#interface GigabitEthernet0/0port link-mode routecombo enable copperip address 1.1.1.1 255.255.255.0 设置公网口的地址为1.1.1.1ipsec apply policy 1 将ipsec应用在出口上#ip route-static 0.0.0.0 0 1.1.1.2 到外网的路由#acl advanced 3000rule 0 permit ip source 192.168.0.0 0.0.0.255 destination 192.168.1.0 0.0.0.255# 感兴趣流匹配192.168.0.0到192.168.1.0ipsec transform-set liuesp encryption-algorithm 3des-cbc 创建安全提议esp authentication-algorithm md5#ipsec policy 1 1 isakmp 创建安全策略transform-set liu 绑定安全提议security acl 3000 绑定兴趣流remote-address 2.2.2.2 设置对端的地址ike-profile 1 引用profile#ike profile 1 配置profilekeychain 1exchange-mode aggressive 选择模式为野蛮模式local-identity fqdn rt1 定义本段的名字#ike keychain 1pre-shared-key address 2.2.2.2 255.255.255.0 key cipher$c$3$Qe9XOAQz1WG1gqfgpF2vhoMwNfA/Sw==MSR2上的配置:interface GigabitEthernet0/0port link-mode routecombo enable copperip address 1.1.1.2 255.255.255.0#interface GigabitEthernet0/1 在0/1口上设置NATport link-mode routecombo enable copperip address 2.2.2.1 255.255.255.0nat outboundMSR3上的配置:interface LoopBack0ip address 192.168.1.1 255.255.255.0 起loopback口模拟内网的地址#interface GigabitEthernet0/0port link-mode routecombo enable copperip address 2.2.2.2 255.255.255.0 在外网口上配置IP地址应用ipsecipsec apply policy 1#ip route-static 0.0.0.0 0 2.2.2.1 写出公网的路由ipsec transform-set liu 写安全提议esp encryption-algorithm 3des-cbcesp authentication-algorithm md5#ipsec policy-template 1 1 模板的方式互联transform-set liu 引用安全提议local-address 2.2.2.2 设置本端的地址ike-profile 1#ipsec policy 1 1 isakmp template 1 引用安全模板#ike profile 1keychain 1exchange-mode aggressivematch remote identity fqdn rt1#ike keychain 1 这里需要注意配置这个地址为nat设备的地址不能是私网的地址pre-shared-key address 2.2.2.1 255.255.255.255 key cipher$c$3$OyYvNspnlpcz0xEthe6KUIeuj+EwGw==实验成功分析[H3C]dis ipsec saInterface: GigabitEthernet0/0IPsec policy: 1Sequence number: 1Mode: ISAKMPTunnel id: 0Encapsulation mode: tunnel 封装模式为tunnelPerfect forward secrecy:Path MTU: 1435 传输单元为1435Tunnel:local address: 1.1.1.1 本端地址remote address: 2.2.2.2 对端地址Flow:sour addr: 192.168.0.0/255.255.255.0 port: 0 protocol: ipdest addr: 192.168.1.0/255.255.255.0 port: 0 protocol: ip [Inbound ESP SAs]SPI: 4286909264 (0xff850b50)Connection ID: 12884901889Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5 一般排查故障的时候可以看两端Sa的加密方式是否一致SA duration (kilobytes/sec): 1843200/3600SA remaining duration (kilobytes/sec): 1843199/3219Max received sequence-number: 4Anti-replay check enable: YAnti-replay window size: 64UDP encapsulation used for NAT traversal: Y nat穿越开启Status: Active[Outbound ESP SAs]SPI: 1462729958 (0x572f7ce6)Connection ID: 21474836480Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5SA duration (kilobytes/sec): 1843200/3600SA remaining duration (kilobytes/sec): 1843199/3219Max sent sequence-number: 4UDP encapsulation used for NAT traversal: YStatus: Active[H3C]dis ike sa verboseConnection ID: 3Outside VPN:Inside VPN:Profile: 1Transmitting entity: InitiatorLocal IP: 1.1.1.1Local ID type: FQDNLocal ID: rt1Remote IP: 2.2.2.2Remote ID type: IPV4_ADDRRemote ID: 2.2.2.2Authentication-method: PRE-SHARED-KEYAuthentication-algorithm: SHA1Encryption-algorithm: DES-CBCLife duration(sec): 86400Remaining key duration(sec): 85991Exchange-mode: AggressiveDiffie-Hellman group: Group 1NAT traversal: Detected在外网的路由器上的sa<H3C>dis ipsec saInterface: GigabitEthernet0/0IPsec policy: 1Sequence number: 1Mode: Template 模式是模板的方式Tunnel id: 0Encapsulation mode: tunnelPerfect forward secrecy:Path MTU: 1435Tunnel:local address: 2.2.2.2remote address: 2.2.2.1 可以看到这边是到对端公网口的地址,而不是内网口的地址Flow:sour addr: 192.168.1.0/255.255.255.0 port: 0 protocol: ipdest addr: 192.168.0.0/255.255.255.0 port: 0 protocol: ip[Inbound ESP SAs]SPI: 1462729958 (0x572f7ce6)Connection ID: 21474836481Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5可是查看此验证是否一致SA duration (kilobytes/sec): 1843200/3600SA remaining duration (kilobytes/sec): 1843199/2936Max received sequence-number: 4Anti-replay check enable: YAnti-replay window size: 64UDP encapsulation used for NAT traversal: Y v7自动开启NAT穿越Status: Active[Outbound ESP SAs]SPI: 4286909264 (0xff850b50)Connection ID: 21474836480Transform set: ESP-ENCRYPT-3DES-CBC ESP-AUTH-MD5SA duration (kilobytes/sec): 1843200/3600SA remaining duration (kilobytes/sec): 1843199/2936Max sent sequence-number: 4UDP encapsulation used for NAT traversal: YStatus: Active<H3C>dis ike sa verbose-----------------------------------------------Connection ID: 8Outside VPN:Inside VPN:Profile: 1Transmitting entity: Responder-----------------------------------------------Local IP: 2.2.2.2Local ID type: IPV4_ADDRLocal ID: 2.2.2.2Remote IP: 2.2.2.1Remote ID type: FQDNRemote ID: rt1Authentication-method: PRE-SHARED-KEYAuthentication-algorithm: SHA1Encryption-algorithm: DES-CBCLife duration(sec): 86400 Remaining key duration(sec): 85712 Exchange-mode: AggressiveDiffie-Hellman group: Group 1 NAT traversal: Detected。
v7防火墙和v7防火墙ipsec对接-野蛮模式功能需求:防火墙A和防火墙B之间建立一个ipsec隧道,对Host A所在的子网(192.168.7.1)与Host B所在的子网(192.168.5.1)之间的数据流进行安全保护。
·防火墙A和防火墙B之间采用IKE协商方式建立IPsec SA。
·使用IKE野蛮模式进行协商,防火墙A作为分部,防火墙B作为总部。
·使用缺省的预共享密钥认证方法。
此案例适用于:分部ip不固定,总部公网ip固定,中间经过nat或者不经过nat的组网。
组网信息及描述:本案例中,以防火墙A(拨号的)的loopback0口代表A设备的内网hostA,以防火墙B(固定ip的)的loopback0口代表B设备的内网hostB,A设备的G1/0/1作为连接外网的接口,ip:2.2.2.1.B设备的G1/0/1口作为连接外网的接口,ip:1.1.1.1。
loopback口代表各自的内网。
防火墙A能ping的通防火墙B的公网ip。
2.2.2.1去往1.1.1.1的公网路由中间经过了nat设备,对源2.2.2.1的转换成了1.1.1.2。
配置步骤:防火墙A配置接口的ip,路由,安全域等基本配置定义要保护由子网192.168.7.0/24去往子网192.168.5.0/24的数据流。
acl advanced 3001rule 5 permit ip source 192.168.7.0 0.0.0.255 destination 192.168.5.0 0.0.0.255配置nat 转换的流,拒绝ipsec保护的流acl advanced 3333rule 0 deny ip source 192.168.7.0 0.0.0.255 destination 192.168.5.0 0.0.0.255rule 5 permit ip可以看到拨号口是dial1interface GigabitEthernet1/0/1port link-mode routepppoe-client dial-bundle-number 1配置内网接口interface LoopBack0ip address 192.168.7.1 255.255.255.255配置去上外网的路由,2.2.2.2是公网接口的网关ipip route-static 0.0.0.0 0.0.0.0 2.2.2.2接口加入安全域及放通安全域。
网御神州防火墙和H3C ipsec互联简要配置文档
第一步:网络配置
配置防火墙IP地址和网关
红线标注的是公网地址,是用来进行VPN互联的
网关
第二步:IPSEC配置
启用IPSEC功能
配置VPN端点
本例中,ike算法组件是des+sha1+dh1 生存期是86400秒,各种参数需要两边vpn设备严格一致才能建立成功
VPN隧道配置
本地网关地址选择配置在防火墙上的公网IP;VPN端点选择上图中配置好的“cnpc”,ipsec的各个算法组件,保护子网等参数必须和对端设备严格对应。
第三步添加安全规则
首先必须添加一条服务是ike的规则,放在第一条
添加允许两边保护子网互通的规则
网神的安全规则有方向性,如下图:下图中的规则只能允许10.0.0.0/8主动访问10.92.30.244/28,如果想要10.92.30.244/28也能主动访问10.0.0.0/8,需要添加一条反方向的规则
允许10.92.30.244/28主动访问10.0.0.0/8的安全规则
查看VPN日志
标注部分显示隧道已经建立成功。
配置路由器:
如图配置各个接口IP地址,具体略
基本配置B(isakmp):
IPSEC自动协商
#RTA的配置
#进入系统视图
<RouteA>system-view
#创建访问控制列表,定义由子网20.x.x.x去子网30.x.x.x的数据流
[RouteA]acl number 3000
[RouteA-acl-adv-3000]rule permit ip source 20.0.0.0 0.255.255.255 destination 30.0.0.0
0.255.255.255
[H3C-acl-adv-3000]quit
# 创IPsec建安全提议tran1。
[RouterA] ipsec transform-set tran1
# 配置安全协议对IP报文的封装形式为隧道模式。
[RouterA-ipsec-transform-set-tran1] encapsulation-mode tunnel
# 配置采用的安全协议为ESP。
[RouterA-ipsec-transform-set-tran1] protocol esp
# 配置ESP协议采用的加密算法为DES,认证算法为HMAC-SHA1。
[RouterA-ipsec-transform-set-tran1] esp encryption-algorithm des-cbc
[RouterA-ipsec-transform-set-tran1] esp authentication-algorithm sha1
[RouterA-ipsec-transform-set-tran1] quit
# 创建并配置IKE keychain,名称为keychain1。
[RouterA] ike keychain keychain1
# 配置与IP地址为2.2.3.1的对端使用的预共享密钥为明文abcd。
[RouterA-ike-keychain-keychain1] pre-share-key address 10.1.1.2 255.255.255.0 key simple abcd [RouterA-ike-keychain-keychain1] quit
# 创建并配置IKE profile,名称为profile1。
[RouterA] ike profile profile1
[RouterA-ike-profile-profile1] keychain keychain1
[RouterB-ike-profile-profile1]match remote identity address 10.1.1.2
[RouterA-ike-profile-profile1] quit
# 创建一条IKE协商方式的IPsec安全策略,名称为map1,序列号为10。
[RouterA] ipsec policy map1 10 isakmp
# 指定引用ACL 3000。
[RouterA-ipsec-policy-isakmp-map1-10] security acl 3000
# 指定引用的安全提议为tran1。
[RouterA-ipsec-policy-isakmp-map1-10] transform-set tran1
# 指定IPsec隧道的本端IP地址为10.1.1.1,对端IP地址为10.1.1.2
[RouterA-ipsec-policy-manual-map1-10] local-address 10.1.1.1
[RouterA-ipsec-policy-manual-map1-10] remote-address 10.1.1.2
# 指定引用的IKE profile为profile1。
[RouterA-ipsec-policy-isakmp-map1-10] ike-profile profile1
[RouterA-ipsec-policy-isakmp-map1-10] quit
# 在接口Ethernet1/2上应用安全策略map1。
[RouterA] interface GigabitEthernet 0/0
[RouterA-Ethernet1/2] ip address 10.1.1.1 255.255.255.0
[RouterA-Ethernet1/2] ipsec policy map1
[RouterA-Ethernet1/2] quit
#配置静态路由
[H3C]ip route-static 30.0.0.0 8 10.1.1.2
#RTB的配置
#进入系统视图
<H3C>system-view
#创建访问控制列表,定义由子网30.x.x.x去子网20.x.x.x的数据流
[H3C]acl number 3000
[H3C-acl-adv-3000]rule permit ip source 30.0.0.0 0.255.255.255 destination 20.0.0.0 0.255.255.255 [H3C-acl-adv-3000]quit
# 创建IPsec安全提议tran1。
[RouterB] ipsec transform-set tran1
# 配置安全协议对IP报文的封装形式为隧道模式。
[RouterB-ipsec-transform-set-tran1] encapsulation-mode tunnel
# 配置采用的安全协议为ESP。
[RouterB-ipsec-transform-set-tran1] protocol esp
# 配置ESP协议采用的加密算法为DES,认证算法为HMAC-SHA1。
[RouterB-ipsec-transform-set-tran1] esp encryption-algorithm des
[RouterB-ipsec-transform-set-tran1] esp authentication-algorithm sha1
[RouterB-ipsec-transform-set-tran1] quit
# 创建并配置IKE keychain,名称为keychain1。
[RouterB] ike keychain keychain1
[RouterB-ike-keychain-keychain1] pre-share-key address 10.1.1.1 255.255.255.0 key simple abcd [RouterB-ike-keychain-keychain1] quit
# 创建并配置IKE profile,名称为profile1。
[RouterB] ike profile profile1
[RouterB-ike-profile-profile1] keychain keychain1
[RouterB-ike-profile-profile1]match remote identity address 10.1.1.1
[RouterB-ike-profile-profile1] quit
# 创建一条IKE协商方式的安全策略,名称为use1,序列号为10。
[RouterB] ipsec policy use1 10 isakmp
# 指定引用ACL 3000。
[RouterB-ipsec-policy-isakmp-use1-10] security acl 3000
# 指定引用的IPsec安全提议为tran1。
[RouterB-ipsec-policy-isakmp-use1-10] transform-set tran1
# 指定IPsec隧道的本端IP地址为10.1.1.2,对端IP地址为10.1.1.1。
[RouterA-ipsec-policy-manual-map1-10] local-address 10.1.1.2
[RouterA-ipsec-policy-manual-use1-10] remote-address 10.1.1.1
# 指定引用的IKE对等体为profile1。
[RouterB-ipsec-policy-isakmp-use1-10] ike-profile profile1
[RouterB-ipsec-policy-isakmp-use1-10] quit
# 在接口Ethernet1/2上应用IPsec安全策略map1。
[RouterB] interface GigabitEthernet 0/0
[RouterB-Ethernet1/2] ip address 10.1.1.2 255.255.255.0
[RouterB-Ethernet1/2] ipsec policy map1
[RouterB-Ethernet1/2] quit
#配置静态路由
[H3C]ip route-static 20.0.0.0 8 10.1.1.1。