magnific0 / wondershaper

Command-line utility for limiting an adapter's bandwidth
GNU General Public License v2.0
1.72k stars 257 forks source link

set bandwidth limit per ip and destination port #30

Closed winanjayaamijoyo closed 4 years ago

winanjayaamijoyo commented 5 years ago

Hi,

I am new with Wondershaper, can I set max. bandwidth limit per source IP and destination port? ie. I need to set eth0 with source ip 10.100.100.50/26 with destination port 80 and 443 to max. bandwidth is 10Mbps download and upload.

need advise.

many thanks in advance

Win

winanjayaamijoyo commented 5 years ago

hello, I need help on this issue.. any plan to support this features?

Badidzetai commented 4 years ago

Hello,

Wondershaper really is a wrapper in bash for tc that focuses on having quick traffic shaping on a whole interface, and thus has currently no support for filtering.

You should look into writing your own classes and filters with tc. This is easier than one might think, once you are familiar with other tools like iptables. You can find examples and guidelines in the arch wiki.

corbolais commented 4 years ago

@winanjayaamijoyo In https://github.com/magnific0/wondershaper/pull/42 I add HIPRIODST, maybe it's of some help to you. The hosts get added to the interactive qdisc, though, as I use ssh on port 443. If you follow this route and do bulk transfer, your interactive qdisc will saturate and the intended interactivity will suffer.

magnific0 commented 4 years ago

I'm closing this issue. The PR referred to @corbolais has been merged. Hopefully this provide a solution.

Other than that, it is really targeted at the interface and to be a simple wrapper. Too many custom solutions and edge case functionality is not the goal. As @Badidzetai mentions tc is really the tool you should be looking at.