C
C
chypakabra2021-06-03 09:22:50
linux
chypakabra, 2021-06-03 09:22:50

How to set a daily Internet traffic limit on a Linux server?

Problem:
I ordered a dedicated server from a hosting provider for a month, the tariff included a 1TB traffic reserve.
I installed LEMP, installed an unconfigured CMS, and so far, for reasons I don’t understand, this thing somehow downloaded 1TB in 1 day (no one visited the site, apparently some process just got stuck and the server was constantly downloading and downloading something) but it's not that important now.
I'm trying to connect to the server, but it is suspended due to the fact that I exceeded the traffic.
I ended up losing 1 month of rent.

Question:
In order not to face the above situation again, I want to reinsure myself. Namely, you need to put a limit on the incoming and outgoing traffic of the server. Because in my tariff, 1000GB is allocated for 30 days, you need to set a limit of 30GB / 24 hours.
And also it is necessary, in case of exceeding the limit, to allow work (pass traffic) in ssh and ftp, as if "add them to the white list".

What tool can help me with this (Debian 10)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zzzz9, 2021-06-03
@Zzzz9

iptables but in Debian 10 nftables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question