How to block an IP address
TurboStack's firewall already blocks abusive clients automatically - for example after repeated failed logins across SSH, FTP, mail and HTTP. Failed attempts are counted collectively across all of these protocols against a single threshold, rather than per protocol, and the firewall reacts within seconds of the suspicious activity. You only need to block an address by hand when you want to stop a specific attacker or scraper that the automatic protection has not caught yet.
Note
A firewall block stops an IP at the network level, for the whole host. To block by request path or for a single application, do it at the web server instead - see Block IP addresses in Nginx.
Block an IP with the CLI
Connect over SSH and use tscli firewall block:
# Block an IP for a week, with a reason
tscli firewall block 203.0.113.10 --time 604800 --comment "spam"
# Block a whole range permanently
tscli firewall block 203.0.113.0/24 --time -1
--time is in seconds (-1 means permanent) and --comment records why. See the
TurboStack CLI for the full list of options.
Check whether an IP is blocked
tscli firewall check 203.0.113.10
This also tells you whether the automatic protection has already blocked the address - useful when a customer reports being locked out.
Remove a block
tscli firewall unblock 203.0.113.10
To clear every automatic block at once there is tscli firewall flush, but read the warning on the
TurboStack CLI page first: it also removes blocks that are protecting you from
active abuse.
Related
- Configure the firewall
- Whitelist an IP address
- Block IP addresses in Nginx
- TurboStack CLI
- Fixing 403 errors