Frp:安裝與設定
安裝 Server 端(有一鍵安裝版):
wget https://raw.githubusercontent.com/MvsCode/frps-onekey/master/install-frps.sh -O ./install-frps.sh
給予權限:
chmod 777 install-frps.sh
執行安裝:
./install-frps.sh install
選擇2使用 Github 源
輸入 frp 接入的 Port:
Please input frps bind_port [1-65535] (Default Server Port: 5443): frps bind_port: 5443
HTTP Port:
Please input frps vhost_http_port [1-65535](Default : 80):80
HTTPS Port:
Please input frps vhost_https_port [1-65535](Default : 443):443
管理面板 Port:
Please input frps dashboard_port [1- 65535](Default : 6443):6443
登入帳號:
Please input frps dashboard_user(Default : admin): frps dashboard_user: admin
登入密碼:
Please input frps dashboard_pwd (Default : tG):
連接金鑰:
Please input frps token(Default : kd):
設定外連網域:
Please input frps subdomain_host(Default : IP):your.domain.com
然後執行:
frps start
客戶端設定(for Raspberry pi):
cd /usr/local/
下載客戶端:
wget https://github.com/fatedier/frp/releases/download/v0.38.0/frp_0.38.0_linux_arm.tar.gz
解安裝:
tar zxvf frp_0.38.0_linux_arm.tar.gz
更名:
mv frp_0.38.0_linux_arm frp
編輯客戶端設置:
nano /usr/local/frp/frpc.ini
[common]
server_addr = your.domain.com
server_port = 57890
token = 3js0
log_file = ./frpc.log
log_level = debug
log_max_days = 3
[prometheus]
type = tcp
local_ip = 127.0.0.1
local_port = 9100
remote_port = 9100
[http]
type = http
local_port = 80
local_ip = 127.0.0.1
custom_domains = s.yourdomain.com
設定完成之後執行客戶端:
./frpc -c frpc.ini &
即可依照設定連線 Server_ip:你設定的port
建立服務:
[Unit]
Description=Frp Client Service
After=network.target
[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/frp/frpc -c /usr/local/frp/frpc.ini
ExecReload=/usr/local/frp/frpc reload -c /usr/local/frp/frpc.ini
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
載入並啟用服務:
systemctl daemon-reload
service frpc start
service frpc status
systemctl enable frpc
阅读剩余
THE END