静看光阴荏苒
不管不顾不问不说也不念

frp内网穿透,这个有大用处!

简单记录一下frp的部署和基本用法,主要是因为今天自己切实享受到了frp带来的便利= =

我说我第一次用frp可能很多人都不相信,因为很久以前都是用3322动态域名/花生壳这类东西,真的是暴露年龄的玩意啊~

frp分为客户端和服务端两类,frps为服务端,frpc为客户端,这个要先理清楚。

首先我们在一台CentOS7的VPS上部署frps:

cd
wget https://github.com/fatedier/frp/releases/download/v0.21.0/frp_0.21.0_linux_amd64.tar.gz
tar -xzvf frp_0.21.0_linux_amd64.tar.gz
cd frp_0.21.0_linux_amd64

编辑服务端配置文件:

vi frps.ini

写入:

[common]
bind_port = 7000
token = 设置一个密码

然后启动服务端:

./frps -c ./frps.ini

成功启动会有类似如下图的回显:

如果要把服务端放到后台运行可以利用scrren:

yum -y install screen
screen -S frp
./frps -c ./frps.ini

接下来是客户端,首先我们下载Windows版本的frp压缩包,下载地址:

https://github.com/fatedier/frp/releases

如图:

编辑客户端的配置文件:frpc.ini

写入:

[common]
server_addr = 服务器公网IP
server_port = 7000
token = 设置一个密码,和服务端相同

[spynote]
type = tcp
local_ip = 127.0.0.1
local_port = 3210
remote_port = 12316

这个配置文件的含义是,当我们访问服务器的公网IP+12316端口就相当于访问我们本地电脑的3210端口。

最后我们打开CMD,执行命令启动frpc:

frpc.exe -c frpc.ini

如图所示,成功连接会有success字样:

并且服务端这边也会有数据回显:

至此,frp的配置就大功告成了,我们现在成功的把内网的3210端口暴露给了外网。

赞(5)
未经允许不得转载:荒岛 » frp内网穿透,这个有大用处!
分享到: 更多 (0)

评论 22

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    ngrok也是一個選擇,因為路由器只有ngrok :razz:

    欧文斯6年前 (2018-08-14) Safari 11.0 Safari 11.0 iPad iOS 11.4.1 iPad iOS 11.4.1回复
    • 我大TP-Link的脸面往哪放!!

      LALA6年前 (2018-08-15) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • openwrt可以安装Frp的

      翔翎6年前 (2018-08-18) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 10 x64 Edition Windows 10 x64 Edition回复
  2. #2

    lala能不能搞个https穿透的教程,我搞了几次用不了。

    david6年前 (2018-08-15) Google Chrome 68.0.3440.91 Google Chrome 68.0.3440.91 Android 8.0.0 Android 8.0.0回复
    • 如果哪天我有需求,也许我就会写篇文章。。。

      LALA6年前 (2018-08-16) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 10 x64 Edition Windows 10 x64 Edition回复
  3. #3

    这样带宽的性能瓶颈就是服务器的带宽了吧

    ANON6年前 (2018-08-17) Google Chrome 68.0.3440.106 Google Chrome 68.0.3440.106 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 这个不好说,环境条件不同,不好判断。。

      LALA6年前 (2018-08-18) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • 不是么,FRP默认也不是三角传输,所有流量都经过服务器中转,天朝VPS的带宽价格 :twisted: ,如果用他的P2P模式,访问终端上又都需要部署FRP,简直 :sad:

        ANON6年前 (2018-08-29) Google Chrome 68.0.3440.106 Google Chrome 68.0.3440.106 Windows 10 x64 Edition Windows 10 x64 Edition回复
        • 想找个好点的开源方案改造一下 :mrgreen: 博主有没有推荐?

          ANON6年前 (2018-08-29) Google Chrome 68.0.3440.106 Google Chrome 68.0.3440.106 Windows 10 x64 Edition Windows 10 x64 Edition回复
          • 目前开源的不是只有这个frp和ngrok了么。。。我真不知道除了这2个还有什么别的了。。。

            LALA6年前 (2018-08-29) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 10 x64 Edition Windows 10 x64 Edition
  4. #4

    家里面的宽带可以用来做没网穿透嘛?

    6年前 (2018-09-02) QQbrowser QQbrowser iPhone iOS 11.1.1 iPhone iOS 11.1.1回复
  5. #5

    家里的宽带ip地址好像是固定的,应该怎么做没网穿透呢?

    6年前 (2018-09-02) QQbrowser QQbrowser iPhone iOS 11.1.1 iPhone iOS 11.1.1回复
    • 没网穿透??内网穿透?

      LALA6年前 (2018-09-04) Google Chrome 67.0.3396.99 Google Chrome 67.0.3396.99 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • 没网穿透笑出声2333

        Lvv6年前 (2018-09-11) Google Chrome 68.0.3440.106 Google Chrome 68.0.3440.106 Windows 7 x64 Edition Windows 7 x64 Edition回复
  6. #6

    那么多端口该怎么办呢

    YuGer6年前 (2018-11-05) Google Chrome 70.0.3538.77 Google Chrome 70.0.3538.77 Windows 10 x64 Edition Windows 10 x64 Edition回复
  7. #7

    lala 我要申请转载权

    anheem5年前 (2018-11-30) Google Chrome 70.0.3538.67 Google Chrome 70.0.3538.67 Windows 7 x64 Edition Windows 7 x64 Edition回复
    • 转呗,dalao留个博客地址我好回访一下啊~

      LALA5年前 (2018-11-30) Google Chrome 70.0.3538.110 Google Chrome 70.0.3538.110 Windows 10 x64 Edition Windows 10 x64 Edition回复
  8. #8

    求你的联系方式大佬

    项目合作5年前 (2019-01-26) Google Chrome 62.0.3202.84 Google Chrome 62.0.3202.84 Android 6.0.1 Android 6.0.1回复

分享创造快乐

广告合作资源投稿