diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2007-09-01 18:30:20 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2007-09-01 18:30:20 +0000 |
commit | bc40d758bea5ba6be700bd83fd9a7ae643378faa (patch) | |
tree | b60c4130ee7b5e9cfdcae080538bbc6cc8672ce7 /usr/local/www/interfaces_opt.php | |
parent | c1abd446e2a96ad48a3d477d0f24ff5bbd8ae097 (diff) | |
download | pfsense-bc40d758bea5ba6be700bd83fd9a7ae643378faa.zip pfsense-bc40d758bea5ba6be700bd83fd9a7ae643378faa.tar.gz |
Create a management subnet on a wan interface if the interface is DHCP.
Create automatic nat rules for the management subnet.
Make the automatic nat rules always use the interface address.
Allow entry of these subnets on the interfaces page.
Diffstat (limited to 'usr/local/www/interfaces_opt.php')
-rwxr-xr-x | usr/local/www/interfaces_opt.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/usr/local/www/interfaces_opt.php b/usr/local/www/interfaces_opt.php index 6125797..66a26a3 100755 --- a/usr/local/www/interfaces_opt.php +++ b/usr/local/www/interfaces_opt.php @@ -62,6 +62,7 @@ $pconfig['spoofmac'] = $optcfg['spoofmac']; $pconfig['mtu'] = $optcfg['mtu']; $pconfig['disableftpproxy'] = isset($optcfg['disableftpproxy']); +$pconfig['use_rrd_gateway'] = $optcfg['use_rrd_gateway']; /* Wireless interface? */ if (isset($optcfg['wireless'])) { @@ -72,7 +73,8 @@ if (isset($optcfg['wireless'])) { if ($optcfg['ipaddr'] == "dhcp") { $pconfig['type'] = "DHCP"; $pconfig['dhcphostname'] = $optcfg['dhcphostname']; - $pconfig['use_rrd_gateway'] = $optcfg['use_rrd_gateway']; + $pconfig['alias-address'] = $optcfg['alias-address']; + $pconfig['alias-subnet'] = $optcfg['alias-subnet']; } else { $pconfig['type'] = "Static"; $pconfig['ipaddr'] = $optcfg['ipaddr']; @@ -165,6 +167,13 @@ if ($_POST) { } } } + if (($_POST['alias-address'] && !is_ipaddr($_POST['alias-address']))) { + $input_errors[] = "A valid alias IP address must be specified."; + } + if (($_POST['alias-subnet'] && !is_numeric($_POST['alias-subnet']))) { + $input_errors[] = "A valid alias subnet bit count must be specified."; + } + if ($_POST['mtu'] && (($_POST['mtu'] < 576) || ($_POST['mtu'] > 1500))) { $input_errors[] = "The MTU must be between 576 and 1500 bytes."; } @@ -222,6 +231,8 @@ if ($_POST) { } else if ($_POST['type'] == "DHCP") { $optcfg['ipaddr'] = "dhcp"; $optcfg['dhcphostname'] = $_POST['dhcphostname']; + $optcfg['alias-address'] = $_POST['alias-address']; + $optcfg['alias-subnet'] = $_POST['alias-subnet']; } $optcfg['blockpriv'] = $_POST['blockpriv'] ? true : false; @@ -444,6 +455,23 @@ function show_mon_config() { and hostname when requesting a DHCP lease. Some ISPs may require this (for client identification).</td> </tr> + <tr> + <td width="100" valign="top" class="vncellreq">Alias IP address</td> + <td class="vtable"> <input name="alias-address" type="text" class="formfld" id="alias-address" size="20" value="<?=htmlspecialchars($pconfig['alias-address']);?>"> + <select name="alias-subnet" class="formselect" id="alias-subnet"> + <?php + for ($i = 32; $i > 0; $i--) { + if($i <> 31) { + echo "<option value=\"{$i}\" "; + if ($i == $pconfig['alias-subnet']) echo "selected"; + echo ">" . $i . "</option>"; + } + } + ?> + </select> + The value in this field is used as a fixed alias IP address by the + DHCP client.</td> + </tr> <tr> <td colspan="2" valign="top" height="16"></td> </tr> |