summaryrefslogtreecommitdiff
path: root/manifests/vm/dns.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-09-11 21:43:49 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-09-11 21:43:49 -0300
commit279c52185ec96cd1f8b0c25a1a14b0e537c1c11a (patch)
tree58a7c463029738804df3650e33ada7ed814b728d /manifests/vm/dns.pp
parent303e2cfcb14fb9dcec2fcda13608389f84bfb307 (diff)
downloadpuppet-firewall-279c52185ec96cd1f8b0c25a1a14b0e537c1c11a.tar.gz
puppet-firewall-279c52185ec96cd1f8b0c25a1a14b0e537c1c11a.tar.bz2
Split and rename
Diffstat (limited to 'manifests/vm/dns.pp')
-rw-r--r--manifests/vm/dns.pp53
1 files changed, 53 insertions, 0 deletions
diff --git a/manifests/vm/dns.pp b/manifests/vm/dns.pp
new file mode 100644
index 0000000..a273bcc
--- /dev/null
+++ b/manifests/vm/dns.pp
@@ -0,0 +1,53 @@
+class firewall::vm::dns($destination, $zone = 'vm') {
+ shorewall::rule { 'dns-route-0':
+ action => 'DNS/ACCEPT',
+ source => 'net',
+ destination => '$FW',
+ proto => '-',
+ destinationport => '-',
+ ratelimit => '-',
+ order => 2000,
+ }
+
+ shorewall::rule { 'dns-route-1':
+ action => 'DNAT',
+ source => 'net',
+ destination => "$zone:$destination:53",
+ proto => 'tcp',
+ destinationport => '53',
+ ratelimit => '-',
+ order => 2001,
+ }
+
+ shorewall::rule { 'dns-route-2':
+ action => 'DNAT',
+ source => '$FW',
+ destination => "fw:$destination:53",
+ proto => 'tcp',
+ destinationport => '53',
+ originaldest => hiera('firewall::external_ip', $::ipaddress),
+ ratelimit => '-',
+ order => 2002,
+ }
+
+ shorewall::rule { 'dns-route-3':
+ action => 'DNAT',
+ source => 'net',
+ destination => "$zone:$destination:53",
+ proto => 'udp',
+ destinationport => '53',
+ ratelimit => '-',
+ order => 2003,
+ }
+
+ shorewall::rule { 'dns-route-4':
+ action => 'DNAT',
+ source => '$FW',
+ destination => "fw:$destination:53",
+ proto => 'udp',
+ destinationport => '53',
+ originaldest => hiera('firewall::external_ip', $::ipaddress),
+ ratelimit => '-',
+ order => 2004,
+ }
+}