summaryrefslogtreecommitdiff
path: root/manifests/router/tor.pp
blob: 6a2986fa1d82bb1f1666751f5a4ae7d2d7d7e77e (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
define firewall::router::tor($destination, $zone = 'loc', $originaldest = $ipaddress) {
  shorewall::rule { "tor-$name-1":
    action          => 'DNAT',
    source          => 'net',
    destination     => "$zone:$destination:9001",
    proto           => 'tcp',
    destinationport => "9001",
    ratelimit       => '-',
    order           => "29001",
  }

  shorewall::rule { "tor-$name-2":
    action          => 'DNAT',
    source          => '$FW',
    destination     => "$zone:$destination:9001",
    proto           => 'tcp',
    destinationport => "9001",
    originaldest    => "$originaldest",
    ratelimit       => '-',
    order           => "29001",
  }

  shorewall::rule { "tor-$name-3":
    action          => 'DNAT',
    source          => 'net',
    destination     => "$zone:$destination:9030",
    proto           => 'tcp',
    destinationport => "9030",
    ratelimit       => '-',
    order           => "29030",
  }

  shorewall::rule { "tor-$name-4":
    action          => 'DNAT',
    source          => '$FW',
    destination     => "$zone:$destination:9030",
    proto           => 'tcp',
    destinationport => "9030",
    originaldest    => "$originaldest",
    ratelimit       => '-',
    order           => "29030",
  }
}