# home nat/router qos or fair nat ?

## mattmatteh

i have been trying to figure out how to share the bandwidth on my gentoo nat box.  i have googled and read alot of what is out there now.  most if not all of the text i find on it, talkes about max upload speed and marking p2p stuff.  all i want to do have each client get fair bandwidth.  if only one user is on the net, then that one user gets all of it.  then if 2 users are on, it will divide it between the 2, if 3 users are on, then divide bewteen the 3.  i dont care what the traffic is.  i would like to be fair on bandwidth or bytes sent, not packets.

what am i looking for?  and what am i not looking for?

thanks

matt

----------

## fangorn

AFAIK the traffic shaper extension has options to filter for user (or ip address). There you can also dim some ports (p2p) in priority, so that if nothing else is running, they get the full bandwidth, but if something else is requesting bandwidth, all p2p stuff is put to the background (for example when using Voice over IP).

But I could be totally wrong here, as I never had to setup such a thing. Please correct me if I am wrong  :Wink: 

----------

## k0001

i'm using a "tunned-up" version of fair-nat 0.79 using "default" shapper... it works nice, but i think it's not what you are lookin for, cuz it doesn't determine bandwith based on a _per_online_users_ ...you have to previously set up a bandwidth for each

----------

## mattmatteh

4 year old question i still have not found the answer to.   brother is using bittorrent and there is an isssue once again.   perhaps traffic shaping has improved over the years.   still hoping i can get fair usage on traffic, something like round robin for each ip on the subnet, if i worded that right.  preferably inboud and outboud.

----------

## Hu

Shaping outbound traffic is more reliable than trying to police inbound traffic.  The simplest solution, although not perfectly fair, would be to relegate his BitTorrent traffic to a class with almost zero guaranteed bandwidth, but a ceiling that lets him use any excess after other bands are served.  Place all other traffic in a band that is guaranteed some large portion of the bandwidth.  Anything unused by the main band will be given to the BitTorrent band.  This is not exactly what you specified, but it may mitigate the problem until you can find an ideal solution.

----------

## think4urs11

Should be possible by defining one bw-class per internal client and have each of them configured with a minimum  bandwidth.

By that when only one machine is active that one gets all bw, if others jump in they get at least their amount and slow down the first one by that amount for the time their transfers take.

These classes should be for traffic 'internal -> external'

That combined with a second set of bw class which differs on protocol where interactive and/or http traffic gets a higher prio than e.g. bittorrent should give the result you want.

These classes should be preferrably both int->ext and ext->int.

----------

