summaryrefslogtreecommitdiff
path: root/manifests/implementations/shorewall/router/tor.pp
blob: eae3775e9b9e782cc973048dfa805380c0d7edf1 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
define firewall::implementations::shorewall::router::tor($destination, $zone = 'loc', $originaldest = $ipaddress) {
  shorewall::rule { "tor-$name-1":
    action          => 'DNAT',
    source          => 'net',
    destination     => "$zone:$destination:9000",
    proto           => 'tcp',
    destinationport => "9000",
    ratelimit       => '-',
    order           => "29000",
  }

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

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

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

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

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

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

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