Difference between revisions of "Setup FRP"

From Hawk Wiki
Jump to: navigation, search
(Setup frp client)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
== Setup frp client ==
 
<pre>
 
<pre>
 
# arm64
 
# arm64
Line 11: Line 12:
  
  
 +
sudo su
 
mkdir -p /usr/local/frpc
 
mkdir -p /usr/local/frpc
 
cp frpc /usr/local/frpc/frpc
 
cp frpc /usr/local/frpc/frpc
Line 37: Line 39:
 
[Service]
 
[Service]
 
ExecStart=/usr/local/frpc/frpc -c /usr/local/frpc/frpc.ini
 
ExecStart=/usr/local/frpc/frpc -c /usr/local/frpc/frpc.ini
 +
Restart=always
 +
RestartSec=30
  
 
[Install]
 
[Install]
Line 45: Line 49:
  
 
sudo systemctl status frpc
 
sudo systemctl status frpc
 +
</pre>
 +
 +
== Setup frp server ==
 +
 +
<pre>
 +
sudo su
 +
mkdir -p /usr/local/frps
 +
cp frps /usr/local/frps/frps
 +
cp frps.ini /usr/local/frps/frps.ini
 +
# set port number
 +
 +
 +
#setup service
 +
cat << EOF > /etc/systemd/system/frps.service
 +
[Unit]
 +
Description=frp server
 +
Wants=network-online.target
 +
After=network.target network-online.target
 +
 +
[Service]
 +
ExecStart=/usr/local/frps/frps -c /usr/local/frps/frps.ini
 +
 +
EOF
 +
 +
sudo systemctl daemon-reload && sudo systemctl enable frps && sudo systemctl start frps
 
</pre>
 
</pre>

Latest revision as of 18:59, 22 October 2023

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


sudo su
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
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target
EOF

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

sudo systemctl status frpc

Setup frp server

sudo su
mkdir -p /usr/local/frps
cp frps /usr/local/frps/frps
cp frps.ini /usr/local/frps/frps.ini
# set port number


#setup service
cat << EOF > /etc/systemd/system/frps.service
[Unit]
Description=frp server
Wants=network-online.target
After=network.target network-online.target

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

EOF

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