---
title: "Connection Refused"
author: "sunjing"
date: "2016-01-21T10:26:54Z"
tags: ["Connection refused"]
categories: ["互联网"]
slug: "connection-refused"
draft: false
lastmod: "2018-08-04T12:14:35Z"
id: 2272395
url: "https://billben.iteye.com/blog/2272395"
---

There could be many reasons, but the most common are:

1. The port is not open on the destination machine.
2. The port is open on the destination machine, but its backlog of pending connections is full.
3. A firewall between the client and server is blocking access (also check local firewalls).
4. IP address conflict

After checking for firewalls and that the port is open, use telnet to connect to the ip/port to test connectivity.  
**Test Connectivity**  
telnet 10.1.131.19 4447

**Check the port status of remote system**  
netstat -tnlp | grep :4447

**Check firewall**  
tcpdump -n icmp

**Check IP**  
arping 10.1.131.19

**Check the number of active connections**  
netstat -np | grep -w 4447 | grep ESTABLISHED | wc -l

 

[Increasing the maximum number of tcp/ip connections in linux](https://stackoverflow.com/questions/410616/increasing-the-maximum-number-of-tcp-ip-connections-in-linux)