I'm trying to run a frp in a container, which needs to listen on dynamic ports. That means the frp may open additional ports in running time.
My operations step by step
- On my remote VPS, I use the following command to start a frp server. Note that I use
hostmode which means, by Docker doc, that all the opened port of frp is accessible from host and external machines.
docker run -d \
--network=host \
-v /etc/frp:/etc/frp/:ro \
--name frps \
--rm \
290007431/frps:v0
Here is the program inside the container, which shows that port 7500 and 9000 is available
.
On my Mac (Big Sur) and Raspberry Pi (Debian 10), I try to visit the dashboard web via port 7500, which results a failure. So I use
nampto scan the port. Here is the result
. It shows that the 7500 and 9000 are unaccessible from the client endpoint (Mac and Raspberry Pi).As things goes out of my mind, I return back to my VPS to check whether the port is actually exposed or not. I use
netstat -nlptucommand, here is the result which shows that the VPS is listening on 7500 and 9000 port
.
Isn't it very odd?
Finally!!! I found the reason why I can not access my VPS from external. That is the VPS Provider has the default firewall, which run outside of the VPS. I login into the VPS Provider console and configure it. What a foolish story