当前位置:网站首页>将内网映射到公网【无需公网IP】
将内网映射到公网【无需公网IP】
2022-07-24 05:22:00 【CpolarLisa】
有时候我们会以本地电脑做服务器搭建项目,需要将内网映射到公网,让公网用户能够访问到在内网搭建的项目。但由于IPV4资源的枯竭,我们基本不会被分配到公网IP,而是内网IP,无法直接实现公网访问内网。
而在没有公网IP的情况下,要如何将内网映射到公网呢?
对于这种情况,可以做内网穿透,流量通过第三方公网IP服务器进行转发,下载个内网穿透工具,就可以很简单的实现公网访问内网。
我使用的是cpolar内网穿透,支持http/https/tcp协议,不限制流量,支持永久免费使用(有4条免费隧道、1M带宽)。
并且,cpolar的使用也很简单,只需要在内网设备上安装配置客户端,就可以创建隧道将内网端口映射到公网上。
1. 免费注册并安装cpolar内网穿透
cpolar官网:https://www.cpolar.com/
- Windows系统直接下载安装即可
- linux系统可参考该教程进行安装配置—— linux系统安装cpolar内网穿透
2. 将内网映射到公网
浏览器访问http://localhost:9200/,使用免费注册的cpolar账号登录,并点击左侧仪表盘——隧道管理——创建隧道
- 隧道名称:可自定义
- 协议:支持http/https/tcp协议
- 本地地址:填写你想要映射的本地端口号
- 域名类型:免费选择“随机域名”,付费用户可选择配置“固定二级子域名”或“自定义域名”
- 地区:可选择United States、China、Europe、Hong Kong…

3. 获取所映射的公网地址
当隧道创建成功后,就可以在状态——在线隧道列表,查看到刚刚创建的隧道。有生成相应的公网地址,复制并且使用,就可以实现公网访问内网服务。
边栏推荐
- day6-jvm
- 常见十大漏洞总结(原理、危害、防御)
- QT char to qstring hexadecimal and char to hexadecimal integer
- CRC-16 MODBUS code
- Deepsort summary
- Dameng database_ Common user management commands
- systemctl + journalctl
- Accessing a one-dimensional array with a pointer
- Unity(二) 更多API和物理引擎
- JDBC advanced -- learning from Shang Silicon Valley (DAO)
猜你喜欢

Calculation steps of principal component analysis
![[deep learning] handwritten neural network model preservation](/img/4a/27031f29598564cf585b3af20fe27b.png)
[deep learning] handwritten neural network model preservation

Hit the wall record (continuously updated)

Use QT to connect to MySQL and create table numbers, write data, and delete data

MySQL download and installation environment settings

使用Keras实现CNN+BiLSTM+Attention的多维(多变量)时间序列预测

Hololens 2 development: use MRTK and simulate gesture input in unity

Lua基础

UE4 replacement system 3. Final results

Unicast, multicast, broadcast, tool development, introduction to QT UDP communication protocol development and source code of development tools
随机推荐
HoloLens 2 中文开发文档 MRTK v2
【数据库系统原理】第四章 高级数据库模型:统一建模语言UML、对象定义语言ODL
UE4: what is the gameplay framework
Search of two-dimensional array of "sword finger offer" C language version
Conversion of world coordinate system, camera coordinate system and image coordinate system
HoloLens2开发:使用MRTK并且模拟眼动追踪
ue4 换装系统3.最终成果
systemctl + journalctl
First knowledge of graphics
day-7 jvm完结
头歌 平台作业
Dameng database_ Logical backup
Demo of UDP communication applied to various environments
ue4换装系统 1.换装系统的基本原理
Hololens 2 development 101: create the first hololens 2 Application
Unicast, multicast, broadcast, tool development, introduction to QT UDP communication protocol development and source code of development tools
Use QT to connect to MySQL and create table numbers, write data, and delete data
day6-jvm
unity2D游戏之让人物动起来-下
Oserror: [winerror 127] the specified program cannot be found. Error loading “caffe2_detectron_ops.dll“ or one of its dependencies