diff -rub orig_pfsense/conf.default/config.xml UPLOAD_pfsense!!!/conf.default/config.xml
--- orig_pfsense/conf.default/config.xml	2006-03-09 23:44:28.000000000 +0300
+++ UPLOAD_pfsense!!!/conf.default/config.xml	2006-11-13 14:15:33.000000000 +0300
@@ -115,6 +115,9 @@
 	<pppoe>
 		<username></username>
 		<password></password>
+		<local></local>
+		<subnet></subnet>
+		<remote></remote>
 		<provider></provider>
 		<!--
 		<ondemand/>
diff -rub orig_pfsense/etc/inc/interfaces.inc UPLOAD_pfsense!!!/etc/inc/interfaces.inc
--- orig_pfsense/etc/inc/interfaces.inc	2007-10-15 12:26:18.000000000 +0400
+++ UPLOAD_pfsense!!!/etc/inc/interfaces.inc	2006-11-13 17:40:24.000000000 +0300
@@ -1162,14 +1162,14 @@
 	set bundle disable multilink
 	set bundle authname "{$pppoecfg['username']}"
 	set bundle password "{$pppoecfg['password']}"
-	set link keep-alive 10 60
+	set link keep-alive 60 180
 	set link max-redial 0
-	set link no acfcomp protocomp
+	set link yes acfcomp protocomp
 	set link disable pap chap
 	set link accept chap
 	set link mtu 1492
 	set ipcp yes vjcomp
-	set ipcp ranges 0.0.0.0/0 0.0.0.0/0
+	set ipcp ranges "{$pppoecfg['local']}/{$pppoecfg['subnet']}" "{$pppoecfg['remote']}/{$pppoecfg['subnet']}"
 
 EOD;
 
@@ -1178,6 +1178,11 @@
 	set ipcp enable req-pri-dns
 
 EOD;
+		if (!isset($config['pppoe']['dnsnosec'])) {
+			$mpdconf .= <<<EOD
+
+EOD;
+		}
 	}
 
 	$mpdconf .= <<<EOD
diff -rub orig_pfsense/usr/local/www/interfaces_wan.php UPLOAD_pfsense!!!/usr/local/www/interfaces_wan.php
--- orig_pfsense/usr/local/www/interfaces_wan.php	2007-10-15 11:59:17.000000000 +0400
+++ UPLOAD_pfsense!!!/usr/local/www/interfaces_wan.php	2007-10-15 12:37:00.000000000 +0400
@@ -1,5 +1,5 @@
 <?php
