(ASA)防火墙 IPSec VPN
ASA防火墙无法配置 GRE over IPSec,只能够配置 IPSec VPN因为是 IPSec VPN,不是 GRE over IPSec VPN,因此不需要配置 gre Tunnel 接口
一、路由 和 ASA 建立 GRE over IPSec:
1、配置 第一阶段 ike加密:
(1)路由器配置:
EDGERTR(config)#crypto isakmp policy 1 EDGERTR(config-isakmp)#encryption aes 256EDGERTR(config-isakmp)#hash sha // 这里只能使用 sha,因为 ASA只支持 shaEDGERTR(config-isakmp)#group 14EDGERTR(config-isakmp)#authentication pre-share EDGERTR(config-isakmp)#exit# 设置与共享密钥:(IP需要指定对端的公网地址)EDGERTR(config)#crypto isakmp key Skills39 address 5.5.5.2
(2)ASA配置:
EDGEFW(config)# crypto ikev1 enable outside // 在指定接口上启用ikev1EDGEFW(config)# crypto ikev1 policy 1EDGEFW(config-ikev1-policy)# encryption aes-256 EDGEFW(config-ikev1-policy)# hash sha EDGEFW(config-ikev1-policy)# group 14EDGEFW(config-ikev1-policy)# authentication pre-share EDGEFW(config-ikev1-policy)# exit# 设置预共享密钥:(IP需要指定对端的公网地址)EDGEFW(config)# tunnel-group 1.1.1.1 type ipsec-l2l EDGEFW(config)# tunnel-group 1.1.1.1 ipsec-attributes EDGEFW(config-tunnel-ipsec)# ikev1 pre-shared-key Skills39EDGEFW(config-tunnel-ipsec)# exit
2、配置 IPSec 协商:
(1)路由器:
EDGERTR(config)#crypto ipsec transform-set IPSec esp-aes 256 esp-sha-hmac EDGERTR(cfg-crypto-trans)#mode tunnel EDGERTR(cfg-crypto-trans)#exit # 匹配内网流量EDGERTR(config)#ip access-list extended IPSecpermit ip 192.168.1.0 0.0.0.255 172.16.1.0 0.0.0.255 // 匹配本地内网,去往对端内网的流量EDGERTR(config-ext-nacl)#exitEDGERTR(config)#crypto map MAP 1 ipsec-isakmp EDGERTR(config-crypto-map)#set peer 5.5.5.2 // 指定对端公网地址EDGERTR(config-crypto-map)#set transform-set IPSec // 应用转换集EDGERTR(config-crypto-map)#match address IPSec // 应用 ACLEDGERTR(config-crypto-map)#exit# 在出接口中应用 MAP:(记得是在被对端使用 peer指定的地址的出接口)EDGERTR(config)#int g0/0EDGERTR(config-if)#crypto map MAP
(2)ASA:
配置转换集EDGEFW(config)# crypto ipsec ikev1 transform-set IPSec esp-aes-256 esp-sha-hmac# 匹配本地内网去往对端内网的流量EDGEFW(config)# access-list IPSec extended permit ip 172.16.1.0 255.255.255.0 192.168.1.0 255.255.255.0EDGEFW(config)# crypto map MAP 1 match address IPSecEDGEFW(config)# crypto map MAP 1 set peer 1.1.1.1EDGEFW(config)# crypto map MAP 1 set ikev1 transform-set IPSec EDGEFW(config)# crypto map MAP interface outside // 在 outside 接口上应用IPSec
3、重要:需要先使用本端的内网地址 ping通对端,才能够有 sa 加密状态:
ping 得通,配置没问题就能够建立
ping 172.16.1.1 source g0/1