前提:
基本配置均已配置完成,网络工作正常
上海asa对象
object network OBJ-VLAN10 \\本地子网对象名称
subnet 192.168.10.0 255.255.255.0 \\本地子网详情
object network OBJ-IPSEC-BEIJING \\对端子网对象名称
subnet 192.168.20.0 255.255.255.0 \\对端子网详情
北京asa对象
object network OBJ-VLAN20 \\本地子网对象名称
subnet 192.168.20.0 255.255.255.0 \\本地子网详情
object network OBJ-IPSEC-SHANGHAI \\对端子网对象名称
subnet 192.168.10.0 255.255.255.0 \\对端子网详情
配置:
1. vpn流量免NAT配置(nat免流)
nat (inside,outside) 1 source static OBJ-VLAN10 OBJ-VLAN10 destination static OBJ-IPSEC-BEIJING OBJ-IPSEC-BEIJING
//此配置,优先级一定要高
nat (inside,outside) 1 \\使用数字修改优先级
2. 配置vpn对等体及域共享密钥 —–隧道群
tunnel-group 2.2.2.2 type ipsec-l2l \\2.2.2.2表示对端公网ip
tunnel-group 2.2.2.2 ipsec-attributes
ikev1 pre-shared-key cisco123 \\ 域共享密钥为cisco123
3. 创建ISAMKP策略
crypto ikev1 policy 10 \\启用并创建ISAMKP策略
authentication pre-share \\配置认证方式,为域共享密钥
encryption aes-256 \\配置对称加密算法
hash md5 \\配置信息摘要算法,校验算法
group 2 \\ DH分组
lifetime 86400 \\生存周期
4. 创建ipsec 流量匹配规则,acl
access-list IPSEC-TO-BEIJING extended permit ip object OBJ-VLAN10 object OBJ-IPSEC-BEIJING \\匹配vpn隧道流量
5. 定义转换集
crypto ipsec ikev1 transform-set to-beijing esp-3des esp-md5-hmac \\to-beijing 表示转换集的名称,可自定义
6. 创建加密图
crypto map MAP-TO-BEIJING 10 match address IPSEC-TO-BEIJING \\调用定义的acl
crypto map MAP-TO-BEIJING 10 set peer 2.2.2.2 \\定义对端地址
crypto map MAP-TO-BEIJING 10 set ikev1 transform-set to-beijing \\调用转换集
crypto map MAP-TO-BEIJING interface outside \\ 将加密图在outside接口调用
7. crypto ikev1 enable outside \\在outside接口启用ikev1 功能
& & & & & & & & & = = = = = = = = = = =
& & & = = = = = =start 上海