Project

General

Profile

Download (23 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
    firewall_nat_out.php
5
    Copyright (C) 2004 Scott Ullrich
6
    All rights reserved.
7

    
8
    originally part of m0n0wall (http://m0n0.ch/wall)
9
    Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
    All rights reserved.
11

    
12
    Redistribution and use in source and binary forms, with or without
13
    modification, are permitted provided that the following conditions are met:
14

    
15
    1. Redistributions of source code must retain the above copyright notice,
16
       this list of conditions and the following disclaimer.
17

    
18
    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

    
22
    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
/*
34
	pfSense_MODULE:	nat
35
*/
36

    
37
##|+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
require("guiconfig.inc");
45
require_once("functions.inc");
46
require_once("filter.inc");
47
require_once("shaper.inc");
48

    
49
if (!is_array($config['nat']['advancedoutbound']))
50
	$config['nat']['advancedoutbound'] = array();
51

    
52
if (!is_array($config['nat']['advancedoutbound']['rule']))
53
	$config['nat']['advancedoutbound']['rule'] = array();
54

    
55
$a_out = &$config['nat']['advancedoutbound']['rule'];
56

    
57
if ($_POST['apply']) {
58
	write_config();
59

    
60
	$retval = 0;
61
	$retval |= filter_configure();
62

    
63
	if(stristr($retval, "error") <> true)
64
	        $savemsg = get_std_save_message($retval);
65
	else
66
		$savemsg = $retval;
67

    
68
	if ($retval == 0) {
69
		clear_subsystem_dirty('natconf');
70
		clear_subsystem_dirty('filter');
71
        }
72
}
73

    
74

    
75

    
76
if (isset($_POST['save']) && $_POST['save'] == "Save") {
77
	/* mutually exclusive settings - if user wants advanced NAT, we don't generate automatic rules */
78
	switch ($_POST['advancedoripsec']) {
79
	case "ipsecpassthru":
80
               	$config['nat']['ipsecpassthru']['enable'] = true;
81
               	unset($config['nat']['advancedoutbound']['enable']);
82
		break;
83
	case "advancedoutboundnat":
84
        	if (!isset($config['nat']['advancedoutbound']['enable'])) {
85
			$config['nat']['advancedoutbound']['enable'] = true;
86
			// if there are already AON rules configured, don't generate default ones
87
			if(!empty($a_out))
88
				continue;
89
			/*
90
			 *    user has enabled advanced outbound NAT and doesn't have rules
91
			 *    lets automatically create entries
92
			 *    for all of the interfaces to make life easier on the pip-o-chap
93
			 */
94
			$ifdescrs = get_configured_interface_with_descr();
95
				
96
			foreach($ifdescrs as $if => $ifdesc) {
97
				if (!interface_has_gateway($if))
98
					continue;
99
				foreach ($ifdescrs as $if2 => $ifdesc2) {
100
					if (interface_has_gateway($if2))
101
						continue;
102

    
103
					$osipaddr = get_interface_ip($if2);
104
					$ossubnet = get_interface_subnet($if2);
105
					if (!is_ipaddr($osipaddr) || empty($ossubnet))
106
						continue;
107
					$osn = gen_subnet($osipaddr, $ossubnet);
108

    
109
					$natent = array();
110
					$natent['source']['network'] = "{$osn}/{$ossubnet}";
111
					$natent['dstport'] = "500";
112
					$natent['descr'] = sprintf(gettext('Auto created rule for ISAKMP - %1$s to %2$s'),$ifdesc2,$ifdesc);
113
					$natent['target'] = "";
114
					$natent['interface'] = $if;
115
					$natent['destination']['any'] = true;
116
					$natent['staticnatport'] = true;
117
					$natent['created'] = make_config_revision_entry(null, gettext("Manual Outbound NAT Switch"));
118
					$a_out[] = $natent;
119

    
120
					$natent = array();
121
					$natent['source']['network'] = "{$osn}/{$ossubnet}";
122
					$natent['sourceport'] = "";
123
					$natent['descr'] = sprintf(gettext('Auto created rule for %1$s to %2$s'),$ifdesc2,$ifdesc);
124
					$natent['target'] = "";
125
					$natent['interface'] = $if;
126
					$natent['destination']['any'] = true;
127
					$natent['natport'] = "";
128
					$natent['created'] = make_config_revision_entry(null, gettext("Manual Outbound NAT Switch"));
129
					$a_out[] = $natent;
130
				}
131
				/* Localhost */
132
				$natent = array();
133
				$natent['source']['network'] = "127.0.0.0/8";
134
				$natent['dstport'] = "";
135
				$natent['descr'] = sprintf(gettext('Auto created rule for localhost to %1$s'),$ifdesc);
136
				$natent['target'] = "";
137
				$natent['interface'] = $if;
138
				$natent['destination']['any'] = true;
139
				$natent['staticnatport'] = false;
140
				$natent['natport'] = "1024:65535";
141
				$natent['created'] = make_config_revision_entry(null, gettext("Manual Outbound NAT Switch"));
142
				$a_out[] = $natent;
143
				/* PPTP subnet */
144
				if (($config['pptpd']['mode'] == "server") && is_private_ip($config['pptpd']['remoteip'])) {
145
					$pptp_size = empty($config['pptpd']['n_pptp_units']) ? 16 : $config['pptpd']['n_pptp_units'];
146
					$pptptopip = $pptp_size - 1;
147
					$pptp_subnets = ip_range_to_subnet_array($config['pptpd']['remoteip'], long2ip32(ip2long($config['pptpd']['remoteip'])+$pptptopip));
148
					foreach ($pptp_subnets as $pptpsn) {
149
						$natent = array();
150
						$natent['source']['network'] = $pptpsn;
151
						$natent['sourceport'] = "";
152
						$natent['descr'] = gettext("Auto created rule for PPTP server");
153
						$natent['target'] = "";
154
						$natent['interface'] = $if;
155
						$natent['destination']['any'] = true;
156
						$natent['natport'] = "";
157
						$natent['created'] = make_config_revision_entry(null, gettext("Manual Outbound NAT Switch"));
158
						$a_out[] = $natent;
159
					}
160
				}
161
				/* PPPoE subnet */
162
				if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
163
					foreach ($config['pppoes']['pppoe'] as $pppoes) {
164
						if (($pppoes['mode'] == "server") && is_ipaddr($pppoes['localip'])) {
165
							if($pppoes['pppoe_subnet'] <> "")
166
								$ossubnet = $pppoes['pppoe_subnet'];
167
							else
168
								$ossubnet = "32";
169
							$osn = gen_subnet($pppoes['localip'], $ossubnet);
170
							$natent = array();
171
							$natent['source']['network'] = "{$osn}/{$ossubnet}";
172
							$natent['sourceport'] = "";
173
							$natent['descr'] = gettext("Auto created rule for PPPoE server");
174
							$natent['target'] = "";
175
							$natent['interface'] = $if;
176
							$natent['destination']['any'] = true;
177
							$natent['natport'] = "";
178
							$natent['created'] = make_config_revision_entry(null, gettext("Manual Outbound NAT Switch"));
179
							$a_out[] = $natent;
180
						}
181
					}
182
				}
183
				/* L2TP subnet */
184
				if($config['l2tp']['mode'] == "server") {
185
					if (is_ipaddr($config['l2tp']['localip'])) {
186
						if($config['l2tp']['l2tp_subnet'] <> "")
187
							$ossubnet = $config['l2tp']['l2tp_subnet'];
188
						else
189
							$ossubnet = "32";
190
						$osn = gen_subnet($config['l2tp']['localip'], $ossubnet);
191
						$natent = array();
192
						$natent['source']['network'] = "{$osn}/{$ossubnet}";
193
						$natent['sourceport'] = "";
194
						$natent['descr'] = gettext("Auto created rule for L2TP server");
195
						$natent['target'] = "";
196
						$natent['interface'] = $if;
197
						$natent['destination']['any'] = true;
198
						$natent['natport'] = "";
199
						$natent['created'] = make_config_revision_entry(null, gettext("Manual Outbound NAT Switch"));
200
						$a_out[] = $natent;
201
					}
202
				}
203
				/* add openvpn interfaces */
204
				if($config['openvpn']['openvpn-server']) {
205
					foreach ($config['openvpn']['openvpn-server'] as $ovpnsrv) {
206
						$natent = array();
207
						$natent['source']['network'] = $ovpnsrv['tunnel_network'];
208
						$natent['sourceport'] = "";
209
						$natent['descr'] = gettext("Auto created rule for OpenVPN server");
210
						$natent['target'] = "";
211
						$natent['interface'] = $if;
212
						$natent['destination']['any'] = true;
213
						$natent['natport'] = "";
214
						$natent['created'] = make_config_revision_entry(null, gettext("Manual Outbound NAT Switch"));
215
						$a_out[] = $natent;
216
					}
217
				}
218
			}
219

    
220
			$savemsg = gettext("Default rules for each interface have been created.");
221
		}
222
		break;
223
	}
224
	if (write_config())
225
		mark_subsystem_dirty('natconf');
226
        header("Location: firewall_nat_out.php");
227
        exit;
228
}
229

    
230
if ($_GET['act'] == "del") {
231
	if ($a_out[$_GET['id']]) {
232
		unset($a_out[$_GET['id']]);
233
		if (write_config())
234
			mark_subsystem_dirty('natconf');
235
		header("Location: firewall_nat_out.php");
236
		exit;
237
	}
238
}
239

    
240
if (isset($_POST['del_x'])) {
241
        /* delete selected rules */
242
        if (is_array($_POST['rule']) && count($_POST['rule'])) {
243
                foreach ($_POST['rule'] as $rulei) {
244
                        unset($a_out[$rulei]);
245
                }
246
		if (write_config())
247
			mark_subsystem_dirty('natconf');
248
                header("Location: firewall_nat_out.php");
249
                exit;
250
        }
251

    
252
} else {
253
        /* yuck - IE won't send value attributes for image buttons, while Mozilla does - so we use .x/.y to find move button clicks instead... */
254
        unset($movebtn);
255
        foreach ($_POST as $pn => $pd) {
256
                if (preg_match("/move_(\d+)_x/", $pn, $matches)) {
257
                        $movebtn = $matches[1];
258
                        break;
259
                }
260
        }
261
        /* move selected rules before this rule */
262
        if (isset($movebtn) && is_array($_POST['rule']) && count($_POST['rule'])) {
263
                $a_out_new = array();
264

    
265
                /* copy all rules < $movebtn and not selected */
266
                for ($i = 0; $i < $movebtn; $i++) {
267
                        if (!in_array($i, $_POST['rule']))
268
                                $a_out_new[] = $a_out[$i];
269
                }
270

    
271
                /* copy all selected rules */
272
                for ($i = 0; $i < count($a_out); $i++) {
273
                        if ($i == $movebtn)
274
                                continue;
275
                        if (in_array($i, $_POST['rule']))
276
                                $a_out_new[] = $a_out[$i];
277
                }
278

    
279
                /* copy $movebtn rule */
280
                if ($movebtn < count($a_out))
281
                        $a_out_new[] = $a_out[$movebtn];
282

    
283
                /* copy all rules > $movebtn and not selected */
284
                for ($i = $movebtn+1; $i < count($a_out); $i++) {
285
                        if (!in_array($i, $_POST['rule']))
286
                                $a_out_new[] = $a_out[$i];
287
                }
288
                if (count($a_out_new) > 0)
289
			$a_out = $a_out_new;
290
		else
291
			unset($config['nat']['advancedoutbound']);
292

    
293
		if (write_config())
294
			mark_subsystem_dirty('natconf');
295
                header("Location: firewall_nat_out.php");
296
                exit;
297
        }
298
}
299

    
300

    
301
$pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("Outbound"));
302
include("head.inc");
303

    
304
?>
305
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
306
<?php include("fbegin.inc"); ?>
307
<form action="firewall_nat_out.php" method="post" name="iform">
308
<script type="text/javascript" language="javascript" src="/javascript/row_toggle.js"></script>
309
<?php if ($savemsg) print_info_box($savemsg); ?>
310
<?php if (is_subsystem_dirty('natconf')): ?>
311
<?php print_info_box_np(gettext("The NAT configuration has been changed.")."<br/>".gettext("You must apply the changes in order for them to take effect."));?><br/>
312
<?php endif; ?>
313
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="firwall nat outbound">  <tr><td>
314
<?php
315
	$tab_array = array();
