下载frp

  • 下载

    # wget https://github.com/fatedier/frp/releases/download/v0.30.0/frp_0.30.0_linux_amd64.tar.gz
    
  • 解压

    # tar -zxf frp_0.30.0_linux_amd64.tar.gz && cd frp_0.30.0_linux_amd64
    

安装

  • 移动二进制文件到applications

    # mv {frpc,frps} /usr/local/share/applications/
    
  • 创建配置文件存放路径

    # mkdir -p /etc/frp
    
  • 移动配置文件到上述路径

    # mv {frpc.ini,frps.ini} /etc/frp
    
  • 修改*.service

    • 修改frps.service

      [Unit]
      Description=Frp Server Service
      After=network.target
      
      [Service]
      Type=simple
      User=nobody
      Restart=on-failure
      RestartSec=5s
      ExecStart=/usr/local/share/applications/frps -c /etc/frp/frps.ini
      
      [Install]
      WantedBy=multi-user.target
      
    • 修改frpc.service

      [Unit]
      Description=Frp Client Service
      After=network.target
      
      [Service]
      Type=simple
      User=nobody
      Restart=on-failure
      RestartSec=5s
      ExecStart=/usr/local/share/applications/frpc -c /etc/frp/frpc.ini
      ExecReload=/usr/local/share/applications/frpc reload -c /etc/frp/frpc.ini
      
      [Install]
      WantedBy=multi-user.target
      
  • 移动*.service到相关路径

    # mv {systemd/frpc.service,systemd/frps.service} /usr/lib/systemd/system/
    

配置frp

创建日志存储文件夹

# mkdir -p /var/log/frp

frps

修改配置文件

# vim /etc/frp/frps.ini

内容如下

[common]
# 服务监听端口
bind_port = 30000
bind_udp_port = 29999
vhost_http_port = 38888
dashboard_addr=0.0.0.0
dashboard_port = 29998
dashboard_user = admin
dashboard_pwd = admin
# 一致身份验证token
token = akiya
# 端口白名单
allow_ports = 30001-35000
# log
log_file=/var/log/frp/frps.log
log_level=info
log_max_days=3
disable_log_color=true

frpc

修改配置文件

# vim /etc/frp/frpc.ini

内容如下

[common]
server_addr = 127.0.0.1
server_port = 30000
token = akiya
# Admin UI
admin_addr = 0.0.0.0
admin_port = 7400
admin_user = admin
admin_pwd = admin
# log
log_file=/var/log/frp/frpc.log
log_level =info
log_max_days = 7
disable_log_color = false

# 笔记本
[rdp-home-akiya]
# 只有 sk 一致的用户才能访问到此服务
ype = stcp
sk = akiya
local_ip = 10.10.10.49
local_port = 3389
# 加密流量
use_encryption = true
use_compression = true

启动

  • frps
    # systemctl start frps
    # systemctl enable frps
    
  • frpc
    # systemctl start frpc
    # systemctl enable frpc
    

标题:CentOS安装frp内网穿透工具
作者:akiya789
地址:https://little-star.love/articles/2019/12/30/1577717602468.html

添加新评论