summaryrefslogtreecommitdiff
path: root/manifests/virtual/dns.pp
blob: f3899294035c5e46ab62116529a7f3416fd9eab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
class firewall::virtual::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,
  }
}