From 279c52185ec96cd1f8b0c25a1a14b0e537c1c11a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 11 Sep 2015 21:43:49 -0300 Subject: Split and rename --- manifests/router/ssh.pp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 manifests/router/ssh.pp (limited to 'manifests/router/ssh.pp') diff --git a/manifests/router/ssh.pp b/manifests/router/ssh.pp new file mode 100644 index 0000000..a37b61f --- /dev/null +++ b/manifests/router/ssh.pp @@ -0,0 +1,29 @@ +define firewall::router::ssh($destination, $port_orig = '22', $port_dest = '', $zone = 'loc', + $originaldest = $ipaddress) { + shorewall::rule { "ssh-$name-1": + action => 'DNAT', + source => 'net', + destination => $port_dest ? { + '' => "$zone:$destination", + default => "$zone:$destination:$port_dest", + }, + proto => 'tcp', + destinationport => "$port_orig", + ratelimit => '-', + order => "2$port_orig", + } + + shorewall::rule { "ssh-$name-2": + action => 'DNAT', + source => '$FW', + destination => $port_dest ? { + '' => "$zone:$destination", + default => "$zone:$destination:$port_dest", + }, + proto => 'tcp', + destinationport => "$port_orig", + originaldest => "$originaldest", + ratelimit => '-', + order => "2$port_orig", + } +} -- cgit v1.2.3