Added support for opening port ranges into firewall module.
This commit is contained in:
parent
29eac7c7aa
commit
130b585eea
2 changed files with 2 additions and 2 deletions
|
@ -8,7 +8,7 @@
|
|||
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
|
||||
-A INPUT -p icmp --icmp-type any -j ACCEPT
|
||||
<% firewall_rules.each do |rule| -%>
|
||||
<% rule = /(tcp|udp)\/(\d+)( .+)?/.match(rule) -%>
|
||||
<% rule = /(tcp|udp)\/([\d:]+)( .+)?/.match(rule) -%>
|
||||
-A INPUT<% if rule[1] == "tcp" %> -m state --state NEW<% end %> -m <%= rule[1] %> -p <%= rule[1] %><% if rule[3] %> -s<%= rule[3] %><% end %> --dport <%= rule[2] %> -j ACCEPT
|
||||
<% end -%>
|
||||
<% firewall_custom.each do |rule| -%>
|
||||
|
|
|
@ -9,7 +9,7 @@ pass in quick inet proto icmp all
|
|||
pass in quick inet6 proto icmp6 all
|
||||
|
||||
<% firewall_rules.each do |rule| -%>
|
||||
<% rule = /(tcp|udp)\/(\d+)( .+)?/.match(rule) -%>
|
||||
<% rule = /(tcp|udp)\/([\d:]+)( .+)?/.match(rule) -%>
|
||||
pass in quick proto <%= rule[1] %><% if rule[3] %> from<%= rule[3] %><% end %> to port <%= rule[2] %>
|
||||
<% end -%>
|
||||
<% firewall_custom.each do |rule| -%>
|
||||
|
|
Loading…
Add table
Reference in a new issue