当前位置:网站首页>将内网映射到公网【无需公网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
- Calculation steps of principal component analysis
- Jestson installs IBus input method
- JUC concurrent programming foundation (9) -- thread pool
- Accurate calculation of time delay detailed explanation of VxWorks timestamp
- Foundation of JUC concurrent programming (4) -- thread group and thread priority
- vsual studio 2013环境 Udp组播
- How to solve the problem of large distribution gap between training set and test set
- Using keras to realize LSTM time series prediction based on attention mechanism
- Channel attention and spatial attention module
猜你喜欢
随机推荐
day-7 jvm完结
[USB host] stm32h7 cubemx porting USB host with FreeRTOS to read USB disk, usbh_ Process_ The OS is stuck. There is a value of 0xa5a5a5
unity最新版本的Text(TMP)UI文本怎么显示中文
Unity(三)三维数学和坐标系统
EXCEL 生成mysql语句批量操作
Unity Shader从内置渲染管线迁移到URP
QT char to qstring hexadecimal and char to hexadecimal integer
ue4 换装系统3.最终成果
JDBC advanced -- learning from Shang Silicon Valley (DAO)
Learning rate optimization strategy
Dameng database_ Common initialization parameters
常见AR以及MR头戴显示设备整理
vsual studio 2013环境 Udp组播
Dameng database_ Summary of supported data types
JSON. Dumps() function parsing
头歌 平台作业
Sort ArrayList < ArrayList < double> >
HoloLens 2 开发:开发环境部署
Positional argument after keyword argument
data normalization









