17
21
subprocess.call('sudo tc ' + command, shell=True)
20
24
@helps(delay='Length of delay in miliseconds (each way).',
21
25
port='Port to induce delay on.')
22
26
def start(delay=500, port=443):
23
28
tc('qdisc add dev lo root handle 1: prio')
24
29
tc('qdisc add dev lo parent 1:3 handle 30: netem delay %dms' % delay)
25
30
tc('filter add dev lo protocol ip parent 1:0 prio 3 u32 match ip'