I want to put in a transparent bridge that will limit any given IP address passing though it to a defined number of incoming and outgoing TCP connections -- In order to prevent torrent clients from sucking up all the bandwidth.

Has anyone done this? If so with what tool?