3

I have a NGINX server running on my local network which as a test that just returns the word "holding". But, I cannot access it from any other PC on the network even though it looks like it is correctly running.

On my server:

$ ip -4 a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic noprefixroute enp2s0
       valid_lft 79059sec preferred_lft 79059sec


$ netstat -nr

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 enp2s0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 enp2s0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 enp2s0


$ sudo netstat -tnlp 

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      747/systemd-resolve 
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      853/cupsd           
tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN      994/mongod          
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1037/nginx: master  
tcp6       0      0 ::1:631                 :::*                    LISTEN      853/cupsd           
tcp6       0      0 :::80                   :::*                    LISTEN      1037/nginx: master  

$ sudo ufw status

Status: active

To                         Action      From
--                         ------      ----
Nginx Full                 ALLOW       Anywhere                  
80/tcp                     ALLOW       Anywhere                  
Nginx Full (v6)            ALLOW       Anywhere (v6)             
80/tcp (v6)                ALLOW       Anywhere (v6) 

$ curl 192.168.1.100

holding

On my client:


$ping 192.168.1.100

PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
64 bytes from 192.168.1.100: icmp_seq=1 ttl=64 time=3.47 ms
64 bytes from 192.168.1.100: icmp_seq=2 ttl=64 time=2.33 ms


$ ip -4 a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    inet 192.168.1.215/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp2s0
       valid_lft 86007sec preferred_lft 86007sec



$ netstat -nr


Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlp2s0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 wlp2s0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlp2s0


$ sudo netstat -tnlp 

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      13013/systemd-resol 
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      31016/cupsd         
tcp6       0      0 ::1:631                 :::*                    LISTEN      31016/cupsd    


$ curl 192.168.1.100

curl: (7) Failed to connect to 192.168.1.100 port 80: No route to host

$ traceroute 192.168.1.1

traceroute 192.168.1.100
traceroute to 192.168.1.100 (192.168.1.100), 30 hops max, 60 byte packets
 1  192.168.1.100 (192.168.1.100)  4.125 ms !X  4.069 ms !X  4.052 ms !X

$ sudo traceroute -T -p 80 192.168.1.100

traceroute to 192.168.1.100 (192.168.1.100), 30 hops max, 60 byte packets
 1  192.168.1.100 (192.168.1.100)  2.821 ms !X  3.137 ms !X  3.132 ms !X


I am totally stumped...

  • 1
    Please, [edit] your answer by adding netstat -nr output, *both* from the client and the server. – FedKad Dec 15 '19 at 14:33
  • Done - sorry I didn't know what would be relevant.. – Johnny John Boy Dec 15 '19 at 14:48
  • Also netstat -nr output for client. And ip -4 a output for both client and server as I have shown in my latest edit. – FedKad Dec 15 '19 at 15:08
  • You wrote that 'ping works.' Please show us that ping session, because no route to host looks like a network misconfiguration. – user535733 Dec 15 '19 at 15:11
  • A traceroute 192.168.1.100 and sudo traceroute -T -p 80 192.168.1.100 output (*from the client*) will be useful also. – FedKad Dec 15 '19 at 15:31
  • Are you sure both machines are connected to the *same* network? The server seems to have an Ethernet connection and the client a Wireless connection. But, are they both connected to the same router (and can it be something in the router that filters http traffic)? – FedKad Dec 15 '19 at 15:39
  • 100% same network.. same router.. – Johnny John Boy Dec 15 '19 at 15:43
  • 1
    Related: https://askubuntu.com/a/1167818/968501 – Raffa Dec 15 '19 at 15:46
  • I've checked the link Raffa.. no duplicate IP addresses.. same subnet which leaves VLAN's which I haven't set up or some kind of blocking which I haven't set up but may be set up by default. I've tested it the other way and the PC can access the notebook, no blocking.. – Johnny John Boy Dec 15 '19 at 16:12
  • Are you saying that the wired server can ping the wireless client, but that the wireless client cannot ping the wired server? – user535733 Dec 15 '19 at 22:33
  • No I've said both can ping each other. Both are on the network. What I am saying is if I run exactly the same setup on my laptop (server in this case) I can access the page through curl on my desktop (client in this case). Doing it the other way, as described in my question results in the "Failed to connect to". Both identical installs of Ubuntu 18.04 – Johnny John Boy Dec 16 '19 at 19:32

0 Answers0