Difference between revisions of "Setup FRP"

From Hawk Wiki
Jump to: navigation, search
Line 1: Line 1:
 +
## Setup frp client
 
<pre>
 
<pre>
 
# arm64
 
# arm64
Line 45: Line 46:
  
 
sudo systemctl status frpc
 
sudo systemctl status frpc
 +
</pre>
 +
 +
## Setup frp server
 +
 +
<pre>
 +
mkdir -p /usr/local/frps
 +
cp frps /usr/local/frpc/frps
 +
cp frps.ini /usr/local/frps/frps.ini
 +
# set port number
 +
 
</pre>
 
</pre>

Revision as of 19:15, 2 April 2023

    1. Setup frp client
# arm64
#wget https://github.com/fatedier/frp/releases/download/v0.44.0/frp_0.44.0_linux_arm64.tar.gz
#tar -xvzf frp_0.44.0_linux_arm64.tar.gz
#cd frp_0.44.0_linux_arm64

# amd 64
wget https://github.com/fatedier/frp/releases/download/v0.44.0/frp_0.44.0_linux_amd64.tar.gz
tar -xvzf frp_0.44.0_linux_amd64.tar.gz
cd frp_0.44.0_linux_amd64


mkdir -p /usr/local/frpc
cp frpc /usr/local/frpc/frpc
cp frpc.ini /usr/local/frpc/frpc.ini


cat << EOF > /usr/local/frpc/frpc.ini
[common]
server_addr = 127.0.0.1
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
EOF


cat << EOF > /etc/systemd/system/frpc.service
[Unit]
Description=frp client
Wants=network-online.target
After=network.target network-online.target

[Service]
ExecStart=/usr/local/frpc/frpc -c /usr/local/frpc/frpc.ini

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload && sudo systemctl enable frpc && sudo systemctl start frpc

sudo systemctl status frpc
    1. Setup frp server
mkdir -p /usr/local/frps
cp frps /usr/local/frpc/frps
cp frps.ini /usr/local/frps/frps.ini
# set port number