3 <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
4 <link rel="stylesheet" href='stylemain.css' type='text/css'>
5 <link rel="stylesheet" href='colors.css' type='text/css'>
6 <script language="javascript" src="util.js"></script>
7 <script language="javascript">
9 var dhcpClnt = '<%ejGet(enblDhcpClnt)%>';
10 var addr = '<%ejGet(wanIpAddress)%>';
11 var mask = '<%ejGet(wanSubnetMask)%>';
12 var enblAuto = '<%ejGet(enblAuto)%>';
13 var gtwyIfc = '<%ejGetOther(sysInfo, dfltGwIfc)%>';
14 if ( gtwyIfc == ' ' ) gtwyIfc = '';
15 var gtwy = '<%ejGetOther(sysInfo, dfltGw)%>';
16 if ( gtwy == ' ' ) gtwy = '';
17 var dnsAuto = '<%ejGetOther(sysInfo,dnsAuto)%>';
18 var dns1Mem = '<%ejGet(dnsPrimary)%>';
19 var dns1 = '<%ejGetOther(sysInfo, dns)%>';
20 if ( dns1 == ' ' )
22 var dns2Mem = '<%ejGet(dnsSecondary)%>';
23 var dns2 = '<%ejGetOther(sysInfo, dns2)%>';
24 if ( dns2 == ' ' )
26 var qs = '<%ejGet(quickSetup)%>';
27 var srvId = parseInt('<%ejGet(serviceId)%>');
29 function disableDnsInfo() {
30 with ( document.forms[0] ) {
31 dnsPrimary.disabled = 1;
32 dnsPrimary.value = '';
33 dnsSecondary.disabled = 1;
34 dnsSecondary.value = '';
38 function enableDnsInfo() {
39 with ( document.forms[0] ) {
40 dnsPrimary.disabled = 0;
41 dnsPrimary.value = dns1;
42 dnsSecondary.disabled = 0;
43 dnsSecondary.value = dns2;
48 with ( document.forms[0] ) {
49 if ( dns[0].checked == true )
56 function disableGwInfo() {
57 with ( document.forms[0] ) {
59 gwAddr.checked = false;
60 defaultGateway.disabled = 1;
61 defaultGateway.value = '';
63 gwIfc.checked = false;
68 function enableGwInfo() {
69 with ( document.forms[0] ) {
72 if ( isValidIpAddress(gtwy) == true ) {
73 gwAddr.checked = true;
74 defaultGateway.value = gtwy;
76 gwAddr.checked = false;
77 defaultGateway.value = '';
79 defaultGateway.disabled = 0;
84 gwIfc.checked = false;
90 with ( document.forms[0] ) {
91 if ( gw[0].checked == true )
98 function disableWanInfo() {
99 with ( document.forms[0] ) {
100 wanIpAddress.disabled = 1;
101 wanIpAddress.value = '';
102 wanSubnetMask.disabled = 1;
103 wanSubnetMask.value = '';
107 function enableWanInfo() {
108 with ( document.forms[0] ) {
109 wanIpAddress.disabled = 0;
110 wanIpAddress.value = addr;
111 wanSubnetMask.disabled = 0;
112 wanSubnetMask.value = mask;
116 function wanClick() {
117 with ( document.forms[0] ) {
118 if ( wan[0].checked == true )
126 with ( document.forms[0] ) {
127 if ( dhcpClnt == '1' ) {
128 wan[0].checked = true;
131 wan[1].checked = true;
134 if ( enblAuto == '1' ) {
135 gw[0].checked = true;
138 gw[1].checked = true;
141 if (dnsAuto == '1') {
142 dns[0].checked = true;
145 dns[1].checked = true;
152 var loc = 'natcfg2.cgi?';
154 with ( document.forms[0] ) {
155 dns1 = dnsPrimary.value;
156 dns2 = dnsSecondary.value;
158 if ( wan[0].checked == true )
159 loc += 'enblDhcpClnt=1'; // auto WAN address
161 loc += 'enblDhcpClnt=0'; // static WAN address
162 if ( isValidIpAddress(wanIpAddress.value) == false ) {
163 alert('WAN IP address "' + wanIpAddress.value + '" is invalid IP address.');
166 loc += '&wanIpAddress=' + wanIpAddress.value;
167 if ( isValidIpAddress(wanSubnetMask.value) == false ) {
168 alert('WAN subnet mask "' + wanSubnetMask.value + '" is invalid IP address.');
171 loc += '&wanSubnetMask=' + wanSubnetMask.value;
174 if ( gw[0].checked == false ) {
175 if ( gwAddr.checked == false && gwIfc.checked == false ) {
176 alert('There is no selection for default gateway.');
179 if ( gwAddr.checked == true ) {
180 if ( isValidIpAddress(defaultGateway.value) == false ) {
181 alert('Remote WAN IP address "' + defaultGateway.value + '" is invalid IP address.');
184 loc += '&defaultGateway=' + defaultGateway.value;
186 loc += '&defaultGateway=0.0.0.0';
187 if ( gwIfc.checked == true ) {
188 var idx = wanIf.selectedIndex;
189 var ifc = wanIf.options[idx].value;
190 // if chosen interface is MER but does not specify static IP address then display error
191 if ( ifc.indexOf('nas_') != -1 && gwAddr.checked == false ) {
192 alert('Default gateway IP address should be specified since MER interface is selected.');
195 loc += '&wanIfName=' + ifc;
197 loc += '&wanIfName=';
198 // use static default gateway
199 loc += '&enblAuto=0';
201 loc += '&defaultGateway=0.0.0.0';
202 loc += '&wanIfName=';
203 loc += '&enblAuto=1';
205 if ( dns[0].checked == false ) {
207 if ( isValidIpAddress(dns1) == false ) {
208 alert('Primary DNS server "' + dnsPrimary.value + '" is invalid IP address.');
211 loc += '&dnsPrimary=' + dns1;
213 if ( dns2 != '' && dns2 != '0.0.0.0' ) {
214 if ( isValidIpAddress(dns2) == false ) {
215 alert('Secondary DNS server "' + dns2 + '" is invalid IP address.');
219 loc += '&dnsSecondary=' + dns2;
220 loc += '&dnsDynamic=0';
222 loc += '&dnsPrimary=0.0.0.0';
223 loc += '&dnsSecondary=0.0.0.0';
224 loc += '&dnsDynamic=1';
228 var code = 'location="' + loc + '"';
233 var loc = 'ntwkprtcl.html';
235 var code = 'location="' + loc + '"';
242 <body onLoad='frmLoad()'>
245 <b>WAN IP Settings</b><br><br>
246 Enter information provided to you by your ISP to configure the WAN IP settings.<br>
247 Notice: DHCP can be enabled for PVC in MER mode or IP over Ethernet as WAN interface
248 if "Obtain an IP address automatically" is chosen.Changing the default gateway or the
249 DNS effects the whole system. Configuring them with static values will disable the
250 automatic assignment from DHCP or other WAN connection.<br>
251 If you configure static default gateway over this PVC in MER mode, you must enter
252 the IP address of the remote gateway in the "Use IP address".
253 The "Use WAN interface" is optional.<br><br>
254 <table border="0" cellpadding="0" cellspacing="0">
256 <td colspan="2"><input type="radio" name="wan" onClick='wanClick()'> Obtain an IP address automatically</td>
259 <td colspan="2"><input type="radio" name="wan" onClick='wanClick()'> Use the following IP address:</td>
262 <td width="160">WAN IP Address:</td>
263 <td><input type='text' name='wanIpAddress'></td>
266 <td>WAN Subnet Mask:</td>
267 <td><input type='text' name='wanSubnetMask'></td>
270 <table border="0" cellpadding="0" cellspacing="0">
272 <td colspan="3"><input type="radio" name="gw" onClick='gwClick()'> Obtain default gateway automatically</td>
275 <td colspan="3"><input type="radio" name="gw" onClick='gwClick()'> Use the following default gateway:</td>
278 <td width="20"> </td>
279 <td><input type="checkbox" name='gwAddr'> Use IP Address: </td>
280 <td><input type='text' name='defaultGateway'></td>
283 <td width="20"> </td>
284 <td><input type="checkbox" name='gwIfc'> Use WAN Interface: </td>
285 <td><select name='wanIf'>
286 <script language="javascript">
290 var defaultInterface = '<%ejGetOther(wanInterfaceInfo, default)%>';
291 var interfaceInfo = '<%ejGetOther(wanInterfaceInfo, route)%>';
292 var interfaces = interfaceInfo.split('|');
294 if ( srvId == 0 || qs == '1' ) {
295 var defaultNames = defaultInterface.split('/');
296 document.write(" <option value='" + defaultNames[1] + "' selected>");
297 document.writeln(defaultInterface);
298 for ( i = 0; i < interfaces.length; i++ ) {
299 var names = interfaces[i].split('/');
300 document.write(" <option value='" + names[1] + "'>");
301 document.writeln(interfaces[i]);
304 for ( i = 0; i < interfaces.length; i++ ) {
305 var names = interfaces[i].split('/');
306 if ( names[1] == gtwyIfc )
307 document.write(" <option value='" + names[1] + "' selected>");
309 document.write(" <option value='" + names[1] + "'>");
310 document.writeln(interfaces[i]);
319 <table border="0" cellpadding="0" cellspacing="0">
321 <td colspan="3"><input type="radio" name="dns" onClick='dnsClick()'> Obtain DNS server addresses automatically</td>
324 <td colspan="3"><input type="radio" name="dns" onClick='dnsClick()'> Use the following DNS server addresses:</td>
327 <td width="20"> </td>
328 <td width="140">Primary DNS server: </td>
329 <td><input type='text' name='dnsPrimary'></td>
333 <td>Secondary DNS server: </td>
334 <td><input type='text' name='dnsSecondary'></td>
338 <input type='button' onClick='btnBack()' value='Back'> <input type='button' onClick='btnNext()' value='Next'>