FRP

FRP is a high-performance reverse proxy application that focuses on Intranet penetration and supports various protocols such as TCP, UDP, HTTP, and HTTPS. Intranet services can be exposed to the public network in a secure and convenient way through the transfer of nodes with public IP addresses.

FRP server

CentOS7 installation FRPS

  • Downloading the Installation package
Wget HTTP: / / https://github.com/fatedier/frp/releases/download/v0.28.2/frp_0.28.2_linux_amd64.tar.gzCopy the code
  • Unzip the files
The tar - XZVF frp_0. 28.2 _linux_amd64. Tar. GzCopy the code
  • Create the FRPS folder
mkdir frps
Copy the code
  • Copy server files to the FRPS folder
CD frp_0.28.2_linux_AMd64 cp FRPS frps_full.ini frps.ini.. /frpsCopy the code
  • This section describes how to test the FRPS
./frps --help 
Copy the code

The following information is displayed:

[root@hecs-centos-7 frps]# ./frps --help frps is the server of frp (https://github.com/fatedier/frp) Usage: frps [flags] Flags: --allow_ports string allow ports --bind_addr string bind address (default "0.0.0.0") -p, --bind_port int bind port (default 7000) --bind_udp_port int bind udp port -c, --config string config file of FRPS --dashboard_addr string dasboard address (default "0.0.0.0") --dashboard_port int dashboard port --dashboard_pwd string dashboard password (default "admin") --dashboard_user string dashboard user (default "admin") -h, --help help for frps --kcp_bind_port int kcp bind udp port --log_file string log file (default "console") --log_level string log level (default "info") --log_max_days int log max days (default 3) --max_ports_per_client int max ports per --proxy_bind_addr string proxy bind address (default "0.0.0.0") --subdomain_host string subdomain host -t, --token string auth token -v, --version version of frpc --vhost_http_port int vhost http port --vhost_http_timeout int vhost http response header timeout (default 60) --vhost_https_port int vhost https portCopy the code
  • Edit FRPS. Ini

    [common] # FRP server port through which clients register with the server (must) bind_port = 7000 # Dashboard port, Dashboard_port = 7500 Specifies the username and password used to access the dashboard. If this parameter is not specified, run the following command to log in to the dashboard: dashboard_port = 7500 Dashboard_user = admin dashboard_pwd = admin dashboard_pwd = admin Vhost_http_port = 10080 vhost_https_port = 10443Copy the code
  • Start the FRPS command

./frps -c ./frps.ini
Copy the code
  • Keep FRPS background running commands
nohup ./frps -c ./frps.ini &
Copy the code

Configure systemctl to operate FRPS

  • Create FRPS. Service
sudo vim /lib/systemd/system/frps.service
Copy the code
  • Add content ExecStart to frps.service based on your actual path
[Unit] Description=frps service After=network.target syslog.target Wants=network.target [Service] Type=simple ExecStart= /usr/local/frp/frps -c /usr/local/frps.ini /usr/local/frps.ini WantedBy=multi-user.targetCopy the code
  • Enable FRPS automatically starts upon server startup
sudo systemctl enable frps
Copy the code
  • Start the FRPS
sudo systemctl start frps
Copy the code
  • Restart the FRPS
 sudo systemctl restart frps
Copy the code
  • Stop FRPS
sudo systemctl stop frps
Copy the code
  • See the log
sudo systemctl status frps
Copy the code

Access the FRPS console

http://ip:7500

FRP client

Windows installation FRPC

  • Visit github.com/fatedier/fr… To download the latest version

  • Decompress to a local directory and edit frpc.ini

[common] # ADDRESS of the FRP server server_addr = 0.0.0.0 # Port of the FRP server server_port = 7000 # Configure HTTP Intranet penetration # alias for the configuration item. Local_ip = 127.0.0.1 # local_port = 8080 # Custom_domains = hw2.smilezq.cn (Only one custom_domains and subdomains can be configured. FRP determines whether to forward requests based on the configured value.) custom_domains = hw2.smilezq.cnCopy the code
  • Run frpc.exe in CMD
Exe 2021/03/31 18:14:55 [I] [service.go:304] [9a47f97bc995AE1c] Login to the server  success, get run id [9a47f97bc995ae1c], server udp port [0] 2021/03/31 18:14:55 [I] [proxy_manager.go:144] [9a47f97bc995ae1c] proxy added: [http] 2021/03/31 18:14:55 [I] [control.go:180] [9a47f97bc995ae1c] [http] start proxy successCopy the code
  • Access the Intranet penetrating address
h2.smilezq.cn:10080
Copy the code

Custom_domains and subdomain

Custom_domains:

  • A user-defined domain name is used to define the ADDRESSES for accessing the HTTP Intranet. Multiple domain names can be configured, separated by commas (,)

    Access format: http://custom_domains:port

  • If subdomain_host is configured in frps.ini, custom_domains cannot be subdomains or pan-domains

subdomain:

  • subdomain, andfrps.iniConfiguration of thesubdomain_hostCollaboratively used to implement multiple Intranet penetration configurations

Access format: http://subdomain.subdomain_host:port

FRP implements the CONFIGURATION of HTTP Intranet penetration client

[common] # ADDRESS of the FRP server server_addr = 0.0.0.0 # Port of the FRP server server_port = 7000 # Configure HTTP Intranet penetration # alias for the configuration item. Local_ip = 127.0.0.1 # local_port = 8080 # Custom_domains = hw2.smilezq.cn (Only one custom_domains and subdomains can be configured. FRP determines whether to forward requests based on the configured value.) custom_domains = hw2.smilezq.cnCopy the code

FRP implements Windows remote client configuration

# The following sentence must begin with, [common] # ADDRESS of the FRP server server_addr = 0.0.0.0 # Port of the FRP server server_port = 7000 # Alias of the configuration item [windowsControl] # Listener type Local_port = 3389 remote_port = 3389Copy the code