Skip to content

Commit

Permalink
Update firewallcmd-rich-rules.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
TorontoMedia committed Mar 24, 2016
1 parent 9444010 commit ed20d28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/action.d/firewallcmd-rich-rules.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ actioncheck =
# firewall-cmd --zone=<zone> --add-rich-rule="rule family='ipv4' source address='<ip>' service name='<service>' <blocktype>"
# Because rich rules can only handle single or a range of ports we must split ports and execute the command for each port. Ports can be single and ranges seperated by a comma or space for an example: http, https, 22-60, 18 mail

actionban = ports="<port>"; for p in $(echo $ports | tr "," " "); do firewall-cmd --add-rich-rule="rule family='ipv4' source address='<ip>' port port='$p' protocol='<protocol>' <blocktype>"; done
actionban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --add-rich-rule="rule family='ipv4' source address='<ip>' port port='$p' protocol='<protocol>' <blocktype>"; done

actionunban = ports="<port>"; for p in $(echo $ports | tr "," " "); do firewall-cmd --remove-rich-rule="rule family='ipv4' source address='<ip>' port port='$p' protocol='<protocol>' <blocktype>"; done
actionunban = ports="<port>"; for p in $(echo $ports | tr ", " " "); do firewall-cmd --remove-rich-rule="rule family='ipv4' source address='<ip>' port port='$p' protocol='<protocol>' <blocktype>"; done

[Init]

Expand Down

0 comments on commit ed20d28

Please sign in to comment.