-
-
Save Firefishy/9464cfa4f6b8bec2644a to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
set +e | |
tc qdisc del dev em1 root | |
tc qdisc add dev em1 root handle 1: htb default 10 | |
tc class add dev em1 parent 1: classid 1:1 htb rate 1070kbps ceil 1070kbps #Overall Speed | |
tc class add dev em1 parent 1:1 classid 1:10 htb rate 1000kbps ceil 1000kbps #Default | |
tc class add dev em1 parent 1:1 classid 1:11 htb rate 60kbps ceil 100kbps # Slower | |
tc class add dev em1 parent 1:1 classid 1:12 htb rate 10kbps ceil 10kbps # Slowest | |
tc qdisc add dev em1 parent 1:10 handle 100: fq_codel #fq_codel on default | |
tc qdisc add dev em1 parent 1:11 handle 110: fq_codel #fq_codel on slower | |
tc qdisc add dev em1 parent 1:12 handle 120: fq_codel #fq_codel on slowest | |
#Slower an IP | |
tc filter add dev em1 parent 1:0 protocol ip prio 1 u32 match ip dst 1.2.3.4/32 match ip sport 80 0xffff flowid 1:11 | |
#Slowest an IP | |
tc filter add dev em1 parent 1:0 protocol ip prio 1 u32 match ip dst 4.3.2.1/32 match ip sport 80 0xffff flowid 1:12 | |
tc filter add dev em1 parent 1:0 protocol ip prio 1 u32 match ip dst 212.159.112.221/32 match ip sport 80 0xffff flowid 1:12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment