I have a python server running on port 8000 on a raspberry pi and would like to make it accessible within the local network, which is currently not working.
The interface wlan0 is configured with the IP 10.0.0.69 and netmask 255.255.255.0.
I can't reach the server within the local network (from a different host):
root@DESKTOP-Lukas:~# curl http://10.0.0.69:8000
curl: (7) Failed to connect to 10.0.0.69 port 8000: Connection refused
I also can't reach the server from the raspberry pi:
lukas@raspberrypi:~ $ curl http://10.0.0.69:8000
curl: (7) Failed to connect to 10.0.0.69 port 8000: Connection refused
The server is running and listening on port 8000:
lukas@raspberrypi:~ $ sudo netstat -tnlp | ack 8000
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 743/python
The server responds properly when using localhost:
lukas@raspberrypi:~ $ curl localhost:8000
<h1>Not Found</h1><p>The requested URL / was not found on this server.</p>
The firewall has allow actions for port 8000:
lukas@raspberrypi:~ $ sudo ufw status
Status: active
To Action From
-- ------ ----
...
8000 ALLOW Anywhere
8000/tcp ALLOW Anywhere
8000 (v6) ALLOW Anywhere (v6)
8000/tcp (v6) ALLOW Anywhere (v6)