蒲公英路由X4C安装frp服务

X4C用来做机房外带管理,  直接穿透外网访问串口服务器等等.
 
 
-----解锁SSH-----
http://10.168.1.1/cgi-bin/oraybox?_api=ssh_set&enabled=1
或者备份数据用7zip打开下载的文件找到etc/config/system修改ssh选项为1 再导入备份重启就可以连接ssh了
5.5.0以上版本密码为oray@12#$%^78
5.5.0以下是admin
 
wget https://github.com/kuoruan/openwrt-frp/releases/download/v0.37.1-1/frpc_0.37.1-1_mipsel_24kc.ipk --no-check-certificate
opkg install frpc_*.ipk

这里备注一下需要mipsel_24kc版本,折腾了大半天走了不少弯路,执行opkg update才发现这个版本能安装.

0.37.1以上版本报错

"Error relocating /usr/bin/frpc: __nanosleep_time64: symbol not found"

frpc.ini配置文件

 cat>/etc/frpc.ini<<EOF
[common]
server_addr = frps.server
server_port = 7000
token = password
log_level = debug
log_max_days = 3
use_compression = true
login_fail_exit = false

[rand-ssh]
type = tcp
local_ip = 0.0.0.0
local_port = 22
remote_port = 0
EOF

启动文件

cat>/etc/init.d/frpc<<EOF
#!/bin/sh /etc/rc.common
START=99
start() {
        sleep 20; nohup /usr/bin/frpc -c /etc/frpc.ini >/root/nohup.out 2>&1 &
}
stop() {
        kill -9 `ps | grep '/usr/bin/frpc' | grep -v 'grep' | awk '{print $1}'`
}
EOF
chmod 755 /etc/init.d/frpc
/etc/init.d/frpc enable && echo on
/etc/init.d/frpc  start

启动文件有点简单粗暴

 

 

frps服务器一键搭建脚本

wget --no-check-certificate https://raw.githubusercontent.com/clangcn/onekey-install-shell/master/frps/install-frps.sh -O ./install-frps.sh
chmod 700 ./install-frps.sh
./install-frps.sh install