summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/easyrule.inc2
-rwxr-xr-xusr/local/www/firewall_nat_out.php34
2 files changed, 19 insertions, 17 deletions
diff --git a/etc/inc/easyrule.inc b/etc/inc/easyrule.inc
index c62f76b..b5b1620 100644
--- a/etc/inc/easyrule.inc
+++ b/etc/inc/easyrule.inc
@@ -46,7 +46,7 @@ function easyrule_find_rule_interface($int) {
if ($config['pptpd']['mode'] == "server")
$iflist['pptp'] = "PPTP VPN";
- if ($config['pppoe']['mode'] == "server")
+ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
$iflist['pppoe'] = "PPPoE VPN";
if ($config['l2tp']['mode'] == "server")
diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php
index 85c4550..0a8af47 100755
--- a/usr/local/www/firewall_nat_out.php
+++ b/usr/local/www/firewall_nat_out.php
@@ -145,22 +145,24 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") {
}
}
/* PPPoE subnet */
- if($config['pppoe']['mode'] == "server") {
- if (is_ipaddr($config['pppoe']['localip'])) {
- if($config['pppoe']['pppoe_subnet'] <> "")
- $ossubnet = $config['pppoe']['pppoe_subnet'];
- else
- $ossubnet = "32";
- $osn = gen_subnet($config['pppoe']['localip'], $ossubnet);
- $natent = array();
- $natent['source']['network'] = "{$osn}/{$ossubnet}";
- $natent['sourceport'] = "";
- $natent['descr'] = gettext("Auto created rule for PPPoE server");
- $natent['target'] = "";
- $natent['interface'] = $if2;
- $natent['destination']['any'] = true;
- $natent['natport'] = "";
- $a_out[] = $natent;
+ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
+ foreach ($config['pppoes']['pppoe'] as $pppoes) {
+ if (($pppoes['mode'] == "server") && is_ipaddr($pppoes['localip'])) {
+ if($pppoes['pppoe_subnet'] <> "")
+ $ossubnet = $pppoes['pppoe_subnet'];
+ else
+ $ossubnet = "32";
+ $osn = gen_subnet($pppoes['localip'], $ossubnet);
+ $natent = array();
+ $natent['source']['network'] = "{$osn}/{$ossubnet}";
+ $natent['sourceport'] = "";
+ $natent['descr'] = gettext("Auto created rule for PPPoE server");
+ $natent['target'] = "";
+ $natent['interface'] = $if2;
+ $natent['destination']['any'] = true;
+ $natent['natport'] = "";
+ $a_out[] = $natent;
+ }
}
}
/* L2TP subnet */
OpenPOWER on IntegriCloud