PÃ¡draig Brady taught me a great trick in a comment to a previous blog post and it was so neat I feel a need to highlight it further as it also makes it easier for me to find it again later!
To simulate a far away server, addÂ RTT time to the localhost device. For example if we add 100 milliseconds (which then makes 200ms ping time to localhost):
tc qdisc add dev lo root handle 1:0 netem delay 100msec
Restore it back to normal again with:
tc qdisc del dev lo root