3 <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
4 <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
5 <link rel="stylesheet" href='stylemain.css' type='text/css'>
6 <link rel="stylesheet" href='colors.css' type='text/css'>
7 <script language="javascript" src="util.js"></script>
8 <script language="javascript">
10 parent.helpframe.location.href="hlplansetup.html";
11 var randomNum = '<%ejGet(CheckNum)%>';
12 var lanIpAddr='<%ejGet(ethIpAddress)%>';
13 var lanSubMask='<%ejGet(ethSubnetMask)%>';
14 var lan2Status='<%ejGet(enblLan2)%>';
15 var lan2IpAddr='<%ejGet(lan2IpAddress)%>';
16 var lan2SubMask='<%ejGet(lan2SubnetMask)%>';
18 var BridgeOnly = '<%ejGetOther(sysInfo, PrtclBridgeOnly)%>';
19 var hostname='<%ejGet(hostname)%>';
20 var domainname='<%ejGet(domainname)%>';
21 var lanmtu = '<%ejGet(lanmtu)%>';
22 var includemtu = '<%ejGetOther(sysInfo, includemtu)%>';
23 var dhcpStart = '<%ejGet(dhcpEthStart)%>';
24 var dhcpEnd = '<%ejGet(dhcpEthEnd)%>';
25 var dhcpLease = '<%ejGet(dhcpLeasedTime)%>';
26 var old_Leasetime=dhcpLease;
27 var nat = '<%ejGet(enblNat)%>';
28 var dhcpEnbl = '<%ejGet(enblDhcpSrv)%>';
29 var natEnbl = '<%ejGetOther(sysInfo, enblNat)%>';
36 function viewList(){
\r
37 window.open("viewdhcprelist.html","","width=470, height=300, scrollbars=yes");
\r
40 function showDhcpInfo(){
\r
41 document.getElementById('DhcpInfo').innerHTML =
\r
42 '<table width="570" border="0" cellspacing="0" cellpadding="0" height="96">'+
\r
44 '<td width="195" height="30"><input type="radio" name="dhcpser" id="dhcpenable" onClick="radiobut()"> DHCP Server On</td>'+
\r
45 '<td width="75" height="30" name="startipstr" id="startipstr">Start IP: </td>'+
\r
46 '<td width="280" height="30" align="left"> '+
\r
47 '<input type="text" name="startIp" id="startIp" size="20"></td>'+
\r
50 '<td width="195" height="30"> </td>'+
\r
51 '<td width="75" height="30" name="endipstr" id="endipstr">End IP: </td>'+
\r
52 '<td width="280" height="30"> <input type="text" name="endIp" id="endIp" size="20"></td>'+
\r
55 '<td width="195" height="30"> </td>'+
\r
56 '<td width="75" height="30" name="leasetimestr" id="leasetimestr">Lease Time: </td>'+
\r
57 '<td width="280" height="30" name="dhmstr" id="dhmstr"> <input type="text" name="time_dd" id="time_dd" size="3"> '+
\r
58 'days <input type="text" name="time_hh" id="time_hh" size="2"> hours '+
\r
59 '<input type="text" name="time_mm" id="time_mm" size="2"> minutes</td>'+
\r
62 '<td width="195" height="33"> </td>'+
\r
63 '<td width="85" height="33"> </td>'+
\r
64 '<td width="280" height="33"> '+
\r
65 '<input type="button" value="Reserved IP Address List" name="resbut" id="resbut" onClick="viewList()"></td>'+
\r
68 '<td width="550" height="42" colspan="3">'+
\r
69 '<table width="550" border="0" cellspacing="0" cellpadding="0" height="42">'+
\r
71 '<td><input type="radio" name="dhcpser" id="dhcprelay" onClick="radiobut()"> Relay On</td>'+
\r
72 '<td name="relaystr" id="relaystr"> Relay to Server IP:</td>'+
\r
73 '<td><input type="text" name="relayIp" id="relayIp" size="20"></td>'+
\r
78 '<td width="550" height="30" colspan="3" align="left">'+
\r
79 '<input type="radio" name="dhcpser" id="dhcpdisable" onClick="radiobut()"> Server and Relay Off</td>'+
\r
84 function setvalue(){
\r
85 if (document.getElementById("dhcpenable").checked==true){
\r
86 document.getElementById("dhcpenable").checked=true;
\r
87 document.getElementById("dhcprelay").checked=false;
\r
88 document.getElementById("dhcpdisable").checked=false;
\r
89 document.getElementById("startipstr").style.color="#000000";
\r
90 document.getElementById("endipstr").style.color="#000000";
\r
91 document.getElementById("leasetimestr").style.color="#000000";
\r
92 document.getElementById("dhmstr").style.color="#000000";
\r
93 document.getElementById("relaystr").style.color="#666666";
\r
94 document.getElementById("startIp").disabled=false;
\r
95 document.getElementById("endIp").disabled=false;
\r
96 document.getElementById("time_dd").disabled=false;
\r
97 document.getElementById("time_hh").disabled=false;
\r
98 document.getElementById("time_mm").disabled=false;
\r
99 document.getElementById("resbut").disabled=false;
\r
100 document.getElementById("relayIp").disabled=true;
\r
101 } else if (document.getElementById("dhcprelay").checked==true){
\r
102 document.getElementById("dhcpenable").checked=false;
\r
103 document.getElementById("dhcprelay").checked=true
\r
104 document.getElementById("dhcpdisable").checked=false;
\r
105 document.getElementById("startipstr").style.color="#666666";
\r
106 document.getElementById("endipstr").style.color="#666666";
\r
107 document.getElementById("leasetimestr").style.color="#666666";
\r
108 document.getElementById("dhmstr").style.color="#666666";
\r
109 document.getElementById("relaystr").style.color="#000000";
\r
110 document.getElementById("startIp").disabled=true;
\r
111 document.getElementById("endIp").disabled=true;
\r
112 document.getElementById("time_dd").disabled=true;
\r
113 document.getElementById("time_hh").disabled=true;
\r
114 document.getElementById("time_mm").disabled=true;
\r
115 document.getElementById("resbut").disabled=true;
\r
116 document.getElementById("relayIp").disabled=false;
\r
118 document.getElementById("dhcpenable").checked=false;
\r
119 document.getElementById("dhcprelay").checked=false;
\r
120 document.getElementById("dhcpdisable").checked=true;
\r
121 document.getElementById("startipstr").style.color="#666666";
\r
122 document.getElementById("endipstr").style.color="#666666";
\r
123 document.getElementById("leasetimestr").style.color="#666666";
\r
124 document.getElementById("dhmstr").style.color="#666666";
\r
125 document.getElementById("relaystr").style.color="#666666";
\r
126 document.getElementById("startIp").disabled=true;
\r
127 document.getElementById("endIp").disabled=true;
\r
128 document.getElementById("time_dd").disabled=true;
\r
129 document.getElementById("time_hh").disabled=true;
\r
130 document.getElementById("time_mm").disabled=true;
\r
131 document.getElementById("resbut").disabled=true;
\r
132 document.getElementById("relayIp").disabled=true;
\r
134 document.getElementById("startIp").value=dhcpStart;
\r
135 document.getElementById("endIp").value=dhcpEnd;
\r
136 dhcpLease=old_Leasetime;
\r
137 DD = Math.floor(dhcpLease/86400);
\r
139 HH = Math.floor(dhcpLease/3600);
\r
141 MM = Math.floor(dhcpLease/60);
\r
142 document.getElementById("time_dd").value=DD;
\r
143 document.getElementById("time_hh").value=HH;
\r
144 document.getElementById("time_mm").value=MM;
\r
145 document.getElementById("relayIp").value=dhcpStart;
\r
146 old_DhcpStatus = dhcpEnbl;
\r
149 function radiobut(){
\r
156 with(document.forms[0]){
157 if(enblLan2.checked==true){
158 document.getElementById('displaylan2').innerHTML ='<table border="0" cellpadding="0" cellspacing="0">'+
160 '<td width="150">Secondary IP Address:</td>'+
161 '<td><input type="text" name="lan2IpAddress"></td>'+
164 '<td>Subnet Mask:</td>'+
165 '<td><input type="text" name="lan2SubnetMask"></td>'+
169 if (lan2IpAddr == '0.0.0.0'){
173 lan2IpAddress.value = lan2IpAddr;
174 lan2SubnetMask.value = lan2SubMask;
176 document.getElementById('displaylan2').innerHTML = '';
181 function showLanMTUInfo(){
182 with ( document.forms[0] ) {
183 document.getElementById('LanMtuInfo').innerHTML =
184 '<table border="0" cellspacing="0" cellpadding="0" height="30">'+
186 '<td width="150" height="30">MTU:</td>'+
187 '<td height="30"><input type="text" name="lmtu" id="mtu" size="5"> (Default: 1500)</td>'+
196 with ( document.forms[0] ) {
197 ethIpAddress.value = lanIpAddr;
198 ethSubnetMask.value = lanSubMask;
199 hname.value=hostname;
200 dname.value=domainname;
202 if ( BridgeOnly == '0' ){
203 if (lan2Status == '1') {
204 enblLan2.checked = true;
208 enblLan2.checked = false;
210 old_lan2status=false;
213 if (includemtu == '1')
218 if (dhcpEnbl == '1'){
\r
219 document.getElementById("dhcpenable").checked=true;
\r
220 document.getElementById("dhcprelay").checked=false;
\r
221 document.getElementById("dhcpdisable").checked=false;
\r
222 } else if (dhcpEnbl == '2'){
\r
223 document.getElementById("dhcpenable").checked=false;
\r
224 document.getElementById("dhcprelay").checked=true;
\r
225 document.getElementById("dhcpdisable").checked=false;
\r
227 document.getElementById("dhcpenable").checked=false;
\r
228 document.getElementById("dhcprelay").checked=false;
\r
229 document.getElementById("dhcpdisable").checked=true;
\r
235 if (<%ejGet(changeset)%> == 1){
236 parent.footerfrm.location.href="footer.html";
241 var loc = 'lancfg2.cgi?';
242 loc += 'checkNum=' + randomNum + '&';
243 with ( document.forms[0] ) {
244 if ( isValidIpAddress(ethIpAddress.value) == false ) {
245 alert('Address "' + ethIpAddress.value + '" is invalid IP address.');
248 if ( isValidIpAddress(ethSubnetMask.value) == false ) {
249 alert('Subnet mask "' + ethSubnetMask.value + '" has invalid IP address.');
252 loc += 'ethIpAddress=' + ethIpAddress.value;
253 loc += 'ðSubnetMask=' + ethSubnetMask.value;
254 if(hname.value.charAt(0).match("^[0-9]") != null){
255 alert("Host name can not start with a number.");
258 loc += '&hostname=' + encodeUrl(hname.value);
259 if(urlError==1) return;
260 if(dname.value.charAt(0).match("^[0-9]") != null){
261 alert("Domain name can not start with a number.");
264 loc += '&domainname=' + encodeUrl(dname.value);
265 if(urlError==1) return;
268 if (enblLan2.checked == true) {
269 if ( isValidIpAddress(lan2IpAddress.value) == false ) {
270 alert('Address "' + lan2IpAddress.value + '" is invalid IP address.');
273 if ( isValidIpAddress(lan2SubnetMask.value) == false ) {
274 alert('Subnet mask "' + lan2SubnetMask.value + '" has invalid IP address.');
277 if ( checkLan1andLan2(ethIpAddress.value, ethSubnetMask.value, lan2IpAddress.value, lan2SubnetMask.value)==false){
278 alert("The primary LAN IP address and secondary LAN IP address MUST belong to different subnets.");
281 loc += '&enblLan2=1';
282 loc += '&lan2IpAddress=' + lan2IpAddress.value;
283 loc += '&lan2SubnetMask=' + lan2SubnetMask.value;
285 loc += '&enblLan2=0';
286 loc += '&lan2IpAddress=' + '0.0.0.0';
287 loc += '&lan2SubnetMask=' + '255.255.255.255';
290 if (includemtu == '1'){
291 if (lmtu.value <1000){
292 alert("Minimum MTU is 1000.");
295 if (lmtu.value >1500){
296 alert("Maximum MTU is 1500.");
299 loc += '&lanmtu=' + lmtu.value;
303 if (dhcpser[2].checked == true){
\r
304 loc += '&enblDhcpSrv=0';
\r
305 } else if (dhcpser[1].checked == true){
\r
306 if ( isValidIpAddress(relayIp.value) == false ) {
\r
307 alert('Relay IP address "' + relayIp.value + '" is invalid IP address.');
\r
310 loc += '&enblDhcpSrv=2';
\r
311 loc += '&dhcpEthStart=' + relayIp.value;
\r
313 if ( isValidIpAddress(startIp.value) == false ) {
\r
314 alert('Start IP address "' +startIp.value + '" is invalid IP address.');
\r
317 if ( isValidIpAddress(endIp.value) == false ) {
\r
318 alert('Stop IP address "' + endIp.value + '" is invalid IP address.');
\r
321 if ( isNaN(time_dd.value) == true || isNaN(time_hh.value) == true ||
\r
322 isNaN(time_mm.value) == true) {
\r
323 alert("Dhcp lease time is invalid.");
\r
326 if (checkDhcpIpAddrRange(startIp.value, endIp.value) == false){
\r
327 alert('DHCP IP Address range is Error.');
\r
330 loc += '&enblDhcpSrv=1';
\r
331 loc += '&dhcpEthStart=' + startIp.value;
\r
332 loc += '&dhcpEthEnd=' + endIp.value;
\r
333 var leasetime=(time_dd.value*86400)+(time_hh.value*3600)+(time_mm.value*60);
\r
334 loc += '&dhcpLeasedTime=' + leasetime;
\r
338 var code = 'window.location.href="/'; // for Mac safari browser compatibility
344 function do_cgi_noIP2(){
345 var loc = 'lancfg2.cgi?';
346 loc += 'checkNum=' + randomNum + '&';
347 with ( document.forms[0] ) {
348 if ( isValidIpAddress(ethIpAddress.value) == false ) {
349 alert('Address "' + ethIpAddress.value + '" is invalid IP address.');
352 if ( isValidIpAddress(ethSubnetMask.value) == false ) {
353 alert('Subnet mask "' + ethSubnetMask.value + '" has invalid IP address.');
356 loc += 'ethIpAddress=' + ethIpAddress.value;
357 loc += 'ðSubnetMask=' + ethSubnetMask.value;
358 loc += '&hostname=' + encodeUrl(hname.value);
359 if(urlError==1) return;
360 loc += '&domainname=' + encodeUrl(dname.value);
361 if(urlError==1) return;
362 if (includemtu == '1'){
363 if (lmtu.value <1000){
364 alert("Minimum MTU is 1000.");
367 if (lmtu.value >1500){
368 alert("Maximum MTU is 1500.");
371 loc += '&lanmtu=' + lmtu.value;
375 if (dhcpser[2].checked == true){
\r
376 loc += '&enblDhcpSrv=0';
\r
377 } else if (dhcpser[1].checked == true){
\r
378 if ( isValidIpAddress(relayIp.value) == false ) {
\r
379 alert('Relay IP address "' + relayIp.value + '" is invalid IP address.');
\r
382 loc += '&enblDhcpSrv=2';
\r
383 loc += '&dhcpEthStart=' + relayIp.value;
\r
385 if ( isValidIpAddress(startIp.value) == false ) {
\r
386 alert('Start IP address "' +startIp.value + '" is invalid IP address.');
\r
389 if ( isValidIpAddress(endIp.value) == false ) {
\r
390 alert('Stop IP address "' + endIp.value + '" is invalid IP address.');
\r
393 if ( isNaN(time_dd.value) == true || isNaN(time_hh.value) == true ||
\r
394 isNaN(time_mm.value) == true) {
\r
395 alert("Dhcp lease time is invalid.");
\r
398 if (checkDhcpIpAddrRange(startIp.value, endIp.value) == false){
\r
399 alert('DHCP IP Address range is Error.');
\r
402 loc += '&enblDhcpSrv=1';
\r
403 loc += '&dhcpEthStart=' + startIp.value;
\r
404 loc += '&dhcpEthEnd=' + endIp.value;
\r
405 var leasetime=(time_dd.value*86400)+(time_hh.value*3600)+(time_mm.value*60);
\r
406 loc += '&dhcpLeasedTime=' + leasetime;
\r
410 var code = 'window.location.href="/'; // for Mac safari browser compatibility
416 function btnApply() {
417 with ( document.forms[0] ) {
418 if ( BridgeOnly == '0' ){
427 <base target="_self">
430 <body onLoad='frmLoad()'>
432 <form class="formpadding">
433 <table border="0" cellpadding="0" cellspacing="3" width="98%">
435 <td><b><font class="netgear">LAN IP Setup</font></b></td>
437 <tr><td> </td></tr>
439 <td background="liteblue.gif" height="12"> </td>
\r
442 <font color="#0099cc"><b>LAN IP Address Configuration</b></font><br><br>
443 Enter the ADSL router IP address and subnet mask for LAN interface.
445 <table border="0" cellpadding="0" cellspacing="0">
447 <td width="150">Primary IP Address:</td>
448 <td><input type='text' name='ethIpAddress'></td>
451 <td>Subnet Mask:</td>
452 <td><input type='text' name='ethSubnetMask'></td>
455 <td width="150">Host Name:</td>
456 <td><input type='text' name='hname' maxlength="31"></td>
459 <td>Domain Name:</td>
460 <td><input type='text' name='dname' maxlength="63"></td>
464 <script language="javascript">
466 if ( BridgeOnly == '0' ){
467 document.writeln("<table border='0' cellpadding='0' cellspacing='0'>");
468 document.writeln("<tr>");
469 document.writeln("<td valign='middle' align='left' width='24' height='20'><input type='checkbox' name='enblLan2' onClick='showlan2()'></td>");
470 document.writeln("<td>Configure secondary IP address and subnet mask.</td>");
471 document.writeln("</tr>");
472 document.writeln("</table>");
473 document.writeln("<br>");
477 <table border="0" cellpadding="0" cellspacing="0">
478 <tr><td><div ID="displaylan2"></div></td></tr>
480 <div ID="LanMtuInfo"></div>
482 <table border="0" cellpadding="0" cellspacing="3" width="98%">
484 <td background="liteblue.gif" height="12"> </td>
\r
487 <font color="#0099cc"><b>DHCP Server Configuration</b></font><br><br>
488 <table border='0' cellspacing="0" cellpadding="0">
\r
489 <tr><td width="580">
\r
490 Enabling DHCP Server on LAN interface can provide the proper IP address settings to your computer.
\r
493 <p ID="DhcpInfo"></p>
495 <table border="0" cellpadding="0" cellspacing="3" width="98%">
497 <td background="liteblue.gif" height="12"> </td>
\r
500 <table border="0" width="520">
502 <td align="left" width="50"><input type='button' onClick='btnApply()' value='Apply'></td>
503 <td align="left" width="60"><input type="button" onClick="btnCancel('lancfg2.html')" value="Cancel"></td>
504 <td class="grey_comment" width="410">New settings only take effect after your ADSL router is rebooted. If necessary, reconfigure your PC's IP address to match new settings.</td>