cndaqiang Web Linux DFT

Frp内网穿透

2019-10-28
cndaqiang
     
RSS

FRP

服务器/客户端软件为同一个压缩包

下载链接: https://github.com/fatedier/frp/releases
openwrt下载示例:
根据https://dev.archive.openwrt.org/wiki/platforms得知ar71xxx是MIPS的架构
下载对应架构的0.17版

wget https://github.com/fatedier/frp/releases/download/v0.17.0/frp_0.17.0_linux_mips.tar.gz

服务器端frps配置

编译frps.ini

[common]
bind_port = 6666  #frps服务端口
token = wgjg$%^$ftrd234 #frp认证密钥
dashboard_port = 7777  #[可选] 网页管理端口
dashboard_user = admin #[可选] 网页管理账户
dashboard_pwd = passwd #[可选] 网页管理密码
#通过 ip:7777 访问网页管理

启动

/opt/frp/frps -c /opt/frp/frps.ini

也可以添加到系统服务vim /etc/systemd/system/frps.service

[Unit]
Description=Frps server
Wants=network-online.target
After=network-online.target
[Service]
User=root
WorkingDirectory=/opt/
LimitNOFILE=4096
PIDFile=/var/run/frps/client.pid
ExecStart=/opt/frp/frps -c /opt/frp/frps.ini
#Restart=on-failure
StartLimitInterval=600
[Install]
WantedBy=multi-user.target

启动服务

systemctl daemon-reload
systemctl start frps
systemctl stop frps
systemctl status frps
systemctl enable frps #开机自启
systemctl disable frps #关闭开机自启

客户端frpc

编译frpc.ini

# Proxy config for user cndaqiang
[common]
server_addr = 服务器ip
server_port = 服务器端口
tcp_mux = true
protocol = tcp
http_proxy = 
token = wgjg$%^$ftrd234 #frp认证密钥
dns_server = 114.114.114.114
 
# 具体映射
[test remote:999 -> 123.123.123.123:666] #备注
privilege_mode = true
type = tcp
local_ip = 123.123.123.123
local_port = 666
remote_port = 999
use_encryption = true
use_compression = true
[test remote:996 -> 123.123.123.123:669] #备注
privilege_mode = true
type = tcp
local_ip = 123.123.123.123
local_port = 669
remote_port = 996
use_encryption = true
use_compression = true
#等等

启动

/opt/frp/frpc -c /opt/frp/frpc.ini

也可添加到系统服务vim /etc/systemd/system/frpc.service

[Unit]
Description=Frpc Client
Wants=network-online.target
After=network-online.target
[Service]
User=root
WorkingDirectory=/opt/
LimitNOFILE=4096
PIDFile=/var/run/frpc/client.pid
ExecStart=/opt/frp/frpc -c /opt/frp/frpc.ini
Restart=on-failure
StartLimitInterval=600
[Install]
WantedBy=multi-user.target

启动服务

systemctl daemon-reload
systemctl start frpc
systemctl stop frpc
systemctl status frpc
systemctl enable frpc #开机自启
systemctl disable frpc #关闭开机自启

免费的服务器端

Sakura Frp

Sakura Frp 注册申请映射列表

客户端方法一: 下载Sakura客户端

如在一32位linux系统上下载

wget https://cdn.tcotp.cn:4443/client/Sakura_frpc_linux_386.tar.gz

并保存到/opt/soft
添加系统服务,vim /etc/systemd/system/sakurafrp.service

[Unit]
Description=Sakura Frp Client
Wants=network-online.target
After=network-online.target
[Service]
User=root
WorkingDirectory=/你的客户端储存位置/
LimitNOFILE=4096
PIDFile=/var/run/sakurafrp/client.pid
ExecStart=/你的客户端储存位置/客户端文件名 --su=你的账号 --sp=你的密码 --sid=你要选择的服务器的ID(就是服务器列表左侧的数字)
Restart=on-failure
StartLimitInterval=600
[Install]
WantedBy=multi-user.target

启动管理服务

systemctl daemon-reload
systemctl start sakurafrp
systemctl enable sakurafrp
systemctl disable sakurafrp
客户端方法二: 使用frpc客户端

方法同上
从映射列表下载用于原版 Frpc 的配置文件


本文首发于我的博客@cndaqiang.
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!


目录

访客数据