九溪

溪水润知林,滴露启慧心

用户工具

站点工具


wiki:linux:linux-windows-frp

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
wiki:linux:linux-windows-frp [2021/12/31 13:44] – [下载] colinwiki:linux:linux-windows-frp [2021/12/31 14:16] (当前版本) – 移除 colin
行 1: 行 1:
-====== frps内网穿透 ====== 
- 
-===== 概述 ===== 
- 
-==== frps是什么 ==== 
- 
-frp 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网。 
- 
-你可以粗略理解它是一个中转站,帮你实现 公网 ←→ FRP(服务器) ←→ 内网 的连接,让内网里的设备也可以被公网访问到。你只需一台有公网IP的 VPS 服务器即可愉快地进行内网穿透,来让外网与你家内网建立起连接,实现远程访问! 
- 
-当然 FRP 还尝试性支持了点对点穿透功能,但限制较多这里不讨论! 
- 
-==== frps资料 ==== 
- 
-  - github官方地址:https://github.com/fatedier/frp 
-  - 中文文档:https://gofrp.org/docs/  https://gofrp.org/docs/examples/ 
-  - Release https://github.com/fatedier/frp/releases 
-  - v0.38.0 https://github.com/fatedier/frp/releases/tag/v0.38.0 (截至20211230) 
-  - frp配置实践教程 https://www.jianshu.com/p/09603d9e0b6c 
-  - 说明:本文中使用的连接方式为kcp(基于udp协议),特此注明 
- 
-==== 准备 ==== 
- 
-  - 公网电脑/VPS:Linux,运行frps服务端 
-  - 内网电脑:windows,运行frpc客户端 
-  - 注册域名、域名A记录指向服务器IP、域名备案(有需要的话) 
- 
-===== 服务端配置(linux为例) ===== 
- 
-==== 安装 ==== 
- 
-FRP 使用 Go 语言开发,可以支持 Windows、Linux、macOS、ARM 等多平台部署。FRP 安装非常容易,因为开源,只需到 Github 发布页 下载对应系统平台的软件包并解压就可用了。 
- 
-<code> 
-sudo mkdir -p /etc/frp 
-cd /etc/frp 
-sudo wget "https://github.com/fatedier/frp/releases/download/v0.38.0/frp_0.38.0_linux_amd64.tar.gz" 
-sudo tar xzvf frp_0.38.0_linux_amd64.tar.gz 
-sudo mv frp_0.38.0_linux_amd64/* /etc/frp 
-</code> 
- 
-==== frps.ini 配置 ==== 
- 
-<code> 
-# frps.ini 服务端配置 
-[common] 
-#bind_addr = 0.0.0.0 
- 
-# 默认使用TCP连接,可能导致http域名无法访问的问题 
-# bind_port = 7000 
- 
-# frp支持使用kcp作为底层的通讯协议,而kcp默认就是基于udp协议 
-kcp_bind_port = 7000 
- 
-vhost_http_port = 8080 
- 
-# frp 控制面板 
-dashboard_port = 7500 
-dashboard_user = admin 
-dashboard_pwd = hellokitty 
-</code> 
- 
-开启防火墙端口:7000 
- 
-==== 运行 ==== 
- 
-  ./frps -c ./frps.ini 
- 
- 
-===== 客户端安装配置(windows为例) ===== 
- 
-==== 下载 ==== 
- 
-从以下地址下载,并解压缩到相应目录。https://github.com/fatedier/frp/releases,下载最新frp_*_windows_amd64.zip 
- 
-  https://github.com/fatedier/frp/releases/download/v0.38.0/frp_0.38.0_windows_amd64.zip 
- 
-==== frpc.ini 配置 ==== 
- 
-启动动前,我们需要先修改配置文件。需要修改 frpc.ini 配置文件。 
- 
-<code> 
-# frpc.ini 客户端配置 
- 
-[common] 
-server_addr = 117.50.175.16 
-server_port = 7000 
-# frp支持使用kcp作为底层的通讯协议,而kcp默认就是基于udp协议 
-protocol = kcp 
- 
-[ip_a] 
-# 适用于IP形式访问 
-# 形式为 server_addr:remote_port 
-# 示例为 117.50.175.16:6655 
-type = tcp 
-# 局域网IP,如果为本机,则是127.0.0.1 
-local_ip = 127.0.0.1 
-local_port = 80 
-remote_port = 8180 
- 
-[ip_evlicensemanager] 
-# 适用于IP形式访问 
-# 形式为 server_addr:remote_port 
-# 示例为 117.50.175.16:6655 
-type = tcp 
-# 局域网IP,如果为本机,则是127.0.0.1 
-local_ip = 172.16.0.18 
-local_port = 88 
-remote_port = 6655 
- 
-[domain_a] 
-# 适用于域名形式访问 
-# 形式为 custom_domains:(frps.ini)vhost_http_port 
-# 示例为 elic.imkk.site:8080 
-type = http 
-# 内网 IP (如是本机,也可使用 127.0.0.1 或者这行不要) 
-local_ip = 172.16.0.18 
-local_port = 88 
-# 必填项 
-custom_domains = elic.imkk.site 
-tls_enable = true 
-</code> 
- 
-==== 运行 ==== 
- 
-  ./frps.exe -c ./frps.ini 
- 
-===== frps 服务端注册为服务,并自动启动 ===== 
- 
-创建服务文件 
- 
-  sudo vim /usr/lib/systemd/system/frps.service 
- 
-编辑为以下内容 
- 
-<code> 
-[Unit] 
-Description=frp server 
-After=network.target 
- 
-[Service] 
-Type=simple 
- 
-ExecStart=/etc/frp/frps -c /etc/frp/frps.ini 
-ExecReload=/bin/kill -s HUP $MAINPID 
-ExecStop=/bin/kill -s QUIT $MAINPID 
- 
-[Install] 
-WantedBy=multi-user.target 
-</code> 
- 
-设置开启自启 
- 
-  sudo systemctl enable frps 
- 
-启动服务 
- 
-  sudo systemctl start frps 
- 
-停止服务 
- 
-  sudo systemctl stop frps 
- 
-重启服务 
- 
-  sudo systemctl restart frps 
- 
-查看服务状态 
- 
-  sudo systemctl status frps 
- 
  
wiki/linux/linux-windows-frp.1640929444.txt.gz · 最后更改: 2023/01/03 15:24 (外部编辑)