Skip to content

Instantly share code, notes, and snippets.

@miy4mori
Forked from larvata/shadowsocks-quota
Created May 10, 2019 02:05
Show Gist options
  • Select an option

  • Save miy4mori/7cbe7df6799d03b6d469630b196a04f8 to your computer and use it in GitHub Desktop.

Select an option

Save miy4mori/7cbe7df6799d03b6d469630b196a04f8 to your computer and use it in GitHub Desktop.
shadowsocks bandwidth limit and data quota each port
# draft
# view current data quota
sudo iptables -nvL -t filter --line-numbers
# init
sudo iptables -I OUTPUT -p tcp --sport <target-port> -m quota --quota <quota-bytes> -j ACCEPT
sudo iptables -I OUTPUT -p tcp --sport <target-port> -j DROP
# reset quota
sudo iptables -R OUTPUT <line-number> -p tcp --sport <target-port> -m quota --quota <quota-bytes> -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment