I'm using a Linux box as a router between two of its network interfaces to route local traffic to and from the internet. The internet connection in question has a defined data allowance, and exceeding this is expensive.
Ideally, I'd like to have the Linux box monitor the amount of data being transferred over the internet-facing interface (as the sum of received and transmitted data) and to bring the interface down once that limit is exceeded. I've been unable to find a ready-made tool for this purpose. How would I best go about this?