一.测试拓扑:
参考链接:
二.基本思路:
A.通过配置hairpin NAT使得内网通过映射后的公网地址访问内部服务器时同时做目标地址转换,也做源地址转换
---被访问的内部服务器看到的地址为ASA内部接口地址,而不是内网实际地址
B.因为流量只是在ASA的内部接口进出,所以需要开启相同安全级别在同一接口的进出
三.基本配置:
A.R1:interface FastEthernet0/0 ip address 202.100.1.2 255.255.255.0 no shutB.ASA8.0:interface Ethernet0/0 nameif inside ip address 10.1.1.254 255.255.255.0 no shutinterface Ethernet0/1 nameif outside ip address 202.100.1.1 255.255.255.0 no shutroute outside 0.0.0.0 0.0.0.0 202.100.1.2C.R2:interface FastEthernet0/0 ip address 10.1.1.2 255.255.255.0 no shutip route 0.0.0.0 0.0.0.0 10.1.1.254enable secret ciscoline vty 0 4 password cisco login-----R1开启telnet服务D.PC1:IP:10.1.1.1/24GW:10.1.1.254四.防火墙NAT配置:A.动态PAT:nat (inside) 1 10.1.1.0 255.255.255.0global (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 icmpB.允许外面Telnet内网R1access-list outside-in extended permit tcp any interface outside eq 2323access-group outside-in in interface outside六.测试:A.PC1能正常通过R2内网地址telnet R2B.R1能正常通过R2映射后公网地址telnet R1R1#telnet 202.100.1.1 2323Trying 202.100.1.1, 2323 ... OpenUser Access VerificationPassword: R2>C.但是PC1却无法通过R1映射后的公网地telnet R1七.配置hairpin NAT参考链接:
A.允许相同接口返回流量same-security-traffic permit intra-interface B.配置hairpin NATglobal (inside) 1 interfacestatic (inside,inside) tcp 202.100.1.1 2323 10.1.1.2 23 C.测试:PC1能通过telnet 202.100.1.1 2323登录R2,登录R2后看到的地址为防火墙内网口地址: