In this repository, we provide a simple solution to access a service running on a remote server, from behind a firewall. Say, we're trying to access this service running on the remote server: 10.0.0.107:9090. After doing this full setup, you will be able to access this service on the local server (and LAN) on 127.0.0.1:69090 or [local-server-lan-ip]:69090.
This solution is particularly useful when the local area network (LAN) is behind a strong firewall that blocks specific ports and protocols through deep packet inspection. By utilizing frp, you can bypass these restrictions and access a service running on a remote server within the LAN.
The local server runs frpc as a client, connecting to the remote frps server. This connection allows the local frpc to forward its frps port to the remote server. Similarly, the remote server runs frpc as a client, connecting to the local frps server. This connection enables the remote frpc to forward the main service port 9090 from the remote server to the local server. Through these connections, the service running on the remote server becomes accessible on the local server, bypassing firewall restrictions within the LAN.
- Download and extract the latest release of frp from here.
- Configure frp by editing the configuration (.ini) files on both servers based on the examples provided in this repository.
sudo ./frps -c frps.ini
sudo ./frps -c frps.ini
./frpc -c frpc.ini
./frpc -c frpc.ini
Q: How can I allow frp ports on the remote server?
Solution from: #2905
Sometimes, you may encounter the following error: [W] [service.go:128] login to server failed: dial tcp [$IP]:7000: i/o timeout
. I also encountered this problem on Oracle Cloud VMs. If you face this issue, follow these steps to resolve it:
- Check the firewall status on the server using the command:
firewall-cmd --zone=public --list-ports
. - Add the firewall rules to open ports for the TCP protocol on ports 7000-7009 using the command:
firewall-cmd --zone=public --add-port=7000-7009/tcp --permanent
. - Update the firewall configuration using the command:
firewall-cmd --reload
. - You may also need to allow these ports through the cloud platforms web console.
Contributions are welcome! If you have any suggestions, ideas, or enhancements for this project, please feel free to open an issue or submit a pull request.