316
	$tab_array[] = array(gettext("Port Forward"), false, "firewall_nat.php");
317
	$tab_array[] = array(gettext("1:1"), false, "firewall_nat_1to1.php");
318
	$tab_array[] = array(gettext("Outbound"), true, "firewall_nat_out.php");
319
	$tab_array[] = array(gettext("NPt"), false, "firewall_nat_npt.php");
320
	display_top_tabs($tab_array);
321
?>
322
  </td></tr>
323
  <tr>
324
    <td>
325
	<div id="mainarea">
326
              <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
327
				<tr><td align="right"><b><?=gettext("Mode:"); ?></b></td>
328
                  <td>
329
                      &nbsp;&nbsp;<input name="advancedoripsec" type="radio" id="ipsecpassthru" value="ipsecpassthru" <?php if (isset($config['nat']['ipsecpassthru']['enable'])) echo "checked=\"checked\"";?> />
330
                      <strong><?=gettext("Automatic outbound NAT rule generation"); ?><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?=gettext("(IPsec passthrough included)");?></strong>
331
                  </td>
332

    
333
                  <td>
334
                      &nbsp;&nbsp;<input name="advancedoripsec" type="radio" id="advancedoutbound" value="advancedoutboundnat" <?php if (isset($config['nat']['advancedoutbound']['enable'])) echo "checked=\"checked\"";?> />
