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

Download FRP Server & Client

Modify frps.ini

  1. [root@VM_0_5_centos frp_0.25.3_linux_amd64]# cat frps.ini
  2. [common]
  3. bind_port = xxxxxx
  4. dashboard_port = xxxxxx
  5. dashboard_user = xxxxxxxxxxxxxxxx
  6. dashboard_pwd = xxxxxxxxxxxxxxxx
  7. allow_ports = xxxxx-xxxxx
  8. token = xxxxxxxxxxxxxxxx
  9. max_pool_count = 10
  10. pool_count = 3

Start frps

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

Modify frpc.ini

  1. root@imx6ul7d:~/frp# cat frpc.ini 
  2. [common]
  3. server_addr = qinuu.com
  4. server_port = xxxxxx
  5. token = xxxxxxxxxxxxxxxx
  6. [ssh]
  7. type = tcp
  8. local_ip = 127.0.0.1
  9. local_port = 22
  10. 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

Leave a Reply

Your email address will not be published. Required fields are marked *