永久免费内网穿透安卓(frp内网穿透)
原理和NAT类似将公网vps中开一个端口映射到内网1中service的ip和端口,只不过增加了frp client负责将流量pipe到service和frp server。
frp部署
这里frp server和frp client都以linux系统部署为例
vps部署frp server
# install frp
wget https://github.com/fatedier/frp/releases/download/v0.32.1/frp_0.32.1_linux_amd64.tar.gz
tar -zxvf frp_0.32.1_linux_amd64.tar.gz
sudo mv frp_0.32.1_linux_amd64 /usr/local/frp
# config frps
sudo vim /usr/local/frp/frps.ini
# frp server配置文件内容,token为认证使用
[common]
bind_port = 7000
token = xxxxx
# 配置frp server为linux service
sudo vim /etc/systemd/system/frps.service
# frps service
[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.ini
Restart= always
RestartSec=1min
[Install]
WantedBy=multi-user.target
# 配置frp server为默认启动服务
sudo systemctl enable frps
# 启动frp server
sudo systemctl start frps
# 查看frp server服务状态
sudo systemctl status frps
# install frp
wget https://github.com/fatedier/frp/releases/download/v0.32.1/frp_0.32.1_linux_amd64.tar.gz
tar -zxvf frp_0.32.1_linux_amd64.tar.gz
sudo mv frp_0.32.1_linux_amd64 /usr/local/frp
# config frpc
sudo vim /usr/local/frp/frpc.ini
# frp client配置文件内容:
# 1. server_addr为vps的公网ip地址
# 2. server_port为frp server监听端口
# 3. token需要保持和frp server中token一致才能认证通过
# 4. tls_enable需要设置为true,否则login失败
# 5. [ssh]为将本主机22端口映射到frp server的5000端口
[common]
server_addr = xxx.xxx.xxx.xxx
server_port = 7000
token = xxxxx
tls_enable = true
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 5000
# 配置frp client为linux service
sudo vim /etc/systemd/system/frpc.service
# frpc service
[Unit]
Description=frpc daemon
After=syslog.target network.target
Wants=network.target
[Service]
Type=simple
ExecStart=/usr/local/frp/frpc -c /usr//local/frp/frpc.ini
Restart= always
RestartSec=1min
[Install]
WantedBy=multi-user.target
# 配置frp client为默认启动服务
sudo systemctl enable frpc
# 启动frp client
sudo systemctl start frpc
# 查看frp client服务状态
sudo systemctl status frpc
免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com