内网穿透产品 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)

相关推荐
zl0_00_021 分钟前
xss-lab
前端·网络·xss
lqlj223342 分钟前
Linux常用命令
linux·运维·服务器
ax一号街阿楠44 分钟前
华为AP 4050DN-HD的FIT AP模式改为FAT AP,家用FAT基本配置
网络·华为·信息与通信
wanhengidc1 小时前
怎样分辨是否是高防服务器?
运维·服务器·网络
itachi-uchiha1 小时前
深入理解 Linux 中的 last 和 lastb 命令
java·linux·服务器
gma9991 小时前
【GB28181】 SIP信令服务器
运维·服务器
张烫麻辣亮。2 小时前
【教程】使用docker+Dify搭建一个本地知识库
运维·docker·容器
不是笨小孩i2 小时前
如何使用Docker一键本地化部署LibrePhotos搭建私有云相册
运维·docker·容器
还有几根头发呀2 小时前
Ubuntu中dpkg命令和apt命令的关系与区别
linux·运维·ubuntu
是懒羊羊吖~2 小时前
IP-----动态路由OSPF
网络·笔记·ospf