0

I have a webserver which serves either tiny, or very large files. I want to rate limit IPs by bandwidth. i.e. you can download X GB per day, and then you get blocked for Y hours.

Is it possible in iptables to do this?

Presume Ubuntu 20.04 or recent Debian.

Amandasaurus
  • 30,211
  • 62
  • 184
  • 246

1 Answers1

0

No. You can only shape/ratelimit certain flows using tc, but not block the user/IP after the limit is reached.

What you are describing here is an [web-]application logic that you can only implement yourself, for instance using lua with nginx.

drookie
  • 8,051
  • 1
  • 17
  • 27