frps服务端
安装
wget https://github.com/fatedier/frp/releases/download/v0.57.0/frp_0.57.0_linux_amd64.tar.gz
tar xf frp_0.57.0_linux_amd64.tar.gz
mv frp_0.57.0_linux_amd64.tar.gz /usr/local/frp
sudo mkdir /var/log/frp
sudo chown sunday.sunday /usr/local/frp /var/log/frp
配置文件
cat > /usr/local/frp/frps.toml << EOF
bindAddr = "0.0.0.0"
bindPort = 7000
vhostHTTPPort = 7480
vhostHTTPSPort = 7443
webServer.addr = "0.0.0.0"
webServer.port = 7400
# dashboard's username and password are both optional
webServer.user = "sunday"
webServer.password = "Sunday@3873"
auth.method = "token"
auth.token = "Sunday01.com"
transport.tcpMux = true
log.to = "/var/log/frps.log"
# trace, debug, info, warn, error
log.level = "info"
log.maxDays = 3
# disable log colors when log.to is console, default is false
log.disablePrintColor = false
EOF
systemd
cat > /usr/lib/systemd/system/frps.service << EOF
[Unit]
Description=frps daemon
After=syslog.target network.target
Wants=network.target
[Service]
Type=simple
ExecStart=/usr/local/frp/frps -c /usr/local/frp/frps.toml
User=sunday
Group=sunday
Restart=always
RestartSec=1min
[Install]
WantedBy=multi-user.target
EOF
systemctl enable frps
systemctl start frps
Openwrt frpc 配置
本地IP为openwrt 网关
http web 穿透
解析unknown.sundayhk.com 指向 frps ip
ssh 穿透
注意打开 frps防火墙 相关端口 如ssh:7422 web:7480
frps dashboard
开放防火墙7480端口 并解析unknown.sundayhk.com 指向 frps ip
打开http://unknown.sundayhk.com:7480 即可访问openwrt
ssh sunday@unknown.sundayhk.com -p 7422
ttyd 注意是tcp 且指定本地和远程端口为7681