Skip to content

Instantly share code, notes, and snippets.

@carlosrberto
Last active August 29, 2015 14:04
Show Gist options
  • Save carlosrberto/51fad8f2a2ab41ba9a76 to your computer and use it in GitHub Desktop.
Save carlosrberto/51fad8f2a2ab41ba9a76 to your computer and use it in GitHub Desktop.
Limit Bandwidth

Limit Bandwidth with terminal

Example, limit port 8000 to 100KByte/s

limit_band 100 8000

Remove bandwidth limit

remove_limit
function limit_band() {
sudo ipfw pipe 1 config bw $1KByte/s
sudo ipfw add 1 pipe 1 src-port $2
}
function remove_limit() {
sudo ipfw delete 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment