Created
July 27, 2015 18:19
-
-
Save lesovsky/6c4e0aaa3fb03b58efae to your computer and use it in GitHub Desktop.
Destination based traffic limiting with tc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # add | |
| # avpkt 1500 - MTU, bandwidth 1000mbit - interface speed, rate 20mbit - limit threshold | |
| tc qdisc add dev eth1 root handle 1: cbq avpkt 1500 bandwidth 1000mbit | |
| tc class add dev eth1 parent 1: classid 1:1 cbq rate 20mbit allot 1500 prio 5 bounded isolated | |
| tc filter add dev eth1 parent 1: protocol ip prio 16 u32 match ip dst 10.0.0.33 flowid 1:1 | |
| # remove | |
| tc filter del dev eth1 parent 1: protocol ip prio 16 u32 match ip dst 10.0.0.33 flowid 1:1 | |
| tc class del dev eth1 parent 1: classid 1:1 cbq rate 20mbit allot 1500 prio 5 bounded isolated | |
| tc qdisc del dev eth1 root handle 1: cbq avpkt 1500 bandwidth 1000mbit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment