Skip to content

Instantly share code, notes, and snippets.

@njsmith
Last active Apr 1, 2022
Embed
What would you like to do?
# Create a new network namespace named 'bad', which will come with its own private loopback interface
sudo ip netns create bad
# Make the loopback interface slow, drop packets, etc.
sudo ip netns exec bad tc qdisc add dev lo root netem delay 200ms 40ms 25% # ... add more netem options here
# Turn on the loopback interface
sudo ip netns exec bad ip link set lo up
# Start a shell inside the new namespace
sudo ip netns exec bad sudo -u $USER /bin/bash
# Try running 'ping 127.0.0.1' to see how bad the network is
# Later, when you're done and want to clean up:
sudo ip netns delete bad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment