summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-06-14 18:46:25 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-06-14 18:46:25 +0000
commit4e2a17d01ca74cd1357e53eafbda0a33eb742dcb (patch)
tree0341e252a5617ea46bd6e7dddf3df73470436295 /etc
parent3aa8c07a2214c848315541850e708ab9c800dd6d (diff)
downloadpfsense-4e2a17d01ca74cd1357e53eafbda0a33eb742dcb.zip
pfsense-4e2a17d01ca74cd1357e53eafbda0a33eb742dcb.tar.gz
Allow maximum PPTP clients to be overridden by:
pptp->n_pptp_units pptp->n_pptp_units
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc35
-rw-r--r--etc/inc/vpn.inc12
2 files changed, 38 insertions, 9 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index b6e4b84..efc56e2 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -516,6 +516,8 @@ function filter_generate_pf_altq_rules() {
$pptpip = $pptpdcfg['localip'];
$pptpsa = $pptpdcfg['remoteip'];
$pptpsn = $g['pptp_subnet'];
+ if($config['pptp']['pptp_subnet'] <> "")
+ $pptpsn = $config['pptp']['pptp_subnet'];
}
/* generate rules */
@@ -537,6 +539,9 @@ function filter_generate_pf_altq_rules() {
}
$nif = $g['n_pptp_units'];
+ if($config['pptp']['n_pptp_units'] <> "")
+ $nif = $config['pptp']['n_pptp_units'];
+
$ispptp = true;
} else {
@@ -913,8 +918,11 @@ function filter_nat_rules_generate() {
/* PPTP subnet */
if ($pptpdcfg['mode'] == "server") {
+ $pptp_subnet = $g['pptp_subnet'];
+ if($config['pptp']['pptp_subnet'] <> "")
+ $pptp_subnet = $config['pptp']['pptp_subnet'];
$natrules .= filter_nat_rules_generate_if($wanif,
- $pptpdcfg['remoteip'] . "/" . $g['pptp_subnet'], null, "", null, null);
+ $pptpdcfg['remoteip'] . "/" . $pptp_subnet, null, "", null, null);
}
/* static routes
@@ -1076,7 +1084,9 @@ function generate_user_filter_rule($rule, $ngcounter) {
if ($pptpdcfg['mode'] == "server") {
$pptpip = $pptpdcfg['localip'];
$pptpsa = $pptpdcfg['remoteip'];
- $pptpsn = $g['pptp_subnet'];
+ $pptpsn = $g['pptp_subnet'];
+ if($config['pptp']['pptp_subnet'] <> "")
+ $pptpsn = $config['pptp']['pptp_subnet'];
}
/* does the rule deal with a PPTP interface? */
@@ -1088,6 +1098,8 @@ function generate_user_filter_rule($rule, $ngcounter) {
}
$nif = $g['n_pptp_units'];
+ if($config['pptp']['n_pptp_units'] <> "")
+ $nif = $config['pptp']['n_pptp_units'];
$ispptp = true;
} else {
@@ -1441,6 +1453,8 @@ function filter_rules_generate() {
$pptpip = $pptpdcfg['localip'];
$pptpsa = $pptpdcfg['remoteip'];
$pptpsn = $g['pptp_subnet'];
+ if($config['pptp']['pptp_subnet'] <> "")
+ $pptpsn = $config['pptp']['pptp_subnet'];
}
/* default block logging? */
@@ -1755,7 +1769,10 @@ EOD;
$line = "";
if (!isset($rule['disabled'])) {
if ($rule['interface'] == "pptp") {
- for($xxx=0; $xxx < $g['n_pptp_units']; $xxx++) {
+ $n_pptp_units = $g['n_pptp_units'];
+ if($config['pptp']['n_pptp_units'] <> "")
+ $nif = $config['pptp']['n_pptp_units'];
+ for($xxx=0; $xxx < $n_pptp_units; $xxx++) {
/*
* now that PPTP server are user rules, detect
* that user is setting the pptp server rule
@@ -1792,7 +1809,10 @@ EOD;
$line = "";
if (!isset($rule['disabled'])) {
if ($rule['interface'] == "pptp") {
- for($xxx=0; $xxx < $g['n_pptp_units']; $xxx++) {
+ $n_pptp_units = $g['n_pptp_units'];
+ if($config['pptp']['n_pptp_units'] <> "")
+ $nif = $config['pptp']['n_pptp_units'];
+ for($xxx=0; $xxx < $n_pptp_units; $xxx++) {
/*
* now that PPTP server are user rules, detect
* that user is setting the pptp server rule
@@ -1944,8 +1964,11 @@ function create_firewall_outgoing_rules_to_itself() {
}
}
- /* netgraph outgoing */
- for($x=0; $x<$g['n_pptp_units']; $x++) {
+ /* netgraph outgoing */
+ $n_pptp_units = $g['n_pptp_units'];
+ if($config['pptp']['n_pptp_units'] <> "")
+ $n_pptp_units = $config['pptp']['n_pptp_units'];
+ for($x=0; $x<$n_pptp_units; $x++) {
if(does_interface_exist("ng{$x}") == true) {
$rule .="pass out quick on ng{$x} all keep state label \"let out anything from firewall host itself\"\n";
}
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index 33e60a4..577cd53 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -423,11 +423,14 @@ pptpd:
EOD;
- for ($i = 0; $i < $g['n_pptp_units']; $i++) {
+ $n_pptp_units = $g['n_pptp_units'];
+ if($config['pptp']['n_pptp_units'] <> "")
+ $n_pptp_units = $config['pptp']['n_pptp_units'];
+ for ($i = 0; $i < $n_pptp_units; $i++) {
$mpdconf .= " load pt{$i}\n";
}
- for ($i = 0; $i < $g['n_pptp_units']; $i++) {
+ for ($i = 0; $i < $n_pptp_units; $i++) {
$clientip = long2ip(ip2long($pptpdcfg['remoteip']) + $i);
$ngif = "ng" . ($i+1);
@@ -513,7 +516,10 @@ EOD;
$mpdlinks = "";
- for ($i = 0; $i < $g['n_pptp_units']; $i++) {
+ $n_pptp_units = $g['n_pptp_units'];
+ if($config['pptp']['n_pptp_units'] <> "")
+ $n_pptp_units = $config['pptp']['n_pptp_units'];
+ for ($i = 0; $i < $n_pptp_units; $i++) {
$mpdlinks .= <<<EOD
pt{$i}:
OpenPOWER on IntegriCloud