search
HomeDatabaseMysql TutorialCisco ASA Hairpinning技术解决内网通过公网IP访问内网服务器问

用户 需求: ASA 目前使用 inside 、 outside 两个接口,无 DMZ 区域,目前 服务器 地址 192.168.1.244 通信端口 8080 ;本地测试客户端的 ip 地址是 192.168.1.100 ; 通过 静态的 NAT 后 ip 是 218.17.199.108 ,外网映射端口是 56123 。做完常规的 STAICN

用户需求:

ASA目前使用inside outside 两个接口,无DMZ区域,目前服务器地址192.168.1.244 通信端口8080;本地测试客户端的ip地址是192.168.1.100通过静态的NATip218.17.199.108,外网映射端口是56123。做完常规的STAIC NAT后,测试情况如下:

公网测试:http://218.17.199.108:56123/Gwall_osa是成功的

本地测试:http://218.17.199.108:56123/Gwall_osa不成功

目的就是要解决本地测试http://218.17.199.108:56123/Gwall_osa,能正常访问,数据能交互。ASA 防火墙使用Hairpinning技术解决内网PC通过公网IP访问内网的服务器问题。如下拓扑:

Cisco ASA Hairpinning技术解决内网通过公网IP访问内网服务器问

 

IOS 8.3以前版本的 Hairpinning技术相关配置如下:

1same-security-traffic permit intra-interface //允许同一接口发起进出口流量

2nat (inside) 1 0.0.0.0 0.0.0.0

3global (outside) 1 interface//NAT允许所有上网

4global (inside) 1 interface

// 为内网用户使用Hairpinning访问内部服务器定义global地址。

5static (inside,outside) 218.17.199.108 192.168.1.244 netmask 255.255.255.255

//使用Static NAT映身一台服务器,公网IP218.17.199.108 -->IP 192.168.1.244

6static (inside,inside) 218.17.199.108 192.168.1.244 netmask255.255.255.255

//Hairpinning流量返回路径定义NAT映射:218.17.199.108 ->192.168.1.244

7access-list outside_access_in extended permit tcp any host218.17.199.108 eq 56123

放行流量,应用在outside的口。

 

IOS 8.3以后版本的 Hairpinning技术相关配置如下:

same-security-traffic permitintra-interface

//允许同一接口发起进出口流量

object network ser1

host 192.168.1.244

nat (insdie,outside) sta 218.17.199.108 sertcp 56123 8080 

//保证公网能通过映射访问内部服务器

object network my-test1

subnet 10.1.0.0 255.255.255.0 

nat(inside,inside) dynamic interface

object network my-test1

subnet 10.2.0.0 255.255.255.0 

nat(inside,inside) dynamic interface

object network my-test3

subnet192.168.1.0 255.255.255.0 

nat(inside,inside) dynamic interface

object network test

host192.168.1.244 (服务器IP)

nat(inside,inside) static 218.17.199.108 service tcp 8080 56123

放行ACL流量

access-list outside_access_in extendedpermit tcp any host 218.17.199.108 eq 56123

access-group outside_access_in in inoutside

yeexw” 博客,转载请与作者联系!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What Are the Limitations of Using Views in MySQL?What Are the Limitations of Using Views in MySQL?May 14, 2025 am 12:10 AM

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

Securing Your MySQL Database: Adding Users and Granting PrivilegesSecuring Your MySQL Database: Adding Users and Granting PrivilegesMay 14, 2025 am 12:09 AM

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

What Factors Influence the Number of Triggers I Can Use in MySQL?What Factors Influence the Number of Triggers I Can Use in MySQL?May 14, 2025 am 12:08 AM

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M

MySQL: Is it safe to store BLOB?MySQL: Is it safe to store BLOB?May 14, 2025 am 12:07 AM

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

MySQL: Adding a user through a PHP web interfaceMySQL: Adding a user through a PHP web interfaceMay 14, 2025 am 12:04 AM

Adding MySQL users through the PHP web interface can use MySQLi extensions. The steps are as follows: 1. Connect to the MySQL database and use the MySQLi extension. 2. Create a user, use the CREATEUSER statement, and use the PASSWORD() function to encrypt the password. 3. Prevent SQL injection and use the mysqli_real_escape_string() function to process user input. 4. Assign permissions to new users and use the GRANT statement.

MySQL: BLOB and other no-sql storage, what are the differences?MySQL: BLOB and other no-sql storage, what are the differences?May 13, 2025 am 12:14 AM

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

MySQL Add User: Syntax, Options, and Security Best PracticesMySQL Add User: Syntax, Options, and Security Best PracticesMay 13, 2025 am 12:12 AM

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

MySQL: How to avoid String Data Types common mistakes?MySQL: How to avoid String Data Types common mistakes?May 13, 2025 am 12:09 AM

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor