How to find the most connections from IP address using netstat

Login via SSH onto your VPS.

Run the following:

netstat -antu | grep :80 | grep -v LISTEN | awk '{print $5}' | cut -d: -f1 | sort | uniq -c

It should give you something like the following:

2 105.13.186.116
1 105.229.232.37
1 130.211.226.44
1 165.255.157.202
1 165.255.89.149
78 196.210.20.237
1 196.22.252.129
1 196.220.172.180
1 41.13.124.34
1 41.13.74.50

As you can see the 196.210.20.237 IP is doing a lot of connections to the server.

Try blocking it using CSF or iptables and see if load on your server drops.


  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Migrating/Restoring large cPanel domain from shared hosting account to your VPS server

cPanel facilitates you to restore full domain including email accounts, MySQL databases, database...

Basic Linux Commands

Below is a brief guide for basic usage of a Linux shell (command line). Once you've mastered the...

Basic iptables usage

Iptables is a program that allows you to configure Linux's built-in firewall. By default, no...

Installing CSF (ConfigServer Firewall) on a server

This guide will walk you through installing CSF on a VPS/Dedicated server. Preparing the server...

How to SSH into your VPS

After receiving your VPS login details, the first thing you'll want to do is log in to the VPS....