内网穿透产品 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 驱动开发的黑盒:从 GPIO 模拟到 DMA 陷阱全书
android·linux·驱动开发
定偶5 分钟前
TCP/IP协议栈深度解析技术
网络
无名的小三轮18 分钟前
华为eNSP中USG6000防火墙web界面登录设置
网络·笔记·安全·web安全·华为
wishchin23 分钟前
Jetson Orin Trt: No CMAKE_CUDA_COMPILER could be found
linux·运维·深度学习
AI视觉网奇24 分钟前
ue 5.5 c++ mqtt 订阅/发布 json
网络·c++·json
ArrebolJiuZhou30 分钟前
03 rtp,rtcp,sdp的包结构
linux·运维·服务器·网络·arm开发
txinyu的博客32 分钟前
解析muduo源码之 StringPiece.h
开发语言·网络·c++
4032407333 分钟前
Ubuntu/Jetson 通用:NVMe 硬盘分区、挂载及开机自动挂载完整教程
linux·运维·ubuntu
田地和代码36 分钟前
linux应用用户安装jdk以后 如果root安装hbase客户端需要jdk还需要再次安装吗
java·linux·hbase
乔碧萝成都分萝37 分钟前
二十四、Linux如何处理中断
linux·驱动开发·嵌入式