frp windows+linux dual-end configuration, Linux encapsulation process starts automatically

The decompression address of the github download package will not be explained here.

The following is the windows version of frp deployment

I use 0.50win

Configure the frp folder on the public network server, experimental environment windows server 201× version

frps, ini files

I have configured several sites here

tasksg port 8001

xp homepage port 8010

mysql port 3306

mysql1 port 3307

Since two versions of mysql are installed locally, different ports are used to distinguish 3306 and 3307.

[common]
# 一、服务器的基本配置部分
# 7000 是FRP服务端口,可以改
bind_port = 7000
# dashboard_user和dashboard_pwd是FRP网页版管理员用户名密码,可以改。
dashboard_user = admin
dashboard_pwd = admin
# 7500 是网页版管理端口:可以通过 http://服务器ip:7500登陆
dashboard_port = 7500
# 服务器和客户机之间的心跳连接
heartbeat_timeout = 30

 
[common]
server_addr = 121.**.***.***  # FRP服务器的公网ip
server_port = 7000        FRP服务器的,服务端口,这个可以改,不过客户端的也要一起改才行。

 

 # 转发端口:[taskmsg]、[xp] 这些没有任何意义,就是大致描述这个端口作用。
# 每增加一个转发端口,复制下面的两行,然后将[]里面的和vhost_http_port_03改了就行了

[tatskmsg]
vhost_tcp_port_01 = 8001
[xp]
vhost_udp_port_02 = 8010

[mysql]
vhost_udp_port_03 = 3306
[mysql_1]
vhost_udp_port_04 = 3307

After the configuration is completed, execute frps.exe -c ./frps.ini on cmd in the file directory. The following instructions appear and the startup is normal.

You can check the relevant link configuration information on the server ip + port number. Mine is 121.***.***.***:7500.

The above is the deployment and settings of the server side

Client settings

[common]
server_addr =121.***.***.***    #frp服务器的公网ip 
server_port = 7000          #frp服务通信端口 
heartbeat_timeout = 30      #服务器和客户机之间的心跳连接 
[taskmsg]
type = tcp
local_ip = 10.16.249.141
local_port = 8001          
remote_port = 8001
heartbeat_timeout = 30

[xp]
type = udp
local_ip = 10.16.249.141
local_port = 8010
remote_port = 8010
heartbeat_timeout = 30

[mysql]
type = tcp
local_ip = 10.16.249.141
local_port = 3306
remote_port = 3306
heartbeat_timeout = 30

[mysql_1]
type = tcp
local_ip = 10.16.249.141
local_port = 3307
remote_port = 3307
heartbeat_timeout = 30

After configuring relevant information, start frpc.exe -c ./frpc.ini in the directory [note the startup names of the client and server here]

The following interface appears, indicating that the startup is normal and you can use the public network IP + port number for access.

Since the domain name is not applied for in the experimental environment, the domain name part is omitted and the content will be modified later if there is a domain name.

linux deployment frp centos

1. Download the frp package, create a directory and extract the files to the new directory /home/nat

mkdir /home/net tar -xvf file name -c /home/nat mv folder name after the current folder name is changed

2. Change the directory folder name mv **** nat

3. Modify the frps.ini file

bind_port = 7000  
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
enble_prometheus = true
authentication = token   # 通过密钥通讯  可以不用
token = 123456

4. Start frp

./frps  -c  ./frps.ini #服务端
./frpc -c ./frpc.ini

5. The packaging process starts automatically

vi /etc/systemd/system/frps.service   #在此文件夹下新建  

[Unit]
Description=frp daemon
After=syslog.target network.target
Wants=network.target
[Service]
Type=simple
ExecStart=/home/nat/nat/frps -c /home/nat/nat/frps.ini   #这里指定启动文件和配置文件目录
[Install]
WantedBy=multi-user.target

#自启
systemctl enable frps
#启动
systemctl start frps

Configure client

For client configuration information, please refer to Windows configuration. The encapsulation process is the same as above. Please note one thing.

The client's startup and configuration file is frpc frpc.ini

Guess you like

Origin blog.csdn.net/u012175909/article/details/131577541