From 410a3477dae7e378f2985b08dc0d686710b4bdab Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 18 Aug 2011 22:07:47 -0300 Subject: Adding parameter port_dest to firewall::router::hairpinning --- manifests/subsystems/firewall/router.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/subsystems/firewall/router.pp b/manifests/subsystems/firewall/router.pp index 242abbf..a8d18c5 100644 --- a/manifests/subsystems/firewall/router.pp +++ b/manifests/subsystems/firewall/router.pp @@ -327,7 +327,8 @@ class firewall::router::torrent($destination, $zone = 'loc') { define firewall::router::hairpinning($order = '5000', $proto = 'tcp', $port = 'www', $external_ip = '$ETH0_IP', $interface = 'eth1', $destination = '192.168.1.100', $source = 'eth1', - $source_zone = 'loc', $dest_zone = 'loc') { + $source_zone = 'loc', $dest_zone = 'loc', + $port_dest = '') { shorewall::masq { "routeback-$name": interface => "$interface:$destination", source => $source, @@ -340,7 +341,10 @@ define firewall::router::hairpinning($order = '5000', $proto = 'tcp', $port = 'w shorewall::rule { "routeback-$name": action => 'DNAT', source => $source_zone, - destination => "$dest_zone:$destination", + destination => $port_dest ? { + '' => "$dest_zone:$destination", + default => "$dest_zone:$destination:$port_dest", + }, proto => $proto, destinationport => $port, ratelimit => '-', -- cgit v1.2.3