335
                      <strong><?=gettext("Manual Outbound NAT rule generation") . "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . gettext("(AON - Advanced Outbound NAT)");?></strong></td>
336
                  <td valign="middle" align="left">
337
					<input name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
338
					&nbsp;<br/>&nbsp;
339
                  </td>
340
                </tr>
341
				<tr>
342
					<td colspan="5">
343
						&nbsp;
344
					</td>
345
				</tr>
346
				<tr>
347
					<td  class="vtable" colspan="5">
348
						&nbsp;
349
					</td>
350
				</tr>
351
              </table>
352
              <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="mappings">
353
				<tr><td colspan="5"><b>&nbsp;<?=gettext("Mappings:"); ?></b></td></tr>
354
				<tr><td>&nbsp;</td></tr>
355
                <tr id="frheader">
356
                  <td width="3%" class="list">&nbsp;</td>
357
                  <td width="3%" class="list">&nbsp;</td>
358
                  <td width="10%" class="listhdrr"><?=gettext("Interface");?></td>
359
                  <td width="15%" class="listhdrr"><?=gettext("Source");?></td>
360
                  <td width="10%" class="listhdrr"><?=gettext("Source Port");?></td>
361
                  <td width="15%" class="listhdrr"><?=gettext("Destination");?></td>
362
                  <td width="10%" class="listhdrr"><?=gettext("Destination Port");?></td>
