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

How can I simulate latency to a single URL?

I tried following to simulate latency to a single URL by adding a ipfw rule.

sudo ipfw add pipe 1 ip  from  myurl.com to any
#(response of running above command) 00100 pipe 1 ip from any to any
sudo ipfw add pipe 1 ip  from  any to myurl.com
#(response of running above command) 00200 pipe 2 ip from any to any


sudo   ipfw pipe 1 config delay 10000ms bw 1Kbit/s
sudo   ipfw pipe 2 config delay 10000ms bw 1Kbit/s

However, above rules introduce to all URLs, and not just myurl.com

Am I missing something to introduce latency to just myurl.com

share|improve this question

1 Answer 1

#!/bin/sh
# latency.sh    

oif="em0" # just the interface looking to the outer space

# let's create two seperate pipes
ipfw pipe 1 config delay 10000ms bw 1Kbit/s
ipfw pipe 2 config delay 10000ms bw 1Kbit/s

# let's pipe some traffic
# going in...
ipfw add 1000 pipe 1 all from myurl.com to any in via $oif
# and out...
ipfw add 1001 pipe 2 all from any to myurl.com out via $oif
# that's all 

# sudo ./latency.sh

share|improve this answer

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.