吸烟
有害健康!

NAT场景下的IPsec隧道的建立(模板方式)

组网及说明

注:如无特别说明,描述中的 FW1对应拓扑中设备名称末尾数字为 1 的设备,FW对应拓扑中设备名称末尾数字为 NAT场景下的IPsec隧道的建立(模板方式)2 的设备,以此类推;另外,同一网段中,IP 地址的主机位为其设备编号,如 FW1 的 g0/0 接口若在 1.1.1.0/24 网段,则其 IP 地址为 1.1.1.1/24,以此类推。

实验需求

1.FW2接口GE_0/1作natoutbound
2.FW1和FW3建立IPsec隧道,涉及nat穿越.
3.不涉及安全域和安全策略
4.FW1和FW3建立环回口地址,模拟业务网段,即感兴趣流。

配置步骤

FW1:

# 
interface LoopBack0
ip address 10.1.1.1 255.255.255.0     /感兴趣流地址
# 
interface GigabitEthernet1/0/0
 port link-mode route
 combo enable copper
 ip address 172.16.1.1 255.255.255.0
 ipsec apply policy ply 
#
 ip route-static 1.1.1.0 24 172.16.1.2 
 ip route-static 10.2.2.0 24 172.16.1.2
#
acl advanced 3000
 rule 0 permit ip source 10.1.1.1 0 destination 10.2.2.3 0 
#
ipsec transform-set ts
 esp encryption-algorithm aes-cbc-128
 esp authentication-algorithm md5 
#
ipsec policy ply 1 isakmp
 transform-set ts
 security acl 3000
 local-address 172.16.1.1
 remote-address 1.1.1.3
 ike-profile pf 
# 
ike profile pf
 keychain key
 local-identity address 1.1.1.1
dpd interval 5 on-demand
 match remote identity address 1.1.1.3 255.255.255.255 
#
ike keychain key
 pre-shared-key address 1.1.1.3 255.255.255.255 key cipher $c$3$z7lFP/twkCnmA3osQjo/9m+TZgtyfVc22w==
#

FW2:

# 
nat address-group 1
 address 1.1.1.1 1.1.1.1 
#  
interface GigabitEthernet1/0/0
 port link-mode route
 combo enable copper
 ip address 172.16.1.2 255.255.255.0 
# 
interface GigabitEthernet1/0/1
 port link-mode route
 combo enable copper
 ip address 1.1.1.2 255.255.255.0 
 nat outbound address-group 1

FW3

# 
interface LoopBack0
 ip address 10.2.2.3 255.255.255.0 
# 
interface GigabitEthernet1/0/0
 port link-mode route
 combo enable copper
 ip address 1.1.1.3 255.255.255.0
 ipsec apply policy ply
# 
 ip route-static 10.1.1.0 24 1.1.1.1 
# 
ipsec transform-set ts
 esp encryption-algorithm aes-cbc-128
 esp authentication-algorithm md5 
 # 
ipsec policy-template pt 1
 transform-set ts
 ike-profile pf 
# 
ipsec policy ply 1 isakmp template pt 
# 
ike profile pf
 keychain key
 dpd interval 5 on-demand
 local-identity address 1.1.1.3
 match remote identity address 1.1.1.1 255.255.255.255 
# 
ike keychain
 key pre-shared-key address 1.1.1.1 255.255.255.255 key cipher $c$3$vVHCQpfnhNIjt7qsouibsAR92FphiThORg== #

配置关键点

FW1侧ike profile中local ID要写NAT后的地址,不然在FW3侧看来remote ID是NAT前地址,如下:

Local IP: 1.1.1.3 
 Local ID type: IPV4_ADDR 
 Local ID: 1.1.1.3 
 Remote IP: 1.1.1.1 
 Remote ID type: IPV4_ADDR 
 Remote ID: 172.16.1.1

与本端配置不匹配,如下:

ike profile pf
 keychain key
 dpd interval 5 on-demand
 local-identity address 1.1.1.3
 match remote identity address 1.1.1.1 255.255.255.255

本文链接:https://www.xxdis.com/datacom/1380.html

NAT场景下的IPsec隧道的建立(模板方式)
赞(0) 打赏
未经允许不得转载:交换云生 » NAT场景下的IPsec隧道的建立(模板方式)
分享到

评论 抢沙发

交换云生

始于1908

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