linux下实现内网穿透
服务端
下载frp并解压
cd /home
wget https://github.com/fatedier/frp/releases/download/v0.48.0/frp_0.48.0_linux_amd64.tar.gz
tar -xzvf frp_0.48.0_linux_amd64.tar.gz
修改配置 vim /home/frp_0.48.0_linux_amd64/frps.ini
[common]
bind_port = 7000
dashboard_port = 7500
token = asdasdahwuih # 请随机
dashboard_user = tioti # 请设置
dashboard_pwd = tioti # 请设置
配置服务
# yum
yum install systemd
# apt
apt install systemd
vim /etc/systemd/system/frps.service
写入启动命令
[Unit]
# 服务名称,可自定义
Description = frp server
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
# 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /home/frp_0.48.0_linux_amd64/frps -c /home/frp_0.48.0_linux_amd64/frps.ini
[Install]
WantedBy = multi-user.target
启动服务
# 启动frp
systemctl start frps
# 停止frp
systemctl stop frps
# 重启frp
systemctl restart frps
# 查看frp状态
systemctl status frps
设置开机自启
systemctl enable frps
客户端 Linux
下载frp并解压
cd /home
wget https://github.com/fatedier/frp/releases/download/v0.48.0/frp_0.48.0_linux_amd64.tar.gz
tar -xzvf frp_0.48.0_linux_amd64.tar.gz
# 设置权限
cd frp_0.48.0_linux_amd64
chmod 755 frpc
修改配置 /home/frp_0.48.0_linux_amd64/frpc.ini
[common]
server_addr = ip_of_remote
server_port = 7000
token = asdasdahwuih # 跟随服务器
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 9022
# 范围端口
[range:moreTcp]
type = tcp
local_ip = 127.0.0.1
local_port = 8000-8100
remote_port = 8000-8100
配置服务
# yum
yum install systemd
# apt
apt install systemd
vim /etc/systemd/system/frpc.service
写入启动命令
[Unit]
# 服务名称,可自定义
Description = frp client
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
# 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /home/frp_0.48.0_linux_amd64/frpc -c /home/frp_0.48.0_linux_amd64/frpc.ini
[Install]
WantedBy = multi-user.target
启动服务
# 启动frp
systemctl start frpc
# 停止frp
systemctl stop frpc
# 重启frp
systemctl restart frpc
# 查看frp状态
systemctl status frpc
设置开机自启
systemctl enable frpc
客户端 Win
太简单了,百度 or 【lanol】Frp内网穿透教程记录
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 Tioit Wang
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果