-/* $Id: interfaces_wan.php,v 1.37.2.21 2006/09/05 21:54:02 sullrich Exp $ */
+/* $Id: interfaces_wan.php,v 1.37.2.11 2006/01/23 05:39:00 sullrich Exp $ */
 /*
 	interfaces_wan.php
         Copyright (C) 2004 Scott Ullrich
@@ -39,6 +39,9 @@
 $pconfig['username'] = $config['pppoe']['username'];
 $pconfig['password'] = $config['pppoe']['password'];
 $pconfig['provider'] = $config['pppoe']['provider'];
+$pconfig['pppoe_local'] = $config['pppoe']['local'];
+$pconfig['pppoe_subnet'] = $config['pppoe']['subnet'];
+$pconfig['pppoe_remote'] = $config['pppoe']['remote'];
 $pconfig['pppoe_dialondemand'] = isset($config['pppoe']['ondemand']);
 $pconfig['pppoe_idletimeout'] = $config['pppoe']['timeout'];
 
@@ -92,29 +95,6 @@
 	unset($input_errors);
 	$pconfig = $_POST;
 
-	if($_POST['gateway'] and $pconfig['gateway'] <> $_POST['gateway']) {
-		/* enumerate slbd gateways and make sure we are not creating a route loop */
-		if(is_array($config['load_balancer']['lbpool'])) {
-			foreach($config['load_balancer']['lbpool'] as $lbpool) {
-				if($lbpool['type'] == "gateway") {
-				    foreach ((array) $lbpool['servers'] as $server) {
-			            $svr = split("\|", $server);
-			            if($svr[1] == $pconfig['gateway'])  {
-			            		$_POST['gateway']  = $pconfig['gateway'];
-			            		$input_errors[] = "Cannot change {$svr[1]} gateway.  It is currently referenced by the load balancer pools.";
-			            }
-					}
-				}
-			}
-			foreach($config['filter']['rule'] as $rule) {
-				if($rule['gateway'] == $pconfig['gateway']) {
-	            		$_POST['gateway']  = $pconfig['gateway'];
-	            		$input_errors[] = "Cannot change {$svr[1]} gateway.  It is currently referenced by the filter rules via policy based routing.";
-				}
-			}
-		}
-	}
-
 	/* input validation */
 	if ($_POST['type'] == "Static") {
 		$reqdfields = explode(" ", "ipaddr subnet gateway");
@@ -122,11 +102,11 @@
 		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
 	} else if ($_POST['type'] == "PPPoE") {
 		if ($_POST['pppoe_dialondemand']) {
-			$reqdfields = explode(" ", "username password pppoe_dialondemand pppoe_idletimeout");
-			$reqdfieldsn = explode(",", "PPPoE username,PPPoE password,Dial on demand,Idle timeout value");
+			$reqdfields = explode(" ", "username password pppoe_local pppoe_subnet pppoe_remote pppoe_dialondemand pppoe_idletimeout");
+			$reqdfieldsn = explode(",", "PPPoE username,PPPoE password,PPPoE local IP address,PPPoE subnet,PPPoE remote IP address,Dial on demand,Idle timeout value");
 		} else {
-			$reqdfields = explode(" ", "username password");
-			$reqdfieldsn = explode(",", "PPPoE username,PPPoE password");
+			$reqdfields = explode(" ", "username password pppoe_local pppoe_subnet pppoe_remote");
+			$reqdfieldsn = explode(",", "PPPoE username,PPPoE password,PPPoE local IP address,PPPoE subnet,PPPoE remote IP address");
 		}
 		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
 	} else if ($_POST['type'] == "PPTP") {
@@ -215,6 +195,9 @@
 		unset($wancfg['dhcphostname']);
 		unset($config['pppoe']['username']);
 		unset($config['pppoe']['password']);
+		unset($config['pppoe']['local']);
+		unset($config['pppoe']['subnet']);
+		unset($config['pppoe']['remote']);
 		unset($config['pppoe']['provider']);
 		unset($config['pppoe']['ondemand']);
 		unset($config['pppoe']['timeout']);
@@ -253,6 +236,9 @@
 			$wancfg['ipaddr'] = "pppoe";
 			$config['pppoe']['username'] = $_POST['username'];
 			$config['pppoe']['password'] = $_POST['password'];
+			$config['pppoe']['local'] = $_POST['pppoe_local'];
+			$config['pppoe']['subnet'] = $_POST['pppoe_subnet'];
+			$config['pppoe']['remote'] = $_POST['pppoe_remote'];
 			$config['pppoe']['provider'] = $_POST['provider'];
 			$config['pppoe']['ondemand'] = $_POST['pppoe_dialondemand'] ? true : false;
 			$config['pppoe']['timeout'] = $_POST['pppoe_idletimeout'];
@@ -291,6 +277,8 @@
 
 		$retval = 0;
 
+		touch("/tmp/reload_interfaces");
+
 		$savemsg = get_std_save_message($retval);
 	}
 }
