Project

General

Profile

Download (20.9 KB) Statistics
| Branch: | Tag: | Revision:
1 19ae0929 Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
    firewall_nat_out.php
5 c55b323d Scott Ullrich
    Copyright (C) 2004 Scott Ullrich
6
    All rights reserved.
7 19ae0929 Scott Ullrich
8 c55b323d Scott Ullrich
    originally part of m0n0wall (http://m0n0.ch/wall)
9 5b237745 Scott Ullrich
    Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
    All rights reserved.
11 19ae0929 Scott Ullrich
12 5b237745 Scott Ullrich
    Redistribution and use in source and binary forms, with or without
13
    modification, are permitted provided that the following conditions are met:
14 19ae0929 Scott Ullrich
15 5b237745 Scott Ullrich
    1. Redistributions of source code must retain the above copyright notice,
16
       this list of conditions and the following disclaimer.
17 19ae0929 Scott Ullrich
18 5b237745 Scott Ullrich
    2. Redistributions in binary form must reproduce the above copyright
19
       notice, this list of conditions and the following disclaimer in the
20
       documentation and/or other materials provided with the distribution.
21 19ae0929 Scott Ullrich
22 5b237745 Scott Ullrich
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
    POSSIBILITY OF SUCH DAMAGE.
32
*/
33 7ac5a4cb Scott Ullrich
/*
34
	pfSense_MODULE:	nat
35
*/
36 5b237745 Scott Ullrich
37 6b07c15a Matthew Grooms
##|+PRIV
38
##|*IDENT=page-firewall-nat-outbound
39
##|*NAME=Firewall: NAT: Outbound page
40
##|*DESCR=Allow access to the 'Firewall: NAT: Outbound' page.
41
##|*MATCH=firewall_nat_out.php*
42
##|-PRIV
43
44 5b237745 Scott Ullrich
require("guiconfig.inc");
45 7a927e67 Scott Ullrich
require_once("functions.inc");
46
require_once("filter.inc");
47
require_once("shaper.inc");
48 5b237745 Scott Ullrich
49 c44d3cf7 Ermal Lu?i
if (!is_array($config['nat']['advancedoutbound']))
50
	$config['nat']['advancedoutbound'] = array();
51
52 5b237745 Scott Ullrich
if (!is_array($config['nat']['advancedoutbound']['rule']))
53 82d0dfc4 Scott Ullrich
	$config['nat']['advancedoutbound']['rule'] = array();
54 19ae0929 Scott Ullrich
55 5b237745 Scott Ullrich
$a_out = &$config['nat']['advancedoutbound']['rule'];
56
57 82d0dfc4 Scott Ullrich
if ($_POST['apply']) {
58
	write_config();
59 5b237745 Scott Ullrich
60 82d0dfc4 Scott Ullrich
	$retval = 0;
61 920b3bb0 Scott Ullrich
	$retval |= filter_configure();
62
63 e8c2c890 Bill Marquette
	if(stristr($retval, "error") <> true)
64
	        $savemsg = get_std_save_message($retval);
65
	else
66
		$savemsg = $retval;
67 19ae0929 Scott Ullrich
68 82d0dfc4 Scott Ullrich
	if ($retval == 0) {
69 a368a026 Ermal Lu?i
		clear_subsystem_dirty('natconf');
70
		clear_subsystem_dirty('filter');
71 9c96aff5 Bill Marquette
        }
72 5b237745 Scott Ullrich
}
73
74 fe693b89 Bill Marquette
75
76 82d0dfc4 Scott Ullrich
if (isset($_POST['save']) && $_POST['save'] == "Save") {
77 53bf5f1d Seth Mos
	/* mutually exclusive settings - if user wants advanced NAT, we don't generate automatic rules */
78 82d0dfc4 Scott Ullrich
	switch ($_POST['advancedoripsec']) {
79
	case "ipsecpassthru":
80
               	$config['nat']['ipsecpassthru']['enable'] = true;
81
               	unset($config['nat']['advancedoutbound']['enable']);
82
		break;
83
	case "advancedoutboundnat":
84 1ddb870b Ermal Lu?i
        	if (!isset($config['nat']['advancedoutbound']['enable'])) {
85
			$config['nat']['advancedoutbound']['enable'] = true;
86 4a3cb40c Chris Buechler
			// if there are already AON rules configured, don't generate default ones
87
			if(!empty($a_out))
88
				continue;
89 82d0dfc4 Scott Ullrich
			/*
90 4a3cb40c Chris Buechler
			 *    user has enabled advanced outbound NAT and doesn't have rules
91
			 *    lets automatically create entries
92 82d0dfc4 Scott Ullrich
			 *    for all of the interfaces to make life easier on the pip-o-chap
93
			 */
94 cbe3ea96 Ermal Luçi
			$ifdescrs = get_configured_interface_with_descr();
95
				
96
			foreach($ifdescrs as $if => $ifdesc) {
97 a55e9c70 Ermal Lu?i
				if (interface_has_gateway($if))
98 e1f675e4 Ermal Luçi
					continue;
99 a55e9c70 Ermal Lu?i
				$osipaddr = get_interface_ip($if);
100
				$ossubnet = get_interface_subnet($if);
101
				if (!is_ipaddr($osipaddr) || empty($ossubnet))
102
					continue;
103
				$osn = gen_subnet($osipaddr, $ossubnet);
104 1ddb870b Ermal Lu?i
				foreach ($ifdescrs as $if2 => $ifdesc2) {
105
					if (!interface_has_gateway($if2))
106
						continue;
107 aad51dbf Ermal Lu?i
108 1ddb870b Ermal Lu?i
					$natent = array();
109
					$natent['source']['network'] = "{$osn}/{$ossubnet}";
110 d2243cff Chris Buechler
					$natent['dstport'] = "500";
111
					$natent['descr'] = "Auto created rule for ISAKMP - {$ifdesc} to {$ifdesc2}";
112 1ddb870b Ermal Lu?i
					$natent['target'] = "";
113
					$natent['interface'] = $if2;
114
					$natent['destination']['any'] = true;
115 d2243cff Chris Buechler
					$natent['staticnatport'] = true;
116 1ddb870b Ermal Lu?i
					$a_out[] = $natent;
117
118
					$natent = array();
119
					$natent['source']['network'] = "{$osn}/{$ossubnet}";
120 d2243cff Chris Buechler
                                        $natent['dstport'] = "5060";
121
                                        $natent['descr'] = "Auto created rule for SIP - {$ifdesc} to {$ifdesc2}";
122 1ddb870b Ermal Lu?i
                                        $natent['target'] = "";
123
                                        $natent['interface'] = $if2;
124
                                        $natent['destination']['any'] = true;
125 d2243cff Chris Buechler
                                        $natent['staticnatport'] = true;
126 1ddb870b Ermal Lu?i
                                        $a_out[] = $natent;
127
					
128
					$natent = array();
129
                                        $natent['source']['network'] = "{$osn}/{$ossubnet}";
130
                                        $natent['sourceport'] = "";
131 aef123a0 Chris Buechler
                                        $natent['descr'] = "Auto created rule for {$ifdesc} to {$ifdesc2}";
132 1ddb870b Ermal Lu?i
                                        $natent['target'] = "";
133
                                        $natent['interface'] = $if2;
134
                                        $natent['destination']['any'] = true;
135
                                        $natent['natport'] = "";
136
                                        $a_out[] = $natent;
137 4b85f096 Chris Buechler
					
138
					/* PPTP subnet */
139
					if($config['pptpd']['mode'] == "server") {
140
						if (is_ipaddr($config['pptpd']['localip'])) {
141
							if($config['pptpd']['pptp_subnet'] <> "")
142
								$ossubnet = $config['pptpd']['pptp_subnet'];
143
							else
144
								$ossubnet = "32";
145
							$osn = gen_subnet($config['pptpd']['localip'], $osn);
146
							$natent = array();
147
							$natent['source']['network'] = "{$osn}/{$ossubnet}";
148
							$natent['sourceport'] = "";
149
							$natent['descr'] = "Auto created rule for PPTP server";
150
							$natent['target'] = "";
151
							$natent['interface'] = $if2;
152
							$natent['destination']['any'] = true;
153
							$natent['natport'] = "";
154
							$a_out[] = $natent;
155
						}
156
					}
157
					/* PPPoE subnet */
158
					if($config['pppoe']['mode'] == "server") {
159
						if (is_ipaddr($config['pppoe']['localip'])) {
160
							if($config['pppoe']['pppoe_subnet'] <> "")
161
								$ossubnet = $config['pppoe']['pptp_subnet'];
162
							else
163
								$ossubnet = "32";
164
							$osn = gen_subnet($config['pppoe']['localip'], $osn);
165
							$natent = array();
166
							$natent['source']['network'] = "{$osn}/{$ossubnet}";
167
							$natent['sourceport'] = "";
168
							$natent['descr'] = "Auto created rule for PPPoE server";
169
							$natent['target'] = "";
170
							$natent['interface'] = $if2;
171
							$natent['destination']['any'] = true;
172
							$natent['natport'] = "";
173
							$a_out[] = $natent;
174
						}
175
					}
176
					/* L2TP subnet */
177
					if($config['l2tp']['mode'] == "server") {
178
						if (is_ipaddr($config['l2tp']['localip'])) {
179
							if($config['l2tp']['l2tp_subnet'] <> "")
180
								$ossubnet = $config['l2tp']['pptp_subnet'];
181
							else
182
								$ossubnet = "32";
183
							$osn = gen_subnet($config['l2tp']['localip'], $osn);
184
							$natent = array();
185
							$natent['source']['network'] = "{$osn}/{$ossubnet}";
186
							$natent['sourceport'] = "";
187
							$natent['descr'] = "Auto created rule for L2TP server";
188
							$natent['target'] = "";
189
							$natent['interface'] = $if2;
190
							$natent['destination']['any'] = true;
191
							$natent['natport'] = "";
192
							$a_out[] = $natent;
193
						}
194
					}
195
					/* add openvpn interfaces */
196
					if($config['openvpn']['openvpn-server']) {
197
						foreach ($config['openvpn']['openvpn-server'] as $ovpnsrv) {
198
							$natent = array();
199
							$natent['source']['network'] = $ovpnsrv['tunnel_network'];
200
							$natent['sourceport'] = "";
201
							$natent['descr'] = "Auto created rule for OpenVPN server";
202
							$natent['target'] = "";
203
							$natent['interface'] = $if2;
204
							$natent['destination']['any'] = true;
205
							$natent['natport'] = "";
206
							$a_out[] = $natent;
207
						}
208
					}
209 1ddb870b Ermal Lu?i
				}	
210 fa56ab75 Scott Ullrich
			}
211 4b85f096 Chris Buechler
212 82d0dfc4 Scott Ullrich
			$savemsg = "Default rules for each interface have been created.";
213
		}
214
		break;
215
	}
216 63868cb8 Scott Ullrich
        write_config();
217 a368a026 Ermal Lu?i
	mark_subsystem_dirty('natconf');
218 63868cb8 Scott Ullrich
        header("Location: firewall_nat_out.php");
219
        exit;
220 fe693b89 Bill Marquette
}
221
222 9c96aff5 Bill Marquette
if (isset($_POST['del_x'])) {
223
        /* delete selected rules */
224
        if (is_array($_POST['rule']) && count($_POST['rule'])) {
225
                foreach ($_POST['rule'] as $rulei) {
226
                        unset($a_out[$rulei]);
227
                }
228
                write_config();
229 a368a026 Ermal Lu?i
		mark_subsystem_dirty('natconf');
230 9c96aff5 Bill Marquette
                header("Location: firewall_nat_out.php");
231
                exit;
232
        }
233
234
} else {
235 87b10bed Bill Marquette
        /* yuck - IE won't send value attributes for image buttons, while Mozilla does - so we use .x/.y to find move button clicks instead... */
236 9c96aff5 Bill Marquette
        unset($movebtn);
237
        foreach ($_POST as $pn => $pd) {
238
                if (preg_match("/move_(\d+)_x/", $pn, $matches)) {
239
                        $movebtn = $matches[1];
240
                        break;
241
                }
242
        }
243
        /* move selected rules before this rule */
244
        if (isset($movebtn) && is_array($_POST['rule']) && count($_POST['rule'])) {
245
                $a_out_new = array();
246
247
                /* copy all rules < $movebtn and not selected */
248
                for ($i = 0; $i < $movebtn; $i++) {
249
                        if (!in_array($i, $_POST['rule']))
250
                                $a_out_new[] = $a_out[$i];
251
                }
252
253
                /* copy all selected rules */
254
                for ($i = 0; $i < count($a_out); $i++) {
255
                        if ($i == $movebtn)
256
                                continue;
257
                        if (in_array($i, $_POST['rule']))
258
                                $a_out_new[] = $a_out[$i];
259
                }
260
261
                /* copy $movebtn rule */
262
                if ($movebtn < count($a_out))
263
                        $a_out_new[] = $a_out[$movebtn];
264
265
                /* copy all rules > $movebtn and not selected */
266
                for ($i = $movebtn+1; $i < count($a_out); $i++) {
267
                        if (!in_array($i, $_POST['rule']))
268
                                $a_out_new[] = $a_out[$i];
269
                }
270 82d0dfc4 Scott Ullrich
                if (count($a_out_new) > 0)
271
			$a_out = $a_out_new;
272
		else
273
			unset($config['nat']['advancedoutbound']);
274
275 9c96aff5 Bill Marquette
                write_config();
276 a368a026 Ermal Lu?i
		mark_subsystem_dirty('natconf');
277 9c96aff5 Bill Marquette
                header("Location: firewall_nat_out.php");
278
                exit;
279
        }
280 5b237745 Scott Ullrich
}
281 9c96aff5 Bill Marquette
282
283 d88c6a9f Scott Ullrich
$pgtitle = array("Firewall","NAT","Outbound");
284 6eb17647 Scott Ullrich
include("head.inc");
285
286 24f600b0 Scott Ullrich
?>
287 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
288
<?php include("fbegin.inc"); ?>
289 fe693b89 Bill Marquette
<form action="firewall_nat_out.php" method="post" name="iform">
290 625dcc40 Bill Marquette
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js">
291 3f57ceee Bill Marquette
</script>
292 5b237745 Scott Ullrich
<?php if ($savemsg) print_info_box($savemsg); ?>
293 a368a026 Ermal Lu?i
<?php if (is_subsystem_dirty('natconf')): ?><p>
294 5b237745 Scott Ullrich
<?php print_info_box_np("The NAT configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
295
<?php endif; ?>
296
<table width="100%" border="0" cellpadding="0" cellspacing="0">  <tr><td>
297 a8726a3d Scott Ullrich
<?php
298
	$tab_array = array();
299 1425e067 Bill Marquette
	$tab_array[] = array("Port Forward", false, "firewall_nat.php");
300
	$tab_array[] = array("1:1", false, "firewall_nat_1to1.php");
301
	$tab_array[] = array("Outbound", true, "firewall_nat_out.php");
302 a8726a3d Scott Ullrich
	display_top_tabs($tab_array);
303
?>
304 5b237745 Scott Ullrich
  </td></tr>
305 19ae0929 Scott Ullrich
  <tr>
306 d732f186 Bill Marquette
    <td>
307
	<div id="mainarea">
308
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
309 fe693b89 Bill Marquette
              <tr>
310 5b237745 Scott Ullrich
                  <td class="vtable"><p>
311 82d0dfc4 Scott Ullrich
                      <input name="advancedoripsec" type="radio" id="ipsecpassthru" value="ipsecpassthru" <?php if (isset($config['nat']['ipsecpassthru']['enable'])) echo "checked";?>>
312 69e108df Chris Buechler
                      <strong><?=gettext("Automatic outbound NAT rule generation (IPsec passthrough)");?></strong></p>
313 6b3a7398 Scott Ullrich
                  </td>
314 5b237745 Scott Ullrich
                </tr>
315 19ae0929 Scott Ullrich
                <tr>
316 fe693b89 Bill Marquette
                  <td class="vtable"><p>
317 82d0dfc4 Scott Ullrich
                      <input name="advancedoripsec" type="radio" id="advancedoutbound" value="advancedoutboundnat" <?php if (isset($config['nat']['advancedoutbound']['enable'])) echo "checked";?>>
318 53bf5f1d Seth Mos
                      <strong><?=gettext("Manual Outbound NAT rule generation (Advanced Outbound NAT (AON))");?></strong></p></td>
319 fe693b89 Bill Marquette
                </tr>
320
                <tr>
321
                  <td> <input name="save" type="submit" class="formbtn" value="Save">
322 5b237745 Scott Ullrich
                  </td>
323
                </tr>
324
                <tr>
325 6b3a7398 Scott Ullrich
                  <td colspan="2"><p><span class="vexpl"><span class="red"><strong>Note:<br>
326 5b237745 Scott Ullrich
                      </strong></span>If advanced outbound NAT is enabled, no outbound NAT
327 af35a7e8 Scott Ullrich
                      rules will be automatically generated any longer. Instead, only the mappings
328 5b237745 Scott Ullrich
                      you specify below will be used. With advanced outbound NAT disabled,
329
                      a mapping is automatically created for each interface's subnet
330 0a82ada4 Bill Marquette
                      (except WAN).  If you use target addresses other than the WAN interface's
331
		      IP address, then depending on the way your WAN connection is setup, you
332
	              may also need a <a href="firewall_virtual_ip.php">Virtual IP</a>.</span><br>
333 5b237745 Scott Ullrich
                      <br>
334
                      You may enter your own mappings below.</p>
335
                    </td>
336
                </tr>
337
              </table>
338 d732f186 Bill Marquette
              <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
339 3f57ceee Bill Marquette
                <tr id="frheader">
340
                  <td width="3%" class="list">&nbsp;</td>
341
                  <td width="3%" class="list">&nbsp;</td>
342 5b237745 Scott Ullrich
                  <td width="10%" class="listhdrr">Interface</td>
343 3af33993 Scott Ullrich
                  <td width="15%" class="listhdrr">Source</td>
344
                  <td width="10%" class="listhdrr">Source Port</td>
345
                  <td width="15%" class="listhdrr">Destination</td>
346
                  <td width="10%" class="listhdrr">Destination Port</td>
347
                  <td width="15%" class="listhdrr">NAT Address</td>
348 5d8b0205 Scott Ullrich
                  <td width="10%" class="listhdrr">NAT Port</td>
349
		  <td width="10%" class="listhdrr">Static Port</td>
350 5b237745 Scott Ullrich
                  <td width="25%" class="listhdr">Description</td>
351 d415d821 Seth Mos
                  <td width="5%" class="list">
352
                    <table border="0" cellspacing="0" cellpadding="1">
353
                      <tr>
354
			<td width="17"></td>
355
                        <td><a href="firewall_nat_out_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add new mapping"></a></td>
356
                      </tr>
357
                    </table>
358
		  </td>
359 5b237745 Scott Ullrich
                </tr>
360 9c96aff5 Bill Marquette
              <?php $nnats = $i = 0; foreach ($a_out as $natent): ?>
361 3f57ceee Bill Marquette
                <tr valign="top" id="fr<?=$nnats;?>">
362
                  <td class="listt"><input type="checkbox" id="frc<?=$nnats;?>" name="rule[]" value="<?=$i;?>" onClick="fr_bgcolor('<?=$nnats;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;"></td>
363 3364bed4 Bill Marquette
                  <td class="listt" align="center"></td>
364 f8b8c2fd Bill Marquette
                  <td class="listlr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
365 5b237745 Scott Ullrich
                    <?php
366
					if (!$natent['interface'] || ($natent['interface'] == "wan"))
367
					  	echo "WAN";
368 c7f97efa Scott Ullrich
                                        else if (!$natent['interface'] || ($natent['interface'] == "lan"))
369
                                                 echo "LAN";                                                
370 f1f60c92 Ermal Luçi
					else if ($natent['interface'] == "openvpn")
371
						echo "OpenVPN";
372 5b237745 Scott Ullrich
					else
373 bb43786e Scott Ullrich
						echo htmlspecialchars($config['interfaces'][$natent['interface']]['descr']);
374 5b237745 Scott Ullrich
					?>
375 19f09ae1 Scott Ullrich
                                        &nbsp;
376 5b237745 Scott Ullrich
                  </td>
377 f8b8c2fd Bill Marquette
                  <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
378 5b237745 Scott Ullrich
                    <?=$natent['source']['network'];?>
379
                  </td>
380 a88aca62 Scott Ullrich
                  <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
381
                    <?php
382
                      if (!$natent['sourceport'])
383
                          echo "*";
384
                      else
385
                          echo $natent['sourceport'];
386
                    ?>
387
                  </td>
388 f8b8c2fd Bill Marquette
                  <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
389 5b237745 Scott Ullrich
                    <?php
390
                      if (isset($natent['destination']['any']))
391
                          echo "*";
392
                      else {
393
                          if (isset($natent['destination']['not']))
394
                              echo "!&nbsp;";
395 2e56710c Scott Ullrich
                          echo $natent['destination']['address'];
396 5b237745 Scott Ullrich
                      }
397
                    ?>
398
                  </td>
399 f8b8c2fd Bill Marquette
                  <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
400 a539f08b Bill Marquette
                    <?php
401 a88aca62 Scott Ullrich
                      if (!$natent['dstport'])
402 a539f08b Bill Marquette
                          echo "*";
403
                      else
404 a88aca62 Scott Ullrich
                          echo $natent['dstport'];
405 a539f08b Bill Marquette
                    ?>
406
                  </td>
407 f8b8c2fd Bill Marquette
                  <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
408 5b237745 Scott Ullrich
                    <?php
409
                      if (!$natent['target'])
410
                          echo "*";
411
                      else
412
                          echo $natent['target'];
413
                    ?>
414
                  </td>
415 4d38bfc3 Scott Ullrich
                  <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
416
                    <?php
417 3af33993 Scott Ullrich
                      if (!$natent['natport'])
418 4d38bfc3 Scott Ullrich
                          echo "*";
419
                      else
420 3af33993 Scott Ullrich
                          echo $natent['natport'];
421
                    ?>
422 5d8b0205 Scott Ullrich
                  </td>
423
                  <td class="listr" onClick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
424
                    <?php
425 b6905de8 Scott Ullrich
			if(isset($natent['staticnatport']))
426 3ea05ff4 Scott Ullrich
			    echo "<CENTER>YES</CENTER>";
427 b6905de8 Scott Ullrich
			else
428 3ea05ff4 Scott Ullrich
			    echo "<CENTER>NO</CENTER>";
429 5d8b0205 Scott Ullrich
                    ?>		    
430 4d38bfc3 Scott Ullrich
                  </td>
431 f8b8c2fd Bill Marquette
                  <td class="listbg"  onClick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
432 64286300 Scott Ullrich
                    <?=htmlspecialchars($natent['descr']);?>&nbsp;
433 5b237745 Scott Ullrich
                  </td>
434 9c96aff5 Bill Marquette
                  <td class="list" valign="middle" nowrap>
435
                    <table border="0" cellspacing="0" cellpadding="1">
436
                      <tr>
437 90e4939a Bill Marquette
                        <td><a href="firewall_nat_out_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="edit mapping"></a></td>
438 9c96aff5 Bill Marquette
                      </tr>
439
                      <tr>
440 677c0869 Erik Kristensen
                        <td><input onmouseover="fr_insline(<?=$nnats;?>, true)" onmouseout="fr_insline(<?=$nnats;?>, false)" name="move_<?=$i;?>" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" title="move selected rules before this rule" height="17" type="image" width="17" border="0"></td>
441
                        <td><a href="firewall_nat_out_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="add a new nat based on this one" width="17" height="17" border="0"></a></td>
442 9c96aff5 Bill Marquette
                      </tr>
443
                    </table>
444
              <?php $i++; $nnats++; endforeach; ?>
445 19ae0929 Scott Ullrich
                <tr>
446 3af33993 Scott Ullrich
                  <td class="list" colspan="11"></td>
447 9c96aff5 Bill Marquette
                  <td class="list" valign="middle" nowrap>
448
                    <table border="0" cellspacing="0" cellpadding="1">
449
                      <tr>
450 677c0869 Erik Kristensen
                        <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="move selected mappings to end" border="0"><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" width="17" height="17" title="move selected mappings to end" border="0"><?php endif; ?></td>
451 90e4939a Bill Marquette
                        <td><a href="firewall_nat_out_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="add new mapping"></a></td>
452 9c96aff5 Bill Marquette
                      </tr>
453
                      <tr>
454 677c0869 Erik Kristensen
                        <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="delete selected rules" border="0"><?php else: ?><input name="del" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" title="delete selected mappings" onclick="return confirm('Do you really want to delete the selected mappings?')"><?php endif; ?></td>
455 9c96aff5 Bill Marquette
                      </tr>
456
                    </table></td>
457 5b237745 Scott Ullrich
                </tr>
458
              </table>
459 d732f186 Bill Marquette
	    </div>
460 5b237745 Scott Ullrich
</td>
461
  </tr>
462
</table>
463
            </form>
464
<?php include("fend.inc"); ?>
465
</body>
466
</html>