Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've played around with the ipfw command on a Mac and tried to limit the bandwidth to 1MBit/s.

sudo ipfw add pipe 1 ip from any to me
sudo ipfw pipe 1 config bw 1MBit/s

These are the statements I'm using. ipfw indeed limits the bandwidth drastically but according to speedtest.net only to ~7.7 Mbps on a 100 Mbps line. With a restriction to 3MBit/s the effective download is ~23.13 Mbps. Apparently the ipfw always uses a factor ~7.7 of the given limit. With a limit of 4 Mbps the effective speed is ~30,84 Mbps, with 8 Mbps it's ~61.6 Mbps and so on...

Anyone knows why this is the reason? Is it a bug or do I use the statement wrong?

Thank you

share|improve this question
    
I'm also interested if anyone else can reproduce this or if it's an issue on my side. –  TheLostOne Mar 30 '12 at 18:31
    
Can you sudo ipfw show here? –  Kondybas Apr 2 '12 at 22:58
    
@Kondybas radi:~ Phil$ sudo ipfw show 00100 2046813 1042400871 pipe 1 ip from any to me 00200 2223777 296348885 pipe 2 ip from me to any 65535 7182907 2143167607 allow ip from any to any aargh.. didn't manage to properly use the code tags –  TheLostOne Apr 4 '12 at 11:08
    
other then creating a pipe itself you need to specify which traffic goes through that pipe –  alexus Apr 4 '12 at 21:31

1 Answer 1

up vote 0 down vote accepted

Seems like your IPFW treat bw xMBits as xMBytes by first significant letters in the units :) Just lowercase to xMbits and probably you'll get what you want.

man ipfw

bw bandwidth | device
             Bandwidth, measured in [K|M]{bit/s|Byte/s}.
share|improve this answer
    
Thank you @Kondybas! The big 'M' was the culprit. Now it's working correctly. Only the time to establish a connection is very long ;-) –  TheLostOne Apr 11 '12 at 8:04
    
@TheLostOne Big "B" was a culprit. IPFW treats MB* as MBytes and Mb* as Mbits. So when you declare MBits, IPFW make a decision about units by two first letters. –  Kondybas Apr 12 '12 at 8:55
    
Yeah, the big "B" was the reason. Sorry. Somehow mixed up 'M' and 'B' in the above comment :D –  TheLostOne Apr 13 '12 at 9:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.