diff --git a/Shorewall/Perl/Shorewall/Nat.pm b/Shorewall/Perl/Shorewall/Nat.pm index 7fd4c5ae0..e6dccf5e2 100644 --- a/Shorewall/Perl/Shorewall/Nat.pm +++ b/Shorewall/Perl/Shorewall/Nat.pm @@ -634,7 +634,7 @@ sub handle_nat_rule( $$$$$$$$$$$$ ) { # # Isolate server port # - if ( $dest =~ /^(.*)(?::(.+))$/ ) { + if ( ( $family == F_IPV4 && $dest =~ /^(.*)(?::(.+))$/ ) || ( $family == F_IPV6 && $dest =~ /^\[(.*)]:(.+)$/ ) ) { # # Server IP and Port # diff --git a/Shorewall6/manpages/shorewall6-rules.xml b/Shorewall6/manpages/shorewall6-rules.xml index 2be27b3d0..a3c07b53d 100644 --- a/Shorewall6/manpages/shorewall6-rules.xml +++ b/Shorewall6/manpages/shorewall6-rules.xml @@ -882,7 +882,7 @@ - Example: + Example 1: + + + Example 2: + + + loc:[]:3128 specifies + that the destination port should be changed to 3128 but the IP + address should remain the same. + + The port may be specified as a service