363
                  <td width="15%" class="listhdrr"><?=gettext("NAT Address");?></td>
364
                  <td width="10%" class="listhdrr"><?=gettext("NAT Port");?></td>
365
		  <td width="10%" class="listhdrr"><?=gettext("Static Port");?></td>
366
                  <td width="25%" class="listhdr"><?=gettext("Description");?></td>
367
                  <td width="5%" class="list">
368
                    <table border="0" cellspacing="0" cellpadding="1" summary="add">
369
                      <tr>
370
			<td width="17"></td>
371
                        <td><a href="firewall_nat_out_edit.php?after=-1"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add new mapping");?>" alt="add" /></a></td>
372
                      </tr>
373
                    </table>
374
		  </td>
375
                </tr>
376
              <?php $nnats = $i = 0; foreach ($a_out as $natent): ?>
377
                <tr valign="top" id="fr<?=$nnats;?>">
378
                  <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>
379
                  <td class="listt" align="center"></td>
380
                  <td class="listlr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
381
                    <?php echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface'])); ?>
382
                                        &nbsp;
383
                  </td>
384
                  <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
385
                    <?=$natent['source']['network'];?>
386
                  </td>
387
                  <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
388
                    <?php
389
			echo ($natent['protocol']) ? $natent['protocol'] . '/' : "" ;
390
                      if (!$natent['sourceport'])
391
                          echo "*";
392
                      else
393
                          echo $natent['sourceport'];
394
                    ?>
395
                  </td>
396
                  <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
397
                    <?php
398
                      if (isset($natent['destination']['any']))
399
                          echo "*";
400
                      else {
401
                          if (isset($natent['destination']['not']))
402
                              echo "!&nbsp;";
403
                          echo $natent['destination']['address'];
404
                      }
405
                    ?>
406
                  </td>
407
                  <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
408
                    <?php
409
			echo ($natent['protocol']) ? $natent['protocol'] . '/' : "" ;
410
                      if (!$natent['dstport'])
411
                          echo "*";
412
                      else
413
                          echo $natent['dstport'];
414
                    ?>
415
                  </td>
416
                  <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
417
                    <?php
418
					if (isset($natent['nonat']))
