From e7bc66295e08f443c504257463ffde6c381ddfe5 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 16 Jun 2013 19:23:14 -0300 Subject: Adding firewall::router::tor --- manifests/router.pp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/manifests/router.pp b/manifests/router.pp index 7fa2db3..32f9359 100644 --- a/manifests/router.pp +++ b/manifests/router.pp @@ -273,6 +273,50 @@ define firewall::router::ssh($destination, $port_orig = '22', $port_dest = '', $ } } +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", + } +} + define firewall::router::munin($destination, $port_orig, $port_dest = '', $zone = 'loc', $order = '400', $originaldest = $ipaddress) { shorewall::rule { "munin-$name-1": -- cgit v1.2.3