diff options
author | Chris Buechler <cmb@pfsense.org> | 2008-02-22 08:54:57 +0000 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2008-02-22 08:54:57 +0000 |
commit | 49b94d3a12a5a8d455f5eb944278c896864931f9 (patch) | |
tree | fb8464b5d16ef2f8687c6a562bd6c6a4e4a8a05f | |
parent | 785b62535b50dabe40e9821d984dda9a5b907a93 (diff) | |
download | pfsense-49b94d3a12a5a8d455f5eb944278c896864931f9.zip pfsense-49b94d3a12a5a8d455f5eb944278c896864931f9.tar.gz |
Do not allow DHCP Server to be used on WAN when it does not have a static IP address.
Single interface support
Appliance Project
-rwxr-xr-x | usr/local/www/services_dhcp.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index a652921..9925887 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -50,6 +50,10 @@ if($config['interfaces']['lan']) { if(!$iflist) $iflist = array("lan" => "LAN"); } else { + /* if WAN is configured for anything other than static + IP, do not allow DHCP server to be configured. */ + if (!is_ipaddr($config['interfaces']['wan']['ipaddr'])) + $singleif_nostaticip = true; $iflist = array("wan" => strtoupper($g['wan_interface_name'])); } @@ -370,6 +374,13 @@ function show_netboot_config() { echo "</html>"; exit; } + if ($singleif_nostaticip) { + echo "<b>The DHCP Server can only be enabled on interfaces configured with static IP addresses. Your interface is not configured with a static IP.</b>"; + include("fend.inc"); + echo "</body>"; + echo "</html>"; + exit; + } ?> <?php if (file_exists($d_staticmapsdirty_path)): ?><p> <?php print_info_box_np("The static mapping configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> |