哪位大佬有
(0)
目录
MSR V5平台和MSR V7平台路由器IPSec VPN对接典型配置(野蛮模式) 1
本案例提到的MSR v5平台路由器是指Comware V5 软件平台MSR WiNet系列路由器,如MSR830-WiNet 、MSR 830-10-WiNet 、MSR 930-WiNet 、MSR 930-10-WiNet 、MSR 930-WiNet-W 、MSR 2600-10-WiNet等
本案例提到的MSR V7平台路由器是指Comware V7平台的MSR830-WiNet系列路由器,如MSR830-10BEI-WiNet 、MSR830-6EI-WiNet 、MSR830-5BEI-WiNet 、MSR830-6BHI-WiNet 、MSR830-10BHI-WiNet等
MSR V5路由器采用PPPoE拨号方式上网,IP地址不固定,MSR V7路由器外网口G0/1的地址为2.2.2.2(模拟运营商公网固定地址环境)。要实现对MSR V5所在的内网(192.168.1.0/24)与MSR V7路由器所在的内网(172.16.1.0/24)之间的数据流进行安全保护,实现两端内网终端通过IPsec VPN 隧道进行互访。
#路由器基本上网配置省略,MSR V5路由器的上网具体设置步骤请参考“2.1.1 路由器外网使用拨号上网配置方法”章节中“MSR830[930][2600]系列路由器基本上网(PPPoE拨号)命令行配置(V5)”案例,MSR V7路由器的上网具体设置步骤请参考“2.1.2 路由器外网使用固定IP地址上网配置方法”章节中“MSR830-WiNet系列路由器基本上网(静态IP)命令行配置(V7)”案例
# 配置一个访问控制列表3000,定义由子网192.168.1.0/24去子网172.16.1.0/24的数据流。
<H3C>system-view
[H3C]acl number 3000
[H3C-acl-adv-3000]rule 0 permit ip source 192.168.1.0 0.0.0.255 destination 172.16.1.0 0.0.0.255
[H3C-acl-adv-3000]quit
#配置公网口NAT要关联的ACl 3001,作用是把IPSec感兴趣流从NAT转换的数据流deny掉,防止IPSec数据流被NAT优先转换
[H3C]acl number 3001
[H3C-acl-adv-3001]rule 0 deny ip source 192.168.1.0 0.0.0.255 destination 172.16.1.0 0.0.0.255
[H3C-acl-adv-3001]rule 1 permit ip
[H3C-acl-adv-3001]quit
#配置本端安全网关的名字
[H3C]ike local-name v5
# 创建一条IKE提议1,指定IKE提议使用的认证算法为MD5,加密算法为3des-cbc
[H3C]ike proposal 1
[H3C-ike-proposal-1]authentication-algorithm md5
[H3C-ike-proposal-1]encryption-algorithm 3des-cbc
[H3C-ike-proposal-1]quit
# 配置IPSec安全提议v5,配置ESP协议采用的加密算法为3des,采用的认证算法md5
[H3C]ipsec transform-set v5
[H3C-ipsec-transform-set-v5]encapsulation-mode tunnel
[H3C-ipsec-transform-set-v5]transform esp
[H3C-ipsec-transform-set-v5]esp encryption-algorithm 3des
[H3C-ipsec-transform-set-v5]esp authentication-algorithm md5
[H3C-ipsec-transform-set-v5]quit
# 创建IKE对等体v5,配置IKE第一阶段的协商模式为野蛮模式,预共享密钥为123456,引用之前创建的IKE安全提议1,选择IKE第一阶段的协商过程中使用ID的类型为name,配置对端地址为对端公网接口地址2.2.2.2,配置对端安全网关的名字为v7,配置本端安全网关的名字为v5
[H3C]ike peer v5
[H3C-ike-peer-v5]exchange-mode aggressive
[H3C-ike-peer-v5]pre-shared-key 123456
[H3C-ike-peer-v5]proposal 1
[H3C-ike-peer-v5]id-type name
[H3C-ike-peer-v5]remote-address 2.2.2.2
[H3C-ike-peer-v5]remote-name v7
[H3C-ike-peer-v5]local-name v5
[H3C-ike-peer-v5]quit
# 创建一条IPSec安全策略v5,协商方式为isakmp。引用之前创建的感兴趣数据流ACL3000,引用之前创建的对等体v5,引用之前的IPSec安全提议v5
[H3C]ipsec policy v5 1 isakmp
[H3C-ipsec-policy-isakmp-v5-1]security acl 3000
[H3C-ipsec-policy-isakmp-v5-1]ike-peer v5
[H3C-ipsec-policy-isakmp-v5-1]transform-set v5
[H3C-ipsec-policy-isakmp-v5-1]quit
#设置外网口(在本例中假设拨号口为Dialer 10)做NAT转换的时候关联ACL 3001 (如果之前已经在外网口配置了 nat outbound,需要先undo掉),并将IPSec安全策略v5应用在外网接口,
[H3C]interface Dialer 10
[H3C-Dialer10]undo nat outbound
[H3C-Dialer10]nat outbound 3001
[H3C-Dialer10]ipsec policy v5
[H3C-Dialer10]quit
# 配置一个访问控制列表,定义由子网172.16.1.0/24去子网192.168.1.0/24的数据流。
<H3C>system-view
[H3C]acl advanced 3000
[H3C-acl-ipv4-adv-3000]rule 0 permit ip source 172.16.1.0 0.0.0.255 destination 192.168.1.0 0.0.0.255
[H3C-acl-ipv4-adv-3000]quit
#配置公网口NAT要关联的ACl 3001,作用是把IPSec感兴趣流从NAT转换的数据流deny掉,防止IPSec数据流被NAT优先转换
[H3C]acl advanced 3001
[H3C-acl-ipv4-adv-3001]rule 0 deny ip source 172.16.1.0 0.0.0.255 destination 192.168.1.0 0.0.0.255
[H3C-acl-ipv4-adv-3001]rule 1 permit ip
[H3C-acl-adv-3001]quit
# 创建一条IKE提议1,指定IKE提议使用的认证算法为MD5,加密算法为3des-cbc
[H3C]ike proposal 1
[H3C-ike-proposal-1]authentication-algorithm md5
[H3C-ike-proposal-1]encryption-algorithm 3des-cbc
[H3C-ike-proposal-1]quit
#配置本端FQDN名称为v7
[H3C]ike identity fqdn v7
[H3C]ike keychain v7
#配置对端IP地址为0.0.0.0(由于对端地址不固定,所以配置对端地址为0.0.0.0,其目的是匹配所有地址),使用的预共享密钥为明文123456
[H3C-ike-keychain-v7]pre-shared-key address 0.0.0.0 0.0.0.0 key simple 123456
[H3C-ike-keychain-v7]quit
# 创建并配置IKE profile,名称为v7,引用上面配置的keychain v7,配置IKE第一阶段的协商模式为野蛮模式,本端身份类型为FQDN且取值为v7,指定需要匹配对端身份类型为FQDN且取值v5,引用之前配置IKE提议1
[H3C]ike profile v7
[H3C-ike-profile-v7]keychain v7
[H3C-ike-profile-v7]exchange-mode aggressive
[H3C-ike-profile-v7]local-identity fqdn v7
[H3C-ike-profile-v7]match remote identity fqdn v5
[H3C-ike-profile-v7]proposal 1
[H3C-ike-profile-v7]quit
# 配置IPsec安全提议v7,ESP协议采用的加密算法为3des-cbc,认证算法为md5
[H3C]ipsec transform-set v7
[H3C-ipsec-transform-set-v7]encapsulation-mode tunnel
[H3C-ipsec-transform-set-v7]esp encryption-algorithm 3des-cbc
[H3C-ipsec-transform-set-v7]esp authentication-algorithm md5
[H3C-ipsec-transform-set-v5]quit
# 创建一个模板名字为1,顺序号为1的安全策略模板,引用之前创建的ACL3000,引用之前创建的IKE profile v7,引用之前的IPSec安全提议v7
[H3C]ipsec policy-template 1 1
[H3C-ipsec-policy-template-1-1]transform-set v7
[H3C-ipsec-policy-template-1-1]security acl 3000
[H3C-ipsec-policy-template-1-1]ike-profile v7
[H3C-ipsec-policy-template-1-1]quit
# 引用IPSec策略模板1,创建名字为policy v7、顺序号为1的IPsec安全策略
[H3C] ipsec policy v7 1 isakmp template 1
#设置外网口做NAT转换的时候关联ACL 3001 (如果之前已经在外网口配置了 nat outbound,需要先undo掉),并将IPSec安全策略v7应用在外网接口
[H3C]interface GigabitEthernet 0/1
[H3C-GigabitEthernet0/1]undo nat outbound
[H3C-GigabitEthernet0/1]nat outbound 3001
[H3C-GigabitEthernet0/1]ipsec apply policy v7
[H3C-GigabitEthernet0/1]quit
#配置完成之后,由拨号端主动发起访问,触发建立IPSec隧道,在MSR V5路由器上带源ping MSR V7路由器内网网关地址
(0)
您好,参考案例
总部采用MSR36路由器,分支采用MSR20路由器
总部与分支建立野蛮模式IPSec VPN
MSR36 代表总部,GE0/1 IP地址17.1.1.2/24,Loopback 0 IP地址2.2.2.2/32代表PC-B;
MSR20 代表分支,E0/1 IP地址17.1.1.1/24,Loopback 0 IP地址1.1.1.1代表PC-A;
1 配置总部路由器:
配置Loopback 0,代表PC-B:
[H3C]interface LoopBack 0
[H3C-LoopBack0] ip address 2.2.2.2 255.255.255.255
配置IKE本地标识:
[H3C] ike identity fqdn nxjt
配置IKE Keychain,配置总部与分支之间协商IKE采用的预共享密钥。若分支无公网IP地址时,这里需要采用Name的方式,分支Name需要与分支侧设置的一致:
[H3C]ike keychain sqgc
[H3C-ike-keychain-sqgc] pre-shared-key hostname sqgc key simple 123
配置两个分支对应的IKE Profile,调用配置的IKE Keychain,采用野蛮模式,并分别匹配对端配置的IKE Name:
[H3C]ike profile sqgc] keychain sqgc
[H3C-ike-profile-sqgc] exchange-mode aggressive
[H3C-ike-profile-sqgc] local-identity fqdn nxjt
[H3C-ike-profile-sqgc] match remote identity fqdn sqgc
配置IPSEC 安全提议,采用隧道模式,认证算法使用MD5,加密算法使用Des-cbc:
[H3C]ipsec transform-set sqgc
[H3C-ipsec-transform-set-sqgc] encapsulation-mode tunnel
[H3C-ipsec-transform-set-sqgc] esp encryption-algorithm des-cbc
[H3C-ipsec-transform-set-sqgc] esp authentication-algorithm md5
配置ipsec策略模版:
[H3C]ipsec policy-template sqgc 1
[H3C-ipsec-policy-template-sqgc-1] transform-set sqgc
[H3C-ipsec-policy-template-sqgc-1] ike-profile sqgc
[H3C-ipsec-policy-template-sqgc-1] local-address 17.1.1.2
配置ipsec 策略,并调用策略模版:
[H3C]ipsec policy nxjt 1 isakmp template sqgc
配置到分支网段静态路由:
[H3C]ip route-static 1.1.1.1 32 17.1.1.1
在外网接口上应用ipsec策略:
[H3C]interface GigabitEthernet0/1
[H3C-GigabitEthernet0/1] ip address 17.1.1.2 255.255.255.252
[H3C-GigabitEthernet0/1] nat outbound
[H3C-GigabitEthernet0/1] ipsec apply policy nxjt
2 配置分支路由:
配置Loopback 0,代表PC-A:
[H3C]interface LoopBack 0
[H3C-LoopBack0] ip address 1.1.1.1 255.255.255.255
配置IKE本地标识:
[H3C]ike local-name sqgc
配置安全acl,匹配感兴趣数据流:
[H3C]acl number 3001
[H3C-acl-adv-3001] rule 0 permit ip source 1.1.1.1 0 destination 2.2.2.2 0
配置IKE Peer,采用野蛮模式,并开启Nat穿越
[H3C]ike peer nxjt
[H3C-ike-peer-nxjt] exchange-mode aggressive
[H3C-ike-peer-nxjt] pre-shared-key simple 123
[H3C-ike-peer-nxjt] id-type name
[H3C-ike-peer-nxjt] remote-name nxjt
[H3C-ike-peer-nxjt] remote-address 17.1.1.2
[H3C-ike-peer-nxjt] nat traversal
配置IPSec安全提议,采用隧道模式,认证算法使用MD5,加密算法使用Des-cbc,与总部配置保持一致:
[H3C]ipsec transform-set nxjt
[H3C-ipsec-transform-set-nxjt] transform esp
[H3C-ipsec-transform-set-nxjt] esp authentication-algorithm md5
[H3C-ipsec-transform-set-nxjt] esp encryption-algorithm des
配置IPSec策略,调用IKE Peer、安全acl及IPSec 安全策略:
[H3C]ipsec policy nxjt 1
[H3C-ipsec-policy-isakmp-nxjt-1] ike-peer nxjt
[H3C-ipsec-policy-isakmp-nxjt-1] security acl 3001
[H3C-ipsec-policy-isakmp-nxjt-1]transform-set default
接口上应用IPSec策略:
[H3C]int e0/1
[H3C-Ethernet0/1] ip address 17.1.1.1 255.255.255.0
[H3C-Ethernet0/1] nat outbound
[H3C-Ethernet0/1] ipsec no-nat-process enable
[H3C-Ethernet0/1] ipsec policy nxjt
配置到总部网段静态路由:
[H3C]ip route-static 2.2.2.2 255.255.255.255 17.1.1.2
测试结果:
从分支路由器带源地址1.1.1.1去ping总部2.2.2.2,尝试建立ipsec:
[H3C]ping -a 1.1.1.1 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
Request time out
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=3 ms
Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=3 ms
Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=3 ms
--- 2.2.2.2 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 3/3/3 ms
分支路由器dis ike sa/dis ipsec sa:
分支路由器可以看到ike协商的两个阶段都正常建立起来:
[H3C]dis ike sa
total phase-1 SAs: 1
connection-id peer flag phase doi
----------------------------------------------------------------
36 17.1.1.2 RD|ST 1 IPSEC
37 17.1.1.2 RD|ST 2 IPSEC
flag meaning
RD--READY ST--STAYALIVE RL--REPLACED FD--FADING TO--TIMEOUT RK—REKEY
[H3C]dis ipsec sa
===============================
Interface: Ethernet0/1
path MTU: 1500
===============================
-----------------------------
IPsec policy name: "nxjt"
sequence number: 1
acl version: ACL4
mode: isakmp
-----------------------------
PFS: N, DH group: none
tunnel:
local address: 17.1.1.1
remote address: 17.1.1.2
flow:
sour addr: 1.1.1.1/255.255.255.255 port: 0 protocol: IP
dest addr: 2.2.2.2/255.255.255.255 port: 0 protocol: IP
总部路由器dis ike sa,
[H3C]dis ike sa
Connection-ID Remote Flag DOI
------------------------------------------------------------------
27 17.1.1.1 RD IPsec
Flags:
RD--READY RL--REPLACED FD-FADING
1 IKE Peer中调用Proposal时,需要注意V5和V7版本的默认参数:
V5:
[H3C]dis ike proposal
priority authentication authentication encryption Diffie-Hellman duration
method algorithm algorithm group (seconds)
---------------------------------------------------------------------------
1 PRE_SHARED MD5 3DES_CBC MODP_768 86400
default PRE_SHARED SHA DES_CBC MODP_768 86400
V7:
[H3C]dis ike proposal
Priority Authentication Authentication Encryption Diffie-Hellman Duration
method algorithm algorithm group (seconds)
----------------------------------------------------------------------------
1 PRE-SHARED-KEY MD5 3DES-CBC Group 1 86400
default PRE-SHARED-KEY SHA1 DES-CBC Group 1 86400
MODP_768 与Group 1是一样的,只是表示方式不同。
2 组网中两台设备互联接口均配置了Nat功能,所以在V5设备中需开启Nat穿越功能,V7设备默认支持Nat穿越,无需配置,设备上也没有去配置的命令。
3 V5设备在出口上配置nat转换时,需要将建立IPSec的感兴趣数据流先Deny掉,确保源地址1.1.1.1能够正确进入IPSec的数据封装程序。或在该接口上开启ipsec no-nat-process enable,该命令在V5设备较早的版本中可能没有。
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论