Skip to content

Instantly share code, notes, and snippets.

@soulgalore
Created September 14, 2017 09:46
Show Gist options
  • Save soulgalore/82801f7ca0f120d5cb7f226833b88ad8 to your computer and use it in GitHub Desktop.
Save soulgalore/82801f7ca0f120d5cb7f226833b88ad8 to your computer and use it in GitHub Desktop.
Set connectivity mac
#!/bin/bash
## Setup a delay
sudo dnctl -q flush
sudo dnctl -q pipe flush
sudo dnctl pipe 1 config delay 0ms noerror
sudo dnctl pipe 2 config delay 0ms noerror
sudo pfctl -f pfctl.rules
sudo dnctl pipe 1 config bw 780Kbit/s delay 100ms
sudo dnctl pipe 2 config bw 330Kbit/s delay 100ms
sudo pfctl -E
# Clear everything
sudo dnctl -q flush
sudo dnctl -q pipe flush
sudo pfctl -f /etc/pf.conf
sudo pfctl -E
sudo pfctl -d
### pfctl.rules
dummynet in all pipe 1
dummynet out all pipe 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment