frp-内网穿透
八月 25, 2025
2443
须要有带有公网IP的服务器,以linux为例
下载frp压缩包
下载到文件目录 /env/frp 此目录可以修改以此为例
下载网址
https://github.com/fatedier/frp/releases
官方网址
https://gofrp.org
1 | # 下载frp压缩包(可自行在下载网址里下载或替换版本号) |
服务端修改
编辑frps.toml文件
1 | bindPort = 7000 # 客户端与服务连接端口 |
运行frps服务
在 /etc/systemd/system 目录下创建一个 frps.service 文件,用于配置 frps 服务。
编辑/etc/systemd/system/frps.service文件
1 | [Unit] |
systemd 命令管理 frps 服务
执行sudo systemctl start frps 启动frps
服务器开放7500端口
启动之后访问公网ip:7500进行访问
1 | # 启动frp |
客户端Windows安装
下载地址:
https://github.com/fatedier/frp/releases/download/v0.64.0/frp_0.64.0_windows_amd64.zip
放入 C:\frp 文件夹下,此文件夹可修改
下载完之后解压,然后修改frpc.toml文件
1 | serverAddr = "xxx.xxx.xxx.xxx" # 你云服务器的IP |
启动frpc
1 | .\frpc.exe -c frpc.toml # 启动frpc |
设置开机自启
新建文件launch_frp.vbs
复制以下内容
1 | Set WshShell = CreateObject("Wscript.Shell") |
双击运行launch_frp.vbs
运行成功之后访问公网IP:7001 对应访问的就是您本地的8080端口
设置自启
Win+R打开运行输入shell:startup
然后把launch_frp.vbs复制进去即可