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.

In order to test our deployment I want to simulate certain network events like connection losses, timeout, limited bandwidths etc.

I already googled for this but haven't found something that really suited my needs. ipfw seems to be what I need but I can't seem to find an ipfw package for Ubuntu. Also I'd like to know whether there are alternatives or even better tools for my task.

share|improve this question
1  
You can use iptables and tc. –  Mircea Vutcovici Feb 17 '11 at 15:05
add comment

3 Answers

up vote 1 down vote accepted

You can simulate those things with firewall.

Userland tool to modify firewall rules is called iptables

for example if you want to simulate 5 seconds of connection loss you can do this

iptables -I INPUT -p tcp -s source.ip.for.which.you.want.to.appear.to.timeout --dpor $port -j DROP ; sleep 5; iptables -D INPUT -p tcp -s source.ip.for.which.you.want.to.appear.to.timeout --dpor $port -j DROP ;

share|improve this answer
1  
Thanks! Pretty cool! Is there something equally elegant to simulate high latencies? I'd like to say "port 1234 has a latency of XXXXms". –  Jan Feb 18 '11 at 7:50
add comment

iptables is great, but some tools are sharper when dealing with this kind of problems.

And also wanem, not a standalone app but more a customized router distro.

share|improve this answer
add comment

From the sister site Stack Overflow: Simulate delayed and dropped packets on Linux

share|improve this answer
add comment

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.