How to restrict overall bandwidth on yunohost

Recently, vultr removed the feature to stop VM when exceeding bandwidth. Can I do that on yunohost?

Not sure exactly what you want to do, but tools like wondershape or trickle are probably what you are after?

No, I want to restrict the total bandwidth per month to 2Tb. And block port 80 443 when exceeding.

Ah so nothing to do with bandwidth. It’s allowed data transfer per month.

I am not aware of one tool doing this. Proxy tools generally do that but by default Yunohost does not inlude a proxy, as far as I know.
You could at least start with monitoring your daily or monthly usage with vnstat, and use scripts to block access when you reach a particular limit (vnstat does have an “alert” option that will trigger a message). It’s quite manual but it would work… see vnstat for example