@@ -305,6 +293,8 @@
 function enable_change(enable_change) {
 	if (document.iform.pppoe_dialondemand.checked || enable_change) {
 		document.iform.pppoe_idletimeout.disabled = 0;
+		document.iform.pppoe_local.disabled = 0;
+		document.iform.pppoe_remote.disabled = 0;
 	} else {
 		document.iform.pppoe_idletimeout.disabled = 1;
 	}
@@ -328,6 +318,8 @@
 			document.iform.provider.disabled = 1;
 			document.iform.pppoe_dialondemand.disabled = 1;
 			document.iform.pppoe_idletimeout.disabled = 1;
+			document.iform.pptp_local.disabled = 1;
+			document.iform.pptp_remote.disabled = 1;
 			document.iform.ipaddr.disabled = 0;
 			document.iform.subnet.disabled = 0;
 			document.iform.gateway.disabled = 0;
@@ -348,6 +340,8 @@
 		case 1:
 			document.iform.username.disabled = 1;
 			document.iform.password.disabled = 1;
+			document.iform.pptp_local.disabled = 1;
+			document.iform.pptp_remote.disabled = 1;
 			document.iform.provider.disabled = 1;
 			document.iform.pppoe_dialondemand.disabled = 1;
 			document.iform.pppoe_idletimeout.disabled = 1;
@@ -371,6 +365,8 @@
 		case 2:
 			document.iform.username.disabled = 0;
 			document.iform.password.disabled = 0;
+			document.iform.pptp_local.disabled = 0;
+			document.iform.pptp_remote.disabled = 0;
 			document.iform.provider.disabled = 0;
 			document.iform.pppoe_dialondemand.disabled = 0;
 			if (document.iform.pppoe_dialondemand.checked || enable_change) {
@@ -398,6 +394,8 @@
 		case 3:
 			document.iform.username.disabled = 1;
 			document.iform.password.disabled = 1;
+			document.iform.pptp_local.disabled = 1;
+			document.iform.pptp_remote.disabled = 1;
 			document.iform.provider.disabled = 1;
 			document.iform.pppoe_dialondemand.disabled = 1;
 			document.iform.pppoe_idletimeout.disabled = 1;
@@ -425,6 +423,8 @@
 		case 4:
 			document.iform.username.disabled = 1;
 			document.iform.password.disabled = 1;
+			document.iform.pptp_local.disabled = 1;
+			document.iform.pptp_remote.disabled = 1;
 			document.iform.provider.disabled = 1;
 			document.iform.pppoe_dialondemand.disabled = 1;
 			document.iform.pppoe_idletimeout.disabled = 1;
@@ -509,7 +509,7 @@
                     /
                     <select name="subnet" class="formfld" id="subnet">
 			<?php
-			for ($i = 32; $i > 0; $i--) {
+			for ($i = 32; $i >= 0; $i--) {
 				if($i <> 31) {
 					echo "<option value=\"{$i}\" ";
 					if ($i == $pconfig['subnet']) echo "selected";
@@ -560,6 +560,24 @@
                   <td class="vtable"><input name="password" type="text" class="formfld" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
                   </td>
                 </tr>
+				
+				<td width="100" valign="top" class="vncellreq">Local IP address</td>
+                  <td class="vtable">                    <input name="pppoe_local" type="text" class="formfld" id="pppoe_local" size="20" value="<?=htmlspecialchars($pconfig['pppoe_local']);?>">
+                    /
+                    <select name="pppoe_subnet" class="formfld" id="pppoe_subnet">
+                      <?php for ($i = 32; $i >= 0; $i--): ?>
+                      <option value="<?=$i;?>" <?php if ($i == $pconfig['pppoe_subnet']) echo "selected"; ?>>
+                      <?=$i;?>
+                      </option>
+                      <?php endfor; ?>
+                    </select>
+                    <br> 
+                    Note: If dynamic address then set local ip adress 0.0.0.0 mask 0</td>
+				</tr>
+                <tr>
+                  <td width="100" valign="top" class="vncellreq">Remote IP address</td>
+                  <td class="vtable">                    <input name="pppoe_remote" type="text" class="formfld" id="pppoe_remote" size="20" value="<?=htmlspecialchars($pconfig['pppoe_remote']);?>">                    <br>
+                    Note: If dynamic address then set remote ip adress  0.0.0.0</td>
                 <tr>
                   <td valign="top" class="vncell">Service name</td>
                   <td class="vtable"><input name="provider" type="text" class="formfld" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>">
@@ -714,27 +732,3 @@
 <?php include("fend.inc"); ?>
 </body>
 </html>
-
-
-<?php
-
-if ($_POST) {
-
-	if (!$input_errors) {
-
-		unlink_if_exists("{$g['tmp_path']}/config.cache");
-
-		ob_flush();
-		flush();
-		sleep(1);
-
-		interfaces_wan_configure();
-
-		reset_carp();
-
-		/* sync filter configuration */
-		filter_configure();
-	}
-}
-
-?>
\ No newline at end of file
