2003-01-14 18:18:42 +01:00
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2002-08-13 22:45:21 +02:00
|
|
|
|
<html>
|
|
|
|
|
<head>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<meta http-equiv="Content-Type"
|
|
|
|
|
content="text/html; charset=windows-1252">
|
|
|
|
|
<title>Shorewall NAT</title>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<meta name="ProgId" content="FrontPage.Editor.Document">
|
2002-08-13 22:45:21 +02:00
|
|
|
|
</head>
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<body>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
|
|
|
|
<blockquote>
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0"
|
|
|
|
|
style="border-collapse: collapse;" width="100%" id="AutoNumber1"
|
|
|
|
|
bgcolor="#400169" height="90">
|
|
|
|
|
<tbody>
|
2002-08-22 23:21:41 +02:00
|
|
|
|
<tr>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
<td width="100%">
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<h1 align="center"><font color="#ffffff">Static NAT</font></h1>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<p><font color="#ff0000"><b>IMPORTANT: If all you want to do is forward
|
|
|
|
|
ports to servers behind your firewall, you do NOT want to use static
|
2003-03-23 19:47:54 +01:00
|
|
|
|
NAT. Port forwarding can be accomplished with simple entries in the
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<a href="Documentation.htm#Rules">rules file</a>.</b></font></p>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<p>Static NAT is a way to make systems behind a firewall and configured
|
|
|
|
|
with private IP addresses (those reserved for private use in RFC1918)
|
|
|
|
|
appear to have public IP addresses. Before you try to use this technique,
|
|
|
|
|
I strongly recommend that you read the <a
|
|
|
|
|
href="shorewall_setup_guide.htm">Shorewall Setup Guide.</a></p>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<p>The following figure represents a static NAT environment.</p>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<p align="center"><strong> <img src="images/staticnat.png"
|
|
|
|
|
width="435" height="397">
|
|
|
|
|
</strong></p>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<blockquote> </blockquote>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
|
|
|
|
<p align="left">Static NAT can be used to make the systems with the
|
2003-01-14 18:18:42 +01:00
|
|
|
|
10.1.1.* addresses appear to be on the upper (130.252.100.*) subnet. If
|
2003-03-23 19:47:54 +01:00
|
|
|
|
we assume that the interface to the upper subnet is eth0, then the following
|
2003-01-14 18:18:42 +01:00
|
|
|
|
/etc/shorewall/NAT file would make the lower left-hand system appear
|
2003-03-23 19:47:54 +01:00
|
|
|
|
to have IP address 130.252.100.18 and the right-hand one to have IP address
|
2002-08-13 22:45:21 +02:00
|
|
|
|
130.252.100.19.</p>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<table border="2" cellpadding="2" style="border-collapse: collapse;">
|
|
|
|
|
<tbody>
|
2002-08-13 22:45:21 +02:00
|
|
|
|
<tr>
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<td><b>EXTERNAL</b></td>
|
|
|
|
|
<td><b>INTERFACE</b></td>
|
|
|
|
|
<td><b>INTERNAL</b></td>
|
|
|
|
|
<td><b>ALL INTERFACES</b></td>
|
|
|
|
|
<td><b>LOCAL</b></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>130.252.100.18</td>
|
|
|
|
|
<td>eth0</td>
|
|
|
|
|
<td>10.1.1.2</td>
|
|
|
|
|
<td>yes</td>
|
|
|
|
|
<td>yes</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>130.252.100.19</td>
|
|
|
|
|
<td>eth0</td>
|
|
|
|
|
<td>10.1.1.3</td>
|
|
|
|
|
<td>yes</td>
|
|
|
|
|
<td>yes</td>
|
|
|
|
|
</tr>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
|
|
|
|
<p>Be sure that the internal system(s) (10.1.1.2 and 10.1.1.3 in the above
|
|
|
|
|
example) is (are) not included in any specification in /etc/shorewall/masq
|
2002-08-13 22:45:21 +02:00
|
|
|
|
or /etc/shorewall/proxyarp.</p>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
|
|
|
|
<p><a name="AllInterFaces"></a>Note 1: The "ALL INTERFACES" column
|
|
|
|
|
is used to specify whether access to the external IP from all firewall
|
|
|
|
|
interfaces should undergo NAT (Yes or yes) or if only access from the
|
|
|
|
|
interface in the INTERFACE column should undergo NAT. If you leave this
|
2003-01-14 18:18:42 +01:00
|
|
|
|
column empty, "Yes" is assumed.<2E>The ALL INTERFACES column was added
|
|
|
|
|
in version 1.1.6.</p>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
|
|
|
|
<p>Note 2: Shorewall will automatically add the external address to the
|
2003-01-14 18:18:42 +01:00
|
|
|
|
specified interface unless you specify <a
|
|
|
|
|
href="Documentation.htm#Aliases">ADD_IP_ALIASES</a>="no" (or "No") in
|
|
|
|
|
/etc/shorewall/shorewall.conf; If you do not set ADD_IP_ALIASES or if
|
|
|
|
|
you set it to "Yes" or "yes" then you must NOT configure your own alias(es).</p>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<p><a name="LocalPackets"></a>Note 3: The contents of the "LOCAL" column
|
|
|
|
|
determine whether packets originating on the firewall itself and destined
|
|
|
|
|
for the EXTERNAL address are redirected to the internal ADDRESS. If this
|
|
|
|
|
column contains "yes" or "Yes" (and the ALL INTERFACES COLUMN also contains
|
|
|
|
|
"Yes" or "yes") then such packets are redirected; otherwise, such packets
|
|
|
|
|
are not redirected. The LOCAL column was added in version 1.1.8.</p>
|
|
|
|
|
</blockquote>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<blockquote> </blockquote>
|
2003-03-23 19:47:54 +01:00
|
|
|
|
|
2003-01-14 18:18:42 +01:00
|
|
|
|
<p><font size="2">Last updated 1/11/2003 - </font><font size="2"> <a
|
|
|
|
|
href="support.htm">Tom Eastep</a></font> </p>
|
|
|
|
|
<a href="copyright.htm"><font size="2">Copyright</font> <20> <font
|
|
|
|
|
size="2">2001, 2002, 2003 Thomas M. Eastep.</font></a><br>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|