Docker 部署 FRP 内网穿透 实现端口映射

Frp 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议,且支持 P2P 通信。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网。 官网地址:https://github.com/fatedier/frp

准备工作:

1、阿里云外网主机一台:CentOS 7  114.55.84.170

2、客户端一台: Window 10 防火墙放行 3389 端口

3、阿里云安全组,放行相关外网端口

实现功能:

透过 Frps 远程桌面到 Window10 服务器上面,远程访问 Nginx 服务

一、服务器 

1、创建目录

mkdir -p /docker/frps

2、创建配置文件

vim frps.ini


[common]
# 服务端监听端口
bind_port = 7000

# http代理监听端口
vhost_http_port = 8080

# https代理监听端口
vhost_https_port = 8081

# 服务端UI界面端口和账密
dashboard_port = 7500
dashboard_addr = 0.0.0.0
dashboard_user = admin
dashboard_pwd = password

3、创建启动脚本

vim start.sh

#!/bin/bash

docker rm -f frps || true
docker run --name frps \
--restart always \
-p 7000:7000 \
-p 7500:7500 \
-p 8080:8080 \
-p 8081:8081 \
-p 33389:33389 \
-v /docker/frps/frps.ini:/etc/frp/frps.ini \
-d snowdreamtech/frps:0.49.0

4、访问 http 服务:http://114.55.84.170:8080/

5、访问 dashboard http://114.55.84.170:7500

二、客户端

1、下载地址

https://github.com/fatedier/frp/releases/download/v0.49.0/frp_0.49.0_windows_amd64.zip

2、解压安装

3、编辑配置文件 frpc.ini

[common]
server_addr = 47.101.192.140
server_port = 7000

# 远程桌面
[rdp]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = 33389

# Web服务
[nginx]
type = http
local_port = 80
custom_domains = local.msh.cloudns.ch

4、运行成功

frpc -c frpc.ini

5、启动客户端 Nginx

6、远程桌面成功

7、远程访问 Nginx 由于没有备案,所以打不开,但是服务是通的。域名+Frps端口

http://local.msh.cloudns.ch:8080/

相关推荐

  1. 使用docker+frp进行穿透

    2024-04-03 17:54:03       17 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-03 17:54:03       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-03 17:54:03       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-03 17:54:03       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-03 17:54:03       18 阅读

热门阅读

  1. 深度学习该如何入门?

    2024-04-03 17:54:03       13 阅读
  2. 【MySQL】数据类型2

    2024-04-03 17:54:03       13 阅读
  3. OpenCV轮廓分析

    2024-04-03 17:54:03       16 阅读
  4. 编写HTML文件时的注意事项

    2024-04-03 17:54:03       17 阅读
  5. ES 在浏览器上安装head插件

    2024-04-03 17:54:03       13 阅读
  6. oceanbase-OAT安装

    2024-04-03 17:54:03       16 阅读
  7. ABAP 去除小数掉

    2024-04-03 17:54:03       16 阅读
  8. 数据仓库——特殊类型的星型模式

    2024-04-03 17:54:03       15 阅读
  9. 国内车牌号正则化匹配

    2024-04-03 17:54:03       13 阅读
  10. 黑豹程序员-Spring Task实现定时任务

    2024-04-03 17:54:03       14 阅读
  11. WebKit结构简介

    2024-04-03 17:54:03       15 阅读
  12. SSD学习_hdparm中的sanitize和security erase的区别

    2024-04-03 17:54:03       13 阅读
  13. RL — 强化学习的若干技巧

    2024-04-03 17:54:03       13 阅读