summaryrefslogtreecommitdiff
path: root/manifests/vm/tor.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/vm/tor.pp')
-rw-r--r--manifests/vm/tor.pp43
1 files changed, 43 insertions, 0 deletions
diff --git a/manifests/vm/tor.pp b/manifests/vm/tor.pp
new file mode 100644
index 0000000..cd8820a
--- /dev/null
+++ b/manifests/vm/tor.pp
@@ -0,0 +1,43 @@
+class firewall::vm::tor($destination, $zone = 'fw') {
+ shorewall::rule { 'tor-0':
+ action => 'DNAT',
+ source => 'net',
+ destination => "$zone:$destination:9001",
+ proto => 'tcp',
+ destinationport => '9001',
+ ratelimit => '-',
+ order => 2100,
+ }
+
+ shorewall::rule { 'tor-1':
+ action => 'DNAT',
+ source => '$FW',
+ destination => "$zone:$destination:9001",
+ proto => 'tcp',
+ destinationport => '9001',
+ originaldest => hiera('firewall::external_ip', $::ipaddress),
+ ratelimit => '-',
+ order => 2101,
+ }
+
+ shorewall::rule { 'tor-2':
+ action => 'DNAT',
+ source => 'net',
+ destination => "$zone:$destination:9030",
+ proto => 'tcp',
+ destinationport => '9030',
+ ratelimit => '-',
+ order => 2102,
+ }
+
+ shorewall::rule { 'tor-3':
+ action => 'DNAT',
+ source => '$FW',
+ destination => "$zone:$destination:9030",
+ proto => 'tcp',
+ destinationport => '9030',
+ originaldest => hiera('firewall::external_ip', $::ipaddress),
+ ratelimit => '-',
+ order => 2103,
+ }
+}