Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want each packet (that match iptables rule) to be delayed by some fixed time interval. How to to this?

Preudocode: iptables -A INPUT -p udp <more conditions> -j DELAY --delay 50000 # delay UDP packets for 50 milliseconds

Update: @related http://superuser.com/questions/147156/simulating-a-low-bandwidth-high-latency-network-connection-on-linux

share|improve this question
    
Why? Testing purposes? – Shinrai Aug 9 '10 at 22:23
    
Yes, testing/debugging. Actually tc qdisc add dev eth1 root netem delay 250ms helped. – Vi. Aug 12 '10 at 9:51
up vote 4 down vote accepted

tc qdisc add dev eth1 root netem delay 250ms hack allows to do it globally for the given interface. It includes UDP packets.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .