| Current Path : /var/www/html/mmishra/indem/ |
| Current File : /var/www/html/mmishra/indem/ipschemes.inc |
<h2>LAN IP Setting</h2>
<?php
$building = $_REQUEST["building"];
$netmask = $_REQUEST["netmask"];
$buildings = array(16 => "CC1", 17 => "CC2", 18 => "Administration", 19 => "Boys Hostel", 20 => "...",
21 => "Library", 22 => "...", 23 => "Visitors Hostel", 24 => "Girls Hostel", 25 => "LT-MBA",
26 => "Residences", 27 => "...", 28 => "...", 29 => "...", 30 => "BPL Network", 31 => "INDEMICA");
$subnets = array(16 => "16", 17 => "16", 18 => "4", 19 => "8", 20 => "1", 21 => "4", 22 => "1", 23 => "4",
24 => "4", 25 => "4", 26 => "8", 27 => "1", 28 => "1", 29 => "1", 30 => "1", 31 => "1");
echo "<table><tr valign='top'>
<td>VLANs<br>";
for ($i=16; $i<32; $i++) {
echo "[ VLAN " . $i . " with " . $subnets[$i] . " subnets ]";
}
echo "</td></tr>
<tr><td>Building: <select name='building'>";
for ($i=16; $i<32; $i++) {
echo "<option value='$i'";
if ($i == $building) {
$vlan = $i;
$subnet = $subnets[$i];
echo " selected";
}
echo ">$buildings[$i]</option>";
}
echo "</select> <input type='submit' name='submit' value='GET IP'></td></tr>
</table>";
$netmask = 256 - $subnet;
if ($building){
for ($k = 1; $k <= $subnet; $k++) {
echo "<table border='1' cellspacing='10' cellpadding='10'><tr>";
for ($j = 1; $j <= 254; $j++){
$row++;
echo "<td><b>
VLAN: $vlan ($buildings[$vlan])<br>
IP Address: 172.{$vlan}.$k.$j<br>
Netmask: 255.255.{$netmask}.0<br>";
if ($vlan == "16" || $vlan == "17") {
echo "Gateway: 172.{$vlan}.$k.1";
} else {
echo "Gateway: 172.{$vlan}.0.1";
}
echo "<br>
Default DNS: 172.31.1.30<br>
Alternate DNS: 8.8.8.8<br>
Proxy: 172.31.1.[1/3/4/6]:8080<br>
Auto Script: http://www.iiita.ac.in/proxy.pac<br><br>
</b></td>";
if ($row % 2 == 0) echo "</tr><tr>";
}
echo "</tr></table><br>";
}
}
?>