My router forwards incoming traffic on port 42424 to port 22 on my raspberry pi. But when i try to connect to the ssh server on the pi i only get Operation timed out. I've tried via tcpdump to see if the traffics comes in at the raspberry, and the traffic gets in but it looks like it will be ignored or something like that. Also checked firewall for allowing incoming traffic. Does anybody now something else i might did not consider?
Timed out means either there is no system at that address (i.e., your router is forwarding it, but not to the pi) or else a firewall/router is dropping incoming or outgoing packets. The latter is significant because if you can demonstrate the Pi is trying to reply, then the router is not forwarding out.
The fact that you can see the traffic with
tcpdump on the Pi does not prove that it is targeting the Pi's actual address. Tcpdump is a network packet sniffer and can report any traffic that reaches the interface, which often includes more than just traffic addressed to that particular machine. For example, on a wifi network, it can include everything (although encryption will complicate this), as it commonly also does on ethernet.
It is actually unusual for a firewall to drop packets instead of replying immediately with an ICMP message denying access, so this is unlikely to be that, and it certainly wouldn't be so on the Pi unless you set that up on purpose. So the two most likely explanations are:
The IP address being forwarded to is not the Pi's real address. This would be my first guess.
The router is not forwarding back out.
Note that the problem cannot be that
sshd is not running, because that will not cause a timeout. It will cause the OS to reply immediately with a message that the service is unreachable. So even if
sshd isn't running, that is not the cause of the timeout.