]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Rollback for http and https rules
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 11 Aug 2011 16:03:10 +0000 (13:03 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 11 Aug 2011 16:03:10 +0000 (13:03 -0300)
manifests/subsystems/firewall.pp

index 58d010202887c79a8c99f00957c8a971a63b7a73..849d016c83c039c993857a945596554ca81919b8 100644 (file)
@@ -355,28 +355,50 @@ class firewall::torrent {
   }
 }
 
-class firewall::router::http($destination, $zone = 'vm', $routeback = false, $iface = 'eth1') {
-  shorewall::rule { 'http-route':
+class firewall::router::http($destination, $zone = 'vm') {
+  shorewall::rule { 'http-route-1':
     action          => 'DNAT',
-    source          => 'all',
+    source          => 'net',
     destination     => "$zone:$destination:80",
     proto           => 'tcp',
     destinationport => '80',
     ratelimit       => '-',
     order           => '600',
   }
+
+  shorewall::rule { 'http-route-2':
+    action          => 'DNAT',
+    source          => '$FW',
+    destination     => "fw:$destination:80",
+    proto           => 'tcp',
+    destinationport => '80',
+    originaldest    => "$ipaddress",
+    ratelimit       => '-',
+    order           => '601',
+  }
 }
 
 class firewall::router::https($destination, $zone = 'vm') {
-  shorewall::rule { 'https-route':
+  shorewall::rule { 'https-route-1':
     action          => 'DNAT',
-    source          => 'all',
+    source          => 'net',
     destination     => "$zone:$destination:443",
     proto           => 'tcp',
     destinationport => '443',
     ratelimit       => '-',
     order           => '602',
   }
+
+  shorewall::rule { 'https-route-2':
+    action          => 'DNAT',
+    source          => '$FW',
+    destination     => "fw:$destination:443",
+    proto           => 'tcp',
+    destinationport => '443',
+    originaldest    => "$ipaddress",
+    ratelimit       => '-',
+    order           => '602',
+  }
 }
 
 class firewall::router::puppetmaster($destination, $puppetmaster_port = '8140', $puppetmaster_nonssl_port = '8141', $zone = 'fw') {