Defined Type: iptables::rule
- Defined in:
- manifests/rule.pp
Overview
Add rules to the IPTables configuration file
### Result:
*filter :INPUT DROP [0:0] :FORWARD DROP [0:0] :OUTPUT ACCEPT [0:0] :LOCAL-INPUT - [0:0] -A INPUT -j LOCAL-INPUT -A FORWARD -j LOCAL-INPUT -A LOCAL-INPUT -p icmp –icmp-type 8 -j ACCEPT -A LOCAL-INPUT -i lo -j ACCEPT -A LOCAL-INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT -A LOCAL-INPUT -m state –state NEW -m tcp -p tcp -s 1.2.3.4 –dport 1024:65535 -j ACCEPT -A LOCAL-INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT -A LOCAL-INPUT -j LOG –log-prefix “IPT:” -A LOCAL-INPUT -j DROP COMMIT
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'manifests/rule.pp', line 78
define iptables::rule (
String $content,
String $table = 'filter',
Boolean $first = false,
Boolean $absolute = false,
Integer[0] $order = 11,
String $comment = '',
Boolean $header = true,
Enum['ipv4','ipv6','all','auto'] $apply_to = 'auto'
) {
iptables_rule { $name:
table => $table,
absolute => $absolute,
first => $first,
order => $order,
header => $header,
content => $content,
apply_to => $apply_to
}
}
|