Skip to content

Instantly share code, notes, and snippets.

@lin2yatou
lin2yatou / gist:804f831be42d94a53f2c173c84c31372
Created December 7, 2018 02:53 — forked from unverbraucht/gist:118117ab66ac142f4eda
Script for OpenWRT that adds delay, bandwidth limiting and packet loss to a Wi-Fi router connection. See http://kevin-read.com/post/86601925386/simulating-a-slow-network-connection-when-testing-on for details
#!/bin/sh
# The bandwidth to simulate, here about 56kilobit per second. This is layer 2 bandwidth, so TCP/UDP and IP overhead will apply
BW="56kbps"
# _Half_ the latency that we aim for. Since this applies to both the WAN port and Wi-Fi, the delay is applied twice, so this actually puts it at around 120+ms
LATENCY="60ms"
# Chance of packet loss. Also applied to both interfaces, so it is 1%.
LOSS="0.5%"
# The device name of your wifi device.
WIFI="wlan0"