内网通过映射后的公网IP访问内网服务测试--ASA8.0 hairpin NAT测试

一.测试拓扑:
122222476.jpg

参考链接:http://blog.csdn.net/boblxs/article/details/8063814

二.基本思路:

A.通过配置hairpin NAT使得内网通过映射后的公网地址访问内部服务器时同时做目标地址转换,也做源地址转换

---被访问的内部服务器看到的地址为ASA内部接口地址,而不是内网实际地址

B.因为流量只是在ASA的内部接口进出,所以需要开启相同安全级别在同一接口的进出

三.基本配置:
A.R1:
interface FastEthernet0/0
ip address 202.100.1.2 255.255.255.0
no shut
B.ASA8.0:
interface Ethernet0/0
nameif inside
ip address 10.1.1.254 255.255.255.0
no shut
interface Ethernet0/1
nameif outside
ip address 202.100.1.1 255.255.255.0
no shut
route outside 0.0.0.0 0.0.0.0 202.100.1.2
C.R2:
interface FastEthernet0/0
ip address 10.1.1.2 255.255.255.0
no shut
ip route 0.0.0.0 0.0.0.0 10.1.1.254
enable secret cisco
line vty 0 4
password cisco
login
-----R1开启telnet服务
D.PC1:
IP:10.1.1.1/24
GW:10.1.1.254
四.防火墙NAT配置:
A.动态PAT:
nat (inside) 1 10.1.1.0 255.255.255.0
global (outside) 1 interface
B.静态PAT:
static (inside,outside) tcp interface 2323 10.1.1.2 23
五.防火墙策略配置:
A.开启ICMP审查
policy-map global_policy
class inspection_default
inspect icmp
B.允许外面Telnet内网R1
access-list outside-in extended permit tcp any interface outside eq 2323
access-group outside-in in interface outside
六.测试:
A.PC1能正常通过R2内网地址telnet R2
B.R1能正常通过R2映射后公网地址telnet R1
R1#telnet 202.100.1.1 2323
Trying 202.100.1.1, 2323 ... Open


User Access Verification

Password:
R2>
C.但是PC1却无法通过R1映射后的公网地telnet R1
七.配置hairpin NAT

参考链接: http://blog.csdn.net/boblxs/article/details/8063814
A.允许相同接口返回流量
same-security-traffic permit intra-interface
B.配置hairpin NAT
global (inside) 1 interface
static (inside,
inside) tcp 202.100.1.1 2323 10.1.1.2 23
C.测试:

PC1能通过telnet 202.100.1.1 2323登录R2,登录R2后看到的地址为防火墙内网口地址:

122235294.jpg

你可能感兴趣的:(NAT,ASA8.0,hairpin,hairpin)