当前位置:文档之家› IPsec 穿越NAT 配置

IPsec 穿越NAT 配置

典型配置示例(对应新版本IPsec模块)
3.2.1组网需求:
某企业总部和分部通过两台路由器实现互联,但由于总部需要和分部建立IPsec VPN通道,总部增加了一台新的路由器用于和分部建立VPN之用,但是又不想改变现有的网络环境,所以把新增的路由器直接挂接在核心交换机下面。

现网络环境描述如下:
●R2605,R4860都支持IPsec穿越NA T功能
●总部(PC 1)通过交换机接入到R2605的F0/1口,网关地址为192.168.1.1;
●分部(PC 2)通过交换机接入到分部R2605的F0/1口,网关为172.16.1.1;
●总部的R2605的F0/0通过核心交换机连接到总部出口路由器R4860的G0/1口;
●总部R4860通过G0/0口接入互联网,分部R2605通过F0/0口接入到互联网;
网络管理员希望通过总部的R2605和分部的R2605通过IPsec VPN建立连接。

使用IPsec 穿越NA T功能实现该需求,进行如下配置:
●总部R2605作为NAT inside侧的IPsec设备,R4860作为NAT网关,分部R2622
作为分部的IPsec设备;
●总部R2605和分部R2622作为VPN设备,配置ipsec vpn与对端建立IPsec通道。

●R4860作为总部的出口路由器配置NAT实现网络地址的转换。

组网图如图1 所示
图1
3.2.2典型实例配置:
(1)分部R2605配置
5.01A
R1#
!
hostname R1
!
crypto isakmp key 0 bdcom address 0.0.0.0 0.0.0.0 //…定义预共享密钥…// crypto isakmp nat keepalive 20
crypto isakmp policy 10
authentication pre-share
encryption 3des
group 2
hash md5
lifetime 60
!
crypto ipsec transform-set ipsec esp-3des esp-md5-hmac //
!
crypto dynamic-map dmap 10 //…定义动态映射注意这里不能指定邻居(即使指定为
0.0.0.0 在这个版本里面也不能表明是以任意为邻
居)…//
match address ipsec
set pfs group2
set security-association lifetime seconds 180
set transform-set ipsec
!
crypto map ipsec 10 ipsec-isakmp dynamic dmap
!
interface FastEthernet0/0
ip address 1.1.1.1 255.255.255.0
crypto map ipsec
!
interface FastEthernet0/1
ip address 172.16.1.1 255.255.255.0
!
ip access-list extended ipsec
permit ip 172.16.1.0 255.255.255.0 192.168.1.0 255.255.255.0
!
(2)总部R4860网关配置
!
hostname R4860
!
interface GigaEthernet0/0
ip address 1.1.1.2 255.255.255.0
ip nat outside
!
interface GigaEthernet0/1
ip address 192.168.2.1 255.255.255.0
ip nat inside
!
ip route default 1.1.1.1
ip route default 192.168.2.2
!
ip access-list standard nat
permit 192.168.2.0 255.255.255.0
!
ip nat inside source list nat interface GigaEthernet0/0

(3)总部R2605配置

hostname R2
!
crypto isakmp key 0 bdcom address 1.1.1.1 255.255.255.255
crypto isakmp nat keepalive 20 //…NA T keeplive时间间隔为20s…//
crypto isakmp policy 10
authentication pre-share //…认证方式预共享密钥…//
encryption 3des //…加密方式为3DES…//
group 2 //…DH组为2…//
hash md5 //…哈希方式MD5…//
lifetime 60 //…第一阶段SA生存时间为60s…//
!
crypto ipsec transform-set ipsec esp-3des esp-md5-hmac //…定义变换集合…//
!
crypto map ipsec 10 ipsec-isakmp
match address ipsec // …匹配感兴趣数据流…//
set peer 1.1.1.1 //…指定对端邻居…//
set pfs group2 //…指定pfs的DH 组… //
set security-association lifetime seconds 120 //…第一阶段SA生存时间…//
set transform-set ipsec //…调用变换集合…//
!
interface FastEthernet0/0
ip address 192.168.2.2 255.255.255.0
crypto map ipsec //…接口下调用映射…//
!
interface FastEthernet0/1
ip address 192.168.1.1 255.255.255.0
!
ip route default 192.168.2.1
!
ip access-list extended ipsec //…定义感兴趣数据流…//
permit ip 192.168.1.0 255.255.255.0 172.16.1.0 255.255.255.0
!。

相关主题