1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
4 Copyright (C) 2006-2010 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(); %>] Forwarding: DMZ
</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 <script type='text/javascript' src='debug.js'
></script>
23 <script type='text/javascript'
>
25 // <% nvram("dmz_enable,dmz_ipaddr,dmz_sip"); %>
27 var lipp
= '<% lipp(); %>.';
29 function verifyFields(focused
, quiet
)
33 off
= !E('_f_dmz_enable').checked
;
35 dip
= E('_f_dmz_ipaddr')
38 sip
= E('_f_dmz_sip');
42 ferror
.clearAll(dip
, sip
);
46 if (dip
.value
.indexOf('.') == -1) dip
.value
= lipp
+ dip
.value
;
47 if (!v_ip(dip
)) return 0;
49 if ((sip
.value
.length
) && (!v_iptaddr(sip
, quiet
, 15))) return 0;
61 if (!verifyFields(null, false)) return;
64 en
= fom
.f_dmz_enable
.checked
;
65 fom
.dmz_enable
.value
= en
? 1 : 0;
67 // shorten it if possible to be more compatible with original
68 s
= fom
.f_dmz_ipaddr
.value
;
69 fom
.dmz_ipaddr
.value
= (s
.indexOf(lipp
) == 0) ? s
.replace(lipp
, '') : s
;
71 fom
.dmz_sip
.value
= fom
.f_dmz_sip
.value
.split(/\s*,\s*/).join(',');
78 <form id='_fom' method='post' action='tomato.cgi'
>
79 <table id='container' cellspacing=
0>
80 <tr><td colspan=
2 id='header'
>
81 <div class='title'
>Tomato
</div>
82 <div class='version'
>Version <%
version(); %></div>
84 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
86 <div id='ident'
><%
ident(); %></div>
90 <input type='hidden' name='_nextpage' value='forward-dmz.asp'
>
91 <input type='hidden' name='_service' value='firewall-restart'
>
93 <input type='hidden' name='dmz_enable'
>
94 <input type='hidden' name='dmz_ipaddr'
>
95 <input type='hidden' name='dmz_sip'
>
97 <div class='section-title'
>DMZ
</div>
99 <script type='text/javascript'
>
100 createFieldTable('', [
101 { title
: 'Enable DMZ', name
: 'f_dmz_enable', type
: 'checkbox', value
: (nvram
.dmz_enable
== '1') },
102 { title
: 'Destination Address', indent
: 2, name
: 'f_dmz_ipaddr', type
: 'text', maxlen
: 15, size
: 17,
103 value
: (nvram
.dmz_ipaddr
.indexOf('.') != -1) ? nvram
.dmz_ipaddr
: (lipp
+ nvram
.dmz_ipaddr
) },
104 { title
: 'Source Address<br>Restriction', indent
: 2, name
: 'f_dmz_sip', type
: 'text', maxlen
: 512, size
: 64,
105 value
: nvram
.dmz_sip
, suffix
: '<br><small>(optional; ex: "1.1.1.1", "1.1.1.0/24", "1.1.1.1 - 2.2.2.2" or "me.example.com")</small>' }
111 <script type='text/javascript'
>if (nvram
.dmz_enable
== '1') show_notice1('<% notice("iptables"); %>');</script>
116 <tr><td id='footer' colspan=
2>
117 <span id='footer-msg'
></span>
118 <input type='button' value='Save' id='save-button' onclick='save()'
>
119 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'
>
123 <script type='text/javascript'
>verifyFields(null, 1);</script>