Error Codes Wiki

Linux Connection Refused

Warningnetwork

Overview

Linux "Connection refused" means a TCP connection attempt was actively rejected because no service is listening on the target port.

Key Details

  • errno 111 (ECONNREFUSED) — TCP RST received
  • Target host is reachable but no service on that port
  • Different from timeout (host unreachable) or no route
  • Firewall may also send RST packets

Common Causes

  • Service is not running on the target port
  • Service is listening on a different port or interface
  • Firewall rejecting (not dropping) the connection
  • Service crashed and is not restarting

Steps

  1. 1Check if service is running: systemctl status servicename
  2. 2Check listening ports: ss -tlnp | grep port
  3. 3Check firewall: iptables -L or firewall-cmd --list-all
  4. 4Verify service binds to correct interface (0.0.0.0 vs 127.0.0.1)

Tags

linuxnetworkconnection refusedtroubleshootingfix

More in Network

Frequently Asked Questions

The server is up (it sent a RST), but nothing is listening on that specific port.