232 字
1 分钟
frp内网穿透部署教程
Docker部署frp内网穿透
可选项:Docker CLI启动命令示例
docker run --restart=always --network host -d -v ./frps.toml:/etc/frp/frps.toml --name frps snowdreamtech/frpsdocker-compose部署服务端(有公网IP)
创建配置文件
touch docker-compose.yml frps.tomldocker-compose.yaml配置
services: frps: image: snowdreamtech/frps container_name: frps network_mode: host volumes: - ./frps.toml:/etc/frp/frps.toml restart: always服务端frps.toml配置
bindPort = 7000auth.token = "admin123"docker-compose部署客户端(内网)
创建配置文件
touch docker-compose.yml frpc.tomldocker-compose.yaml配置
services: frpc: image: snowdreamtech/frpc container_name: frpc network_mode: host volumes: - ./frpc.toml:/etc/frp/frpc.toml restart: always客户端frpc.toml配置
serverAddr = "8.8.8.8" # 公网服务器IPserverPort = 7000 # 对接端口和frps一致auth.token = "admin123" # 认证令牌和frps一致
# 暴露SSH服务[[proxies]]name = "ssh"type = "tcp"localIP = "127.0.0.1"localPort = 22 # 本地服务端口remotePort = 6000 # 让frps暴露的公网端口二进制文件部署
官方二进制文件下载地址:https://github.com/fatedier/frp/releases
配置文件和上面一样
服务端启动命令./frps -c ./frps.toml
客户端启动命令./frpc -c ./frpc.toml