summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2013-08-17 05:05:33 -0500
committerChris Buechler <cmb@pfsense.org>2013-08-17 05:05:33 -0500
commit31202953719b1c30daf4e0f1bfeb64e95a969185 (patch)
treedb5afd359147270337af14fbdfc398bd37fe71f1 /etc
parentf843664906d2f63efc6fdb8b182b2cc3f0c2096a (diff)
downloadpfsense-31202953719b1c30daf4e0f1bfeb64e95a969185.zip
pfsense-31202953719b1c30daf4e0f1bfeb64e95a969185.tar.gz
Fix selection of IPv6 target IP for IPv6 Outbound NAT rules.
This makes it possible (without source hacking) to do many:1 NAT of IPv6. Some will rejoice. Some will curse. This should really only be done in limited, specific circumstances. Don't develop the IPv4 NAT mentality with IPv6.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 8f1020f..fd48ff0 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1341,6 +1341,12 @@ function filter_nat_rules_generate_if($if, $src = "any", $srcport = "", $dst = "
$protocol = " proto {$proto}";
} else
$protocol = "";
+ /* Set tgt for IPv6 */
+ if ($proto == "ipv6") {
+ $natip = get_interface_ipv6($if);
+ if(is_ipaddrv6($natip))
+ $tgt = "{$natip}/128";
+ }
/* Add the hard set source port (useful for ISAKMP) */
if($natport != "")
$tgt .= " port {$natport}";
OpenPOWER on IntegriCloud