419
						echo '<I>NO NAT</I>';
420
					elseif (!$natent['target'])
421
						echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface'])) . " address";
422
					elseif ($natent['target'] == "other-subnet")
423
						echo $natent['targetip'] . '/' . $natent['targetip_subnet'];
424
					else
425
						echo $natent['target'];
426
                    ?>
427
                  </td>
428
                  <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
429
                    <?php
430
                      if (!$natent['natport'])
431
                          echo "*";
432
                      else
433
                          echo $natent['natport'];
434
                    ?>
435
                  </td>
436
                  <td class="listr" onclick="fr_toggle(<?=$nnats;?>)" id="frd<?=$nnats;?>" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';" align="center">
437
                    <?php
438
			if(isset($natent['staticnatport']))
439
			    echo gettext("YES");
440
			else
441
			    echo gettext("NO");
442
                    ?>		    
443
                  </td>
444
                  <td class="listbg" onclick="fr_toggle(<?=$nnats;?>)" ondblclick="document.location='firewall_nat_out_edit.php?id=<?=$nnats;?>';">
445
                    <?=htmlspecialchars($natent['descr']);?>&nbsp;
446
                  </td>
447
                  <td class="list nowrap" valign="middle">
448
                    <table border="0" cellspacing="0" cellpadding="1" summary="move">
449
                      <tr>
450
                        <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="<?=gettext("move selected rules before this rule");?>" type="image" style="height:17;width:17;border:0" /></td>
451
                        <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="<?=gettext("edit mapping");?>" alt="edit" /></a></td>
452
                      </tr>
453
                      <tr>
454
			<td align="center" valign="middle"><a href="firewall_nat_out.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this rule?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete rule");?>" alt="delete" /></a></td>
455
                        <td><a href="firewall_nat_out_edit.php?dup=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add a new NAT based on this one");?>" width="17" height="17" border="0" alt="duplicate" /></a></td>
456
                      </tr>
457
                    </table>
458
              <?php $i++; $nnats++; endforeach; ?>
459
                <tr>
460
                  <td class="list" colspan="11"></td>
461
                  <td class="list nowrap" valign="middle">
462
                    <table border="0" cellspacing="0" cellpadding="1" summary="edit">
463
                      <tr>
464
                        <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" title="<?=gettext("move selected mappings to end");?>" border="0" alt="move" /><?php else: ?><input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" style="width:17;height:17;border:0" title="<?=gettext("move selected mappings to end");?>" /><?php endif; ?></td>
465
                        <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="<?=gettext("add new mapping");?>" alt="add" /></a></td>
466
                      </tr>
467
                      <tr>
468
                        <td><?php if ($nnats == 0): ?><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" title="<?=gettext("delete selected rules");?>" border="0" alt="delete" /><?php else: ?><input name="del" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" style="width:17;height:17" title="<?=gettext("delete selected mappings");?>" onclick="return confirm('<?=gettext("Do you really want to delete the selected mappings?");?>')" /><?php endif; ?></td>
469
                      </tr>
470
                    </table></td>
471
                </tr>
472
                <tr>
473
                  <td colspan="12">
474
			<p><span class="vexpl"><span class="red"><strong><?=gettext("Note:"); ?><br/>
475
			</strong></span>
476
			<?=gettext("With automatic outbound NAT enabled, a mapping is automatically created " .
477
			"for each interface's subnet (except WAN-type connections) and the rules " .
478
			"on this page are ignored.<br/><br/> " .
479
			"If manual outbound NAT is enabled, outbound NAT rules will not be " .
480
			"automatically generated and only the mappings you specify on this page " .
481
			"will be used. <br/><br/> " .
482
			"If a target address other than a WAN-type interface's IP address is used, " .
483
			"then depending on the way the WAN connection is setup, a "); ?>
484
			<a href="firewall_virtual_ip.php"><?=gettext("Virtual IP"); ?></a>
485
			<?= gettext(" may also be required.") ?>
486
			<br/><br/>
487
			<?= gettext("To completely disable outbound NAT, switch to Manual Outbound NAT then delete any " .
488
			"NAT rules that appear in the list.") ?></span></p>
489
                    </td>
490
                </tr>
491

    
492
              </table>
493
	    </div>
494
</td>
495
  </tr>
496
</table>
497
            </form>
498
<?php include("fend.inc"); ?>
499
</body>
500
</html>
(67-67/246)