前言
IPsec VPN指采用IPSec协议来实现远程接入的一种VPN技术,IPSec全称为Internet Protocol Security,是由Internet Engineering Task Force (IETF) 定义的安全标准框架,在公网上为两个私有网络提供安全通信通道,通过加密通道保证连接的安全——在两个公共网关间提供私密数据封包服务。IPSEC是一套比较完整成体系的VPN技术,它规定了一系列的协议标准。


一、实验内容与目标
本次实验需要根据实验教程组网要求,搭建实验拓扑,并完成以下实验任务:
(1)配置IPsec+预共享密钥的IKE主模式
(2)配置IPsec+预共享密钥的IKE野蛮模式
二、实验组网图

三、实验需要的软、硬件
1、 HCL模拟器软件
2、 PC电脑
四、实验步骤
各设备接口IP地址:

(一)配置IPsec+预共享密钥的IKE主模式
SWA配置:
SWA:
[SWA]interface Vlan-interface 1
[SWA-Vlan-interface1]ip address 1.1.1.2 24
[SWA-Vlan-interface1]qu
[SWA]vlan 2
[SWA-vlan2]qu
[SWA]interface Vlan-interface 2
[SWA-Vlan-interface2]ip address 2.2.2.2 24
[SWA-Vlan-interface2]qu
[SWA]interface GigabitEthernet 1/0/2
[SWA-GigabitEthernet1/0/2]port access vlan 2
RTA配置
基础配置:
[RTA]int g0/0
[RTA-GigabitEthernet0/0]ip address 192.168.1.1 24
[RTA-GigabitEthernet0/0]qu
[RTA]int g0/1
[RTA-GigabitEthernet0/1]ip address 1.1.1.1 24
[RTA-GigabitEthernet0/1]qu
[RTA]ip route-static 0.0.0.0 0 1.1.1.2 ##配置公网静态路由
[RTA]ip route-static 192.168.2.0 255.255.255.0 1.1.1.2
配置安全ACL:
[RTA]acl advanced 3101
[RTA-acl-ipv4-adv-3101]rule permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255
配置IPSec安全提议:
[RTA]ipsec transform-set tran1# 创建IPsec安全提议tran1
[RTA-ipsec-transform-set-tran1]encapsulation-mode tunnel # 配置安全协议对IP报文的封装形式为隧道模式
[RTA-ipsec-transform-set-tran1]protocol esp # 配置采用的安全协议为ESP
[RTA-ipsec-transform-set-tran1]esp encryption-algorithm aes-cbc-128 # 配置ESP协议采用的加密算法为128比特的AES
[RTA-ipsec-transform-set-tran1]esp authentication-algorithm sha1 #认证算法为HMAC-SHA1
[RTA-ipsec-transform-set-tran1]qu
配置IKE对等体:
[RTA]ike keychain keychain1 # 创建并配置IKE keychain,名称为keychain1
[RTA-ike-keychain-keychain1] pre-shared-key address 2.2.2.1 255.255.0.0 key simple 123456TESTplat&! # 配置与IP地址为2.2.2.1的对端使用的预共享密钥为明文123456TESTplat&!。
配置安全策略:
[RTA]ike profile profile1# 创建并配置IKE profile,名称为profile1:
[RTA-ike-profile-profile1]keychain keychain1
[RTA-ike-profile-profile1]local-identity address 1.1.1.1
[RTA-ike-profile-profile1] match remote identity address 2.2.2.1 255.255.0.0
[RTA]ipsec policy map1 10 isakmp # 创建一条IKE协商方式的IPsec安全策略,名称为map1,顺序号为10
[RTA-ipsec-policy-isakmp-map1-10]remote-address 2.2.2.1 # 配置IPsec隧道的对端IP地址为2.2.2.1
[RTA-ipsec-policy-isakmp-map1-10]security acl 3101 # 指定引用ACL 3101
[RTA-ipsec-policy-isakmp-map1-10]transform-set tran1 # 指定引用的安全提议为tran1
[RTA-ipsec-policy-isakmp-map1-10]ike-profile profile1 # 指定引用的IKE profile为profile1
[RTA-ipsec-policy-isakmp-map1-10]qu
[RTA]int g0/1
[RTA-GigabitEthernet0/1]ipsec apply policy map1 # 在接口GigabitEthernet0/1上应用IPsec安全策略map1
[RTA-GigabitEthernet0/1]
RTB配置
基础配置:
[RTB]int g0/0
[RTB-GigabitEthernet0/0]ip address 192.168.2.1 24
[RTB-GigabitEthernet0/0]qu
[RTB]int g0/1
[RTB-GigabitEthernet0/1]ip address 2.2.2.1 24
[RTB-GigabitEthernet0/1]qu
[RTB]ip route-static 0.0.0.0 0 2.2.2.2 ##配置公网静态路由
[RTB]ip route-static 192.168.1.0 255.255.255.0 2.2.2.2
配置安全ACL:
[RTB]acl advanced 3101
[RTB-acl-ipv4-adv-3101]rule permit ip source 192.168.2.0 0.0.0.255 destination 1
92.168.1.0 0.0.0.255
配置IPSec安全提议:
[RTB]ipsec transform-set tran1# 创建IPsec安全提议tran1
[RTB-ipsec-transform-set-tran1]encapsulation-mode tunnel # 配置安全协议对IP报文的封装形式为隧道模式
[RTB-ipsec-transform-set-tran1]protocol esp # 配置采用的安全协议为ESP
[RTB-ipsec-transform-set-tran1]esp encryption-algorithm aes-cbc-128 # 配置ESP协议采用的加密算法为128比特的AES
[RTB-ipsec-transform-set-tran1]esp authentication-algorithm sha1 #配置认证算法为HMAC-SHA1
[RTB-ipsec-transform-set-tran1]qu
配置IKE对等体:
[RTB]ike keychain keychain1 # 创建并配置IKE keychain,名称为keychain1
[RTB-ike-keychain-keychain1]pre-shared-key address 1.1.1.1 255.255.255.0 key simple 123456TESTplat&! # 配置与IP地址为1.1.1.1的对端使用的预共享密钥为明文123456TESTplat&!。
配置安全策略:
[RTB]ike profile profile1 # 创建IKE profile,名称为profile1
[RTB-ike-profile-profile1]keychain keychain1 # 指定引用的IKE keychain为keychain1
[RTB-ike-profile-profile1]local-identity address 2.2.2.1 # 配置本端的身份信息为IP地址2.2.2.1
[RTB-ike-profile-profile1]match remote identity address 1.1.1.1 255.255.0.0 # 配置匹配对端身份的规则为IP地址1.1.1.1/16
[RTB-ike-profile-profile1]qu
[RTB]ipsec policy use1 10 isakmp # 创建一条IKE协商方式的IPsec安全策略,名称为use1,顺序号为10
[RTB-ipsec-policy-isakmp-use1-10]remote-address 1.1.1.1 # 配置IPsec隧道的对端IP地址为1.1.1.1
[RTB-ipsec-policy-isakmp-use1-10]security acl 3101 # 指定引用ACL 3101
[RTB-ipsec-policy-isakmp-use1-10]transform-set tran1 # 指定引用的安全提议为tran1
[RTB-ipsec-policy-isakmp-use1-10]ike-profile profile1 # 指定引用的IKE profile为profile1
[RTB-ipsec-policy-isakmp-use1-10]qu
[RTB]int g0/1
[RTB-GigabitEthernet0/1]ipsec apply policy use1 # 在接口GigabitEthernet0/1上应用IPsec安全策略use1
测试


查看IPsec SA的基本信息

抓包情况


(二)配置IPsec+预共享密钥的IKE野蛮模式
先推出系统视图,然后清除IKE / IPsec SA:
<RTA>reset ike sa
<RTA>reset ipsec sa
<RTB>reset ike sa
<RTB>reset ipsec sa
然后清除ACL
[RTA]undo acl advanced 3101
[RTB]undo acl advanced 3101
然后配置跟主模式基本一样,只是配置安全策略哪里设置为野蛮模式
[RTA]ike profile profile1
[RTA-ike-profile-profile1]exchange-mode aggressive
[RTB]ike profile profile1
[RTB-ike-profile-profile1]exchange-mode aggressive
测试:

抓包情况:

&spm=1001.2101.3001.5002&articleId=137781854&d=1&t=3&u=11a5aefcd5094e4a97390b4516773098)
2182

被折叠的 条评论
为什么被折叠?



