1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
4 Copyright (C) 2006-2008 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 For use with Tomato Firmware only.
8 No part of this file may be used without permission.
12 <meta http-equiv='content-type' content='text/html;charset=utf-
8'
>
13 <meta name='robots' content='noindex,nofollow'
>
14 <title>[<%
ident(); %>] Basic: Network
</title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'
>
16 <link rel='stylesheet' type='text/css' href='color.css'
>
17 <script type='text/javascript' src='tomato.js'
></script>
21 <style type='text/css'
>
24 vertical-align: middle
;
28 <script type='text/javascript' src='debug.js'
></script>
30 <script type='text/javascript' src='md5.js'
></script>
31 <script type='text/javascript'
>
32 // <% nvram("dhcp_lease,dhcp_num,dhcp_start,dhcpd_startip,dhcpd_endip,l2tp_server_ip,lan_gateway,lan_ipaddr,lan_netmask,lan_proto,mtu_enable,ppp_demand,ppp_idletime,ppp_passwd,ppp_redialperiod,ppp_service,ppp_username,pptp_server_ip,security_mode2,wan_dns,wan_gateway,wan_ipaddr,wan_mtu,wan_netmask,wan_proto,wan_wins,wds_enable,wl_channel,wl_closed,wl_crypto,wl_key,wl_key1,wl_key2,wl_key3,wl_key4,wl_lazywds,wl_mode,wl_net_mode,wl_passphrase,wl_radio,wl_radius_ipaddr,wl_radius_port,wl_ssid,wl_wds,wl_wep_bit,wl_wpa_gtk_rekey,wl_wpa_psk,wl_radius_key,wds_save,wl_auth,wl0_hwaddr"); %>
35 ghz
= [['1', '1 - 2.412 GHz'],['2', '2 - 2.417 GHz'],['3', '3 - 2.422 GHz'],['4', '4 - 2.427 GHz'],['5', '5 - 2.432 GHz'],['6', '6 - 2.437 GHz'],['7', '7 - 2.442 GHz'],['8', '8 - 2.447 GHz'],['9', '9 - 2.452 GHz'],['10', '10 - 2.457 GHz'],['11', '11 - 2.462 GHz'],['12', '12 - 2.467 GHz'],['13', '13 - 2.472 GHz'],['14', '14 - 2.484 GHz']]
37 if ((!fixIP(nvram
.dhcpd_startip
)) || (!fixIP(nvram
.dhcpd_endip
))) {
38 var x
= nvram
.lan_ipaddr
.split('.').splice(0, 3).join('.') + '.';
39 nvram
.dhcpd_startip
= x
+ nvram
.dhcp_start
;
40 nvram
.dhcpd_endip
= x
+ ((nvram
.dhcp_start
* 1) + (nvram
.dhcp_num
* 1) - 1);
47 if (x
) e
.value
= 'Scan ' + (wscan
.tries
+ 1);
48 else e
.value
= 'Scan';
49 E('spin').style
.visibility
= x
? 'visible' : 'hidden';
57 xob
.onCompleted = function(text
, xml
) {
64 for (i
= 0; i
< wlscandata
.length
; ++i
) {
65 var data
= wlscandata
[i
];
69 if (!wscan
.inuse
[ch
]) {
77 if (!wscan
.seen
[mac
]) {
79 ++wscan
.inuse
[ch
].count
;
82 if (data
[4] > wscan
.inuse
[ch
].rssi
) {
83 wscan
.inuse
[ch
].rssi
= data
[4];
84 wscan
.inuse
[ch
].ssid
= data
[1];
87 var e
= E('_wl_channel');
88 for (i
= 0; i
< 14; ++i
) {
90 var u
= wscan
.inuse
[i
+ 1];
91 if (u
) s
+= ' (' + u
.count
+ ' AP' + (u
.count
== 1 ? '' : 's') + ' / strongest: "' + ellipsis(u
.ssid
, 15) + '" ' + u
.rssi
+ ' dBm)';
92 e
.options
[i
].innerHTML
= s
;
94 e
.style
.width
= '400px';
98 if (wscan
.tries
< 4) {
100 setTimeout(scan
, 1000);
108 xob
.onError = function(x
) {
109 alert('error: ' + x
);
115 xob
.post('update.cgi', 'exec=wlscan');
118 function scanButton()
131 function joinAddr(a
) {
135 for (i
= 0; i
< a
.length
; ++i
) {
137 if ((s
!= '00:00:00:00:00:00') && (s
!= '0.0.0.0')) r
.push(s
);
142 function random_x(max
)
144 var c
= '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
146 while (max
-- > 0) s
+= c
.substr(Math
.floor(c
.length
* Math
.random()), 1);
150 function random_psk(id
)
153 e
.value
= random_x(63);
154 verifyFields(null, 1);
157 function random_wep()
159 E('_wl_passphrase').value
= random_x(16);
163 function v_wep(e
, quiet
)
165 var s
= e
.value
.toUpperCase().replace(/[^0-9A-F]/g, '');
166 if (s
.length
!= e
.maxLength
) {
167 ferror
.set(e
, 'Invalid WEP key, ', quiet
);
175 // compatible w/ Linksys' and Netgear's (key 1) method for 128-bits
176 function generate_wep()
178 function _wepgen(pass
, i
)
180 while (pass
.length
< 64) pass
+= pass
;
181 return hex_md5(pass
.substr(0, 64)).substr(i
, (E('_wl_wep_bit').value
== 128) ? 26 : 10);
184 var e
= E('_wl_passphrase');
186 if (!v_length(e
, false, 3)) return;
187 E('_wl_key1').value
= _wepgen(pass
, 0);
189 E('_wl_key2').value
= _wepgen(pass
, 2);
191 E('_wl_key3').value
= _wepgen(pass
, 4);
193 E('_wl_key4').value
= _wepgen(pass
, 6);
194 verifyFields(null, 1);
197 function verifyFields(focused
, quiet
)
204 // --- visibility ---
220 _ppp_redialperiod
: 1,
249 _wl_wpa_gtk_rekey
: 1,
251 _wl_radius_ipaddr
: 1,
266 var wan
= E('_wan_proto').value
;
267 var wmode
= E('_f_wmode').value
;
269 if (wmode
== 'wet') {
272 vis
._f_dhcpd_enable
= 0;
275 else vis
._wan_na
= 0;
279 vis
._ppp_username
= 0;
280 vis
._ppp_service
= 0;
281 vis
._l2tp_server_ip
= 0;
283 vis
._wan_netmask
= 0;
284 vis
._wan_gateway
= 0;
285 vis
._pptp_server_ip
= 0;
291 vis
._l2tp_server_ip
= 0;
293 vis
._ppp_service
= 0;
294 vis
._ppp_username
= 0;
295 vis
._pptp_server_ip
= 0;
296 vis
._wan_gateway
= 0;
298 vis
._wan_netmask
= 0;
300 vis
._lan_gateway
= 0;
303 vis
._l2tp_server_ip
= 0;
304 vis
._pptp_server_ip
= 0;
305 vis
._wan_gateway
= 0;
307 vis
._wan_netmask
= 0;
309 vis
._lan_gateway
= 0;
312 vis
._l2tp_server_ip
= 0;
314 vis
._ppp_service
= 0;
315 vis
._ppp_username
= 0;
316 vis
._pptp_server_ip
= 0;
318 vis
._lan_gateway
= 0;
321 vis
._l2tp_server_ip
= 0;
322 vis
._ppp_service
= 0;
323 vis
._wan_gateway
= 0;
325 vis
._lan_gateway
= 0;
328 vis
._ppp_service
= 0;
329 vis
._pptp_server_ip
= 0;
330 vis
._wan_gateway
= 0;
332 vis
._wan_netmask
= 0;
334 vis
._lan_gateway
= 0;
338 vis
._ppp_idletime
= (E('_ppp_demand').value
== 1) && vis
._ppp_demand
339 vis
._ppp_redialperiod
= !vis
._ppp_idletime
&& vis
._ppp_demand
;
341 if (vis
._mtu_enable
) {
342 if (E('_mtu_enable').value
== 0) {
345 switch (E('_wan_proto').value
) {
360 if (!E('_f_dhcpd_enable').checked
) vis
._dhcp_lease
= 0;
362 if (!E('_f_wl_radio').checked
) {
363 vis
._f_wl_lazywds
= 2;
366 vis
._security_mode2
= 2;
370 vis
._wl_net_mode
= 2;
372 vis
._wl_radius_key
= 2;
373 vis
._wl_wpa_gtk_rekey
= 2;
374 vis
._wl_radius_ipaddr
= 2;
387 vis
._f_wl_lazywds
= 0;
392 var sm2
= E('_security_mode2').value
;
398 vis
._wl_radius_key
= 0;
399 vis
._wl_radius_ipaddr
= 0;
400 vis
._wl_wpa_gtk_rekey
= 0;
405 vis
._wl_radius_key
= 0;
406 vis
._wl_radius_ipaddr
= 0;
407 vis
._wl_wpa_gtk_rekey
= 0;
415 if (sm2
.indexOf('personal') != -1) {
416 vis
._wl_radius_key
= 0;
417 vis
._wl_radius_ipaddr
= 0;
425 if ((E('_f_wl_lazywds').value
== 1) && (vis
._f_wds_0
== 1)) {
431 vis
._ppp_passwd
= vis
._ppp_username
;
432 vis
._dhcpd_startip
= vis
._dhcpd_endip
= vis
._wan_wins
= vis
._dhcp_lease
;
433 vis
._f_scan
= vis
._wl_channel
;
434 vis
._f_psk_random1
= vis
._wl_wpa_psk
;
435 vis
._f_psk_random2
= vis
._wl_radius_key
;
436 vis
._wl_radius_port
= vis
._wl_radius_ipaddr
;
437 vis
._wl_key1
= vis
._wl_key2
= vis
._wl_key3
= vis
._wl_key4
= vis
._f_wep_gen
= vis
._f_wep_random
= vis
._wl_passphrase
= vis
._wl_wep_bit
;
439 for (i
= 1; i
< 10; ++i
) {
440 vis
['_f_wds_' + i
] = vis
._f_wds_0
;
445 b
.disabled
= (c
!= 1);
446 PR(b
).style
.display
= c
? '' : 'none';
452 if (wmode
== 'sta') {
453 if (wan
== 'disabled') {
454 ferror
.set('_wan_proto', 'Wireless Client mode requires a valid WAN setting (usually DHCP).', quiet
);
458 ferror
.clear('_wan_proto');
460 if ((vis
._f_wmode
== 1) && (wmode
!= 'ap') && (sm2
.substr(0, 4) == 'wpa2')) {
461 ferror
.set('_security_mode2', 'WPA2 is supported only in AP mode.', quiet
);
464 ferror
.clear('_security_mode2');
466 a
= E('_wl_wpa_psk');
468 if (vis
._wl_wpa_psk
== 1) {
469 if ((a
.value
.length
< 8) || ((a
.value
.length
== 64) && (a
.value
.search(/[^0-9A-Fa-f]/) != -1))) {
470 ferror
.set('_wl_wpa_psk', 'Invalid pre-shared key. Please enter at least 8 characters or 64 hexadecimal digits.', quiet
);
476 a
= ['_l2tp_server_ip','_pptp_server_ip', '_wan_gateway','_wan_ipaddr','_lan_ipaddr', '_wl_radius_ipaddr', '_dhcpd_startip', '_dhcpd_endip'];
477 for (i
= a
.length
- 1; i
>= 0; --i
)
478 if ((vis
[a
[i
]]) && (!v_ip(a
[i
], quiet
))) ok
= 0;
480 // IP address, blank -> 0.0.0.0
481 a
= ['_f_dns_1', '_f_dns_2', '_f_dns_3','_wan_wins','_lan_gateway'];
482 for (i
= a
.length
- 1; i
>= 0; --i
)
483 if ((vis
[a
[i
]]) && (!v_ipz(a
[i
], quiet
))) ok
= 0;
486 a
= ['_wan_netmask','_lan_netmask'];
487 for (i
= a
.length
- 1; i
>= 0; --i
)
488 if ((vis
[a
[i
]]) && (!v_netmask(a
[i
], quiet
))) ok
= 0;
491 a
= [['_ppp_idletime', 3, 1440],['_ppp_redialperiod', 1, 86400],['_f_wan_mtu', 576, 1500],
492 ['_dhcp_lease', 1, 10080],['_wl_wpa_gtk_rekey', 60, 7200], ['_wl_radius_port', 1, 65535]];
493 for (i
= a
.length
- 1; i
>= 0; --i
) {
495 if ((vis
[v
[0]]) && (!v_range(v
[0], quiet
, v
[1], v
[2]))) ok
= 0;
499 a
= [['_wl_ssid', 1], ['_wl_radius_key', 1]];
500 for (i
= a
.length
- 1; i
>= 0; --i
) {
502 if ((vis
[v
[0]]) && (!v_length(v
[0], quiet
, v
[1], E(v
[0]).maxlength
))) ok
= 0;
506 a
= (E('_wl_wep_bit').value
== 128) ? 26 : 10;
507 for (i
= 1; i
<= 4; ++i
) {
508 b
= E('_wl_key' + i
);
510 if ((b
.value
.length
> 0) || (E('_f_wepidx_' + i
).checked
)) {
511 if (!v_wep(b
, quiet
)) ok
= 0;
513 else ferror
.clear(b
);
517 ferror
.clear('_f_wds_0');
518 if (vis
._f_wds_0
== 1) {
520 for (i
= 0; i
< 10; ++i
) {
521 a
= E('_f_wds_' + i
);
522 if (!v_macz(a
, quiet
)) ok
= 0;
523 else if (!isMAC0(a
.value
)) b
= 1;
526 ferror
.set('_f_wds_0', 'WDS MAC address required.', quiet
);
531 a
= E('_dhcpd_startip');
532 b
= E('_dhcpd_endip');
534 if ((!a
._error_msg
) && (!b
._error_msg
)) {
535 c
= aton(E('_lan_netmask').value
);
536 d
= aton(E('_lan_ipaddr').value
) & c
;
537 e
= 'Invalid IP address or subnet mask';
538 if ((aton(a
.value
) & c
) != d
) {
539 ferror
.set(a
, e
, quiet
);
542 if ((aton(b
.value
) & c
) != d
) {
543 ferror
.set(b
, e
, quiet
);
548 if ((!a
._error_msg
) && (!b
._error_msg
)) {
549 if (aton(a
.value
) > aton(b
.value
)) {
555 elem
.setInnerHTML('dhcp_count', '(' + ((aton(b
.value
) - aton(a
.value
)) + 1) + ')');
563 verifyFields(null, 1);
571 if (!verifyFields(null, false)) return;
574 var wmode
= fom
.f_wmode
.value
;
575 var sm2
= fom
.security_mode2
.value
;
576 var wradio
= fom
.f_wl_radio
.checked
;
578 fom
.lan_proto
.value
= fom
.f_dhcpd_enable
.checked
? 'dhcp' : 'static';
580 fom
.wan_mtu
.value
= fom
.f_wan_mtu
.value
;
581 fom
.wan_mtu
.disabled
= fom
.f_wan_mtu
.disabled
;
583 if (wmode
== 'apwds') fom
.wl_mode
.value
= 'ap';
584 else fom
.wl_mode
.value
= wmode
;
586 if (wmode
== 'wet') {
587 fom
.wan_proto
.value
= 'disabled';
588 fom
.wan_proto
.disabled
= 0;
589 fom
.lan_proto
.value
= 'static';
593 for (i
= 0; i
< 10; ++i
) a
.push(E('_f_wds_' + i
).value
);
594 fom
.wl_wds
.value
= joinAddr(a
);
596 fom
.wds_save
.value
= nvram
.wds_save
;
597 if (wmode
.indexOf('wds') != -1) {
598 fom
.wds_enable
.value
= 1;
599 fom
.wl_lazywds
.value
= fom
.f_wl_lazywds
.value
;
600 if (fom
.wl_lazywds
.value
== 1) fom
.wl_wds
.value
= '';
601 else fom
.wds_save
.value
= fom
.wl_wds
.value
;
604 fom
.wds_enable
.value
= 0;
605 fom
.wl_wds
.value
= '';
606 fom
.wl_lazywds
.value
= 0;
609 fom
.wan_dns
.value
= joinAddr([fom
.f_dns_1
.value
, fom
.f_dns_2
.value
, fom
.f_dns_3
.value
])
611 fom
.wl_radio
.value
= fom
.f_wl_radio
.checked
? 1 : 0;
612 fom
.wl_radio
.disabled
= fom
.f_wl_radio
.disabled
;
614 fom
.wl_auth
.value
= nvram
.wl_auth
;
620 fom
.security_mode
.value
= sm2
;
621 fom
.wl_akm
.value
= '';
625 if (sm2
.indexOf('personal') != -1) {
626 if (sm2
.indexOf('wpa2_') == -1) c
.push('psk');
627 if (sm2
.indexOf('wpa_') == -1) c
.push('psk2');
630 if (sm2
.indexOf('wpa2_') == -1) c
.push('wpa');
631 if (sm2
.indexOf('wpa_') == -1) c
.push('wpa2');
634 fom
.security_mode
.value
= c
;
635 fom
.wl_akm
.value
= c
;
638 fom
.wl_auth_mode
.value
= (sm2
== 'radius') ? 'radius' : 'none';
639 fom
.wl_wep
.value
= ((sm2
== 'radius') || (sm2
== 'wep')) ? 'enabled': 'disabled';
640 fom
.wl_auth_mode
.disabled
= fom
.wl_wep
.disabled
= fom
.security_mode
.disabled
= fom
.wl_akm
.disabled
= fom
.security_mode2
.disabled
;
642 if (sm2
.indexOf('wpa') != -1) fom
.wl_auth
.value
= 0;
644 fom
.wl_gmode
.value
= (fom
.wl_net_mode
.value
== 'b-only') ? 0 : (fom
.wl_net_mode
.value
== 'g-only') ? 2 : 1;
645 fom
.wl_gmode
.disabled
= fom
.wl_net_mode
.disabled
;
647 fom
.wl_closed
.value
= fom
.f_bcast
.checked
? 0 : 1;
648 fom
.wl_closed
.disabled
= fom
.f_bcast
.disabled
;
650 fom
.wl_key
.value
= fields
.radio
.selected(fom
.f_wepidx
).value
;
651 fom
.wl_key
.disabled
= fom
.wl_key1
.disabled
;
653 fom
.wl_mode
.disabled
= fom
.wl_wds
.disabled
= fom
.wds_enable
.disabled
= !fom
.f_wl_radio
.checked
;
655 if (nvram
.lan_ipaddr
!= fom
.lan_ipaddr
.value
) {
656 fom
._moveip
.value
= 1;
667 <form id='_fom' method='post' action='tomato.cgi'
>
668 <table id='container' cellspacing=
0>
669 <tr><td colspan=
2 id='header'
>
670 <div class='title'
>Tomato
</div>
671 <div class='version'
>Version <%
version(); %></div>
673 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
675 <div id='ident'
><%
ident(); %></div>
679 <input type='hidden' name='_nextpage' value='basic-network.asp'
>
680 <input type='hidden' name='_nextwait' value='
10'
>
681 <input type='hidden' name='_service' value='*'
>
682 <input type='hidden' name='_moveip' value='
0'
>
684 <input type='hidden' name='wan_mtu'
>
685 <input type='hidden' name='wl_mode'
>
686 <input type='hidden' name='wds_enable'
>
687 <input type='hidden' name='wl_wds'
>
688 <input type='hidden' name='wds_save'
>
689 <input type='hidden' name='lan_proto'
>
690 <input type='hidden' name='wan_dns'
>
691 <input type='hidden' name='wl_radio'
>
692 <input type='hidden' name='wl_closed'
>
693 <input type='hidden' name='wl_key'
>
694 <input type='hidden' name='wl_gmode'
>
695 <input type='hidden' name='security_mode'
>
696 <input type='hidden' name='wl_akm'
>
697 <input type='hidden' name='wl_auth'
>
698 <input type='hidden' name='wl_auth_mode'
>
699 <input type='hidden' name='wl_wep'
>
700 <input type='hidden' name='wl_lazywds'
>
703 <div class='section-title'
>WAN / Internet
</div>
704 <div class='section'
>
705 <script type='text/javascript'
>
706 createFieldTable('', [
707 { text
: '<span id="_wan_na"><i>Wireless Ethernet Bridge Mode</i></span>' },
708 { title
: 'Type', name
: 'wan_proto', type
: 'select', options
: [['dhcp','DHCP'],['pppoe','PPPoE'],['static','Static'],['pptp','PPTP'],['l2tp','L2TP'],['disabled','Disabled']],
709 value
: nvram
.wan_proto
},
710 { title
: 'Username', name
: 'ppp_username', type
: 'text', maxlen
: 50, size
: 54, value
: nvram
.ppp_username
},
711 { title
: 'Password', name
: 'ppp_passwd', type
: 'password', maxlen
: 50, size
: 54, value
: nvram
.ppp_passwd
},
712 { title
: 'Service Name', name
: 'ppp_service', type
: 'text', maxlen
: 50, size
: 54, value
: nvram
.ppp_service
},
713 { title
: 'L2TP Server', name
: 'l2tp_server_ip', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.l2tp_server_ip
},
714 { title
: 'IP Address', name
: 'wan_ipaddr', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.wan_ipaddr
},
715 { title
: 'Subnet Mask', name
: 'wan_netmask', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.wan_netmask
},
716 { title
: 'Gateway', name
: 'wan_gateway', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.wan_gateway
},
717 { title
: 'Gateway', name
: 'pptp_server_ip', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.pptp_server_ip
},
718 { title
: 'Connect Mode', name
: 'ppp_demand', type
: 'select', options
: [['1', 'Connect On Demand'],['0', 'Keep Alive']],
719 value
: nvram
.ppp_demand
},
720 { title
: 'Max Idle Time', indent
: 2, name
: 'ppp_idletime', type
: 'text', maxlen
: 5, size
: 7, suffix
: ' <i>(minutes)</i>',
721 value
: nvram
.ppp_idletime
},
722 { title
: 'Check Interval', indent
: 2, name
: 'ppp_redialperiod', type
: 'text', maxlen
: 5, size
: 7, suffix
: ' <i>(seconds)</i>',
723 value
: nvram
.ppp_redialperiod
},
724 { title
: 'MTU', multi
: [
725 { name
: 'mtu_enable', type
: 'select', options
: [['0', 'Default'],['1','Manual']], value
: nvram
.mtu_enable
},
726 { name
: 'f_wan_mtu', type
: 'text', maxlen
: 4, size
: 6, value
: nvram
.wan_mtu
} ] }
731 <div class='section-title'
>LAN
</div>
732 <div class='section'
>
733 <script type='text/javascript'
>
734 dns
= nvram
.wan_dns
.split(/\s+/);
735 ipp
= nvram
.lan_ipaddr
.split('.').splice(0, 3).join('.');
737 createFieldTable('', [
738 { title
: 'Router IP Address', name
: 'lan_ipaddr', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.lan_ipaddr
},
739 { title
: 'Subnet Mask', name
: 'lan_netmask', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.lan_netmask
},
740 { title
: 'Default Gateway', name
: 'lan_gateway', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.lan_gateway
},
741 { title
: 'Static DNS', name
: 'f_dns_1', type
: 'text', maxlen
: 15, size
: 17, value
: dns
[0] || '0.0.0.0' },
742 { title
: '', name
: 'f_dns_2', type
: 'text', maxlen
: 15, size
: 17, value
: dns
[1] || '0.0.0.0' },
743 { title
: '', name
: 'f_dns_3', type
: 'text', maxlen
: 15, size
: 17, value
: dns
[2] || '0.0.0.0' },
744 { title
: 'DHCP Server', name
: 'f_dhcpd_enable', type
: 'checkbox', value
: (nvram
.lan_proto
== 'dhcp') },
745 { title
: 'IP Address Range', indent
: 2, multi
: [
746 { name
: 'dhcpd_startip', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.dhcpd_startip
, suffix
: ' - ' },
747 { name
: 'dhcpd_endip', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.dhcpd_endip
, suffix
: ' <i id="dhcp_count"></i>' }
750 { title
: 'Lease Time', indent
: 2, name
: 'dhcp_lease', type
: 'text', maxlen
: 6, size
: 8, suffix
: ' <i>(minutes)</i>',
751 value
: (nvram
.dhcp_lease
> 0) ? nvram
.dhcp_lease
: 1440 },
752 { title
: 'WINS', indent
: 2, name
: 'wan_wins', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.wan_wins
}
758 <div class='section-title'
>Wireless
</div>
759 <div class='section'
>
760 <script type='text/javascript'
>
762 { title
: 'Enable Wireless', name
: 'f_wl_radio', type
: 'checkbox',
763 value
: (nvram
.wl_radio
== '1') && (nvram
.wl_net_mode
!= 'disabled') },
764 { title
: 'MAC Address', text
: '<a href="advanced-mac.asp">' + nvram
.wl0_hwaddr
+ '</a>' },
765 { title
: 'Wireless Mode', name
: 'f_wmode', type
: 'select',
766 options
: [['ap', 'Access Point'],['apwds', 'Access Point + WDS'],['sta', 'Wireless Client'],['wet', 'Wireless Ethernet Bridge'],['wds', 'WDS']],
767 value
: ((nvram
.wl_mode
== 'ap') && (nvram
.wds_enable
== '1')) ? 'apwds' : nvram
.wl_mode
},
768 { title
: 'B/G Mode', name
: 'wl_net_mode', type
: 'select', value
: (nvram
.wl_net_mode
== 'disabled') ? 'mixed' : nvram
.wl_net_mode
, options
:[['mixed','Mixed'],['b-only','B Only'],['g-only','G Only']] },
769 { title
: 'SSID', name
: 'wl_ssid', type
: 'text', maxlen
: 32, size
: 34, value
: nvram
.wl_ssid
},
770 { title
: 'Broadcast', indent
: 2, name
: 'f_bcast', type
: 'checkbox', value
: (nvram
.wl_closed
== '0') },
771 { title
: 'Channel', name
: 'wl_channel', type
: 'select', options
: ghz
, suffix
: ' <input type="button" id="_f_scan" value="Scan" onclick="scanButton()"> <img src="spin.gif" id="spin">',
772 value
: nvram
.wl_channel
},
774 { title
: 'Security', name
: 'security_mode2', type
: 'select',
775 options
: [['disabled','Disabled'],['wep','WEP'],['wpa_personal','WPA Personal'],['wpa_enterprise','WPA Enterprise'],['wpa2_personal','WPA2 Personal'],['wpa2_enterprise','WPA2 Enterprise'],['wpaX_personal','WPA / WPA2 Personal'],['wpaX_enterprise','WPA / WPA2 Enterprise'],['radius','Radius']],
776 value
: nvram
.security_mode2
},
777 { title
: 'Encryption', indent
: 2, name
: 'wl_crypto', type
: 'select',
778 options
: [['tkip','TKIP'],['aes','AES'],['tkip+aes','TKIP / AES']], value
: nvram
.wl_crypto
},
779 { title
: 'Shared Key', indent
: 2, name
: 'wl_wpa_psk', type
: 'text', maxlen
: 64, size
: 66,
780 suffix
: ' <input type="button" id="_f_psk_random1" value="Random" onclick="random_psk(\'_wl_wpa_psk\')">',
781 value
: nvram
.wl_wpa_psk
},
782 { title
: 'Shared Key', indent
: 2, name
: 'wl_radius_key', type
: 'text', maxlen
: 80, size
: 32,
783 suffix
: ' <input type="button" id="_f_psk_random2" value="Random" onclick="random_psk(\'_wl_radius_key\')">',
784 value
: nvram
.wl_radius_key
},
785 { title
: 'Group Key Renewal', indent
: 2, name
: 'wl_wpa_gtk_rekey', type
: 'text', maxlen
: 4, size
: 6, suffix
: ' <i>(seconds)</i>',
786 value
: nvram
.wl_wpa_gtk_rekey
},
787 { title
: 'Radius Server', indent
: 2, multi
: [
788 { name
: 'wl_radius_ipaddr', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.wl_radius_ipaddr
},
789 { name
: 'wl_radius_port', type
: 'text', maxlen
: 5, size
: 7, prefix
: ' : ', value
: nvram
.wl_radius_port
} ] },
790 { title
: 'Encryption', indent
: 2, name
: 'wl_wep_bit', type
: 'select', options
: [['128','128-bits'],['64','64-bits']],
791 value
: nvram
.wl_wep_bit
},
792 { title
: 'Passphrase', indent
: 2, name
: 'wl_passphrase', type
: 'text', maxlen
: 16, size
: 20,
793 suffix
: ' <input type="button" id="_f_wep_gen" value="Generate" onclick="generate_wep()"> <input type="button" id="_f_wep_random" value="Random" onclick="random_wep()">',
794 value
: nvram
.wl_passphrase
}
797 for (i
= 1; i
<= 4; ++i
) {
799 { title
: ('Key ' + i
), indent
: 2, name
: ('wl_key' + i
), type
: 'text', maxlen
: 26, size
: 34,
800 suffix
: '<input type="radio" onchange="verifyFields(this,1)" onclick="verifyFields(this,1)" name="f_wepidx" id="_f_wepidx_' + i
+ '" value="' + i
+ '"' + ((nvram
.wl_key
== i
) ? ' checked>' : '>'),
801 value
: nvram
['wl_key' + i
] });
805 { title
: 'WDS', name
: 'f_wl_lazywds', type
: 'select',
806 options
: [['0','Link With...'],['1','Automatic']], value
: nvram
.wl_lazywds
} );
807 wds
= ((nvram
.wl_wds
== '') ? nvram
.wds_save
: nvram
.wl_wds
).split(/\s+/);
808 for (i
= 0; i
< 10; i
+= 2) {
809 f
.push({ title
: (i
? '' : 'MAC Address'), indent
: 2, multi
: [
810 { name
: 'f_wds_' + i
, type
: 'text', maxlen
: 17, size
: 20, value
: wds
[i
] || '00:00:00:00:00:00' },
811 { name
: 'f_wds_' + (i
+ 1), type
: 'text', maxlen
: 17, size
: 20, value
: wds
[i
+ 1] || '00:00:00:00:00:00' } ] } );
814 createFieldTable('', f
);
821 <tr><td id='footer' colspan=
2>
822 <span id='footer-msg'
></span>
823 <input type='button' value='Save' id='save-button' onclick='save()'
>
824 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'
>
828 <script type='text/javascript'
>earlyInit()</script>
829 <div style='height:
100px'
></div>