Last active
August 29, 2015 14:20
-
-
Save jlongman/0baaaa74d86fbc54f500 to your computer and use it in GitHub Desktop.
FreeBSD pipe satsim
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/sh | |
# simple one, assumes pipe | |
# usage: set_pipe bw delay [errorpercentage] | |
#ipfw pipe 1 config bw $1Kbits delay $(($2/2))ms plr $3 queue $((($1*$2)/8))bytes | |
# | |
# advanced, sets pipe | |
if [ $# "<" 6 ] ; then | |
echo "usage: $0 <Client IP> <Server IP> <fw bw, kbps> <return bw, kbps> <delay, ms> <ber, float>"; | |
fi | |
ipfw -f flush | |
ipfw -f pipe flush | |
# following variations depend on FreeBSD version | |
# ipfw add pipe 1 from $1 to $2 out via bridge0 | |
ipfw add pipe 1 from $1 to $2 bridged | |
ipfw pipe 1 config bw $4Kbits delay $(($5/2))ms plt $6 queue $((($4*$5)/8))bytes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment