0
sudo ufw status       
Status: active

To                         Action      From
--                         ------      ----
8080                       ALLOW       Anywhere                  
8080 (v6)                  ALLOW       Anywhere (v6)             

8080                       ALLOW OUT   Anywhere                  
8080 (v6)                  ALLOW OUT   Anywhere (v6)

To serve, I do php -S 0.0.0.0:8080, on the machine I can access it through 0.0.0.0:8080, 192.168.0.150:8080 or 127.0.0.1:8080, but on my phone or another computer in the network, 192.168.0.150:8080 does not work.

Is the firewall ok? Is there any way to find out if I have another firewall?
Also, in my router, but this should not matter I think, since it's still inside the network

enter image description here

sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain DOCKER (0 references)
target     prot opt source               destination         

Chain DOCKER-ISOLATION-STAGE-1 (0 references)
target     prot opt source               destination         

Chain DOCKER-ISOLATION-STAGE-2 (0 references)
target     prot opt source               destination         

Chain DOCKER-USER (0 references)
target     prot opt source               destination         

Chain ufw-after-forward (0 references)
target     prot opt source               destination         

Chain ufw-after-input (0 references)
target     prot opt source               destination         

Chain ufw-after-logging-forward (0 references)
target     prot opt source               destination         

Chain ufw-after-logging-input (0 references)
target     prot opt source               destination         

Chain ufw-after-logging-output (0 references)
target     prot opt source               destination         

Chain ufw-after-output (0 references)
target     prot opt source               destination         

Chain ufw-before-forward (0 references)
target     prot opt source               destination         

Chain ufw-before-input (0 references)
target     prot opt source               destination         

Chain ufw-before-logging-forward (0 references)
target     prot opt source               destination         

Chain ufw-before-logging-input (0 references)
target     prot opt source               destination         

Chain ufw-before-logging-output (0 references)
target     prot opt source               destination         

Chain ufw-before-output (0 references)
target     prot opt source               destination         

Chain ufw-reject-forward (0 references)
target     prot opt source               destination         

Chain ufw-reject-input (0 references)
target     prot opt source               destination         

Chain ufw-reject-output (0 references)
target     prot opt source               destination         

Chain ufw-track-forward (0 references)
target     prot opt source               destination         

Chain ufw-track-input (0 references)
target     prot opt source               destination         

Chain ufw-track-output (0 references)
target     prot opt source               destination
alex
  • 51
  • 5
  • Doesn't work how exactly? What error/response do you see? – ADyson Aug 17 '23 at 15:22
  • 1
    Did you try telling php to serve on the 192 address instead of the 0.0.0.0? – ADyson Aug 17 '23 at 15:23
  • @ADyson In the browser sais "The connection has timed out. The server at 192.168.0.150 is taking too long to respond." I had also tried to serve on 192.168.0.150:8080, works fine on local but not on the other machines in the network. – alex Aug 17 '23 at 15:27
  • @Alex: Which other services can you access on that server from the clients that timeout? Any at all? Did you had a working configuration earlier? If so, what did you change since then? And never run on 0.0.0.0 while trouble-shooting network problems, it creates the impression you would be guessing and would not know which network adapter is responsible for which connection. And it remains unlcear why you point to UFW that early, did it stopped working after you have activated it? Have you tried to uninstall it and see if it then works? – hakre Aug 17 '23 at 22:44
  • @hakre I had it working long time ago and it stopped somewhere on the way, have not used it lately so I don't know exactly why it stopped. Have uninstalled ufw, same thing. Have also added iptables output, I don't know how to read that unfortunatelly. From now on, will serve only on local IP, not 0.0.0.0. I haven't tried to access anything else, but I tried to ping the IP from the other machine and it works, but if I serve "php -S 192.168.0.150:80" it still does not work, while on localhost "http://192.168.0.150" works – alex Aug 18 '23 at 07:42
  • When you put the mobile device into the network, e.g. in the WLAN,, does it work then? You should not allow non-local traffic to touch the PHP dev server anyway, so remove the route in the router as well. – hakre Aug 18 '23 at 08:03
  • @hakre The mobile device is in the WLAN, my other PC is also on the network, since I can ping the IP. Now I have tried to use apache2, same thing, I can't access it outside localhost, when I use the internal ip, the one ending *.150 – alex Aug 18 '23 at 16:24
  • I can't reproduce that here, I also did mobile testing with the php development webserver on the LAN IP of my box and via WLAN and then got my celli connected (no ufw IIRC). Perhaps contact the support of your router, timeout sounds like a network issue. – hakre Aug 18 '23 at 16:36
  • @hakre Thing is I remember it working, after I opened the port in the router I could access from my mobile and the other PC, I could even access it from the public IP, so I don't think it's the router, otherwise it would not even let me ping the IP from the other PC, that's my logic. I think it's some firewall or something, but I can't figure what exactly. Also, from this PC I can access stuff on the other one through the router, so that's another reason the router is not the problem. – alex Aug 18 '23 at 17:22

0 Answers0