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

相关推荐
天一生水water1 天前
docker-compose安装
运维·docker·容器
AuroraDPY1 天前
计算机网络:基于TCP协议的自定义协议实现网络计算器功能
网络·tcp/ip·计算机网络
Archy_Wang_11 天前
基于BaGet 构建NuGet私有库并实现类库打包到NuGet私有库
运维·jenkins
小狗爱吃黄桃罐头1 天前
正点原子【第四期】Linux之驱动开发学习笔记-10.1 Linux 内核定时器实验
linux·驱动开发·学习
初听于你1 天前
运维高级故障排除与恢复-SysRq
运维·服务器·安全
张人玉1 天前
TCP 的三次握手和四次挥手
网络·tcp/ip·c#
RPA机器人就用八爪鱼1 天前
RPA自动化程序:企业数字化转型的智能引擎
运维·自动化·rpa
Kang强1 天前
tcpdump 抓到 icmp 包,但是抓不到 tcp 包??
linux
demodashi6661 天前
Linux下ag搜索命令详解
linux·运维·windows
無识1 天前
Linux-第四章web服务
linux·运维·服务器