/go/iptop ranks the IP addresses that sent the most requests to the server in a chosen time window. It can also block the ones that look like bots or floods. It: No setup is needed. GoAdmio's default cron jobs already run iptop block every hour, so high-traffic IPs and bots are blocked automatically. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Top IPs in the last 24 hours. Nothing is blocked.
/go/iptop
# Show the last hour and block offenders (what cron runs)
/go/iptop block
Options
Modes
| Argument | Window | Rows shown | Blocks? | Threshold |
|---|---|---|---|---|
| (none or unrecognized) | 24 hours | 25 | No | — |
<seconds> (digits only) |
That many seconds | 25 | No | — |
hour |
1 hour | 25 | No | — |
day |
24 hours | 25 | No | — |
week |
7 days | See note | No | — |
block |
1 hour | 50 | Yes | 2500 (default) |
robot |
15 minutes | 50 | Yes | A quarter of the limit (625 by default) |
underattack |
15 minutes | 1 | Yes | 100, only if server load is over 100% |
Configuration
| Item | Required | Default | Notes |
|---|---|---|---|
/var/go/etc/iptop (file) |
No | 2500 |
A whole number: the request count at which an IP is blocked. See Threshold. |
/etc/white (file) |
No | — | IPs to leave out of the count. See Whitelist. |
Examples
# Who visited most in the last 5 minutes?
/go/iptop 300
# Who visited most this week?
/go/iptop week
# Report and block, as cron does every hour
/go/iptop block
# Block at 5000 requests per hour instead of 2500
echo 5000 | sudo tee /var/go/etc/iptop
# Go back to the default threshold
sudo rm /var/go/etc/iptop
# Read the history of runs and their arguments
sudo tail /var/log/go/iptop.log
Output
| Outcome | What you get |
|---|---|
| Report | A table of IPs with visits, country, city, and company. |
| Blocking mode, IPs blocked | The same table, then an email and a WhatsApp message listing the blocked IPs. |
| Blocking mode, nothing blocked | The table only. No message is sent. |
| Blocking mode, another instance running | Instance (<name>) already running. and exit code 1. |
underattack, server load not over 100% |
No output and exit code 1. |
Report
The columns are aligned with column. This sample is illustrative.
IP VISITS COUNTRY CITY COMPANY
-- ------ ------- ---- -------
203.0.113.7 4120 US Chicago Example Hosting LLC
198.51.100.22 310 DE Berlin Example Telecom
The server’s own IPv4 address, its IPv6 address, and 127.0.0.1 are never listed. Whitelisted IPs are not counted, so they don’t appear either.
Notification
Sent only in blocking modes, and only if at least one IP was blocked in that run.
| Channel | Subject or title |
|---|---|
Email, through sendmail |
Blocking of High Traffic and Non-Human Bot IPs (<N> IPs) |
WhatsApp, through sendwhatsapp |
*Blocking of High Traffic and Non-Human Bot IPs (<N> IPs)* |
The body explains what happened, then lists one line per blocked IP. The number of minutes is the window used for that run.
- Robot 203.0.113.7 (3 Visits / 60 Minutes) - Country: US, Company: Example Hosting LLC.
- High Traffic 198.51.100.22 (4120 Visits / 60 Minutes) - Country: DE, Company: Example Telecom.
[!WARNING]
Blocking is automatic and unattended. The bot-network list blocks an IP after a single request, and it matches broad names such asMicrosoft,Comcast Cable Communications, andBeijing. A real visitor on one of those networks can be blocked. Read the notification emails, and useunblockfor any false positive.
See the full reference at /go/iptop and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
