1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 (c) 2005 U.S. Robotics Corporation
7 <title>DHCP Server « LAN</title>
9 <link href="usr_layout.css" type="text/css" rel="stylesheet" /><script src="usr_layout.js" type="text/javascript"></script>
10 <link href="usr_menus_dropdown.css" rel="stylesheet" type="text/css"><script src="usr_menus_dropdown.js" type="text/javascript"></script><script src="usr_menus_build.js" type="text/javascript"></script>
11 <link href="usr_device.css" type="text/css" rel="stylesheet" /><script src="usr_device.js" type="text/javascript"></script><link href="usr_91xx.css" type="text/css" rel="stylesheet" /><script src="usr_91xx.js" type="text/javascript"></script><script src="usr_resources.js" type="text/javascript"></script>
13 <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
15 <script type="text/javascript" src="util.js"></script>
16 <script type="text/javascript">
20 var state = '<%ejGetJS(lanRefresh)%>';
22 var code = 'location="lancfg2.cgi?lanRefresh=0"';
26 var dhcpStart = '<%ejGetJS(dhcpEthStart)%>';
27 var dhcpEnd = '<%ejGetJS(dhcpEthEnd)%>';
28 var dhcpLease = '<%ejGetJS(dhcpLeasedTime)%>';
29 var proto = '<%ejGetOther(sysInfo, noBrPrtcl)%>';
30 var ipExt = '<%ejGetOther(sysInfo, pppIpExtension)%>';
31 var dhcpEnbl = '<%ejGetJS(enblDhcpSrv)%>';
32 var natEnbl = '<%ejGetOther(sysInfo, enblNat)%>';
33 var enblUpnp = '<%ejGetJS(enblUpnp)%>';
34 var enblIgmpSnp = '<%ejGetJS(enblIgmpSnp)%>';
35 var enblIgmpMode = '<%ejGetJS(enblIgmpMode)%>';
36 var buildUpnp = '<%ejGetOther(sysInfo, buildUpnp)%>';
37 var enblStp = '<%ejGetJS(enblStp)%>';
39 function hideStpInfo(hide) {
40 var status = 'visible';
44 if (document.getElementById) // DOM3 = IE5, NS6
45 document.getElementById('idStp').style.visibility = status;
47 if (document.layers == false) // IE4
48 document.all.idStp.style.visibility = status;
52 function hideUpnpInfo(hide) {
53 var status = 'visible';
57 if (document.getElementById) // DOM3 = IE5, NS6
58 document.getElementById('upnpInfo').style.visibility = status;
60 if (document.layers == false) // IE4
61 document.all.upnpInfo.style.visibility = status;
65 function hideIgmpSnpInfo(hide) {
66 var status = 'visible';
70 if (document.getElementById) // DOM3 = IE5, NS6
71 document.getElementById('igmpSnpInfo').style.visibility = status;
73 if (document.layers == false) // IE4
74 document.all.igmpSnpInfo.style.visibility = status;
78 function hideDhcpInfo(hide) {
79 var status = 'visible';
83 if (document.getElementById) // DOM3 = IE5, NS6
84 document.getElementById('dhcpInfo').style.visibility = status;
86 if (document.layers == false) // IE4
87 document.all.dhcpInfo.style.visibility = status;
91 function disableDhcpSrv() {
92 with ( document.forms[0] ) {
93 dhcpSrvType[1].checked = false;
94 dhcpEthStart.disabled = 1;
95 dhcpEthEnd.disabled = 1;
96 dhcpLeasedTime.value = '';
97 dhcpLeasedTime.disabled = 1;
101 function enableDhcpSrv(formLoad) {
102 with ( document.forms[0] ) {
103 dhcpSrvType[1].checked = true;
104 dhcpEthStart.disabled = 0;
105 dhcpEthEnd.disabled = 0;
107 setDhcpAddresses(ethIpAddress.value);
109 dhcpEthStart.value = dhcpStart;
110 dhcpEthEnd.value = dhcpEnd;
112 dhcpLeasedTime.value = dhcpLease;
113 dhcpLeasedTime.disabled = 0;
117 function hideRelayInfo(hide) {
118 var status = 'visible';
122 if (document.getElementById) // DOM3 = IE5, NS6
123 document.getElementById('relayInfo').style.visibility = status;
125 if (document.layers == false) // IE4
126 document.all.relayInfo.style.visibility = status;
130 function disableDhcpSrvRelay() {
131 with ( document.forms[0] ) {
132 dhcpSrvType[2].checked = false;
133 dhcpSrvAddr.disabled = 1;
137 function enableDhcpSrvRelay() {
138 with ( document.forms[0] ) {
139 dhcpSrvType[2].checked = true;
140 if (dhcpEthStart.value != "")
141 dhcpSrvAddr.value = dhcpEthStart.value;
143 dhcpSrvAddr.value = dhcpStart;
144 dhcpSrvAddr.disabled = 0;
148 function typeClick() {
149 with ( document.forms[0] ) {
150 // if any protocol has NAT enabled then
151 // don't show DHCP relay
152 if ( natEnbl == '1' ) {
153 if ( dhcpSrvType[0].checked == true )
158 if ( dhcpSrvType[0].checked == true ) {
160 disableDhcpSrvRelay();
161 } else if ( dhcpSrvType[1].checked == true ) {
163 disableDhcpSrvRelay();
165 enableDhcpSrvRelay();
172 function igmpClick() {
176 with ( document.forms[0] ) {
177 ethIpAddress.value = '<%ejGetJS(ethIpAddress)%>';
178 ethSubnetMask.value = '<%ejGetJS(ethSubnetMask)%>';
180 if ( natEnbl == '1' && buildUpnp == '1' ) {
181 if ( enblUpnp == '1' )
182 chkUpnp.checked = true;
184 chkUpnp.checked = false;
189 if ( enblIgmpSnp == '1' )
190 chkIgmpSnp.checked = true;
192 chkIgmpSnp.checked = false;
193 if ( enblIgmpMode == '1' ) {
194 igmpMode[0].checked = false;
195 igmpMode[1].checked = true;
198 igmpMode[0].checked = true;
199 igmpMode[1].checked = false;
203 // if protocol is Bridge or PPP IP extension
204 // then don't show DHCP info
205 if (proto == 'Bridge' || ipExt == '1')
209 // if any protocol has NAT enabled then
210 // don't show DHCP relay
211 if ( natEnbl == '1' ) {
213 if ( dhcpEnbl == '1' )
216 dhcpSrvType[0].checked = true;
221 if ( dhcpEnbl == '1' ) {
223 disableDhcpSrvRelay();
224 } else if ( dhcpEnbl == '2' ) {
225 enableDhcpSrvRelay();
228 dhcpSrvType[0].checked = true;
230 disableDhcpSrvRelay();
233 lan2IpAddress.value = '<%ejGetJS(lan2IpAddress)%>';
234 lan2SubnetMask.value = '<%ejGetJS(lan2SubnetMask)%>';
235 if ('<%ejGetJS(enblLan2)%>' == '1') {
236 enblLan2.checked = true;
239 enblLan2.checked = false;
244 chkStp.checked = true;
246 chkStp.checked = false;
250 function hideLan2Info(hide) {
251 var status = 'visible';
255 if (document.getElementById) // DOM3 = IE5, NS6
256 document.getElementById('lan2Info').style.visibility = status;
258 if (document.layers == false) // IE4
259 document.all.lan2Info.style.visibility = status;
263 function lan2CbClick(cb) {
264 if ( cb.checked == true )
270 function isEndGTEStart(EndIp, StartIp)
272 addrEnd = EndIp.split('.');
273 addrStart = StartIp.split('.');
274 E = parseInt(addrEnd[3]) + 1;
275 S = parseInt(addrStart[3]) + 1;
281 function btnApply(reboot) {
282 var loc = 'lancfg2.cgi?';
285 loc = 'lancfg2Reset.cgi?';
287 with ( document.forms[0] ) {
288 if ( isValidIpAddress(ethIpAddress.value) == false ) {
289 alert('Address "' + ethIpAddress.value + '" is invalid IP address.');
292 if ( isValidIpAddress(ethSubnetMask.value) == false ) {
293 alert('Subnet mask "' + ethSubnetMask.value + '" has invalid IP address.');
296 loc += 'ethIpAddress=' + ethIpAddress.value;
297 loc += 'ðSubnetMask=' + ethSubnetMask.value;
298 if ( buildUpnp == '1' ) {
299 if ( chkUpnp.checked == true )
300 loc += '&enblUpnp=1';
302 loc += '&enblUpnp=0';
304 if ( chkStp.checked == true )
309 if ( chkIgmpSnp.checked == true )
310 loc += '&enblIgmpSnp=1';
312 loc += '&enblIgmpSnp=0';
313 if ( igmpMode[1].checked == true )
314 loc += '&enblIgmpMode=1';
316 loc += '&enblIgmpMode=0';
317 if ( dhcpSrvType[1].checked == true ) {
318 if (isValidIpAddress(dhcpEthStart.value) == false ||
319 !(isSameSubNet(ethIpAddress.value, ethSubnetMask.value, dhcpEthStart.value, ethSubnetMask.value))) {
320 alert('Start IP address "' + dhcpEthStart.value + '" is invalid IP address.');
323 if ( isValidIpAddress(dhcpEthEnd.value) == false ||
324 !(isSameSubNet(ethIpAddress.value, ethSubnetMask.value, dhcpEthEnd.value, ethSubnetMask.value))) {
325 alert('End IP address "' + dhcpEthEnd.value + '" is invalid IP address.');
328 if (!(isEndGTEStart(dhcpEthEnd.value, dhcpEthStart.value))) {
329 alert("End ip has to be equal or greater than Start Ip address.");
332 if ( isNaN(dhcpLeasedTime.value) == true || dhcpLeasedTime.value <= 0) {
333 alert('Leased time "' + dhcpLeasedTime.value + '" is invalid.');
336 loc += '&dhcpEthStart=' + dhcpEthStart.value;
337 loc += '&dhcpEthEnd=' + dhcpEthEnd.value;
338 loc += '&dhcpLeasedTime=' + dhcpLeasedTime.value;
339 loc += '&enblDhcpSrv=1';
341 if ( natEnbl == '1' )
342 loc += '&enblDhcpSrv=0';
344 if ( dhcpSrvType[2].checked == true ) {
345 if ( isValidIpAddress(dhcpSrvAddr.value) == false ) {
346 alert('DHCP server IP address "' + dhcpSrvAddr.value + '" is invalid IP address.');
349 loc += '&dhcpEthStart=' + dhcpSrvAddr.value;
350 loc += '&enblDhcpSrv=2';
352 loc += '&enblDhcpSrv=0';
355 if (enblLan2.checked == true) {
356 if ( isValidIpAddress(lan2IpAddress.value) == false ) {
357 alert('Address "' + lan2IpAddress.value + '" is invalid IP address.');
360 if ( isValidIpAddress(lan2SubnetMask.value) == false ) {
361 alert('Subnet mask "' + lan2SubnetMask.value + '" has invalid IP address.');
364 if (ethIpAddress.value == lan2IpAddress.value) {
365 alert('The IP address "' + ethIpAddress.value + '" for both LAN interfaces should not be the same.');
368 if (isSameSubNet(ethIpAddress.value, ethSubnetMask.value, lan2IpAddress.value, lan2SubnetMask.value)) {
369 alert('The Subnet can not be the same for both LAN interfaces.');
372 loc += '&enblLan2=1';
373 loc += '&lan2IpAddress=' + lan2IpAddress.value;
374 loc += '&lan2SubnetMask=' + lan2SubnetMask.value;
377 loc += '&enblLan2=0';
379 var code = 'location="' + loc + '"';
383 function btnReset() {
384 var loc = 'rebootinfo.cgi';
386 var code = 'location = "' + loc + '"';
390 function setDhcpAddresses(lanIp) {
391 with ( document.forms[0] ) {
392 if ( isValidIpAddress(lanIp) == false ) {
393 alert('Address "' + lanIp + '" is invalid IP address.');
396 addrParts = lanIp.split('.');
397 if ( addrParts.length != 4 )
399 t1 = parseInt(addrParts[3]) + 1;
400 if (dhcpEthStart.value != '' && t1 >= 255) {
401 alert("Last portion of IP Address has to be less than 254 for Enabled DHCP Server");
404 dhcpEthStart.value = dhcpEthEnd.value = "";
405 for (i = 0; i < 3; i++) {
406 dhcpEthStart.value = dhcpEthStart.value + addrParts[i] + ".";
407 dhcpEthEnd.value = dhcpEthEnd.value + addrParts[i] + ".";
409 dhcpEthStart.value = dhcpEthStart.value + t1;
410 dhcpEthEnd.value = dhcpEthEnd.value + 254;
414 function manualModDhcp() {
415 with ( document.forms[0] ) {
416 dhcpStart = dhcpEthStart.value;
417 dhcpEnd = dhcpEthEnd.value;
423 <base target="_self">
426 <body onload="initMenu(); frmLoad();">
428 <script type="text/javascript">
435 <p>Configure the router’s IP address and subnet mask for LAN interface.</p>
437 <table border="0" cellpadding="1" cellspacing="0">
439 <td><label for="ethIpAddress">IP address:</label></td>
440 <td><input type='text' name='ethIpAddress' id='ethIpAddress' onChange='setDhcpAddresses(this.value)'></td>
443 <td><label for="ethSubnetMask">Subnet mask:</label></td>
444 <td><input type='text' name='ethSubnetMask' id='ethSubnetMask'></td>
450 <input type='radio' name='dhcpSrvType' id='optDHCPoff' onClick='typeClick()'> <label for="optDHCPoff">Disable DHCP server</label><br>
451 <input type='radio' name='dhcpSrvType' id='optDHCPon' onClick='typeClick()'> <label for="optDHCPon">Enable DHCP server</label>
453 <table border="0" cellpadding="1" cellspacing="0" style="margin-left: 2em;">
455 <td><label for="dhcpEthStart">Start IP address:</label></td>
456 <td><input type='text' name='dhcpEthStart' id='dhcpEthStart' onChange='manualModDhcp()'></td>
459 <td><label for="dhcpEthEnd">End IP address:</label></td>
460 <td><input type='text' name='dhcpEthEnd' id='dhcpEthEnd' onChange='manualModDhcp()'></td>
463 <td><label for="dhcpLeasedTime">Lease time:</label></td>
464 <td><input type='text' name='dhcpLeasedTime' id='dhcpLeasedTime'> hours</td>
469 <p><input type='radio' name='dhcpSrvType' id='optDHCPrelay' onClick='typeClick()'> <label for="optDHCPrelay">Enable DHCP server relay</label></p>
470 <table border="0" cellpadding="1" cellspacing="0" style="margin-left: 2em;">
472 <td><label for="dhcpSrvAddr">DHCP server IP address:</label></td>
473 <td><input type='text' name='dhcpSrvAddr' id='dhcpSrvAddr'></td>
478 <p><input type='checkbox' name='enblLan2' id='enblLan2' onClick='lan2CbClick(this)'> <label for="enblLan2">Configure the second IP address and subnet mask for LAN interface</label></p>
480 <table border="0" cellpadding="1" cellspacing="0" style="margin-left: 2em;">
482 <td><label for="lan2IpAddress">IP address:</label></td>
483 <td><input type='text' name='lan2IpAddress' id='lan2IpAddress'></td>
486 <td><label for="lan2SubnetMask">Subnet mask:</label></td>
487 <td><input type='text' name='lan2SubnetMask' id='lan2SubnetMask'></td>
493 <div id='igmpSnpInfo'>
494 <h3>IGMP Snooping</h3>
495 <p><input type='checkbox' name='chkIgmpSnp' id='chkIgmpSnp'> <label for="chkIgmpSnp">IGMP snooping</label></p>
496 <P><input type='radio' name='igmpMode' id='igmpModeS'> <label for="igmpModeS">Standard mode</label><br/>
497 <input type='radio' name='igmpMode' id='igmpModeB'> <label for="igmpModeB">Blocking mode</label>
502 <h3>Universal Plug-n-Play</h3>
503 <p><input type='checkbox' name='chkUpnp' id='chkUpnp'> <label for="chkUpnp">Universal Plug-n-Play (UPnP)</label></p>
508 <p><input type='checkbox' name='chkStp' id='chkStp'> <label for="chkStp">802.1d spanning tree protocol</label></p>
511 <p><input type='button' onClick='btnApply(0)' value='Apply'> <input type='button' onClick='btnReset()' value='Restart'></p>
514 <script type="text/javascript">