2023-07-11 17:25:28 +08:00
|
|
|
|
---
|
|
|
|
|
title: frp反向代理实现内网穿透
|
|
|
|
|
date: 2023-07-11 16:12:34
|
|
|
|
|
excerpt:
|
|
|
|
|
tags:
|
|
|
|
|
rating: ⭐
|
|
|
|
|
---
|
2023-07-11 18:55:56 +08:00
|
|
|
|
|
|
|
|
|
# 服务端配置
|
2023-07-12 10:34:48 +08:00
|
|
|
|
Docker 启动**frps**的命令:
|
2023-07-11 18:55:56 +08:00
|
|
|
|
```bash
|
|
|
|
|
docker run --restart=always --network host -d \
|
2023-07-12 13:49:04 +08:00
|
|
|
|
-v /home/frp/frps.ini:/etc/frp/frps.ini \
|
2023-07-11 18:55:56 +08:00
|
|
|
|
--name frps snowdreamtech/frps
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
服务器配置:
|
|
|
|
|
```ini
|
|
|
|
|
[common]
|
2023-07-12 12:58:32 +08:00
|
|
|
|
# 监听端口
|
2023-07-12 13:49:04 +08:00
|
|
|
|
bind_port = 7100
|
2023-07-12 12:58:32 +08:00
|
|
|
|
# 面板端口
|
|
|
|
|
dashboard_port = 7500
|
|
|
|
|
# 登录面板账号设置
|
|
|
|
|
dashboard_user = bluerose
|
|
|
|
|
dashboard_pwd = ljj199221
|
|
|
|
|
# 设置http及https协议下代理端口(非重要)
|
2023-07-12 13:49:04 +08:00
|
|
|
|
vhost_http_port = 7001
|
|
|
|
|
vhost_https_port = 7002
|
2023-07-11 18:55:56 +08:00
|
|
|
|
# 身份验证
|
2023-07-12 13:49:04 +08:00
|
|
|
|
token = ljj@378100977
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# 内网Linux客户端
|
|
|
|
|
Docker 启动**frpc**的命令:
|
|
|
|
|
```bash
|
|
|
|
|
docker run --restart=always --network host -d \
|
|
|
|
|
-v /root/frp/frpc.ini:/etc/frp/frpc.ini \
|
|
|
|
|
--name frpc snowdreamtech/frpc
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
内网客户端配置:
|
|
|
|
|
```bash
|
|
|
|
|
[common]
|
|
|
|
|
# server_addr为FRPS服务器IP地址
|
|
|
|
|
server_addr = 150.109.145.182
|
|
|
|
|
# server_port为服务端监听端口,bind_port
|
|
|
|
|
server_port = 7100
|
|
|
|
|
# 身份验证
|
|
|
|
|
token = ljj@378100977
|
|
|
|
|
|
2023-07-11 18:55:56 +08:00
|
|
|
|
# [ssh] 为服务名称,下方此处设置为,访问frp服务段的2288端口时,等同于通过中转服务器访问127.0.0.1的22端口。
|
|
|
|
|
# type 为连接的类型,此处为tcp
|
|
|
|
|
# local_ip 为中转客户端实际访问的IP
|
|
|
|
|
# local_port 为目标端口
|
|
|
|
|
# remote_port 为远程端口
|
2023-07-12 13:49:04 +08:00
|
|
|
|
[ssh]
|
2023-07-11 18:55:56 +08:00
|
|
|
|
type = tcp
|
2023-07-12 12:58:32 +08:00
|
|
|
|
local_ip = 127.0.0.1
|
2023-07-12 13:49:04 +08:00
|
|
|
|
local_port = 22
|
|
|
|
|
remote_port = 10022
|
2023-07-11 18:55:56 +08:00
|
|
|
|
|
2023-07-12 13:49:04 +08:00
|
|
|
|
[wol web]
|
|
|
|
|
type = http
|
|
|
|
|
local_ip = 127.0.0.1
|
|
|
|
|
local_port = 7000
|
|
|
|
|
custom_domains = blueroses.top
|
2023-07-12 10:34:48 +08:00
|
|
|
|
```
|
2023-07-11 18:55:56 +08:00
|
|
|
|
|
2023-07-12 10:34:48 +08:00
|
|
|
|
# 外网Win客户端
|