在互联网云服务上购买一个台虚拟机带有公网IP地址能映射虚拟服务器提供给互联网用户或者实验者使用
下载软件包 Frp 配置服务端 cat /usr/local/frp/frps.toml bindPort = 7000 bindAddr = "172.31.122.119" log.to = "/var/log/frpc.log" log.level = "info" log.maxDays = 3 webServer.addr = "172.31.122.119" webServer.port = 7400 webServer.user = "admin" webServer.password = "adf009@#@!@!@" auth.method = "token" auth.token = "123123fsa2r89-rufajpsue" enablePrometheus = true transport.maxPoolCount = 200
建立服务(包括客户端也是相同) [root@yxh_johan ~]# cat /etc/systemd/system/frp.service [Unit]
Description = frp server After = network.target syslog.target Wants = network.target
[Service] Type = simple
ExecStart = /usr/local/frp/frps -c /usr/local/frp/frps.toml
[Install] WantedBy = multi-user.target
配置客户端
serverAddr = " " 公网IP serverPort = 7000
log.to = "/var/log/frpc.log" log.level = "info" log.maxDays = 3 webServer.addr = "0.0.0.0" webServer.port = 7400 webServer.user = "admin" webServer.password = "adf009@#@!@!@" auth.method = "token" auth.token = "123123fsa2r89-rufajpsue" enablePrometheus = true transport.maxPoolCount = 200
[[proxies]] name = "mysql-node1" type = "tcp" localIP = "127.0.0.1" localPort = 3306 remotePort = 8500
测试 |