frp Linux

Cool.Cat 2021-11-28 1420

服务端

wget https://github.com/fatedier/frp/releases/download/v0.38.0/frp_0.38.0_linux_amd64.tar.gz
tar -zxvf frp_0.38.0_linux_amd64.tar.gz -C /usr/local/ && cd /usr/local/ && mv frp_0.38.0_linux_amd64 frp && rm -rf frp_0.38.0_linux_amd64.tar.gz && cd frp && rm -f frpc frpc.ini
cat > frps.ini << EOF
[common]
bind_addr = 0.0.0.0
bind_port = 8888
token = token
authentication_timeout = 900
max_pool_count = 65535
log_file = /var/log/frps.log
log_level = info
log_max_days = 3
allow_ports = 1-65535
dashboard_port = 8080
dashboard_user = admin
dashboard_pwd = admin
EOF
cat > /etc/systemd/system/frps.service << EOF
[Unit]
Description=FRP Server Daemon
[Service]
Type=simple
ExecStartPre=-/sbin/setcap cap_net_bind_service=+ep /usr/local/frp/frps
ExecStart=/usr/local/frp/frps -c /usr/local/frp/frps.ini
Restart=always
RestartSec=10s
User=root
PermissionsStartOnly=true
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload && systemctl enable frps && systemctl start frps && systemctl status frps


客户端

wget https://github.com/fatedier/frp/releases/download/v0.38.0/frp_0.38.0_linux_arm64.tar.gz
tar -zxvf frp_0.38.0_linux_arm64.tar.gz -C /usr/local/ && cd /usr/local/ && mv frp_0.38.0_linux_arm64 frp && rm -rf frp_0.38.0_linux_arm64.tar.gz && cd frp && rm -f frps frps.ini
cat > frpc.ini << EOF
[common]
server_addr = 服务端地址
server_port = 8888
tls_enable = true
token = token
pool_count = 1
[range:ccnet]#多客户端不能重复
use_encryption = true
use_compression = true
type = tcp
local_port = 22,9000
remote_port = 30022,39000
EOF
cat > /etc/systemd/system/frpc.service << EOF
[Unit]
Description=FRP Client Daemon
[Service]
Type=simple
ExecStartPre=-/sbin/setcap cap_net_bind_service=+ep /usr/local/frp/frpc
ExecStart=/usr/local/frp/frpc -c /usr/local/frp/frpc.ini
Restart=always
RestartSec=10s
User=root
PermissionsStartOnly=true
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload && systemctl enable frpc && systemctl start frpc && systemctl status frpc


最新回复 (0)
返回
发新帖
X