summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-07 22:29:55 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-07 22:29:55 +0000
commit84888bedae4e880636cc302d7e2a5ccdf4be4207 (patch)
tree6857197a45970c664cb024512d17185bb71ff018 /etc
parent63d3d377efe69bd93e0615e85985eca256456580 (diff)
downloadpfsense-84888bedae4e880636cc302d7e2a5ccdf4be4207.zip
pfsense-84888bedae4e880636cc302d7e2a5ccdf4be4207.tar.gz
Only setup route-to directives if gateway is set
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc22
1 files changed, 12 insertions, 10 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 85e1aa0..ad9693f 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -967,14 +967,7 @@ function filter_nat_rules_generate() {
$natrules .= "\n";
}
- /* captive portal redirects */
- if(isset($config['captiveportal']['enable'])) {
- $natrules .= "# Captive Portal\n";
- $cp_interface = filter_translate_type_to_real_interface($config['captiveportal']['interface']);
- $lan_ip = $config['interfaces']['lan']['ipaddr'];
- $natrules .= "no rdr on {$cp_interface} proto tcp from <captiveportal> to any \n";
- $natrules .= "rdr on " . $cp_interface . " proto tcp from any to any port { 80 443 } -> {$lan_ip} port 8000\n\n";
- }
+
/* DIAG: add ipv6 NAT, if requested */
if (isset($config['diag']['ipv6nat']['enable']) and $config['diag']['ipv6nat']['ipaddr'] <> "") {
@@ -1053,6 +1046,15 @@ EOD;
$natrules .= process_carp_nat_rules();
+ /* captive portal redirects */
+ if(isset($config['captiveportal']['enable'])) {
+ $natrules .= "# Captive Portal\n";
+ $cp_interface = filter_translate_type_to_real_interface($config['captiveportal']['interface']);
+ $lan_ip = $config['interfaces']['lan']['ipaddr'];
+ $natrules .= "no rdr on {$cp_interface} proto tcp from <captiveportal> to any \n";
+ $natrules .= "rdr on " . $cp_interface . " proto tcp from any to any port { 80 443 } -> {$lan_ip} port 8000\n\n";
+ }
+
return $natrules;
}
@@ -1227,9 +1229,9 @@ function generate_user_filter_rule($rule, $ngcounter) {
}
/* if user has selected a custom gateway, lets work with it */
- if($rg <> "") {
+ if($rule['gateway'] <> "") {
$int = guess_interface_from_ip($rule['gateway']);
- $line .= " route-to (" . $int . " " . $rule['gateway'] . ") ";
+ $line .= " route-to (" . $int . " " . $rg . ") ";
}
/* Setup outgoing load balancing */
OpenPOWER on IntegriCloud