]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Changing rules for firewall::router::http and firewall::router::https
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 16 Aug 2011 01:03:41 +0000 (22:03 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 16 Aug 2011 01:03:41 +0000 (22:03 -0300)
manifests/subsystems/firewall/router.pp

index 7dbd2f50d027dcbf8cbe92712591e9fa07170cc8..814aa66fbf17dcff2704ac9f78f7581c68898088 100644 (file)
@@ -1,25 +1,47 @@
 class firewall::router::http($destination, $zone = 'loc') {
-  shorewall::rule { 'http-route':
+  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 = 'loc') {
-  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',