1

I'm currently trying to diagnose why my build of Libreoffice online keeps giving '504 Timed Out' errors on my nginx reverse proxy. I shutdown the entire daemon, hoping to see an error along the lines of 'Connection Refused' but I still get Connection timed out.

So I fired up netcat (nc) and ran the following:

nc 192.168.1.13 9980 -v

And it gives me the following response:

nc: connect to 192.168.1.13 port 9980 (tcp) failed: connection timed out

So I figured that the daemon was still alive somewhere hidden on my system, so I rebooted it an verified that nothing was on port 9980 with netstat.

When I run this command from the server itself:

nc localhost 9980 -v

It says connection refused! Even though localhost and 192.168.1.13 point to the same machine!

Also: Results of ip addr are 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether d0:67:e5:23:50:56 brd ff:ff:ff:ff:ff:ff inet 192.168.1.13/24 brd 192.168.1.255 scope global dynamic noprefixroute enp3s0 valid_lft 2719sec preferred_lft 2719sec inet6 fe80::ca8b:d4b8:34aa:7036/64 scope link noprefixroute valid_lft forever preferred_lft forever

I figured it may have been a firewall error, so I temporarily flushed every iptables rule and added one back.

iptables -A INPUT -p tcp --dport 9980 -j REJECT

Again, nc on 192.168.1.13 times out and nc on localhost gives me connection refused.

Essentially, my issue is this:

nc 192.168.1.13 9980 ---> Connection timed out

nc localhost 9980 ---> Connection refused

Why are there different answers if they are both the same machine?

Any ideas on what could be going on with the network? I'd really like to avoid changing ips since a few services on another computer depend on that ip remaining static.

Duplicate edit: I read the question that was referred to when this was marked as a duplicate, and here's why I believe my question is different:

I'm not asking why Connection refused is appearing. I want that to appear. I want to know why the connection is timing out, even when the host is reachable on literally every other port. And I mentioned in the question above that I checked the firewall settings and flushed everything to get rid of variables, which still causes it to timeout. In the other question, the answer simply says "A port isn't open" (I'm aware) and "A firewall is blocking it" (I took diagnostic steps so it wasn't)

ryan77627
  • 11
  • 3
  • I've edited the question to try and be clearer and don't believe it is a duplicate of the question linked. I would appreciate it if it were opened again – ryan77627 Aug 05 '19 at 02:11
  • Are you running netcat on the same machine or a different machine? – Michael Hampton Aug 05 '19 at 05:29
  • 1
    I was running it on the same machine, so localhost pointed to the correct machine in this instance. I seemed to fix the issue though by just getting rid of NetworkManager, installing ifupdown and just configuring the interface myself. I'll leave the question unanswered for now just in case someone has an explanation as to why this may have happened. – ryan77627 Aug 05 '19 at 15:46
  • 1
    Probably some of your filter rules filters 192.168.1.13, but not 127.0.0.1 . – peterh Aug 05 '19 at 15:50
  • Wouldn't think so, I dumped every iptable rule and set everything to allow (insecure, I know but used for testing) and it still did that. Weirdest part was, every other port was fine, just that one – ryan77627 Aug 05 '19 at 15:53
  • `ip ro show table all`? The `noprefixroute` on 192.168.1.13 is why I ask for the route table. If you even still have a testable setup, now that you've resolved your immediate issue. – Andrew Domaszek Aug 05 '19 at 18:37

0 Answers0