You are not logged in.

#1 2015-07-02 21:32:49

khouli
Member
Registered: 2014-12-14
Posts: 70

[SOLVED] HTTP requests suddenly failing, SSH still works

I have an up to date Arch machine running Nginx, OpenSSH, and Netatalk (and other things now and then). All have worked reliably for several months but today I can't get through to Nginx or Netatalk. I can still ssh in. Even on the same local (wireless) network I get this behavior.

Here are the clues I've gathered using a second machine on the same local network. The troublesome machine has local ip 192.168.0.14.

Nginx hasn't reported any errors to journald and it's status is active according to systemd.

I can ping the machine.

$ ping 192.168.0.14
PING 192.168.0.14 (192.168.0.14): 56 data bytes
64 bytes from 192.168.0.14: icmp_seq=0 ttl=64 time=38.716 ms
64 bytes from 192.168.0.14: icmp_seq=1 ttl=64 time=4.165 ms

nmap reports that port 80/tcp is open.

$ nmap -v -sT 192.168.0.14

Starting Nmap 6.47 ( http://nmap.org ) at 2015-07-02 16:58 EDT
Initiating Ping Scan at 16:58
Scanning 192.168.0.14 [2 ports]
Completed Ping Scan at 16:58, 0.00s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 16:58
Completed Parallel DNS resolution of 1 host. at 16:58, 0.02s elapsed
Initiating Connect Scan at 16:58
Scanning 192.168.0.14 [1000 ports]
Discovered open port 80/tcp on 192.168.0.14

I can't get through with nc.

# on machine running Nginx
$ nc -l 90
# on other machine
$ echo hi | nc -v 192.168.0.14 90
nc: connectx to 192.168.0.14 port 90 (tcp) failed: Connection refused

The machine has nothing interesting in iptables.

$ iptables -L -n
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

There's nothing interesting in nftables either.

$ nft list table filter
table ip filter {
	chain input {
		 type filter hook input priority 0;
	}

	chain forward {
		 type filter hook forward priority 0;
	}

	chain output {
		 type filter hook output priority 0;
	}
}

Nginx logs don't show any external request making it to Nginx but I can get a response as localhost.

tcpdump shows that tcp packets are making it to the machine. This works for packets from the local network and from the internet.

$ tcpdump -v host 192.168.0.14 and port http
tcpdump: listening on wlp5s0, link-type EN10MB (Ethernet), capture size 262144 bytes
17:19:58.579283 IP (tos 0x8, ttl 46, id 3718, offset 0, flags [DF], proto TCP (6), length 60)
    162.246.187.130.34906 > shodan.http: Flags [S], cksum 0x7585 (correct), seq 2140781002, win 14600, options [mss 1352,sackOK,TS val 22525772 ecr 0,nop,wscale 4], length 0
17:20:07.339435 IP (tos 0x8, ttl 45, id 4107, offset 0, flags [DF], proto TCP (6), length 60)
    162.246.187.130.p-net-local > shodan.http: Flags [S], cksum 0xb828 (correct), seq 1081192401, win 14600, options [mss 1352,sackOK,TS val 22527962 ecr 0,nop,wscale 4], length 0
17:20:13.617633 IP (tos 0x8, ttl 45, id 61169, offset 0, flags [DF], proto TCP (6), length 60)
    162.246.187.130.36413 > shodan.http: Flags [S], cksum 0x3f3c (correct), seq 806431498, win 14600, options [mss 1352,sackOK,TS val 22529531 ecr 0,nop,wscale 4], length 0
17:20:23.639852 IP (tos 0x8, ttl 45, id 3238, offset 0, flags [DF], proto TCP (6), length 60)
    162.246.187.130.34098 > shodan.http: Flags [S], cksum 0x5f4d (correct), seq 1994900323, win 14600, options [mss 1352,sackOK,TS val 22532037 ecr 0,nop,wscale 4], length 0

I don't think the router is the issue but just to be sure I disabled the firewall on the router but that changed nothing.

This is not an area of my expertise. I've expended my knowledge and now I'm confused -- what could be happening to the tcp packets?? They hit the machine but then get lost before finding Nginx.

(To be honest my guess is that this wasn't spontaneous. I must have fiddled with something in the wrong way. If that's the case I don't remember what it was and obviously I didn't think I was breaking anything.)

What else should I try or what other info should I share? Thanks.

Last edited by khouli (2015-07-02 22:15:15)

Offline

#2 2015-07-02 22:15:04

khouli
Member
Registered: 2014-12-14
Posts: 70

Re: [SOLVED] HTTP requests suddenly failing, SSH still works

Ah, nm. The issue was just that nftables was rejecting packets.

Offline

Board footer

Powered by FluxBB