Skip to content

Instantly share code, notes, and snippets.

@cpanxaoc
Last active August 29, 2015 14:21
Show Gist options
  • Save cpanxaoc/6178556dd4426becd9b7 to your computer and use it in GitHub Desktop.
Save cpanxaoc/6178556dd4426becd9b7 to your computer and use it in GitHub Desktop.
Rex iptables DSL example
iptables table => q(filter),
append => q(INPUT),
protocol => q(tcp),
match => q(state),
state => q(NEW),
dport => 22,
jump => q(ACCEPT);
iptables table => q(filter),
append => q(INPUT),
protocol => q(tcp),
match => q(state),
state => q(NEW),
dport => 80,
jump => q(ACCEPT);
generates...
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment