内网穿透产品 frp ngrok FastTunnel

目录

[一,frp 内外穿透 ,自己搭建内网穿透服务,需要服务器](#一,frp 内外穿透 ,自己搭建内网穿透服务,需要服务器)

[1 服务器端配置 frps.ini](#1 服务器端配置 frps.ini)

[2 想要 frps 随系统启动,可以使用系统服务管理器,](#2 想要 frps 随系统启动,可以使用系统服务管理器,)

[3 客户端 frpc.ini 配置](#3 客户端 frpc.ini 配置)

[4 用nginx映射端口号的路径到不同的端口,避免公网ip暴露过多的端口号,](#4 用nginx映射端口号的路径到不同的端口,避免公网ip暴露过多的端口号,)

5,远程登录内网linux主机配置

1)阿里云主机放开ssh登录端口2223(随便选一个端口)

2)内网linux客户端frpc.ini增加配置

3)连接配置连接配置)

4)测试连接测试连接)

6,远程连接windows主机配置

[二,ngrok 国外的免费的内网穿透工具,不需要服务器,很慢](#二,ngrok 国外的免费的内网穿透工具,不需要服务器,很慢)

[0. 在自己电脑跑一个web服务,端口 8080](#0. 在自己电脑跑一个web服务,端口 8080)

[1. Unzip to install](#1. Unzip to install)

[2. Connect your account](#2. Connect your account)

[3. Fire it up](#3. Fire it up)

[三,FastTunnel 国内开源产品,需要公网服务器](#三,FastTunnel 国内开源产品,需要公网服务器)


一,frp 内外穿透 ,自己搭建内网穿透服务,需要服务器

客户端,服务端根据不同的系统分别下载不同的版本

下载地址:

Releases · fatedier/frp (github.com)

1 服务器端配置 frps.ini

bash 复制代码
# frps.ini

[common]
bind_port = 7000

bind_addr = 0.0.0.0
# 用于身份验证,请自行修改,要保证服务端与客户端一致
token = 123456
# 运行日志文件
log_file = /var/log/frps.log
# 是否以守护进程方式运行
daemon = true

启动命令 测试配置是否正确

bash 复制代码
# 连接窗口关闭或ctrl+c停止运行
 ./frps -c ./frps.ini 

2想要 frps 随系统启动,可以使用系统服务管理器,

如 systemd 来创建服务文件。以下是一个 systemd 服务文件示例(frps.service):

bash 复制代码
[Unit]
Description=FRP Server Service
After=network.target

[Service]
Type=simple
ExecStart=/path/to/frps -c /path/to/frps.ini
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

将 frps.service 文件保存到 /etc/systemd/system/ 目录下,然后使用以下命令启用和启动 frps 服务:

bash 复制代码
 
#systemctl enable frps.service 这一条命令的作用是启用(或称为激活)一个 systemd 服务单元(在这个例子中是 frps.service),以确保该服务在系统启动时自动运行。
#具体来说,当你执行 systemctl enable frps.service 时,systemd 会执行以下操作:
#它会查找你提供的服务单元文件(在这个例子中是 frps.service),这个文件通常位于 /etc/systemd/system/、/lib/systemd/system/ 或其他 systemd 服务单元文件目录中。
#一旦找到服务单元文件,systemd 会创建一个指向该文件的符号链接(symlink)在 /etc/systemd/system/multi-user.target.wants/ 或其他类似的目标(target)目录中。这个符号链接#的创建是 enable 命令的主要工作。
#当系统启动到 multi-user.target(也就是通常的图形界面或多用户模式)时,systemd 会遍历这些目标目录中的符号链接,并启动它们所指向的服务单元文件定义的服务。
#因此,当系统下次启动时,frps 服务将自动启动,而无需你手动执行 systemctl start frps.service 命令。
sudo systemctl enable frps.service  # 激活服务
sudo systemctl start frps.service    # 启动服务
sudo systemctl stop frps.service    # 停止服务
sudo systemctl status frps.service    # 查看服务状态

3 客户端 frpc.ini 配置

bash 复制代码
[common]
server_addr = 106.xxx.xxx.xxx
server_port = 7000
token = 123456

# 把公网106.xxx.xxx.xxx:8600 映射到本地8000端口
[park]
type = tcp
local_ip = 127.0.0.1
local_port = 8000
remote_port = 8600

# 把公网106.xxx.xxx.xxx:8601映射到本地8001端口
[pay]
type = tcp
local_ip = 127.0.0.1
local_port = 8001
remote_port = 8601

启动客户端 ,公网ip:106.xxx.xxx.xxx 暴露 7000,8600,8601端口号

bash 复制代码
 frpc -c ./frpc.ini

4 用nginx映射端口号的路径到不同的端口,避免公网ip暴露过多的端口号,

5,远程登录内网linux主机配置

1)阿里云主机放开ssh登录端口2223(随便选一个端口)

2)内网linux客户端frpc.ini增加配置

复制代码
[ssh_pi]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 2223

3)连接配置

4)测试连接

6,远程连接windows主机配置

Windows远程桌面配置(阿里云ECS服务器+frp+windows远程桌面配置)_云服务器ecs windows-CSDN博客

参考

frp内网穿透_frps-CSDN博客

https://www.cnblogs.com/cenima/p/17849921.html

开源内网穿透工具 frp 简单使用教程 - 个人文章 - SegmentFault 思否

二,ngrok 国外的免费的内网穿透工具,不需要服务器,很慢

注册ngrok - Online in One Line

官网有各种系统部署方法,支持win,mas,linux,raspberry...等各种平台

0. 在自己电脑跑一个web服务,端口 8080

1. Unzip to install

On Linux or Mac OS X you can unzip ngrok from a terminal with the following command. On Windows, just double click ngrok.zip to extract it.

复制代码
unzip /path/to/ngrok.zip

2. Connect your account

Running this command will add your authtoken to the default ngrok.yml configuration file. This will grant you access to more features and longer session times. Running tunnels will be listed on the endpoints page of the dashboard.

复制代码
ngrok config add-authtoken 你的token

3. Fire it up

To start a HTTP tunnel forwarding to your local port 80, run this next:

复制代码
ngrok http 8080

三,FastTunnel 国内开源产品,需要公网服务器

快速上手 | FastTunnel (suidao.io)

相关推荐
白菜欣4 分钟前
Linux —进程概念
linux·运维·服务器
iuu_star7 分钟前
Vue+FastAPI 项目宝塔Linux部署指南
linux·运维·fastapi
杜哥无敌9 分钟前
FreeSSHd vs FileZilla Server vs SFTPGo:Windows SFTP服务器易用性终极横向测评
运维·服务器·windows
楼田莉子10 分钟前
仿Muduo的高并发服务器:Channel模块与Poller模块
linux·服务器·c++·学习·设计模式
zhouwy11312 分钟前
Linux网络编程从入门到精通
linux·c++
luoqice15 分钟前
RTMP视频流的帧格式分析
网络·ffmpeg
zhangrelay16 分钟前
ROS Kinetic-信号与系统-趣味案例
linux·笔记·学习·ubuntu
IMPYLH16 分钟前
Linux 的 tail 命令
linux·运维·服务器·bash
生成论实验室17 分钟前
《事件关系阴阳博弈动力学:识势应势之道》第五篇:安全关键关系——故障、障碍与冲突
运维·服务器·人工智能·安全·架构
weixin_4462608518 分钟前
应用实战篇:利用 DeepSeek V4 构建生产级 AI 应用的全流程与最佳实践
大数据·linux·人工智能