Skip to content

Instantly share code, notes, and snippets.

@supershabam
Created December 3, 2014 23:19
Show Gist options
  • Save supershabam/5c415683f5bd4c0afe9b to your computer and use it in GitHub Desktop.
Save supershabam/5c415683f5bd4c0afe9b to your computer and use it in GitHub Desktop.
dynamic iptables rules using updating groups
# Accept packets from trusted IP addresses
iptables -A INPUT -s group:web_workers -j ACCEPT # change the IP address as appropriate
# enumerates group to create several rule lines
# iptables -A INPUT -s 123.1.1.2 -j ACCEPT # change the IP address as appropriate
# iptables -A INPUT -s 123.1.1.3 -j ACCEPT # change the IP address as appropriate
# as the web_workers group is updated, the rules are recreated and iptables flushed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment