Created
September 11, 2012 09:59
-
-
Save calston/3697349 to your computer and use it in GitHub Desktop.
Iptables ERB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allowed ports | |
<% if has_variable?("open_ports") then %> | |
<% open_ports.each do |port| -%> | |
iptables -t filter -A INPUT -p tcp --dport <%= port %> -j ACCEPT | |
<% end -%> | |
<% end %> | |
<% if has_variable?("open_ports_from") then %> | |
<% open_ports_from.each_pair do |port, host| -%> | |
iptables -t filter -A INPUT -p tcp --dport <%= port %> -s <%= host %> -j ACCEPT | |
<% end -%> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment