Water's Home

Just another Life Style

0%

How to expose a local server behind a NAT or firewall to the internet

Download FRP Server & Client

Modify frps.ini

[root@VM_0_5_centos frp_0.25.3_linux_amd64]# cat frps.ini
[common]
bind_port = xxxxxx
dashboard_port = xxxxxx
dashboard_user = xxxxxxxxxxxxxxxx
dashboard_pwd = xxxxxxxxxxxxxxxx
allow_ports = xxxxx-xxxxx
token = xxxxxxxxxxxxxxxx
max_pool_count = 10
pool_count = 3

Start frps

[root@VM_0_5_centos frp_0.25.3_linux_amd64]# ./frps -c ./frps.ini

Modify frpc.ini

root@imx6ul7d:~/frp# cat frpc.ini
[common]
server_addr = qinuu.com
server_port = xxxxxx
token = xxxxxxxxxxxxxxxx
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = xxxxxx

Start frpc

root@imx6ul7d:~/frp# ./frpc -c ./frpc.ini

Start a systemd service

[root@VM_0_5_centos frp_0.25.3_linux_amd64]# cat /lib/systemd/system/frps.service
[Unit]
Description=Frp Server Service
After=network.target

[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/frp/frp_0.25.3_linux_amd64/frps -c /usr/local/frp/frp_0.25.3_linux_amd64/frps.ini

[Install]
WantedBy=multi-user.targethis

[root@VM_0_5_centos frp_0.25.3_linux_amd64]# systemctl start frps
[root@VM_0_5_centos frp_0.25.3_linux_amd64]# systemctl enable frps
[root@VM_0_5_centos frp_0.25.3_linux_amd64]# systemctl status frps