frp 实现内网穿透

作者: guanguans | 来源:发表于2018-10-20 23:29 被阅读71次

一、准备

  • 公网服务器
  • 内网服务器(自己本地服务器)

二、安装frp服务端

2.1 公网服务器执行下面四条命令

# apt 更新
apt-get update

# 下载frps服务端脚本
wget --no-check-certificate https://raw.githubusercontent.com/clangcn/onekey-install-shell/master/frps/install-frps.sh -O ./install-frps.sh

# 修改脚本权限
chmod 700 ./install-frps.sh

# 执行脚本安装
./install-frps.sh install

2.2之后会让你输一些参数,直接一路回车默认值就可以了

==============================================
You Server IP      : 45.*******.194
Bind port          : 5443
KCP support        : true
vhost http port    : 80
vhost https port   : 443
Dashboard port     : 6443
token              : WK*******tDGI
tcp_mux            : true
Max Pool count     : 50
Log level          : info
Log max days       : 3
Log file           : enable
==============================================
frps Dashboard     : http://45.*******.194:6443/
Dashboard user     : ******
Dashboard password : ******
==============================================

2.3 浏览器访问控制面板、安装成功。

三、安装frp客户端

根据自己本地操作系统选择下载客户端 https://github.com/fatedier/frp/releases/

减压找到配置文件 frpc.ini

# 我的配置
# ./frpc -c ./frpc.ini
[common]
server_addr = 47.93.21.194
server_port = 5443
token = WKMRk7J3adu9tDGI

[web]
type = http
local_ip = 127.0.0.1
local_port = 80
# IP解析
custom_domains = 47.******.194
# 域名解析
# custom_domains = www.xxx.com

四、启动服务

4.1 首先启动本地服务器nginx、apache或者tomcat,确保 local_ip 127.0.0.1能够浏览器访问

127.0.0.1

4.2MAC(其他系统参考 frp github)下执行 ./frpc -c ./frpc.ini,验证外网ip访问本地服务器。

47.******.194

4.3 如果要实现域名访问内网,只需要域名解析服务端公网IP,服务端的服务器(nginx、apache或者tomcat)配置一下虚拟主机就可以了。

相关文章

  • Springboot实现跨域

    为了实现内网穿透,使用的frp。 请求链路:localhost前端—>云端服务器—>经frp穿透内网到localh...

  • 【附下载】带你使用frp实现内网穿透详细教程!

    frp实现内网穿透 项目地址:https://github.com/fatedier/frp/releases[h...

  • (五)frp内网穿透安全配置

    frp的安装介绍 已经在第一节文章有介绍请参考 (一)frp内网穿透ssh登录内网ip服务器 frp 内网穿透安全...

  • frp 实现内网穿透

    一、准备 公网服务器 内网服务器(自己本地服务器) 二、安装frp服务端 2.1 公网服务器执行下面四条命令 2....

  • Frp 实现内网穿透

    首先你要有一台公网服务器如果没有公网服务器,可以用NATAPP,请参见这篇教程之前一直想用ngrok来实现,奈何交...

  • frp实现内网穿透

    因为有在外面访问家里 NAS 的需求,群晖自带的动态域名解析访问又太慢。所以需要用内网穿透技术来实现通过其他公网 ...

  • frp实现内网穿透

    frp简介 FRP 项目地址https://github.com/fatedier/frp/blob/master...

  • frp实现内网穿透

    没有公网IP是一件很不方便的事情,尤其是在国内的网络环境。例如在校园网情况下想要使用远程桌面,只能使用第三方远程桌...

  • frp实现内网穿透

    github项目[https://github.com/fatedier/frp/tree/dev] 目标 从公网...

  • frp实现内网穿透

    一、准备工作 使用场景 因为疫情的原因,最近在家无法返校。无法访问实验室的工作站的话就没法干活了(跑深度学习实验)...

网友评论

    本文标题:frp 实现内网穿透

    本文链接:https://www.haomeiwen.com/subject/awlvzftx.html