mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fix automatic and manual outbound NAT for PPTP. Fixes #954
This commit is contained in:
parent
bdb6bd3065
commit
4e12754d1a
@ -1326,12 +1326,10 @@ function filter_nat_rules_generate() {
|
||||
}
|
||||
}
|
||||
/* PPTP subnet */
|
||||
if(isset($FilterIflist['pptp']) && $FilterIflist['pptp']['mode'] == "server" ) {
|
||||
$pptp_subnet = $FilterIflist['pptp']['sn'];
|
||||
if(is_private_ip($FilterIflist['pptp']['sa']) && !empty($pptp_subnet)) {
|
||||
$numberofnathosts++;
|
||||
$tonathosts .= "{$FilterIflist['pptp']['sa']}/{$pptp_subnet} ";
|
||||
}
|
||||
if(($config['pptpd']['mode'] == "server" ) && is_private_ip($config['pptpd']['remoteip'])) {
|
||||
$pptp_subnets = ip_range_to_subnet_array($config['pptpd']['remoteip'], long2ip32(ip2long($config['pptpd']['remoteip'])+$config['pptpd']['n_pptp_units']));
|
||||
$numberofnathosts += count($pptp_subnets);
|
||||
$tonathosts .= implode(" ", $pptp_subnets) . " ";
|
||||
}
|
||||
/* PPPoE subnet */
|
||||
if(isset($FilterIflist['pppoe']) && $FilterIflist['pppoe']['mode'] == "server") {
|
||||
|
||||
@ -126,15 +126,11 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") {
|
||||
$a_out[] = $natent;
|
||||
|
||||
/* PPTP subnet */
|
||||
if($config['pptpd']['mode'] == "server") {
|
||||
if (is_ipaddr($config['pptpd']['localip'])) {
|
||||
if($config['pptpd']['pptp_subnet'] <> "")
|
||||
$ossubnet = $config['pptpd']['pptp_subnet'];
|
||||
else
|
||||
$ossubnet = "32";
|
||||
$osn = gen_subnet($config['pptpd']['localip'], $ossubnet);
|
||||
if (($config['pptpd']['mode'] == "server") && is_private_ip($config['pptpd']['remoteip'])) {
|
||||
$pptp_subnets = ip_range_to_subnet_array($config['pptpd']['remoteip'], long2ip32(ip2long($config['pptpd']['remoteip'])+$config['pptpd']['n_pptp_units']));
|
||||
foreach ($pptp_subnets as $pptpsn) {
|
||||
$natent = array();
|
||||
$natent['source']['network'] = "{$osn}/{$ossubnet}";
|
||||
$natent['source']['network'] = $pptpsn;
|
||||
$natent['sourceport'] = "";
|
||||
$natent['descr'] = gettext("Auto created rule for PPTP server");
|
||||
$natent['target'] = "";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user