I have a simple Flask server that echos requests it gets to the terminal. Requests I send it via the device's public IP address do not register.
The flask server is started correctly on all interfaces with .run(host="0.0.0.0", port=5000, debug=False)
. For testing purposes, my router is configured with the flask server in the DMZ.
My main method of testing connectivity has been with curl. Here are my results:
From the host machine:
curl localhost:5000
- Successcurl 127.0.0.1:5000
- Successcurl 192.168.1.115:5000
(Local IP) - Successcurl 64.x.x.x:5000
(Public IP) - Failurecurl xxx.com:5000
(A domain that resolves to the public IP) - Failure
Attempting to access the latter two hosts from a remote (mobile) network also fail.
The server is a simple linux machine, and is not running any firewalls that I am aware of.
Looking at the router's logs, I do not ever see an attempted connection to the public IP address on port 5000. This seems strange.
This tells me that the server is correctly binding on all ports, but the local ip addresses are not properly routed to from the public ip address. What do I need to do to fix this?
Edit: I have moved the entire server to a different network, and it works correctly. There is clearly something about my network configuration that's a problem, but I can't determine what it is.
Edit 2: Here's something else that seems strange.
If I run with .run(host="0.0.0.0", port=5000, debug=False, ssl_context=('fullchain.pem', 'privkey.pem'))
(passing it proper credentials), I can't even connect to it locally: I just get
0 Answers