summaryrefslogtreecommitdiff
path: root/puppet/modules/site_shorewall/manifests/dnat_rule.pp
blob: 68f480d8aa230303b77151816c250e9d7eeac197 (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
define site_shorewall::dnat_rule {

  $port = $name
  if $port != 1194 {
    shorewall::rule {
        "dnat_tcp_port_$port":
          action          => 'DNAT',
          source          => 'net',
          destination     => "\$FW:${site_openvpn::openvpn_gateway_address}:1194",
          proto           => 'tcp',
          destinationport => $port,
          order           => 100;
    }

    shorewall::rule {
        "dnat_udp_port_$port":
          action          => 'DNAT',
          source          => 'net',
          destination     => "\$FW:${site_openvpn::openvpn_gateway_address}:1194",
          proto           => 'udp',
          destinationport => $port,
          order           => 100;
    }
  }
}