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 addr = '<%ejGet(wanIpAddress)%>';
10 var mask = '<%ejGet(wanSubnetMask)%>';
11 var enblAuto = '<%ejGet(enblAuto)%>';
12 var gtwyIfc = '<%ejGetOther(sysInfo, dfltGwIfc)%>';
13 if ( gtwyIfc == ' ' ) gtwyIfc = '';
14 var gtwy = '<%ejGetOther(sysInfo, dfltGw)%>';
15 if ( gtwy == ' ' ) gtwy = '';
16 var dnsAuto = '<%ejGetOther(sysInfo,dnsAuto)%>';
17 var dns1Mem = '<%ejGet(dnsPrimary)%>';
18 var dns1 = '<%ejGetOther(sysInfo, dns)%>';
19 if ( dns1 == ' ' )
21 var dns2Mem = '<%ejGet(dnsSecondary)%>';
22 var dns2 = '<%ejGetOther(sysInfo, dns2)%>';
23 if ( dns2 == ' ' )
25 var qs = '<%ejGet(quickSetup)%>';
26 var srvId = parseInt('<%ejGet(serviceId)%>');
28 function disableDnsInfo() {
29 with ( document.forms[0] ) {
30 dnsPrimary.disabled = 1;
31 dnsPrimary.value = '';
32 dnsSecondary.disabled = 1;
33 dnsSecondary.value = '';
37 function enableDnsInfo() {
38 with ( document.forms[0] ) {
39 dnsPrimary.disabled = 0;
40 dnsPrimary.value = dns1;
41 dnsSecondary.disabled = 0;
42 dnsSecondary.value = dns2;
46 function dnsClick(cb) {
47 if ( cb.checked == true )
53 function disableGwInfo() {
54 with ( document.forms[0] ) {
56 gwAddr.checked = false;
57 defaultGateway.disabled = 1;
58 defaultGateway.value = '';
60 gwIfc.checked = false;
65 function enableGwInfo() {
66 with ( document.forms[0] ) {
68 if ( isValidIpAddress(gtwy) == true ) {
69 gwAddr.checked = true;
70 defaultGateway.value = gtwy;
72 gwAddr.checked = false;
73 defaultGateway.value = '';
75 defaultGateway.disabled = 0;
80 gwIfc.checked = false;
85 function gwClick(cb) {
86 if ( cb.checked == true )
93 with ( document.forms[0] ) {
94 wanIpAddress.value = addr;
95 wanSubnetMask.value = mask;
96 if ( enblAuto == '1' ) {
103 if (dnsAuto == '1') {
114 var loc = 'natcfg2.cgi?';
116 with ( document.forms[0] ) {
117 dns1 = dnsPrimary.value;
118 dns2 = dnsSecondary.value;
119 // ipoa always uses static wan ip address
120 loc += 'enblDhcpClnt=0';
122 if ( isValidIpAddress(wanIpAddress.value) == false ) {
123 alert('WAN IP address "' + wanIpAddress.value + '" is invalid IP address.');
126 loc += '&wanIpAddress=' + wanIpAddress.value;
128 if ( isValidIpAddress(wanSubnetMask.value) == false && wanSubnetMask.value != '255.255.255.255') {
129 alert('WAN subnet mask "' + wanSubnetMask.value + '" is invalid IP address.');
132 loc += '&wanSubnetMask=' + wanSubnetMask.value;
134 if ( gw.checked == true ) {
135 if ( gwAddr.checked == false && gwIfc.checked == false ) {
136 alert('There is no selection for default gateway.');
139 if ( gwAddr.checked == true ) {
140 if ( isValidIpAddress(defaultGateway.value) == false ) {
141 alert('Remote WAN IP address "' + defaultGateway.value + '" is invalid IP address.');
144 loc += '&defaultGateway=' + defaultGateway.value;
146 loc += '&defaultGateway=0.0.0.0';
147 if ( gwIfc.checked == true ) {
148 var idx = wanIf.selectedIndex;
149 var ifc = wanIf.options[idx].value;
150 // if chosen interface is MER but does not specify static IP address then display error
151 if ( ifc.indexOf('nas_') != -1 && gwAddr.checked == false ) {
152 alert('Default gateway IP address should be specified since MER interface is selected.');
155 loc += '&wanIfName=' + ifc;
157 loc += '&wanIfName=';
158 // use static default gateway
159 loc += '&enblAuto=0';
161 loc += '&defaultGateway=0.0.0.0';
162 loc += '&wanIfName=';
163 loc += '&enblAuto=1';
165 if ( dns.checked == true ) {
167 if ( isValidIpAddress(dns1) == false ) {
168 alert('Primary DNS server "' + dnsPrimary.value + '" is invalid IP address.');
171 loc += '&dnsPrimary=' + dns1;
173 if ( dns2 != '' && dns2 != '0.0.0.0' ) {
174 if ( isValidIpAddress(dns2) == false ) {
175 alert('Secondary DNS server "' + dns2 + '" is invalid IP address.');
179 loc += '&dnsSecondary=' + dns2;
180 loc += '&dnsDynamic=0';
182 loc += '&dnsPrimary=0.0.0.0';
183 loc += '&dnsSecondary=0.0.0.0';
184 loc += '&dnsDynamic=1';
188 var code = 'location="' + loc + '"';
193 var loc = 'ntwkprtcl.html';
195 var code = 'location="' + loc + '"';
202 <body onLoad='frmLoad()'>
205 <b>WAN IP Settings</b><br>
207 Enter information provided to you by your ISP to configure the WAN IP settings.<br><br>
208 Notice: DHCP is not supported in IPoA mode.
209 Changing the default gateway or the DNS effects the whole system.
210 Configuring them with static values will disable the automatic assignment
211 from other WAN connection.<br><br>
212 <table border="0" cellpadding="0" cellspacing="0">
214 <td width="160">WAN IP Address:</td>
215 <td><input type='text' name='wanIpAddress'></td>
218 <td>WAN Subnet Mask:</td>
219 <td><input type='text' name='wanSubnetMask'></td>
222 <table border="0" cellpadding="0" cellspacing="0">
224 <td colspan="3"><input type="checkbox" name="gw" onClick='gwClick(this)'> Use the following default gateway:</td>
227 <td width="20"> </td>
228 <td><input type="checkbox" name='gwAddr'> Use IP Address: </td>
229 <td><input type='text' name='defaultGateway'></td>
232 <td width="20"> </td>
233 <td><input type="checkbox" name='gwIfc'> Use WAN Interface: </td>
234 <td><select name='wanIf'>
235 <script language="javascript">
239 var defaultInterface = '<%ejGetOther(wanInterfaceInfo, default)%>';
240 var interfaceInfo = '<%ejGetOther(wanInterfaceInfo, route)%>';
241 var interfaces = interfaceInfo.split('|');
243 if ( srvId == 0 || qs == '1' ) {
244 var defaultNames = defaultInterface.split('/');
245 document.write(" <option value='" + defaultNames[1] + "' selected>");
246 document.writeln(defaultInterface);
247 for ( i = 0; i < interfaces.length; i++ ) {
248 var names = interfaces[i].split('/');
249 document.write(" <option value='" + names[1] + "'>");
250 document.writeln(interfaces[i]);
253 for ( i = 0; i < interfaces.length; i++ ) {
254 var names = interfaces[i].split('/');
255 if ( names[1] == gtwyIfc )
256 document.write(" <option value='" + names[1] + "' selected>");
258 document.write(" <option value='" + names[1] + "'>");
259 document.writeln(interfaces[i]);
268 <table border="0" cellpadding="0" cellspacing="0">
270 <td colspan="3"><input type="checkbox" name="dns" onClick='dnsClick(this)'> Use the following DNS server addresses:</td>
273 <td width="20"> </td>
274 <td width="140">Primary DNS server: </td>
275 <td><input type='text' name='dnsPrimary'></td>
279 <td>Secondary DNS server: </td>
280 <td><input type='text' name='dnsSecondary'></td>
284 <input type='button' onClick='btnBack()' value='Back'> <input type='button' onClick='btnNext()' value='Next'>