From 84029e5bd4c148aa606330275df21040fb4aa9b7 Mon Sep 17 00:00:00 2001
From: teastep
Date: Sat, 8 May 2004 22:31:54 +0000
Subject: [PATCH] Updates for 2.0.2
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@1317 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
---
Shorewall-docs2/Accounting.xml | 15 +-
Shorewall-docs2/Documentation.xml | 1182 ++++--
Shorewall-docs2/Documentation_Index.xml | 4 +-
Shorewall-docs2/FAQ.xml | 967 +++--
Shorewall-docs2/FTP.xml | 25 +-
Shorewall-docs2/IPSEC.xml | 265 +-
Shorewall-docs2/Install.xml | 126 +-
Shorewall-docs2/PPTP.xml | 24 +-
Shorewall-docs2/Shorewall_Squid_Usage.xml | 6 +-
Shorewall-docs2/bridge.xml | 6 +-
Shorewall-docs2/configuration_file_basics.xml | 21 +-
Shorewall-docs2/errata.xml | 353 +-
Shorewall-docs2/images/State_Diagram.png | Bin 26272 -> 28375 bytes
Shorewall-docs2/images/State_Diagram.vdx | 619 +--
Shorewall-docs2/images/staticnat.png | Bin 6422 -> 8036 bytes
Shorewall-docs2/images/staticnat.vdx | 598 ++-
Shorewall-docs2/myfiles.xml | 122 +-
Shorewall-docs2/ports.xml | 25 +-
.../shorewall_extension_scripts.xml | 112 +-
Shorewall-docs2/shorewall_features.xml | 50 +-
Shorewall-docs2/shorewall_logging.xml | 6 +-
.../shorewall_quickstart_guide.xml | 20 +-
Shorewall-docs2/shorewall_setup_guide_fr.xml | 3352 ++++++-----------
Shorewall-docs2/standalone.xml | 11 +-
Shorewall-docs2/standalone_fr.xml | 746 ++--
.../starting_and_stopping_shorewall.xml | 272 +-
Shorewall-docs2/template.xml | 4 -
Shorewall-docs2/three-interface.xml | 11 +-
Shorewall-docs2/three-interface_fr.xml | 2012 ++++------
Shorewall-docs2/two-interface.xml | 12 +-
Shorewall-docs2/two-interface_fr.xml | 1807 +++++----
Shorewall-docs2/upgrade_issues.xml | 654 ++--
32 files changed, 6910 insertions(+), 6517 deletions(-)
diff --git a/Shorewall-docs2/Accounting.xml b/Shorewall-docs2/Accounting.xml
index c923f77ac..fa3695ce4 100644
--- a/Shorewall-docs2/Accounting.xml
+++ b/Shorewall-docs2/Accounting.xml
@@ -15,7 +15,7 @@
- 2004-01-05
+ 2004-04-192003-2004
@@ -193,9 +193,13 @@
[root@gateway shorewall]#
Here's how the same example would be constructed on an HTTP server
- (READ THAT FOLKS -- IT SAYS SERVER. If
- you want to account for web browsing, you have to reverse the rules below)
- with only one interface (eth0):
+ with only one interface (eth0).
+
+
+ READ THE ABOVE CAREFULLY -- IT SAYS SERVER.
+ If you want to account for web browsing, you have to reverse the rules
+ below.
+ #ACTION CHAIN SOURCE DESTINATION PROTOCOL DEST SOURCE
# PORT PORT
@@ -228,4 +232,7 @@
8767 727K all -- eth0 * 0.0.0.0/0 0.0.0.0/0
11506 13M all -- * eth0 0.0.0.0/0 0.0.0.0/0
[root@mail shorewall]#
+
+ For an example of integrating Shorewall Accounting with MRTG, see
+ http://www.nightbrawler.com/code/shorewall-stats/.
\ No newline at end of file
diff --git a/Shorewall-docs2/Documentation.xml b/Shorewall-docs2/Documentation.xml
index 4c3b98d96..e1c9823e8 100644
--- a/Shorewall-docs2/Documentation.xml
+++ b/Shorewall-docs2/Documentation.xml
@@ -15,7 +15,7 @@
- 2004-03-28
+ 2004-05-062001-2004
@@ -29,7 +29,8 @@
1.2 or any later version published by the Free Software Foundation; with
no Invariant Sections, with no Front-Cover, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
- GNU Free Documentation License.
+ GNU Free Documentation
+ License.
@@ -50,9 +51,10 @@
params
- a parameter file installed in /etc/shorewall
- that can be used to establish the values of shell variables for use
- in other files.
+ a parameter file installed in /etc/shorewall that can be used to
+ establish the values of shell variables for use in other
+ files.
@@ -60,8 +62,9 @@
shorewall.conf
- a parameter file installed in /etc/shorewall
- that is used to set several firewall parameters.
+ a parameter file installed in /etc/shorewall that is used to set
+ several firewall parameters.
@@ -69,8 +72,9 @@
zones
- a parameter file installed in /etc/shorewall
- that defines a network partitioning into zones
+ a parameter file installed in /etc/shorewall that defines a network
+ partitioning into zones
@@ -78,8 +82,9 @@
policy
- a parameter file installed in /etc/shorewall
- that establishes overall firewall policy.
+ a parameter file installed in /etc/shorewall that establishes overall
+ firewall policy.
@@ -87,9 +92,10 @@
rules
- a parameter file installed in /etc/shorewall
- and used to express firewall rules that are exceptions to the
- high-level policies established in /etc/shorewall/policy.
+ a parameter file installed in /etc/shorewall and used to express
+ firewall rules that are exceptions to the high-level policies
+ established in /etc/shorewall/policy.
@@ -97,8 +103,9 @@
blacklist
- a parameter file installed in /etc/shorewall
- and used to list blacklisted IP/subnet/MAC addresses.
+ a parameter file installed in /etc/shorewall and used to list
+ blacklisted IP/subnet/MAC addresses.
@@ -106,9 +113,9 @@
ecn
- a parameter file installed in /etc/shorewall
- and used to selectively disable Explicit Congestion Notification
- (ECN - RFC 3168).
+ a parameter file installed in /etc/shorewall and used to selectively
+ disable Explicit Congestion Notification (ECN - RFC 3168).
@@ -117,7 +124,8 @@
a set of shell functions used by both the firewall and
- shorewall shell programs. Installed in /usr/share/shorewall.
+ shorewall shell programs. Installed in /usr/share/shorewall.
@@ -125,9 +133,10 @@
modules
- a parameter file installed in /etc/shorewall
- and that specifies kernel modules and their parameters. Shorewall
- will automatically load the modules specified in this file.
+ a parameter file installed in /etc/shorewall and that specifies
+ kernel modules and their parameters. Shorewall will automatically
+ load the modules specified in this file.
@@ -135,9 +144,9 @@
tos
- a parameter file installed in /etc/shorewall
- that is used to specify how the Type of Service (TOS) field in
- packets is to be set.
+ a parameter file installed in /etc/shorewall that is used to specify
+ how the Type of Service (TOS) field in packets is to be set.
@@ -145,10 +154,10 @@
init.sh and init.debian.sh
- a shell script installed in /etc/init.d
- to automatically start Shorewall during boot. The
- particular script installed depends on which distribution you are
- running.
+ a shell script installed in /etc/init.d to automatically start
+ Shorewall during boot. The particular script installed depends on
+ which distribution you are running.
@@ -156,8 +165,9 @@
interfaces
- a parameter file installed in /etc/shorewall
- and used to describe the interfaces on the firewall system.
+ a parameter file installed in /etc/shorewall and used to describe the
+ interfaces on the firewall system.
@@ -165,8 +175,9 @@
hosts
- a parameter file installed in /etc/shorewall
- and used to describe individual hosts or subnetworks in zones.
+ a parameter file installed in /etc/shorewall and used to describe
+ individual hosts or subnetworks in zones.
@@ -174,9 +185,10 @@
maclist
- a parameter file installed in /etc/shorewall
- and used to verify the MAC address (and possibly also the IP
- address(es)) of devices.
+ a parameter file installed in /etc/shorewall and used to verify the
+ MAC address (and possibly also the IP address(es)) of
+ devices.
@@ -185,7 +197,8 @@
This file also describes IP masquerading under Shorewall and
- is installed in /etc/shorewall.
+ is installed in /etc/shorewall.
@@ -195,7 +208,8 @@
a shell program that reads the configuration files in
/etc/shorewall and configures
- your firewall. This file is installed in /usr/share/shorewall.
+ your firewall. This file is installed in /usr/share/shorewall.
@@ -203,8 +217,9 @@
nat
- a parameter file in /etc/shorewall
- used to define one-to-one NAT.
+ a parameter file in /etc/shorewall used to define one-to-one NAT.
@@ -212,8 +227,9 @@
proxyarp
- a parameter file in /etc/shorewall
- used to define Proxy Arp.
+ a parameter file in /etc/shorewall used to define Proxy Arp.
@@ -221,9 +237,10 @@
rfc1918
- a parameter file in /usr/share/shorewall
- used to define the treatment of packets under the norfc1918 interface option.
+ a parameter file in /usr/share/shorewall used to define the
+ treatment of packets under the norfc1918
+ interface option.
@@ -231,9 +248,10 @@
bogons
- a parameter file in /usr/share/shorewall
- used to define the treatment of packets under the nobogons interface option.
+ a parameter file in /usr/share/shorewall used to define the
+ treatment of packets under the nobogons
+ interface option.
@@ -241,9 +259,9 @@
routestopped
- a parameter file in /etc/shorewall
- used to define those hosts that can access the firewall when
- Shorewall is stopped.
+ a parameter file in /etc/shorewall used to define those
+ hosts that can access the firewall when Shorewall is stopped.
@@ -261,8 +279,9 @@
tunnels
- a parameter file in /etc/shorewall
- used to define IPSec tunnels.
+ a parameter file in /etc/shorewall used to define IPSec
+ tunnels.
@@ -274,7 +293,8 @@
to control and monitor the firewall. This should be placed in
/sbin or in /usr/sbin (the install.sh script and
- the rpm install this file in /sbin).
+ the rpm install this file in /sbin).
@@ -282,9 +302,9 @@
accounting
- a parameter file in /etc/shorewall
- used to define traffic accounting rules. This file was added in
- version 1.4.7.
+ a parameter file in /etc/shorewall used to define traffic
+ accounting rules. This file was added in version 1.4.7.
@@ -292,8 +312,9 @@
version
- a file created in /usr/share/shorewall
- that describes the version of Shorewall installed on your system.
+ a file created in /usr/share/shorewall that describes the
+ version of Shorewall installed on your system.
@@ -305,7 +326,8 @@
files in /etc/shorewall
and /usr/share/shorewall
respectively that allow you to define your own actions for rules in
- /etc/shorewall/rules.
+ /etc/shorewall/rules.
@@ -313,8 +335,9 @@
actions.std and action.*
- files in /usr/share/shorewall
- that define the actions included as a standard part of Shorewall.
+ files in /usr/share/shorewall that define the
+ actions included as a standard part of Shorewall.
@@ -348,7 +371,8 @@ NET_OPTIONS=blacklist,norfc1918
net eth0 130.252.100.255 blacklist,norfc1918
- Variables may be used anywhere in the other configuration files.
+ Variables may be used anywhere in the other configuration
+ files.
@@ -380,7 +404,8 @@ NET_OPTIONS=blacklist,norfc1918
DISPLAY
- The name of the zone as displayed during Shorewall startup.
+ The name of the zone as displayed during Shorewall
+ startup.
@@ -399,25 +424,28 @@ net Net Internet
loc Local Local networks
dmz DMZ Demilitarized zone
- You may add, delete and modify entries in the /etc/shorewall/zones
- file as desired so long as you have at least one zone defined.
+ You may add, delete and modify entries in the
+ /etc/shorewall/zones file as desired so long as you
+ have at least one zone defined.
- If you rename or delete a zone, you should perform shorewall
- stop; shorewall start to install the change rather
- than shorewall restart.
+ If you rename or delete a zone, you should perform
+ shorewall stop; shorewall start to
+ install the change rather than shorewall
+ restart.
- The order of entries in the /etc/shorewall/zones
- file is significant in some cases.
+ The order of entries in the
+ /etc/shorewall/zones file is significant in some cases./etc/shorewall/interfaces
- This file is used to tell the firewall which of your firewall's
+ This file is used to tell the firewall which of your firewall's
network interfaces are connected to which zone. There will be one entry in
/etc/shorewall/interfaces for each of your interfaces. Columns in an entry
are:
@@ -462,12 +490,14 @@ dmz DMZ Demilitarized zone
- the interface must be up before you start your firewall
+ the interface must be up before you start your
+ firewallthe interface must only be attached to a single
- sub-network (i.e., there must have a single broadcast address).
+ sub-network (i.e., there must have a single broadcast
+ address).
@@ -477,7 +507,8 @@ dmz DMZ Demilitarized zone
OPTIONS
- a comma-separated list of options. Possible options include:
+ a comma-separated list of options. Possible options
+ include:
@@ -485,7 +516,7 @@ dmz DMZ Demilitarized zone
(Added in version 1.4.7) - This option causes
- /proc/sys/net/ipv4/conf/<interface>/arp_filter
+ /proc/sys/net/ipv4/conf/<interface>/arp_filter
to be set with the result that this interface will only answer
ARP who-has requests from hosts that are routed
out of that interface. Setting this option facilitates testing
@@ -516,7 +547,8 @@ dmz DMZ Demilitarized zone
(Added in version 1.4.2) - This option causes Shorewall
to set up handling for routing packets that arrive on this
interface back out the same interface. If this option is
- specified, the ZONE column may not contain -.
+ specified, the ZONE column may not contain
+ -.
@@ -531,7 +563,8 @@ dmz DMZ Demilitarized zone
typically used for silent port scans. Packets
failing these checks are logged according to the
TCP_FLAGS_LOG_LEVEL option in and are
- disposed of according to the TCP_FLAGS_DISPOSITION option.
+ disposed of according to the TCP_FLAGS_DISPOSITION
+ option.
@@ -540,7 +573,8 @@ dmz DMZ Demilitarized zone
This option causes incoming packets on this interface to
- be checked against the blacklist.
+ be checked against the blacklist.
@@ -579,10 +613,10 @@ dmz DMZ Demilitarized zone
within their own infrastructure. Also, many cable and DSL
modems have an RFC 1918 address that can be
used through a web browser for management and monitoring
- functions. If you want to specify norfc1918
- on your external interface but need to allow access to certain
- addresses from the above list, see FAQ
- 14.
+ functions. If you want to specify norfc1918 on your external interface
+ but need to allow access to certain addresses from the above
+ list, see FAQ 14.
@@ -601,7 +635,7 @@ dmz DMZ Demilitarized zone
routefilter
- Invoke the Kernel's route filtering (anti-spoofing)
+ Invoke the Kernel's route filtering (anti-spoofing)
facility on this interface. The kernel will reject any packets
incoming on this interface that have a source address that
would be routed outbound through another interface on the
@@ -619,7 +653,8 @@ dmz DMZ Demilitarized zone
(Added in version 1.3.5) - This option causes Shorewall
- to set /proc/sys/net/ipv4/conf/<interface>/proxy_arp
+ to set
+ /proc/sys/net/ipv4/conf/<interface>/proxy_arp
and is used when implementing Proxy ARP Sub-netting as
described at http://www.tldp.org/HOWTO/mini/Proxy-ARP-Subnet/.
@@ -664,7 +699,8 @@ dmz DMZ Demilitarized zone
they do not have a broadcast or multicast address as their
source. Any such packets will be dropped after being
optionally logged according to the setting of SMURF_LOG_LEVEL
- in /etc/shorewall/shorewall.conf.
+ in /etc/shorewall/shorewall.conf.
@@ -673,11 +709,13 @@ dmz DMZ Demilitarized zone
- External Interface -- tcpflags,blacklist,norfc1918,routefilter,nosmurfs
+ External Interface -- tcpflags,blacklist,norfc1918,routefilter,nosmurfs
- Wireless Interface -- maclist,routefilter,tcpflags,detectnets,nosmurfs
+ Wireless Interface -- maclist,routefilter,tcpflags,detectnets,nosmurfs
@@ -693,8 +731,9 @@ dmz DMZ Demilitarized zone
You have a conventional firewall setup in which eth0 connects to
a Cable or DSL modem and eth1 connects to your local network and eth0
gets its IP address via DHCP. You want to check all packets entering
- from the internet against the black list.
- Your /etc/shorewall/interfaces file would be as follows:
+ from the internet against the black
+ list. Your /etc/shorewall/interfaces file would be as
+ follows:
#ZONE INTERFACE BROADCAST OPTIONS
net eth0 detect dhcp,norfc1918,blacklist
@@ -726,12 +765,13 @@ loc eth1 192.168.1.255,192.168.12.255
purpose of the /etc/shorewall/hosts file.
- The only time that you need entries in /etc/shorewall/hosts
- is where you have more than one zone
- connecting through a single interface.
+ The only time that you need entries in
+ /etc/shorewall/hosts is where you have more than one zone connecting through a single
+ interface.
- IF YOU DON'T HAVE THIS SITUATION THEN
- DON'T TOUCH THIS FILE!!
+ IF YOU DON'T HAVE THIS SITUATION THEN DON'T
+ TOUCH THIS FILE!!Columns in this file are:
@@ -751,8 +791,8 @@ loc eth1 192.168.1.255,192.168.12.255
The name of an interface defined in the /etc/shorewall/interfaces file followed
- by a colon (":") and a comma-separated list whose elements
- are either:
+ by a colon (":") and a comma-separated list whose elements are
+ either:
@@ -760,8 +800,9 @@ loc eth1 192.168.1.255,192.168.12.255
- A subnetwork in the form <subnet-address>/<mask
- width>
+ A subnetwork in the form
+ <subnet-address>/<mask
+ width>
@@ -769,8 +810,8 @@ loc eth1 192.168.1.255,192.168.12.255
only allowed when the interface names a bridge created by the
brctl addbr command. This port must not be
defined in /etc/shorewall/interfaces and
- may optionally followed by a colon (":") and a host or
- network IP. See the bridging
+ may optionally followed by a colon (":") and a host or network
+ IP. See the bridging
documentation for details.
@@ -832,7 +873,8 @@ loc eth1 192.168.1.255,192.168.12.255
This option causes incoming packets on this port to be
- checked against the blacklist.
+ checked against the blacklist.
@@ -878,12 +920,12 @@ loc eth1 192.168.1.255,192.168.12.255
- If you don't define any hosts for a zone, the hosts in the zone
+ If you don't define any hosts for a zone, the hosts in the zone
default to i0:0.0.0.0/0 , i1:0.0.0.0/0, ... where i0, i1, ... are the
interfaces to the zone.
- You probably DON'T want to specify any hosts for your internet
+ You probably DON'T want to specify any hosts for your internet
zone since the hosts that you specify will be the only ones that you
will be able to access without adding additional rules.
@@ -960,10 +1002,10 @@ loc eth1:192.168.1.0/24,192.168.12.0/24
Policies defined in /etc/shorewall/policy describe
which zones are allowed to establish connections with other zones.
- Policies established in /etc/shorewall/policy can
- be viewed as default policies. If no rule in /etc/shorewall/rules applies
- to a particular connection request then the policy from
- /etc/shorewall/policy is applied.
+ Policies established in /etc/shorewall/policy
+ can be viewed as default policies. If no rule in
+ /etc/shorewall/rules applies to a particular connection request then the
+ policy from /etc/shorewall/policy is applied.Five policies are defined:
@@ -989,7 +1031,8 @@ loc eth1:192.168.1.0/24,192.168.12.0/24
The connection request is rejected with an RST (TCP) or an
- ICMP destination-unreachable packet being returned to the client.
+ ICMP destination-unreachable packet being returned to the
+ client.
@@ -1021,7 +1064,8 @@ loc eth1:192.168.1.0/24,192.168.12.0/24
that you want a message sent to your system log each time that the policy
is applied.
- Entries in /etc/shorewall/policy have four columns as follows:
+ Entries in /etc/shorewall/policy have four columns as
+ follows:
@@ -1072,16 +1116,18 @@ loc eth1:192.168.1.0/24,192.168.12.0/24
If left empty, TCP connection requests from the SOURCE zone to the DEST
- zone will not be rate-limited. Otherwise, this column specifies the
- maximum rate at which TCP connection requests will be accepted
- followed by a colon (:) followed by the maximum burst
- size that will be tolerated. Example: 10/sec:40
+ role="bold">SOURCE zone to the DEST zone will not be rate-limited.
+ Otherwise, this column specifies the maximum rate at which TCP
+ connection requests will be accepted followed by a colon
+ (:) followed by the maximum burst size that will be
+ tolerated. Example: 10/sec:40
specifies that the maximum rate of TCP connection requests allowed
will be 10 per second and a burst of 40 connections will be
tolerated. Connection requests in excess of these limits will be
- dropped. See the rules file documentation
- for an explaination of how rate limiting works.
+ dropped. See the rules file
+ documentation for an explaination of how rate limiting
+ works.
@@ -1116,12 +1162,12 @@ all all REJECT info
- The firewall script processes the /etc/shorewall/policy
- file from top to bottom and uses the first
- applicable policy that it finds. For example, in the
- following policy file, the policy for (loc, loc) connections would be
- ACCEPT as specified in the first entry even though the third entry in
- the file specifies REJECT.
+ The firewall script processes the
+ /etc/shorewall/policy file from top to bottom and
+ uses the first applicable policy that it
+ finds. For example, in the following policy file, the policy
+ for (loc, loc) connections would be ACCEPT as specified in the first
+ entry even though the third entry in the file specifies REJECT.#SOURCE DEST POLICY LOG LEVEL LIMIT:BURST
loc all ACCEPT
@@ -1140,7 +1186,8 @@ loc loc REJECT info
specify all in either the SOURCE or DEST column) and that
there are no rules concerning connections from that zone to itself. If
there is an explicit policy or if there are one or more rules, then
- traffic within the zone is handled just like traffic between zones is.
+ traffic within the zone is handled just like traffic between zones
+ is.
Any time that you have multiple interfaces associated with a
single zone, you should ask yourself if you really want traffic routed
@@ -1150,22 +1197,22 @@ loc loc REJECT info
Multiple net interfaces to different ISPs. You
- don't want to route traffic from one ISP to the other through
- your firewall.
+ don't want to route traffic from one ISP to the other through your
+ firewall.
- Multiple VPN clients. You don't necessarily want them to
- all be able to communicate between themselves using your
+ Multiple VPN clients. You don't necessarily want them to all
+ be able to communicate between themselves using your
gateway/router.Beginning with Shorewall 2.0.0, you can control the traffic from
- the firewall to itself. As with any zone, fw->fw traffic is enabled
+ the firewall to itself. As with any zone, fw->fw traffic is enabled
by default. It is not necessary to define the loopback interface (lo) in
/etc/shorewall/interfaces in order to
- define fw->fw rules or a fw->fw policy.
+ define fw->fw rules or a fw->fw policy.
So long as there are no intra-zone rules for a zone, all
@@ -1180,15 +1227,15 @@ loc loc REJECT info
The CONTINUE policy
- Where zones are nested or overlapping,
- the CONTINUE policy allows hosts that are within multiple zones to be
- managed under the rules of all of these zones. Let's look at an
- example:
+ Where zones are nested or
+ overlapping, the CONTINUE policy allows hosts that are within
+ multiple zones to be managed under the rules of all of these zones.
+ Let's look at an example:/etc/shorewall/zones:#ZONE DISPLAY COMMENTS
-sam Sam Sam's system at home
+sam Sam Sam's system at home
net Internet The Internet
loc Local Local Network
@@ -1205,11 +1252,13 @@ net eth0:0.0.0.0/0
sam eth0:206.191.149.197
- Sam's home system is a member of both the sam zone and the net
- zone and as described above , that means
- that sam must be listed before
- net in /etc/shorewall/zones.
+ Sam's home system is a member of both the sam zone and the net zone and as
+ described above , that means that sam must be listed before net in
+ /etc/shorewall/zones./etc/shorewall/policy:
@@ -1225,8 +1274,9 @@ all all REJECT info
zone is sam and if there is no match
then the connection request should be treated under rules where the
source zone is net. It is important
- that this policy be listed BEFORE the next policy (net
- to all).
+ that this policy be listed BEFORE the next policy (net to all).
Partial /etc/shorewall/rules:
@@ -1236,19 +1286,19 @@ DNAT sam loc:192.168.1.3 tcp ssh
DNAT net loc:192.168.1.5 tcp www
...
- Given these two rules, Sam can connect to the firewall's
- internet interface with ssh and the connection request will be forwarded
- to 192.168.1.3. Like all hosts in the net
- zone, Sam can connect to the firewall's internet interface on TCP
- port 80 and the connection request will be forwarded to 192.168.1.5. The
+ Given these two rules, Sam can connect to the firewall's internet
+ interface with ssh and the connection request will be forwarded to
+ 192.168.1.3. Like all hosts in the net
+ zone, Sam can connect to the firewall's internet interface on TCP port
+ 80 and the connection request will be forwarded to 192.168.1.5. The
order of the rules is not significant.Sometimes it is necessary to suppress port forwarding
for a sub-zone. For example, suppose that all hosts can SSH to the
firewall and be forwarded to 192.168.1.5 EXCEPT Sam. When Sam connects
- to the firewall's external IP, he should be connected to the
- firewall itself. Because of the way that Netfilter is constructed, this
- requires two rules as follows:
+ to the firewall's external IP, he should be connected to the firewall
+ itself. Because of the way that Netfilter is constructed, this requires
+ two rules as follows:#ACTION SOURCE DEST PROTO DEST PORT(S)
...
@@ -1270,12 +1320,12 @@ DNAT net loc:192.168.1.3 tcp ssh
/etc/shorewall/rulesThe /etc/shorewall/rules file defines
- exceptions to the policies established in the /etc/shorewall/policy
- file. There is one entry in /etc/shorewall/rules for each of these rules.
- Entries in this file only govern the establishment of new connections —
- packets that are part of an existing connection or that establish a
- connection that is related to an existing connection are automatically
- accepted.
+ exceptions to the policies established in the
+ /etc/shorewall/policy file. There is one entry in
+ /etc/shorewall/rules for each of these rules. Entries in this file only
+ govern the establishment of new connections — packets that are part of an
+ existing connection or that establish a connection that is related to an
+ existing connection are automatically accepted.
Rules for each pair of zones (source zone, destination zone) are
evaluated in the order that they appear in the file — the first match
@@ -1296,7 +1346,8 @@ DNAT net loc:192.168.1.3 tcp ssh
CONTINUE rules may cause the connection request to be
- reprocessed using a different (source zone, destination zone) pair.
+ reprocessed using a different (source zone, destination zone)
+ pair.
@@ -1317,15 +1368,37 @@ DNAT net loc:192.168.1.3 tcp ssh
+
+ ACCEPT+
+
+
+ Added in Shorewall 2.0.2 Beta 2. Works like ACCEPT but
+ also exempts the connection from matching DNAT and REDIRECT
+ rules later in the file.
+
+
+
+
+ NONAT
+
+
+ Added in Shorewall 2.0.2 Beta 2. Exempts matching
+ connections from DNAT and REDIRECT rules later in the
+ file.
+
+
+
DNATCauses the connection request to be forwarded to the
system specified in the DEST column (port forwarding).
- DNAT stands for Destination
- Network Address
- Translation
+ DNAT stands for Destination Network Address Translation
@@ -1333,7 +1406,8 @@ DNAT net loc:192.168.1.3 tcp ssh
DNAT-
- The above ACTION (DNAT) generates two iptables rules:
+ The above ACTION (DNAT) generates two iptables
+ rules:
@@ -1342,8 +1416,8 @@ DNAT net loc:192.168.1.3 tcp ssh
- an ACCEPT rule in the Netfilter filter
- table.
+ an ACCEPT rule in the Netfilter
+ filter table.
@@ -1375,8 +1449,8 @@ DNAT net loc:192.168.1.3 tcp ssh
- an ACCEPT rule in the Netfilter filter
- table.
+ an ACCEPT rule in the Netfilter
+ filter table.
@@ -1389,7 +1463,8 @@ DNAT net loc:192.168.1.3 tcp ssh
LOG
- Log the packet -- requires a syslog level (see below).
+ Log the packet -- requires a syslog level (see
+ below).
@@ -1404,20 +1479,22 @@ DNAT net loc:192.168.1.3 tcp ssh
When the protocol specified in the PROTO column is TCP
- (tcp, TCP or 6),
- Shorewall will only pass connection requests (SYN packets)
- to user space. This is for compatibility with ftwall.
+ (tcp, TCP or
+ 6), Shorewall will only pass connection
+ requests (SYN packets) to user space. This is for
+ compatibility with ftwall.
- <defined
- action>
+ <defined
+ action>(Shorewall 1.4.9 and later) - An action defined in the
- /etc/shorewall/actions
+ /etc/shorewall/actions
file.
@@ -1428,7 +1505,19 @@ DNAT net loc:192.168.1.3 tcp ssh
REJECT:info or ACCEPT:debug). This causes the packet to be logged at
the specified level prior to being processed according to the
specified ACTION. Note: if the ACTION is LOG then you MUST specify a
- syslog level.
+ syslog level. Beginning with Shorewall version 2.0.2 Beta 1, a
+ log tag may be specified. A log tag is a
+ string of alphanumeric characters and is specified by following the
+ log level with ":" and the log tag. Example:ACCEPT:info:ftp net dmz tcp 21
+The log tag is appended to the log prefix generated by the
+ LOGPREFIX variable in /etc/shorewall/conf. If
+ "ACCEPT:info" generates the log prefix "Shorewall:net2dmz:ACCEPT:"
+ then "ACCEPT:info:ftp" will generate "Shorewall:net2dmz:ACCEPT:ftp "
+ (note the trailing blank). The maximum length of a log prefix
+ supported by iptables is 29 characters; if a larger prefix is
+ generated, Shorewall will issue a warning message and will truncate
+ the prefix to 29 characters.
The use of DNAT or REDIRECT requires that you have NAT enabled
in your kernel configuration.
@@ -1449,7 +1538,8 @@ DNAT net loc:192.168.1.3 tcp ssh
If the source is not all then the source may be
further restricted by adding a colon (:) followed by
- a comma-separated list of qualifiers. Qualifiers are may include:
+ a comma-separated list of qualifiers. Qualifiers are may
+ include:
@@ -1460,7 +1550,8 @@ DNAT net loc:192.168.1.3 tcp ssh
specified interface (example loc:eth4). Beginning with
Shorwall 1.3.9, the interface name may optionally be followed
by a colon (:) and an IP address or subnet
- (examples: loc:eth4:192.168.4.22, net:eth0:192.0.2.0/24).
+ (examples: loc:eth4:192.168.4.22,
+ net:eth0:192.0.2.0/24).
@@ -1478,7 +1569,8 @@ DNAT net loc:192.168.1.3 tcp ssh
MAC Address
- in Shorewall
+ in Shorewall
format.
@@ -1538,13 +1630,14 @@ DNAT net loc:192.168.1.3 tcp ssh
Unlike in the SOURCE column, a range of IP addresses may be
- specified in the DEST column as <first address>-<last
- address>. When the ACTION is DNAT or DNAT-,
- connections will be assigned to the addresses in the range in a
- round-robin fashion (load-balancing). This
- feature is available with DNAT rules only with Shorewall 1.4.6 and
- later versions; it is available with DNAT- rules in all versions
- that support DNAT-.
+ specified in the DEST column as <first
+ address>-<last address>.
+ When the ACTION is DNAT or DNAT-, connections will be assigned to
+ the addresses in the range in a round-robin fashion
+ (load-balancing). This feature is available
+ with DNAT rules only with Shorewall 1.4.6 and later versions; it is
+ available with DNAT- rules in all versions that support
+ DNAT-.
@@ -1562,11 +1655,11 @@ DNAT net loc:192.168.1.3 tcp ssh
DEST PORT(S)
- Port or port range (<low port>:<high port>)
- being connected to. May only be specified if the protocol is tcp,
- udp or icmp. For icmp, this column's contents are interpreted as
- an icmp type. If you don't want to specify DEST PORT(S) but need
- to include information in one of the columns to the right, enter
+ Port or port range (<low port>:<high port>) being
+ connected to. May only be specified if the protocol is tcp, udp or
+ icmp. For icmp, this column's contents are interpreted as an icmp
+ type. If you don't want to specify DEST PORT(S) but need to include
+ information in one of the columns to the right, enter
- in this column. You may give a list of ports and/or
port ranges separated by commas. Port numbers may be either integers
or service names from /etc/services.
@@ -1578,13 +1671,13 @@ DNAT net loc:192.168.1.3 tcp ssh
May be used to restrict the rule to a particular client port
- or port range (a port range is specified as <low port
- number>:<high port number>). If you don't want to
- restrict client ports but want to specify something in the next
- column, enter - in this column. If you wish to
- specify a list of port number or ranges, separate the list elements
- with commas (with no embedded white space). Port numbers may be
- either integers or service names from /etc/services.
+ or port range (a port range is specified as <low port
+ number>:<high port number>). If you don't want to restrict
+ client ports but want to specify something in the next column, enter
+ - in this column. If you wish to specify a list of
+ port number or ranges, separate the list elements with commas (with
+ no embedded white space). Port numbers may be either integers or
+ service names from /etc/services.
@@ -1648,19 +1741,20 @@ DNAT loc:192.168.1.0/24 loc:192.168.1.3 tcp
ACCEPT, DNAT[-], REDIRECT[-] or LOG rules with an entry in this
column. Entries have the form
- <rate>/<interval>[:<burst>]
+ <rate>/<interval>[:<burst>]
- where <rate> is the number of connections per
- <interval> (sec or min) and
- <burst> is the largest burst permitted. If no burst value is
+ where <rate> is the number of connections per
+ <interval> (sec or min) and
+ <burst> is the largest burst permitted. If no burst value is
given, a value of 5 is assumed.
- There may be no whitespace embedded in the specification.
+ There may be no whitespace embedded in the
+ specification.
- Let's take
+ Let's take
- ACCEPT<2/sec:4> net dmz tcp 80
+ ACCEPT<2/sec:4> net dmz tcp 80The first time this rule is reached, the packet will be
accepted; in fact, since the burst is 4, the first four packets
@@ -1702,7 +1796,7 @@ DNAT loc:192.168.1.0/24 loc:192.168.1.3 tcp
to 4/minute with a burst of 8 (Shorewall 1.4.7 and later only):
#ACTION SOURCE DEST PROTO DEST PORT(S)
-DNAT<4/min:8> net loc:192.168.1.3 tcp ssh
+DNAT<4/min:8> net loc:192.168.1.3 tcp ssh
@@ -1736,15 +1830,19 @@ ACCEPT loc dmz:155.186.235.222 tcp www
server to be accessible from the internet in addition to the local
192.168.1.0/24 and dmz 192.168.2.0/24 subnetworks.
- since the server is in the 192.168.2.0/24 subnetwork,
- we can assume that access to the server from that subnet will not
- involve the firewall (but see FAQ 2)unless
- you have more than one external IP address, you can leave the ORIGINAL
- DEST column blank in the first rule. You cannot leave it blank in the
- second rule though because then all ftp connections originating in the
- local subnet 192.168.1.0/24 would be sent to 192.168.2.2 regardless of
- the site that the user was trying to connect to. That is clearly not
- what you want.
+
+ since the server is in the 192.168.2.0/24 subnetwork, we can
+ assume that access to the server from that subnet will not involve
+ the firewall (but see FAQ
+ 2)
+
+ unless you have more than one external IP address, you can
+ leave the ORIGINAL DEST column blank in the first rule. You cannot
+ leave it blank in the second rule though because then all ftp
+ connections originating in the local subnet 192.168.1.0/24 would be
+ sent to 192.168.2.2 regardless of the site that the user was trying
+ to connect to. That is clearly not what you want.
+ #ACTION SOURCE DEST PROTO DEST PORT(S) SOURCE ORIGINAL
# PORT(S) DEST
@@ -1781,15 +1879,18 @@ ACCEPT loc:~02-00-08-E3-FA-55 dmz all#ACTION SOURCE DEST PROTO DEST PORT(S)
ACCEPT all dmz tcp 25
- When all is used as a source or
- destination, intra-zone traffic is not affected. In this example, if
- there were two DMZ interfaces then the above rule would NOT enable SMTP
- traffic between hosts on these interfaces.
+
+ When all is used as a source or destination,
+ intra-zone traffic is not affected. In this example, if there were
+ two DMZ interfaces then the above rule would NOT enable SMTP traffic
+ between hosts on these interfaces.
+
- Your firewall's external interface has several IP addresses
- but you only want to accept SSH connections on address 206.124.146.176.
+ Your firewall's external interface has several IP addresses but
+ you only want to accept SSH connections on address
+ 206.124.146.176.#ACTION SOURCE DEST PROTO DEST PORT(S)
ACCEPT net fw:206.124.146.176 tcp 22
@@ -1822,7 +1923,29 @@ ACCEPT net dmz:192.0.2.177 tcp 25
DNAT net loc:192.168.1.101-192.168.1.109 tcp 80
- Look here for information on other services.
+
+ (Shorewall 2.0.2 Beta 2 and Later). You want to redirect all
+ local www connection requests EXCEPT those from 192.168.1.4 and
+ 192.168.1.199 to a Squid transparent proxy running on the firewall and
+ listening on port 3128.
+
+ #ACTION SOURCE DEST PROTO DEST PORT(S) SOURCE ORIGINAL
+# PORT(S) DEST
+NONAT loc:192.168.1.4,192.168.1.199 \
+ net tcp www
+REDIRECT loc 3128 tcp www -
+ACCEPT fw net tcp www
+
+ The reason that NONAT is used in the above example rather than
+ ACCEPT+ is that the example is assuming the usual ACCEPT loc->net
+ policy. Since traffic from the local zone to the internet zone is
+ accepted anyway, adding an additional ACCEPT rule is unnecessary and all
+ that is required is to avoid the REDIRECT rule for HTTP connection
+ requests from the two listed IP addresses.
+
+
+ Look here for information on other
+ services.
@@ -1845,13 +1968,15 @@ DNAT net loc:192.168.1.101-192.168.1.109 tcp 80
optionally qualified by adding : and a subnet or host
IP. When this qualification is added, only packets addressed to that
host or subnet will be masqueraded. Beginning with Shorewall version
- 1.4.10, the interface name can be qualified with ":"
- followed by a comma separated list of hosts and/or subnets. If this
- list begins with ! (e.g., eth0:!192.0.2.8/29,192.0.2.32/29)
- then only packets addressed to destinations not
- listed will be masqueraded; otherwise (e.g., eth0:192.0.2.8/29,192.0.2.32/29),
- traffic will be masqueraded if it does
- match one of the listed addresses.
+ 1.4.10, the interface name can be qualified with ":" followed by a
+ comma separated list of hosts and/or subnets. If this list begins
+ with ! (e.g.,
+ eth0:!192.0.2.8/29,192.0.2.32/29) then only packets
+ addressed to destinations not
+ listed will be masqueraded; otherwise (e.g.,
+ eth0:192.0.2.8/29,192.0.2.32/29), traffic will be
+ masqueraded if it does match one of
+ the listed addresses.
Beginning with Shorewall version 1.3.14, if you have set
ADD_SNAT_ALIASES=Yes in , you can cause
@@ -1912,6 +2037,48 @@ DNAT net loc:192.168.1.101-192.168.1.109 tcp 80
will use all listed ranges/addresses in rounde-robin fashion.
+
+
+ PROTO (Added in Shorewall version 2.0.2 Beta 1)
+
+
+ If specified, must be a protocol number of a protocol name
+ from /etc/protocols. Restricts the SNAT or Masquerade to that
+ protocol.
+
+
+
+
+ PORT(S) (Added in Shorewall version 2.0.2 Beta 1)
+
+
+ If the PROTO column specifies TCP (6) or UDP (17) then this
+ column may be used to restrict to SNAT or Masquerade to traffic with
+ a certain destination port or a set of destination ports. The column
+ may contain:
+
+
+
+ A port number or a port name from /etc/services.
+
+
+
+ A comma-separated list of port numbers and/or port names.
+ Your kernel must have Multiport match support. You can tell if
+ your kernel has this support by issuing a shorewall
+ check command and looking at the output under
+ Shorewall has detected the following iptables/netfilter
+ capabilities:.
+
+
+
+ A range of port numbers of the form <low
+ port>:<high
+ port>
+
+
+
+
@@ -1934,7 +2101,7 @@ ipsec0:10.1.0.0/16 192.168.9.0/24
You have a DSL line connected on eth0 and a local network
- (192.168.10.0/24) connected to eth1. You want all local->net
+ (192.168.10.0/24) connected to eth1. You want all local->net
connections to use source address 206.124.146.176.#INTERFACE SUBNET ADDRESS
@@ -1950,18 +2117,18 @@ eth0 192.168.10.0/24!192.168.10.44,192.168.10.45 206.124.146.176
- (Shorewall version >= 1.3.14):
- You have a second IP address (206.124.146.177) assigned to you and wish
- to use it for SNAT of the subnet 192.168.12.0/24. You want to give that
- address the name eth0:0. You must have ADD_SNAT_ALIASES=Yes in .
+ (Shorewall version >=
+ 1.3.14): You have a second IP address (206.124.146.177)
+ assigned to you and wish to use it for SNAT of the subnet
+ 192.168.12.0/24. You want to give that address the name eth0:0. You must
+ have ADD_SNAT_ALIASES=Yes in .#INTERFACE SUBNET ADDRESS
eth0:0 192.168.12.0/24 206.124.146.177
- (Shorewall version >= 1.4.7):
+ (Shorewall version >= 1.4.7):
You want to use both 206.124.146.177 and 206.124.146.179 for SNAT of the
subnet 192.168.12.0/24. Each address will be used on alternate outbound
connections.
@@ -1969,6 +2136,21 @@ eth0:0 192.168.12.0/24 206.124.146.177#INTERFACE SUBNET ADDRESS
eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
+
+
+ (Shorewall version >= 2.0.2 Beta
+ 1): You want all outgoing SMTP traffic entering the firewall
+ on eth1 to be sent from eth0 with source IP address 206.124.146.177. You
+ want all other outgoing traffic from eth1 to be sent from eth0 with
+ source IP address 206.124.146.176.
+
+ #INTERFACE SUBNET ADDRESS PROTO PORT(S)
+eth0 eth1 206.124.146.177 tcp 25
+eth0 eth1 206.124.146.176
+
+ Note that the order of the entries in the above example is
+ important.
+
@@ -1978,10 +2160,11 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179Proxy ARP Subnet
Mini HOWTO. If you decide to use the technique described in that
- HOWTO, you can set the proxy_arp flag for an interface (/proc/sys/net/ipv4/conf/<interface>/proxy_arp)
+ HOWTO, you can set the proxy_arp flag for an interface
+ (/proc/sys/net/ipv4/conf/<interface>/proxy_arp)
by including the proxyarp option in the
- interface's record in . When using Proxy
- ARP sub-netting, you do NOT include any
+ interface's record in . When using Proxy ARP
+ sub-netting, you do NOT include any
entries in /etc/shorewall/proxyarp.
The /etc/shorewall/proxyarp file is used to
@@ -2032,33 +2215,33 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179PERSISTENT
- If you specify "No" or "no" in the HAVEROUTE
- column, Shorewall will automatically add a route to the host in the
- ADDRESS column through the interface in the INTERFACE column. If you
- enter No or no in the PERSISTENT
- column or if you leave the column empty, that route will be deleted
- if you issue a shorewall stop or
- shorewall clear command. If you place
- Yes or yes in the PERSISTENT column,
- then those commands will not cause the route to be deleted.
+ If you specify "No" or "no" in the HAVEROUTE column, Shorewall
+ will automatically add a route to the host in the ADDRESS column
+ through the interface in the INTERFACE column. If you enter
+ No or no in the PERSISTENT column or
+ if you leave the column empty, that route will be deleted if you
+ issue a shorewall stop or shorewall
+ clear command. If you place Yes or
+ yes in the PERSISTENT column, then those commands
+ will not cause the route to be deleted.
- After you have made a change to the /etc/shorewall/proxyarp
- file, you may need to flush the ARP cache of all routers on
- the LAN segment connected to the interface specified in the EXTERNAL
- column of the change/added entry(s). If you are having problems
- communicating between an individual host (A) on that segment and a
- system whose entry has changed, you may need to flush the ARP cache on
- host A as well.
+ After you have made a change to the
+ /etc/shorewall/proxyarp file, you may need to flush
+ the ARP cache of all routers on the LAN segment connected to the
+ interface specified in the EXTERNAL column of the change/added entry(s).
+ If you are having problems communicating between an individual host (A)
+ on that segment and a system whose entry has changed, you may need to
+ flush the ARP cache on host A as well.ISPs typically have ARP configured with long TTL (hours!) so if
your ISPs router has a stale cache entry (as seen using tcpdump
- -nei <external interface> host <IP addr>), it
- may take a long while to time out. I personally have had to contact my
- ISP and ask them to delete a stale entry in order to restore a system to
+ -nei <external interface> host <IP addr>), it may
+ take a long while to time out. I personally have had to contact my ISP
+ and ask them to delete a stale entry in order to restore a system to
working order after changing my proxy ARP settings.
@@ -2072,18 +2255,21 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179In your DMZ, you want to install a Web/FTP server with public
address 155.186.235.4. On the Web server, you subnet just like the
- firewall's eth0 and you configure 155.186.235.1 as the default
- gateway. In your /etc/shorewall/proxyarp file, you
- will have:
+ firewall's eth0 and you configure 155.186.235.1 as the default gateway.
+ In your /etc/shorewall/proxyarp file, you will
+ have:
#ADDRESS INTERFACE EXTERNAL HAVEROUTE
155.186.235.4 eth2 eth0 NO
- You may want to configure the servers in your DMZ with
- a subnet that is smaller than the subnet of your internet interface. See
- the Proxy
- ARP Subnet Mini HOWTO for details. In this case you will want to
- place Yes in the HAVEROUTE column.
+
+ You may want to configure the servers in your DMZ with a
+ subnet that is smaller than the subnet of your internet interface.
+ See the Proxy ARP
+ Subnet Mini HOWTO for details. In this case you will want to
+ place Yes in the HAVEROUTE column.
+
@@ -2092,12 +2278,12 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179/etc/shorewall/proxyarp. I haven't had the time
- to debug this problem so I can't say if it is a bug in the Kernel or
- in FreeS/Wan.
+ /etc/shorewall/proxyarp. I haven't had the time to
+ debug this problem so I can't say if it is a bug in the Kernel or in
+ FreeS/Wan.
You might be able to work around
- this problem using the following (I haven't tried it):
+ this problem using the following (I haven't tried it):
In /etc/shorewall/init, include:
@@ -2120,10 +2306,11 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
If all you want to do is forward ports to servers behind your
firewall, you do NOT want to use one-to-one NAT. Port forwarding can be
- accomplished with simple entries in the rules file.
- Also, in most cases Proxy ARP provides a
- superior solution to one-to-one NAT because the internal systems are
- accessed using the same IP address internally and externally.
+ accomplished with simple entries in the rules
+ file. Also, in most cases Proxy
+ ARP provides a superior solution to one-to-one NAT because the
+ internal systems are accessed using the same IP address internally and
+ externally.
Columns in an entry are:
@@ -2181,13 +2368,17 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179LOCAL
- If Yes or yes and the ALL INTERFACES column contains Yes or
- yes, NAT will be effective from the firewall system.
+ If Yes or yes, NAT will be effective from the firewall system.
+ Note that with Shorewall 2.0.1 and earlier versions, this column was
+ ignored if the ALL INTERFACES column did not contain "Yes" or "yes".
+ Beginning with Shorewall 2.0.2 Beta 1, this column's contents are
+ independent of the value in ALL INTERFACES.For this to work, you must be running kernel 2.4.19 or later
and iptables 1.2.6a or later and you must have enabled CONFIG_IP_NF_NAT_LOCAL in your kernel.
+ role="bold">CONFIG_IP_NF_NAT_LOCAL in your
+ kernel.
@@ -2213,13 +2404,13 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
- Instructions for setting up IPSEC tunnels
- may be found here, instructions for IPIP and GRE
- tunnels are here, instructions for OpenVPN
- tunnels are here, instructions for PPTP
- tunnels are here, instructions for 6to4
- tunnels are here, and instructions for integrating Shorewall with other types of
+ Instructions for setting up IPSEC
+ tunnels may be found here, instructions for IPIP and GRE tunnels are here, instructions for
+ OpenVPN tunnels are here, instructions
+ for PPTP tunnels are here, instructions for
+ 6to4 tunnels are here, and instructions for
+ integrating Shorewall with other types of
tunnels are here.
@@ -2229,6 +2420,52 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179This file is used to set the following firewall parameters:
+
+ DYNAMIC_ZONES
+
+
+ (Added at version 2.0.2) - When set to Yes or yes, enables
+ dynamic zones.
+
+
+
+
+ CONFIG_PATH
+
+
+ (Added at version 2.0.2) - Specifies where configuration files
+ other than shorewall.conf may be found.
+ CONFIG_PATH is specifies as a list of directory names separated by
+ colons (":"). When looking for a configuration file other than
+ shorewall.conf:
+
+
+
+ If the command is "try" or if "-c <configuration
+ directory>" was specified in the command then the directory
+ given in the command is searched first.
+
+
+
+ Next, each directory in the CONFIG_PATH setting is
+ searched in sequence.
+
+
+
+ If CONFIG_PATH is not given or if it is set to the empty value
+ then the contents of
+ /usr/share/shorewall/configpath are used. As
+ released from shorewall.net, that file sets the CONFIG_PATH to
+ /etc/shorewall:/usr/share/shorewall
+ but your particular distribution may set it
+ differently.
+
+ Note that the setting in
+ /usr/share/shorewall/configpath is always used
+ to locate shorewall.conf.
+
+
+
BRIDGING
@@ -2244,9 +2481,10 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
(Added at version 2.0.0) - Specifies the logging level for
smurf packets (see the nosmurfs
- option in /etc/shorewall/interfaces).
- If set to the empty value ( SMURF_LOG_LEVEL="" ) then smurfs
- are not logged.
+ option in /etc/shorewall/interfaces). If set to
+ the empty value ( SMURF_LOG_LEVEL="" ) then smurfs are not
+ logged.
@@ -2256,8 +2494,8 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
(Added at version 1.4.9) - The value of this variable
determines the possible file extensions of kernel modules. The
- default value is "o gz ko and o.gz". See for more details.
+ default value is "o gz ko and o.gz". See
+ for more details.
@@ -2266,7 +2504,7 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
(Added at version 1.4.7) - The value of this variable affects
- Shorewall's stopped
+ Shorewall's stopped
state. When ADMINISABSENTMINDES=No, only traffic to/from
those addresses listed in /etc/shorewall/routestopped is accepted
when Shorewall is stopped.When ADMINISABSENTMINDED=Yes, in addition
@@ -2300,24 +2538,24 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179fireparse, set it as:
- LOGFORMAT="fp=%s:%d a=%s "
+ LOGFORMAT="fp=%s:%d a=%s "
- If the LOGFORMAT value contains the substring %d
- then the logging rule number is calculated and formatted in that
- position; if that substring is not included then the rule number is
- not included. If not supplied or supplied as empty
- (LOGFORMAT="") then Shorewall:%s:%s: is
+ If the LOGFORMAT value contains the substring
+ %d then the logging rule number is calculated and
+ formatted in that position; if that substring is not included then
+ the rule number is not included. If not supplied or supplied as
+ empty (LOGFORMAT="") then Shorewall:%s:%s: is
assumed./sbin/shorewall uses the leading part of
the LOGFORMAT string (up to but not including the first
- %) to find log messages in the show log,
- status and hits commands. This part
- should not be omitted (the LOGFORMAT should not begin with
- %) and the leading part should be sufficiently
- unique for /sbin/shorewall to identify
- Shorewall messages.
+ %) to find log messages in the show
+ log, status and hits
+ commands. This part should not be omitted (the LOGFORMAT should
+ not begin with %) and the leading part should be
+ sufficiently unique for /sbin/shorewall to
+ identify Shorewall messages.
@@ -2327,15 +2565,16 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
(Added at version 1.3.13) - If this option is set to
- No then Shorewall won't clear the current traffic
+ No then Shorewall won't clear the current traffic
control rules during [re]start. This setting is intended for use by
people that prefer to configure traffic shaping when the network
interfaces come up rather than when the firewall is started. If that
is what you want to do, set TC_ENABLED=Yes and CLEAR_TC=No and do
not supply an /etc/shorewall/tcstart file. That
- way, your traffic shaping rules can still use the fwmark
- classifier based on packet marking defined in
- /etc/shorewall/tcrules. If not specified, CLEAR_TC=Yes is assumed.
+ way, your traffic shaping rules can still use the
+ fwmark classifier based on packet marking defined in
+ /etc/shorewall/tcrules. If not specified, CLEAR_TC=Yes is
+ assumed.
@@ -2354,7 +2593,7 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179 command; if a FORWARD chain is
displayed then your kernel will support this option. If this option
is not specified or if it is given the empty value (e.g.,
- MARK_IN_FORWARD_CHAIN="") then MARK_IN_FORWARD_CHAIN=No is
+ MARK_IN_FORWARD_CHAIN="") then MARK_IN_FORWARD_CHAIN=No is
assumed.
@@ -2364,8 +2603,9 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
(Added at version 1.3.12) - This parameter determines the
- level at which packets logged under the norfc1918
- mechanism are logged. The value must be a valid norfc1918 mechanism are
+ logged. The value must be a valid syslog level and if no level is
given, then info is assumed. Prior to Shorewall version 1.3.12,
these packets are always logged at the info level.
@@ -2377,8 +2617,9 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
(Added at version 2.0.1) - This parameter determines the level
- at which packets logged under the nobogons
- mechanism are logged. The value must be a valid nobogons mechanism are
+ logged. The value must be a valid syslog level and if no level is
given, then info is assumed.
@@ -2393,8 +2634,8 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179tcpflags interface option and must have
a value of ACCEPT (accept the packet), REJECT (send an RST response)
or DROP (ignore the packet). If not set or if set to the empty value
- (e.g., TCP_FLAGS_DISPOSITION="") then
- TCP_FLAGS_DISPOSITION=DROP is assumed.
+ (e.g., TCP_FLAGS_DISPOSITION="") then TCP_FLAGS_DISPOSITION=DROP is
+ assumed.
@@ -2406,9 +2647,9 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179syslog level for logging
packets that fail the checks enabled by the tcpflags interface option.The value must
- be a valid syslogd log level. If you don't want to log these
+ be a valid syslogd log level. If you don't want to log these
packets, set to the empty value (e.g.,
- TCP_FLAGS_LOG_LEVEL="").
+ TCP_FLAGS_LOG_LEVEL="").
@@ -2421,7 +2662,7 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179 and must have the value ACCEPT (accept the
connection request anyway), REJECT (reject the connection request)
or DROP (ignore the connection request). If not set or if set to the
- empty value (e.g., MACLIST_DISPOSITION="") then
+ empty value (e.g., MACLIST_DISPOSITION="") then
MACLIST_DISPOSITION=REJECT is assumed.
@@ -2434,8 +2675,8 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179syslog level for logging
connection requests that fail MAC
Verification. The value must be a valid syslogd log level.
- If you don't want to log these connection requests, set to the
- empty value (e.g., MACLIST_LOG_LEVEL="").
+ If you don't want to log these connection requests, set to the empty
+ value (e.g., MACLIST_LOG_LEVEL="").
@@ -2464,7 +2705,8 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179syslog level at
- which you want the packets logged. Example: LOGNEWNOTSYN=ULOG|
+ which you want the packets logged. Example:
+ LOGNEWNOTSYN=ULOG|
Packets logged under this option are usually the result of
@@ -2484,8 +2726,8 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179No or no, Shorewall will not detect
this address and any destination IP address will match the DNAT
- rule. If not specified or empty, DETECT_DNAT_ADDRS=Yes
- is assumed.
+ rule. If not specified or empty,
+ DETECT_DNAT_ADDRS=Yes is assumed.
@@ -2519,8 +2761,8 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179This parameter should be set to the name of a file that the
firewall should create if it starts successfully and remove when it
stops. Creating and removing this file allows Shorewall to work with
- your distribution's initscripts. For RedHat, this should be set
- to /var/lock/subsys/shorewall. For Debian, the value is
+ your distribution's initscripts. For RedHat, this should be set to
+ /var/lock/subsys/shorewall. For Debian, the value is
/var/state/shorewall and in LEAF it is /var/run/shorwall. Example:
SUBSYSLOCK=/var/lock/subsys/shorewall.
@@ -2531,8 +2773,8 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
This parameter specifies the name of a directory where
- Shorewall stores state information. If the directory doesn't
- exist when Shorewall starts, it will create the directory. Example:
+ Shorewall stores state information. If the directory doesn't exist
+ when Shorewall starts, it will create the directory. Example:
STATEDIR=/tmp/shorewall.
@@ -2549,7 +2791,7 @@ eth0 192.168.12.0/24 206.124.146.177,206.124.146.179
This parameter specifies the directory where your kernel
netfilter modules may be found. If you leave the variable empty,
- Shorewall will supply the value "/lib/modules/`uname
+ Shorewall will supply the value "/lib/modules/`uname
-r`/kernel/net/ipv4/netfilter.
@@ -2577,7 +2819,8 @@ LOGBURST=5
be logged from the rule, regardless of how many packets reach it.
Also, every 6 seconds which passes without matching a packet, one
of the bursts will be regained; if no packets hit the rule for 30
- seconds, the burst will be fully recharged; back where we started.
+ seconds, the burst will be fully recharged; back where we
+ started.
@@ -2588,9 +2831,9 @@ LOGBURST=5
This parameter tells the /sbin/shorewall program where to look
for Shorewall messages when processing the show log,
- monitor, status and hits
- commands. If not assigned or if assigned an empty value,
- /var/log/messages is assumed.
+ monitor, status and
+ hits commands. If not assigned or if assigned an
+ empty value, /var/log/messages is assumed.
@@ -2630,7 +2873,7 @@ LOGBURST=5
If this variable is not set or is given an empty value
- (IP_FORWARD="") then IP_FORWARD=On is assumed.
+ (IP_FORWARD="") then IP_FORWARD=On is assumed.
@@ -2639,14 +2882,15 @@ LOGBURST=5
This parameter determines whether Shorewall automatically adds
- the external address(es) in .
- If the variable is set to Yes or yes
- then Shorewall automatically adds these aliases. If it is set to
- No or no, you must add these aliases
- yourself using your distribution's network configuration tools.
+ the external address(es) in . If the variable is set to Yes or
+ yes then Shorewall automatically adds these aliases.
+ If it is set to No or no, you must add
+ these aliases yourself using your distribution's network
+ configuration tools.
If this variable is not set or is given an empty value
- (ADD_IP_ALIASES="") then ADD_IP_ALIASES=Yes is assumed.
+ (ADD_IP_ALIASES="") then ADD_IP_ALIASES=Yes is assumed.
@@ -2659,10 +2903,11 @@ LOGBURST=5
the variable is set to Yes or yes then
Shorewall automatically adds these addresses. If it is set to
No or no, you must add these addresses
- yourself using your distribution's network configuration tools.
+ yourself using your distribution's network configuration
+ tools.
If this variable is not set or is given an empty value
- (ADD_SNAT_ALIASES="") then ADD_SNAT_ALIASES=No is assumed.
+ (ADD_SNAT_ALIASES="") then ADD_SNAT_ALIASES=No is assumed.
@@ -2673,10 +2918,10 @@ LOGBURST=5
This parameter determines the logging level of mangled/invalid
packets controlled by the dropunclean and logunclean
interface options. If LOGUNCLEAN is empty (LOGUNCLEAN=) then packets
- selected by dropclean are dropped silently (logunclean
- packets are logged under the info log level).
- Otherwise, these packets are logged at the specified level (Example:
- LOGUNCLEAN=debug).
+ selected by dropclean are dropped silently
+ (logunclean packets are logged under the
+ info log level). Otherwise, these packets are logged
+ at the specified level (Example: LOGUNCLEAN=debug).
@@ -2698,10 +2943,10 @@ LOGBURST=5
This paremter determines if packets from blacklisted hosts are
logged and it determines the syslog level that they are to be logged
- at. Its value is a syslog level
- (Example: BLACKLIST_LOGLEVEL=debug). If you do not assign a value or
- if you assign an empty value then packets from blacklisted hosts are
- not logged.
+ at. Its value is a syslog
+ level (Example: BLACKLIST_LOGLEVEL=debug). If you do not
+ assign a value or if you assign an empty value then packets from
+ blacklisted hosts are not logged.
@@ -2713,7 +2958,8 @@ LOGBURST=5
Netfilter and is usually required when your internet connection is
through PPPoE or PPTP. If set to Yes or
yes, the feature is enabled. If left blank or set to
- No or no, the feature is not enabled.
+ No or no, the feature is not
+ enabled.
This option requires CONFIG_IP_NF_TARGET_TCPMSS
parameter exists (see above).The file that is released with Shorewall calls the Shorewall
- function loadmodule for the set of modules that I load.
+ function loadmodule for the set of modules that I
+ load.
- The loadmodule function is called as follows:
+ The loadmodule function is called as
+ follows:
- loadmodule <modulename> [ <module parameters> ]
+ loadmodule <modulename> [ <module parameters> ]where
- <modulename>
+ <modulename>is the name of the modules without the trailing
@@ -2764,7 +3012,7 @@ LOGBURST=5
- <module parameters>
+ <module parameters>Optional parameters to the insmod utility.
@@ -2772,31 +3020,31 @@ LOGBURST=5
- The function determines if the module named by <modulename>
- is already loaded and if not then the function determines if the
- .o file corresponding to the module exists in the
- <moduledirectory>; if so, then the following
- command is executed:
+ The function determines if the module named by
+ <modulename> is already loaded and if not then
+ the function determines if the .o file corresponding to the
+ module exists in the <moduledirectory>; if so,
+ then the following command is executed:
- insmod <moduledirectory>/<modulename>.o <module parameters>
+ insmod <moduledirectory>/<modulename>.o <module parameters>
- If the file doesn't exist, the function determines of the
+ If the file doesn't exist, the function determines of the
.o.gz file corresponding to the module exists in the
moduledirectory. If it does, the function assumes
that the running configuration supports compressed modules and execute the
following command:
- insmod <moduledirectory>/<modulename>.o.gz <module parameters>
+ insmod <moduledirectory>/<modulename>.o.gz <module parameters>Beginning with the 1.4.9 Shorewall release, the value of the
MODULE_SUFFIX option in determines which files the loadmodule function
- looks for if the named module doesn't exist. For each file
- <extension> listed in MODULE_SUFFIX (default
- "o gz ko o.gz"), the function will append a period (".")
- and the extension and if the resulting file exists then the following
- command will be executed:
+ looks for if the named module doesn't exist. For each file
+ <extension> listed in MODULE_SUFFIX (default "o
+ gz ko o.gz"), the function will append a period (".") and the extension
+ and if the resulting file exists then the following command will be
+ executed:
- insmod moduledirectory/<modulename>.<extension> <module parameters>
+ insmod moduledirectory/<modulename>.<extension> <module parameters>
@@ -2805,7 +3053,8 @@ LOGBURST=5
The /etc/shorewall/tos file allows you to set
the Type of Service field in packet headers based on packet source, packet
destination, protocol, source port and destination port. In order for this
- file to be processed by Shorewall, you must have mangle support enabled.
+ file to be processed by Shorewall, you must have mangle support
+ enabled.
Entries in the file have the following columns:
@@ -2816,11 +3065,11 @@ LOGBURST=5
The source zone. May be qualified by following the zone name
with a colon (:) and either an IP address, an IP
- subnet, a MAC address in
- Shorewall Format or the name of an interface. This column
- may also contain the name of the firewall zone to indicate packets
- originating on the firewall itself or all to indicate
- any source.
+ subnet, a MAC address in Shorewall Format
+ or the name of an interface. This column may also contain the name
+ of the firewall zone to indicate packets originating on the firewall
+ itself or all to indicate any source.
@@ -2840,8 +3089,8 @@ LOGBURST=5
PROTOCOL
- The name of a protocol in /etc/protocols or
- the protocol's number.
+ The name of a protocol in /etc/protocols
+ or the protocol's number.
@@ -2917,12 +3166,13 @@ all all tcp ftp-data - 8Packets from hosts listed in the
blacklist file will be disposed of according to the value assigned to the
- BLACKLIST_DISPOSITION and BLACKLIST_LOGLEVEL
- variables in /etc/shorewall/shorewall.conf. Only packets arriving on
- interfaces that have the blacklist
- option in /etc/shorewall/interfaces are checked
- against the blacklist. The black list is designed to prevent listed
- hosts/subnets from accessing services on your
+ BLACKLIST_DISPOSITION and BLACKLIST_LOGLEVEL variables in
+ /etc/shorewall/shorewall.conf. Only packets arriving on interfaces that
+ have the blacklist option
+ in /etc/shorewall/interfaces are checked against the
+ blacklist. The black list is designed to prevent listed hosts/subnets from
+ accessing services on your
network.
Beginning with Shorewall 1.3.8, the blacklist file has three
@@ -2955,7 +3205,8 @@ all all tcp ftp-data - 8iptables -h icmp).
+ of ICMP type numbers or names (see iptables -h
+ icmp).
@@ -2964,10 +3215,11 @@ all all tcp ftp-data - 8.
- The Shorewall blacklist file is NOT
- designed to police your users' web browsing -- to do that, I suggest
- that you install and configure Squid
- with SquidGuard.
+ The Shorewall blacklist file is NOT designed to police your users' web browsing
+ -- to do that, I suggest that you install and configure Squid with SquidGuard.
@@ -2999,7 +3251,8 @@ all all tcp ftp-data - 8RETURN
- Process the packet normally thru the rules and policies.
+ Process the packet normally thru the rules and
+ policies.
@@ -3015,8 +3268,9 @@ all all tcp ftp-data - 8logdrop
- Log then drop the packet -- see the RFC1918_LOG_LEVEL
- parameter above.
+ Log then drop the packet -- see the RFC1918_LOG_LEVEL parameter
+ above.
@@ -3024,9 +3278,9 @@ all all tcp ftp-data - 8
- If you want to modify this file, DO NOT MODIFY /usr/share/shorewall/rfc1918.
- Rather copy that file to /etc/shorewall/rfc1918 and
- modify the copy.
+ If you want to modify this file, DO NOT MODIFY
+ /usr/share/shorewall/rfc1918. Rather copy that file
+ to /etc/shorewall/rfc1918 and modify the copy.
@@ -3034,7 +3288,8 @@ all all tcp ftp-data - 8This file lists the subnets affected by the nobogons interface option and nobogons hosts option. Columns in the file are:
+ linkend="Hosts">nobogons hosts option. Columns in the file
+ are:
@@ -3056,7 +3311,8 @@ all all tcp ftp-data - 8RETURN
- Process the packet normally thru the rules and policies.
+ Process the packet normally thru the rules and
+ policies.
@@ -3072,8 +3328,8 @@ all all tcp ftp-data - 8logdrop
- Log then drop the packet -- see the BOGONS_LOG_LEVEL
- parameter above.
+ Log then drop the packet -- see the BOGONS_LOG_LEVEL parameter above.
@@ -3081,16 +3337,17 @@ all all tcp ftp-data - 8
- If you want to modify this file, DO NOT MODIFY /usr/share/shorewall/bogons.
- Rather copy that file to /etc/shorewall/bogons and
- modify the copy.
+ If you want to modify this file, DO NOT MODIFY
+ /usr/share/shorewall/bogons. Rather copy that file to
+ /etc/shorewall/bogons and modify the copy./etc/shorewall/netmap (Added in Version 2.0.1)
- Network mapping is defined using the /etc/shorewall/netmap
- file. Columns in this file are:
+ Network mapping is defined using the
+ /etc/shorewall/netmap file. Columns in this file
+ are:
@@ -3100,12 +3357,12 @@ all all tcp ftp-data - 8Must be DNAT or SNAT.
If DNAT, traffic entering INTERFACE and addressed to NET1 has
- it's destination address rewritten to the corresponding address
- in NET2.
+ it's destination address rewritten to the corresponding address in
+ NET2.
If SNAT, traffic leaving INTERFACE with a source address in
- NET1 has it's source address rewritten to the corresponding
- address in NET2.
+ NET1 has it's source address rewritten to the corresponding address
+ in NET2.
@@ -3113,7 +3370,8 @@ all all tcp ftp-data - 8NET1
- Must be expressed in CIDR format (e.g., 192.168.1.0/24).
+ Must be expressed in CIDR format (e.g.,
+ 192.168.1.0/24).
@@ -3122,7 +3380,8 @@ all all tcp ftp-data - 8
A firewall interface. This interface must have been defined in
- /etc/shorewall/interfaces.
+ /etc/shorewall/interfaces.
@@ -3200,15 +3459,108 @@ eth1 -
Revision History
- 1.162004-03-17TEClarified
- LOGBURST and LOGLIMIT.1.152004-02-16TEMove
- the rfc1918 file to /usr/share/shorewall.1.142004-02-13TEAdd
- a note about the order of rules.1.132004-02-03TEUpdate
- for Shorewall 2.0.1.122004-01-21TEAdd
- masquerade destination list.1.122004-01-18TECorrect
- typo.1.112004-01-05TEStandards
- Compliance1.102004-01-05TEImproved
- formatting of DNAT- and REDIRECT- for clarity1.92003-12-25MNInitial
- Docbook Conversion Complete
+
+
+ 1.17
+
+ 2004-04-05
+
+ TE
+
+ Update for Shorewall 2.0.2
+
+
+
+ 1.16
+
+ 2004-03-17
+
+ TE
+
+ Clarified LOGBURST and LOGLIMIT.
+
+
+
+ 1.15
+
+ 2004-02-16
+
+ TE
+
+ Move the rfc1918 file to
+ /usr/share/shorewall.
+
+
+
+ 1.14
+
+ 2004-02-13
+
+ TE
+
+ Add a note about the order of rules.
+
+
+
+ 1.13
+
+ 2004-02-03
+
+ TE
+
+ Update for Shorewall 2.0.
+
+
+
+ 1.12
+
+ 2004-01-21
+
+ TE
+
+ Add masquerade destination list.
+
+
+
+ 1.12
+
+ 2004-01-18
+
+ TE
+
+ Correct typo.
+
+
+
+ 1.11
+
+ 2004-01-05
+
+ TE
+
+ Standards Compliance
+
+
+
+ 1.10
+
+ 2004-01-05
+
+ TE
+
+ Improved formatting of DNAT- and REDIRECT- for
+ clarity
+
+
+
+ 1.9
+
+ 2003-12-25
+
+ MN
+
+ Initial Docbook Conversion Complete
+
+
\ No newline at end of file
diff --git a/Shorewall-docs2/Documentation_Index.xml b/Shorewall-docs2/Documentation_Index.xml
index 90e80114b..4b6a2229a 100644
--- a/Shorewall-docs2/Documentation_Index.xml
+++ b/Shorewall-docs2/Documentation_Index.xml
@@ -64,7 +64,7 @@
Please review the appropriate guide before trying to use this documentation
directly.
-
+ Accounting
@@ -391,5 +391,5 @@
White List Creation
-
+
\ No newline at end of file
diff --git a/Shorewall-docs2/FAQ.xml b/Shorewall-docs2/FAQ.xml
index 50e9c792b..98a677de4 100644
--- a/Shorewall-docs2/FAQ.xml
+++ b/Shorewall-docs2/FAQ.xml
@@ -17,7 +17,7 @@
- 2004-03-05
+ 2004-05-042001-2004
@@ -31,7 +31,8 @@
1.2 or any later version published by the Free Software Foundation; with
no Invariant Sections, with no Front-Cover, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
- GNU Free Documentation License.
+ GNU Free Documentation
+ License.
@@ -52,8 +53,8 @@
(FAQ 1) I want to forward UDP port 7777 to my my personal PC with
- IP address 192.168.1.5. I've looked everywhere and can't find
- how to do it.
+ IP address 192.168.1.5. I've looked everywhere and can't find how to do
+ it.
Answer: The first example in the
rules file documentation
@@ -61,7 +62,7 @@
port-forwarding rule to a local system is as follows:#ACTION SOURCE DEST PROTO DEST PORT
-DNAT net loc:<local IP address>[:<local port>] <protocol> <port #>
+DNAT net loc:<local IP address>[:<local port>] <protocol> <port #>
So to forward UDP port 7777 to internal system 192.168.1.5, the
rule is:
@@ -70,18 +71,19 @@ DNAT net loc:<local IP address>[:<
DNAT net loc:192.168.1.5 udp 7777
If you want to forward requests directed to a particular address (
- <external IP> ) on your firewall to an
+ <external IP> ) on your firewall to an
internal system:#ACTION SOURCE DEST PROTO DEST PORT SOURCE ORIGINAL
# PORT DEST.
-DNAT net loc:<local IP address>[:<local port>] <protocol> <port #> - <external IP>
+DNAT net loc:<local IP address>[:<local port>] <protocol> <port #> - <external IP>
Finally, if you need to forward a range of ports, in the PORT
- column specify the range as <low-port>:<high-port>.
+ column specify the range as
+ <low-port>:<high-port>.
- (FAQ 1a) Ok -- I followed those instructions but it doesn't
+ (FAQ 1a) Ok -- I followed those instructions but it doesn't
workAnswer: That is usually the
@@ -90,14 +92,14 @@ DNAT net loc:<local IP address>[:<You are trying to test from inside your firewall (no, that
- won't work -- see ).
+ won't work -- see ).You have a more basic problem with your local system (the
one that you are trying to forward to) such as an incorrect
default gateway (it should be set to the IP address of your
- firewall's internal interface).
+ firewall's internal interface).
@@ -107,40 +109,42 @@ DNAT net loc:<local IP address>[:<You are running Mandrake Linux and have configured Internet
Connection Sharing. In that case, the name of your local zone is
- 'masq' rather than 'loc' (change all instances of
- 'loc' to 'masq' in your rules). You may want to
- consider re-installing Shorewall in a configuration which matches
- the Shorewall documentation. See the two-interface QuickStart Guide for
- details.
+ 'masq' rather than 'loc' (change all instances of 'loc' to 'masq'
+ in your rules). You may want to consider re-installing Shorewall
+ in a configuration which matches the Shorewall documentation. See
+ the two-interface QuickStart
+ Guide for details.
- (FAQ 1b) I'm still having problems with port forwarding
+ (FAQ 1b) I'm still having problems with port forwardingAnswer: To further diagnose
this problem:
- As root, type iptables -t nat -Z.
- This clears the NetFilter counters in the nat table.
+ As root, type iptables -t nat
+ -Z. This clears the NetFilter counters in the
+ nat table.
- Try to connect to the redirected port from an external host.
+ Try to connect to the redirected port from an external
+ host.
- As root type shorewall show nat
+ As root type shorewall show
+ natLocate the appropriate DNAT rule. It will be in a chain
- called <source zone>_dnat (net_dnat
- in the above examples).
+ called <source zone>_dnat
+ (net_dnat in the above examples).
@@ -149,7 +153,7 @@ DNAT net loc:<local IP address>[:<
@@ -166,12 +170,13 @@ DNAT net loc:<local IP address>[:<you are trying to connect to a secondary IP address on
your firewall and your rule is only redirecting the primary IP
address (You need to specify the secondary IP address in the
- ORIG. DEST. column in your DNAT rule); or
+ ORIG. DEST. column in your DNAT rule);
+ or
- your DNAT rule doesn't match the connection request
- in some other way. In that case, you may have to use a packet
+ your DNAT rule doesn't match the connection request in
+ some other way. In that case, you may have to use a packet
sniffer such as tcpdump or ethereal to further diagnose the
problem.
@@ -193,8 +198,8 @@ DNAT net loc:192.168.3:22 tcp 1022
- (FAQ 30) I'm confused about when to use DNAT rules and when
- to use ACCEPT rules.
+ (FAQ 30) I'm confused about when to use DNAT rules and when to
+ use ACCEPT rules.It would be a good idea to review the QuickStart Guide
@@ -216,7 +221,7 @@ DNAT net loc:192.168.3:22 tcp 1022
(FAQ 2) I port forward www requests to www.mydomain.com (IP
130.151.100.69) to system 192.168.1.5 in my local network. External
clients can browse http://www.mydomain.com but internal clients
- can't.
+ can't.
Answer: I have two objections to
this setup.
@@ -225,7 +230,7 @@ DNAT net loc:192.168.3:22 tcp 1022
Having an internet-accessible server in your local network is
like raising foxes in the corner of your hen house. If the server is
- compromised, there's nothing between that server and your other
+ compromised, there's nothing between that server and your other
internal systems. For the cost of another NIC and a cross-over
cable, you can put your server in a DMZ such that it is isolated
from your local systems - assuming that the Server can be located
@@ -234,11 +239,11 @@ DNAT net loc:192.168.3:22 tcp 1022
The accessibility problem is best solved using Bind Version 9 views
- (or using a separate DNS server for local clients) such that
- www.mydomain.com resolves to 130.141.100.69 externally and
- 192.168.1.5 internally. That's what I do here at shorewall.net
- for my local systems that use one-to-one NAT.
+ url="shorewall_setup_guide.htm#DNS">Bind Version 9
+ views (or using a separate DNS server for
+ local clients) such that www.mydomain.com resolves to 130.141.100.69
+ externally and 192.168.1.5 internally. That's what I do here at
+ shorewall.net for my local systems that use one-to-one NAT.
@@ -254,9 +259,11 @@ DNAT net loc:192.168.3:22 tcp 1022
If you are running Shorewall 1.4.1 or Shorewall 1.4.1a, please
upgrade to Shorewall 1.4.2 or later.
- Otherwise:In this configuration, all loc->loc
- traffic will look to the server as if it came from the firewall rather
- than from the original client!
+ Otherwise:
+ In this configuration, all loc->loc traffic will look to
+ the server as if it came from the firewall rather than from the
+ original client!
+
@@ -267,23 +274,25 @@ loc eth1 detect routeback
- In /etc/shorewall/rules:
+ In /etc/shorewall/rules (Assuming that
+ your local network is 192.168.1.0/24):
- #ACTION SOURCE DEST PROTO DEST PORT SOURCE ORIGINAL
-# PORT DEST.
-DNAT loc loc:192.168.1.5 tcp www - 130.151.100.69:192.168.1.254
+ #ACTION SOURCE DEST PROTO DEST PORT SOURCE ORIGINAL
+# PORT DEST.
+DNAT loc:192.168.1.0/24 loc:192.168.1.5 tcp www - 130.151.100.69:192.168.1.254That rule only works of course if you have a static external
IP address. If you have a dynamic IP address and are running
- Shorewall 1.3.4 or later then include this in /etc/shorewall/init:
+ Shorewall 1.3.4 or later then include this in
+ /etc/shorewall/init:
ETH0_IP=`find_interface_address eth0`and make your DNAT rule:
- #ACTION SOURCE DEST PROTO DEST PORT SOURCE ORIGINAL
-# PORT DEST.
-DNAT loc loc:192.168.1.5 tcp www - $ETH0_IP:192.168.1.254
+ #ACTION SOURCE DEST PROTO DEST PORT SOURCE ORIGINAL
+# PORT DEST.
+DNAT loc:192.168.1.0/24 loc:192.168.1.5 tcp www - $ETH0_IP:192.168.1.254Using this technique, you will want to configure your
DHCP/PPPoE client to automatically restart Shorewall each time that
@@ -295,14 +304,14 @@ DNAT loc loc:192.168.1.5 tcp www - $ETH0_IP:19
(FAQ 2a) I have a zone Z with an RFC1918 subnet
and I use one-to-one NAT to assign non-RFC1918 addresses to hosts in
Z. Hosts in Z cannot communicate with each other using their external
- (non-RFC1918 addresses) so they can't access each other using
- their DNS names.
+ (non-RFC1918 addresses) so they can't access each other using their
+ DNS names.
If the ALL INTERFACES column in /etc/shorewall/nat is empty or
contains Yes, you will also see log messages like the
following when trying to access a host in Z from another host in Z
- using the destination hosts's public address:
+ using the destination hosts's public address:Oct 4 10:26:40 netgw kernel:
Shorewall:FORWARD:REJECT:IN=eth1 OUT=eth1 SRC=192.168.118.200
@@ -313,19 +322,19 @@ DNAT loc loc:192.168.1.5 tcp www - $ETH0_IP:19
Answer: This is another problem
that is best solved using Bind Version 9 views. It
allows both external and internal clients to access a NATed host using
- the host's DNS name.
+ the host's DNS name.
Another good way to approach this problem is to switch from
one-to-one NAT to Proxy ARP. That way, the hosts in Z have non-RFC1918
addresses and can be accessed externally and internally using the same
address.
- If you don't like those solutions and prefer routing all
- Z->Z traffic through your firewall then:
+ If you don't like those solutions and prefer routing all Z->Z
+ traffic through your firewall then:
- Set the Z->Z policy to ACCEPT.
+ Set the Z->Z policy to ACCEPT.
@@ -341,7 +350,7 @@ DNAT loc loc:192.168.1.5 tcp www - $ETH0_IP:19
Yes.
- In this configuration, all Z->Z traffic will look to
+ In this configuration, all Z->Z traffic will look to
the server as if it came from the firewall rather than from the
original client! I DO NOT RECOMMEND THIS SETUP.
@@ -389,13 +398,13 @@ eth2 192.168.2.0/24
following:
- > I know PoM -ng is going to address this issue, but till it
- is ready, and > all the extras are ported to it, is there any way
- to use the h.323 > contrack module kernel patch with a 2.6 kernel?
- > Running 2.6.1 - no 2.4 kernel stuff on the system, so downgrade
- is not > an option... The module is not ported yet to 2.6, sorry.
- > Do I have any options besides a gatekeeper app (does not work in
- my > network) or a proxy (would prefer to avoid them)? I suggest
+ > I know PoM -ng is going to address this issue, but till it
+ is ready, and > all the extras are ported to it, is there any way
+ to use the h.323 > contrack module kernel patch with a 2.6 kernel?
+ > Running 2.6.1 - no 2.4 kernel stuff on the system, so downgrade
+ is not > an option... The module is not ported yet to 2.6, sorry.
+ > Do I have any options besides a gatekeeper app (does not work in
+ my > network) or a proxy (would prefer to avoid them)? I suggest
everyone to setup a proxy (gatekeeper) instead: the module is really
dumb and does not deserve to exist at all. It was an excellent tool to
debug/develop the newnat interface.
@@ -404,7 +413,8 @@ eth2 192.168.2.0/24
Look here
for a solution for MSN IM but be aware that there are significant
security risks involved with this solution. Also check the Netfilter
- mailing list archives at http://www.netfilter.org.
+ mailing list archives at http://www.netfilter.org.
@@ -428,14 +438,15 @@ eth2 192.168.2.0/24
cuts down slightly on the amount of Windows chatter on LAN segments
connected to the Firewall.
- If you are seeing port 80 being closed, that's
+ If you are seeing port 80 being closed, that's
probably your ISP preventing you from running a web server in violation
of your Service Agreement.You can change the default behavior of Shorewall through use of
an /etc/shorewall/common file. See the Extension Script Section.
+ url="shorewall_extension_scripts.htm">Extension Script
+ Section.
@@ -450,14 +461,16 @@ eth2 192.168.2.0/24
the default policy to all zone from the internet is DROP. The Drop
action is defined in /etc/shorewall/action.Drop
which in turn invokes the RejectAuth
- action (defined in /etc/shorewall/action.RejectAuth).
- This is necessary to prevent outgoing connection problems to services
- that use the Auth mechanism for identifying requesting
- users. That is the only service which the default setup rejects.
+ action (defined in
+ /etc/shorewall/action.RejectAuth). This is
+ necessary to prevent outgoing connection problems to services that use
+ the Auth mechanism for identifying requesting users. That
+ is the only service which the default setup rejects.
If you are seeing closed TCP ports other than 113 (auth) then
either you have added rules to REJECT those ports or a router outside of
- your firewall is responding to connection requests on those ports.
+ your firewall is responding to connection requests on those
+ ports.
(FAQ 4a) I just ran an nmap UDP scan of my firewall and it
@@ -467,12 +480,12 @@ eth2 192.168.2.0/24
read the nmap man page section about UDP scans. If nmap gets nothing back from your firewall then it reports
the port as open. If you want to see which UDP ports are really open,
- temporarily change your net->all policy to REJECT, restart
+ temporarily change your net->all policy to REJECT, restart
Shorewall and do the nmap UDP scan again.
- (FAQ 4b) I have a port that I can't close no matter how I
+ (FAQ 4b) I have a port that I can't close no matter how I
change my rules.I had a rule that allowed telnet from my local network to my
@@ -490,8 +503,9 @@ eth2 192.168.2.0/24
(FAQ 4c) How to I use Shorewall with PortSentry?Here's
- a writeup on a nice integration of Shorewall and PortSentry.
+ url="http://www.shorewall.net/pub/shorewall/contrib/PortsentryHOWTO.txt">Here's
+ a writeup on a nice integration of Shorewall and
+ PortSentry.
@@ -500,8 +514,8 @@ eth2 192.168.2.0/24
Connection Problems
- (FAQ 5) I've installed Shorewall and now I can't ping
- through the firewall
+ (FAQ 5) I've installed Shorewall and now I can't ping through the
+ firewallAnswer: If you want your firewall
to be totally open for ping,
@@ -509,7 +523,7 @@ eth2 192.168.2.0/24
Create /etc/shorewall/common if it
- doesn't already exist.
+ doesn't already exist.
@@ -518,7 +532,8 @@ eth2 192.168.2.0/24
- Add the following to /etc/shorewall/common
+ Add the following to
+ /etc/shorewall/commonrun_iptables -A icmpdef -p ICMP --icmp-type echo-request -j ACCEPT
@@ -529,18 +544,18 @@ eth2 192.168.2.0/24
- (FAQ 15) My local systems can't see out to the net
+ (FAQ 15) My local systems can't see out to the netAnswer: Every time I read
- systems can't see out to the net, I wonder where the
+ systems can't see out to the net, I wonder where the
poster bought computers with eyes and what those computers will
see when things are working properly. That aside, the
most common causes of this problem are:
- The default gateway on each local system isn't set to the
- IP address of the local firewall interface.
+ The default gateway on each local system isn't set to the IP
+ address of the local firewall interface.
@@ -550,32 +565,34 @@ eth2 192.168.2.0/24
The DNS settings on the local systems are wrong or the user is
- running a DNS server on the firewall and hasn't enabled UDP and
- TCP port 53 from the firewall to the internet.
+ running a DNS server on the firewall and hasn't enabled UDP and TCP
+ port 53 from the firewall to the internet.
- (FAQ 29) FTP Doesn't Work
+ (FAQ 29) FTP Doesn't Work
- See the Shorewall and FTP page.
+ See the Shorewall and FTP
+ page.(FAQ 33) From clients behind the firewall, connections to some
sites fail. Connections to the same sites from the firewall itself work
- fine. What's wrong.
+ fine. What's wrong.
Answer: Most likely, you need to
- set CLAMPMSS=Yes in /etc/shorewall/shorewall.conf.
+ set CLAMPMSS=Yes in /etc/shorewall/shorewall.conf.
(FAQ 35) I have two Ethernet interfaces to my local network which
- I have bridged. When Shorewall is started, I'm unable to pass
- traffic through the bridge. I have defined the bridge interface (br0) as
- the local interface in /etc/shorewall/interfaces; the bridged Ethernet
+ I have bridged. When Shorewall is started, I'm unable to pass traffic
+ through the bridge. I have defined the bridge interface (br0) as the
+ local interface in /etc/shorewall/interfaces; the bridged Ethernet
interfaces are not defined to Shorewall. How do I tell Shorewall to
allow traffic through the bridge?
@@ -593,37 +610,39 @@ eth2 192.168.2.0/24
the destination?
Answer: NetFilter uses the
- kernel's equivalent of syslog (see man syslog) to log
- messages. It always uses the LOG_KERN (kern) facility (see
- man openlog) and you get to choose the log level (again,
- see man syslog) in your man syslog) to log
+ messages. It always uses the LOG_KERN (kern) facility (see man
+ openlog) and you get to choose the log level (again, see
+ man syslog) in your policies and rules. The destination for
- messaged logged by syslog is controlled by /etc/syslog.conf
- (see man syslog.conf). When you have changed
- /etc/syslog.conf, be sure to restart syslogd (on a RedHat system,
- service syslog restart).
+ messaged logged by syslog is controlled by
+ /etc/syslog.conf (see man
+ syslog.conf). When you have changed /etc/syslog.conf, be sure to
+ restart syslogd (on a RedHat system, service syslog
+ restart).
By default, older versions of Shorewall ratelimited log messages
through settings in
/etc/shorewall/shorewall.conf -- If you want to log
all messages, set:
- LOGLIMIT=""
-LOGBURST=""
+ LOGLIMIT=""
+LOGBURST=""Beginning with Shorewall version 1.3.12, you can set up Shorewall to log all of its messages
to a separate file.
- (FAQ 6a) Are there any log parsers that work with Shorewall?
+ (FAQ 6a) Are there any log parsers that work with
+ Shorewall?Answer: Here are several links
that may be helpful:http://www.shorewall.net/pub/shorewall/parsefw/
+ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/pub/shorewall/parsefw/
http://www.fireparse.comhttp://cert.uni-stuttgart.de/projects/fwlogwatchhttp://www.logwatch.org
@@ -713,10 +732,23 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
- ExampleMAC=00:04:4c:dc:e2:28:00:b0:8e:cf:3c:4c:08:00Destination
- MAC address = 00:04:4c:dc:e2:28Source
- MAC address = 00:b0:8e:cf:3c:4cEthernet
- Frame Type = 08:00 (IP Version 4)
+
+ Example
+
+ MAC=00:04:4c:dc:e2:28:00:b0:8e:cf:3c:4c:08:00
+
+ Destination MAC address = 00:04:4c:dc:e2:28
+
+
+
+ Source MAC address = 00:b0:8e:cf:3c:4c
+
+
+
+ Ethernet Frame Type = 08:00 (IP Version 4)
+
+
+
@@ -725,22 +757,23 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
making it unusable!
Answer: If you are running
- Shorewall version 1.4.4 or 1.4.4a then check the errata.
- Otherwise:
+ Shorewall version 1.4.4 or 1.4.4a then check the errata. Otherwise:
Find where klogd is being started (it will be from one of the
files in /etc/init.d -- sysklogd, klogd, ...). Modify that file or
the appropriate configuration file so that klogd is started with
- -c <n> where
- <n> is a log level of 5 or less; or
+ -c <n> where
+ <n> is a log level of 5 or less;
+ or
- See the dmesg man page (man dmesg).
- You must add a suitable dmesg command to your startup
- scripts or place it in /etc/shorewall/start.
+ See the dmesg man page (man
+ dmesg). You must add a suitable dmesg command
+ to your startup scripts or place it in /etc/shorewall/start.
@@ -776,9 +809,10 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
man1918 or logdrop
- The destination address is listed in /usr/share/shorewall/rfc1918
- with a logdrop target -- see
- /usr/share/shorewall/rfc1918.
+ The destination address is listed in
+ /usr/share/shorewall/rfc1918 with a logdrop target -- see /usr/share/shorewall/rfc1918.
@@ -794,23 +828,25 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
- all2<zone>, <zone>2all or all2all
+ all2<zone>, <zone>2all or all2all
- You have a policy
- that specifies a log level and this packet is being logged under
- that policy. If you intend to ACCEPT this traffic then you need a
- rule to that effect.
+ You have a policy that specifies a log
+ level and this packet is being logged under that policy. If you
+ intend to ACCEPT this traffic then you need a rule to that effect.
- <zone1>2<zone2>
+ <zone1>2<zone2>
- Either you have a policy
- for <zone1> to <zone2> that specifies a log level
+ Either you have a policy for <zone1> to <zone2> that specifies a log level
and this packet is being logged under that policy or this packet
matches a rule that
includes a log level.
@@ -818,11 +854,13 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
- <interface>_mac
+ <interface>_mac
- The packet is being logged under the maclist
- interface option.
+ The packet is being logged under the maclistinterface
+ option.
@@ -830,8 +868,10 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
logpkt
- The packet is being logged under the logunclean
- interface option.
+ The packet is being logged under the loguncleaninterface
+ option.
@@ -839,10 +879,12 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
badpkt
- The packet is being logged under the dropunclean
- interface option
- as specified in the LOGUNCLEAN
- setting in /etc/shorewall/shorewall.conf.
+ The packet is being logged under the dropuncleaninterface option as
+ specified in the LOGUNCLEAN
+ setting in /etc/shorewall/shorewall.conf.
@@ -864,8 +906,9 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
The packet is being logged because it is a TCP packet that
is not part of any current connection yet it is not a syn packet.
Options affecting the logging of such packets include NEWNOTSYN and LOGNEWNOTSYN
- in /etc/shorewall/shorewall.conf.
+ role="bold">NEWNOTSYN and LOGNEWNOTSYN in /etc/shorewall/shorewall.conf.
@@ -873,12 +916,12 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
INPUT or FORWARD
- The packet has a source IP address that isn't in any of
- your defined zones (shorewall check and look at the
+ The packet has a source IP address that isn't in any of your
+ defined zones (shorewall check and look at the
printed zone definitions) or the chain is FORWARD and the
- destination IP isn't in any of your defined zones. Also see
- for another cause of packets being logged
- in the FORWARD chain.
+ destination IP isn't in any of your defined zones. Also see for another cause of packets being logged in
+ the FORWARD chain.
@@ -888,7 +931,8 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
The packet is being logged because it failed the checks
implemented by the tcpflags
- interface option.
+ interface
+ option.
@@ -897,20 +941,24 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
Here is an example:Jun 27 15:37:56 gateway kernel:
- Shorewall:all2all:REJECT:IN=eth2 OUT=eth1 SRC=192.168.2.2
- DST=192.168.1.3 LEN=67 TOS=0x00 PREC=0x00 TTL=63 ID=5805 DF PROTO=UDP
- SPT=1803 DPT=53 LEN=47
+ Shorewall:all2all:REJECT:IN=eth2OUT=eth1SRC=192.168.2.2
+ DST=192.168.1.3 LEN=67 TOS=0x00 PREC=0x00 TTL=63 ID=5805 DF PROTO=UDP
+ SPT=1803 DPT=53 LEN=47
- Let's look at the important parts of this message:
+ Let's look at the important parts of this message:all2all:REJECT
- This packet was REJECTed out of the all2all
- chain -- the packet was rejected under the all->all
- REJECT policy ( above).
+ This packet was REJECTed out of the all2all chain -- the packet was rejected
+ under the all->all REJECT
+ policy ( above).
@@ -971,7 +1019,8 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
url="http://logi.cc/linux/netfilter-log-format.php3">http://logi.cc/linux/netfilter-log-format.php3.
In this case, 192.168.2.2 was in the dmz zone and
- 192.168.1.3 is in the loc zone. I was missing the rule:
+ 192.168.1.3 is in the loc zone. I was missing the
+ rule:
ACCEPT dmz loc udp 53
@@ -1012,15 +1061,15 @@ url="http://www.shorewall.net/pub/shorewall/parsefw/">http://www.shorewall.net/p
UDP port 2857. This causes a port unreachable (type 3, code 3) to be
generated back to 192.0.2.3. As this packet is sent back through
206.124.146.179, that box correctly changes the source address in the
- packet to 206.124.146.179 but doesn't reset the DST IP in the
- original DNS response similarly. When the ICMP reaches your firewall
- (192.0.2.3), your firewall has no record of having sent a DNS reply to
- 172.16.1.10 so this ICMP doesn't appear to be related to anything
- that was sent. The final result is that the packet gets logged and
- dropped in the all2all chain. I have also seen cases where the source IP
- in the ICMP itself isn't set back to the external IP of the remote
- NAT gateway; that causes your firewall to log and drop the packet out of
- the rfc1918 chain because the source IP is reserved by RFC 1918.
+ packet to 206.124.146.179 but doesn't reset the DST IP in the original
+ DNS response similarly. When the ICMP reaches your firewall (192.0.2.3),
+ your firewall has no record of having sent a DNS reply to 172.16.1.10 so
+ this ICMP doesn't appear to be related to anything that was sent. The
+ final result is that the packet gets logged and dropped in the all2all
+ chain. I have also seen cases where the source IP in the ICMP itself
+ isn't set back to the external IP of the remote NAT gateway; that causes
+ your firewall to log and drop the packet out of the rfc1918 chain
+ because the source IP is reserved by RFC 1918.
@@ -1067,7 +1116,8 @@ eth1 eth2
url="http://www.lartc.org">LARTC HOWTO and has not been verified
by the author. If you have questions or problems with the instructions
given below, please post to the LARTC mailing list.
+ url="http://www.lartc.org/#mailinglist">LARTC mailing
+ list.
A common configuration is the following, in which there are two
@@ -1103,15 +1153,17 @@ eth1 eth2
Let us first set some symbolical names. Let $IF1 be the name of the first interface (if1 in
the picture above) and $IF2 the name
- of the second interface. Then let $IP1
- be the IP address associated with $IF1
- and $IP2 the IP address associated
- with $IF2. Next, let $IP1 be the IP address associated with
+ $IF1 and $IP2 the IP address associated with $IF2. Next, let $P1 be the IP address of the gateway at
Provider 1, and $P2 the IP address of
- the gateway at provider 2. Finally, let $P1_NET
- be the IP network $P1 is in, and
- $P2_NET the IP network $P1_NET be the IP network $P1 is in, and $P2_NET the IP network $P2 is in.One creates two additional routing tables, say Next you set up the main routing table. It is a good idea to
route things to the direct neighbour through the interface connected
- to that neighbour. Note the `src' arguments, they make sure the
- right outgoing IP address is chosen.
+ to that neighbour. Note the `src' arguments, they make sure the right
+ outgoing IP address is chosen.ip route add $P1_NET dev $IF1 src $IP1
ip route add $P2_NET dev $IF2 src $IP2
@@ -1155,8 +1207,8 @@ ip rule add from $IP2 table T2
on a particular interface get answered from that interface.
- 'If $P0_NET is the local network and $IF0 is its
- interface, the following additional entries are desirable:
+ 'If $P0_NET is the local network and $IF0 is its interface,
+ the following additional entries are desirable:ip route add $P0_NET dev $IF0 table T1
ip route add $P2_NET dev $IF2 table T1
@@ -1200,11 +1252,45 @@ ip route add 127.0.0.0/8 dev lo table T2Furthermore, if you really want to do this, you probably also
- want to look at Julian Anastasov's patches at http://www.ssi.bg/~ja/#routes
- , Julian's route patch page. They will make things nicer to work
+ , Julian's route patch page. They will make things nicer to work
with.
+
+ The following was contributed by Martin Brown and is an excerpt
+ from http://www.docum.org/stef.coene/qos/faq/cache/44.html.
+
+
+ There are two issues requiring different handling when dealing
+ with multiple Internet providers on a given network. The below assumes
+ that the host which has multiple Internet connections is a
+ masquerading (or NATting) host and is at the chokepoint between the
+ internal and external networks. For the use of multiple inbound
+ connections to the same internal server (public IP A from ISP A and
+ public IP B from ISP B both get redirected to the same internal
+ server), the ideal solution involves using two private IP addresses on
+ the internal server. This leads to an end-to-end uniqueness of public
+ IP to private IP and can be easily accomplished by following the
+ directions here:
+
+ http://linux-ip.net/html/adv-multi-internet.html#adv-multi-internet-inbound
+
+ For the use of multiple outbound links to the Internet, there
+ are a number of different techniques. The simplest is identified
+ here:
+
+ http://linux-ip.net/html/adv-multi-internet.html#adv-multi-internet-outbound
+
+ Better (and more robust) techniques are available after a kernel
+ routing patch by Julian Anastasov. See the famous nano-howto.
+
+ http://www.ssi.bg/~ja/
+
@@ -1212,19 +1298,20 @@ ip route add 127.0.0.0/8 dev lo table T2
Starting and Stopping
- (FAQ 7) When I stop Shorewall using shorewall stop,
- I can't connect to anything. Why doesn't that command work?
+ (FAQ 7) When I stop Shorewall using shorewall
+ stop, I can't connect to anything. Why doesn't that command
+ work?The stop command is intended to
place your firewall into a safe state whereby only those hosts listed in
- /etc/shorewall/routestopped' are activated. If
- you want to totally open up your firewall, you must use the
+ /etc/shorewall/routestopped' are activated. If you
+ want to totally open up your firewall, you must use the
shorewall clear command.(FAQ 8) When I try to start Shorewall on RedHat, I get messages
- about insmod failing -- what's wrong?
+ about insmod failing -- what's wrong?
Answer: The output you will see
looks something like this:
@@ -1234,7 +1321,7 @@ Hint: insmod errors can be caused by incorrect module parameters, including inva
/lib/modules/2.4.17/kernel/net/ipv4/netfilter/ip_tables.o: insmod
/lib/modules/2.4.17/kernel/net/ipv4/netfilter/ip_tables.o failed
/lib/modules/2.4.17/kernel/net/ipv4/netfilter/ip_tables.o: insmod ip_tables failed
-iptables v1.2.3: can't initialize iptables table `nat': iptables who? (do you need to insmod?)
+iptables v1.2.3: can't initialize iptables table `nat': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
This problem is usually corrected through the following sequence
@@ -1253,12 +1340,13 @@ rmmod ipchains
message referring me to FAQ #8
Answer: This is usually cured
- by the sequence of commands shown above in .
+ by the sequence of commands shown above in .
- (FAQ 9) Why can't Shorewall detect my interfaces properly at
+ (FAQ 9) Why can't Shorewall detect my interfaces properly at
startup?I just installed Shorewall and when I issue the start command, I
@@ -1280,18 +1368,18 @@ Deleting user chains...
Creating input Chains...
...
- Why can't Shorewall detect my interfaces properly?
+ Why can't Shorewall detect my interfaces properly?Answer: The above output is
perfectly normal. The Net zone is defined as all hosts that are
connected through eth0 and the local zone is defined as all hosts
connected through eth1. If you
are running Shorewall 1.4.10 or later, you can consider setting the
- detectnets
- interface option on your local interface (eth1 in the above example). That will
- cause Shorewall to restrict the local zone to only those networks routed
- through that interface.
+ detectnets interface option on your local
+ interface (eth1 in the above
+ example). That will cause Shorewall to restrict the local zone to only
+ those networks routed through that interface.
@@ -1299,25 +1387,86 @@ Creating input Chains...
Shorewall starts. Which file do I put them in?
You can place these commands in one of the Shorewall Extension Scripts.
- Be sure that you look at the contents of the chain(s) that you will be
- modifying with your commands to be sure that the commands will do what
- they are intended. Many iptables commands published in HOWTOs and other
- instructional material use the -A command which adds the rules to the
- end of the chain. Most chains that Shorewall constructs end with an
- unconditional DROP, ACCEPT or REJECT rule and any rules that you add
- after that will be ignored. Check man iptables and look
- at the -I (--insert) command.
+ url="shorewall_extension_scripts.htm">Shorewall Extension
+ Scripts. Be sure that you look at the contents of the chain(s)
+ that you will be modifying with your commands to be sure that the
+ commands will do what they are intended. Many iptables commands
+ published in HOWTOs and other instructional material use the -A command
+ which adds the rules to the end of the chain. Most chains that Shorewall
+ constructs end with an unconditional DROP, ACCEPT or REJECT rule and any
+ rules that you add after that will be ignored. Check man
+ iptables and look at the -I (--insert) command.
(FAQ 34) How can I speed up start (restart)?Using a light-weight shell such as ash can
- dramatically decrease the time required to start
- or restart Shorewall. See the
- SHOREWALL_SHELL variable in start or restart
+ Shorewall. See the SHOREWALL_SHELL variable in shorewall.conf.
+
+ Beginning with Shorewall version 2.0.2 Beta 1, Shorewall supports
+ a fast start capability. To use this capability:
+
+
+
+ With Shorewall in the started state, run
+ shorewall save. This creates the script
+ /var/lib/shorewall/restore.
+
+
+
+ Use the -f option to the
+ start command (e.g., shorewall -f start). This
+ causes Shorewall to look for the
+ /var/lib/shorewall/restore script and if that
+ script exists, it is run. Running
+ /var/lib/shorewall/restore takes much less time
+ than a full shorewall start.
+
+
+
+ The /etc/init.d/shorewall script that is
+ run at boot time uses the -f
+ option.
+
+
+
+ The /var/lib/shorewall/restore script can
+ be run any time to restore the firewall. The script may be run
+ directly or it may be run indirectly using the shorewall
+ restore command.
+
+
+
+ If you change your Shorewall configuration, you must execute a
+ shorewall start (without -f) or shorewall restart prior
+ to doing another shorewall save. The
+ shorewall save command saves the currently running
+ configuration and not the one reflected in your updated configuration
+ files.
+
+ Likewise, if you change your Shorewall configuration then once you
+ are satisfied that it is working properly, you must do another
+ shorewall save. Otherwise at the next reboot, you
+ will revert to the old configuration stored in
+ /var/lib/shorewall/restore.
+
+
+ (FAQ 34a) I get errors about a host or network not found when I
+ run/var/lib/shorewall/restore. The
+ shorewall restore and shorewall -f
+ start commands gives the same result.
+
+ Answer: iptables 1.2.9 is broken with respect to iptables-save
+ and the connection tracking match extension. You must patch your
+ iptables using the patch available from the Shorewall errata page.
+
@@ -1328,7 +1477,8 @@ Creating input Chains...
(FAQ 10) What Distributions does it work with?Shorewall works with any GNU/Linux distribution that includes the
- proper prerequisites.
+ proper
+ prerequisites.
@@ -1360,14 +1510,15 @@ Creating input Chains...
(FAQ 23) Why do you use such ugly fonts on your web site?
- The Shorewall web site is almost font neutral (it doesn't
+ The Shorewall web site is almost font neutral (it doesn't
explicitly specify fonts except on a few pages) so the fonts you see are
- largely the default fonts configured in your browser. If you don't
- like them then reconfigure your browser.
+ largely the default fonts configured in your browser. If you don't like
+ them then reconfigure your browser.
- (FAQ 25) How to I tell which version of Shorewall I am running?
+ (FAQ 25) How to I tell which version of Shorewall I am
+ running?At the shell prompt, type:
@@ -1388,7 +1539,8 @@ Creating input Chains...
- Tear Drop: Sending packets that contain overlapping fragments?
+ Tear Drop: Sending packets that contain overlapping
+ fragments?Answer: This is the responsibility of the IP stack, not the
@@ -1406,7 +1558,8 @@ Creating input Chains...
blacklisting
facility. Shorewall versions 2.0.0 and later filter these packets
under the nosmurfs interface option in
- /etc/shorewall/interfaces.
+ /etc/shorewall/interfaces.
@@ -1416,8 +1569,8 @@ Creating input Chains...
Answer: Yes, if the routefilter interface option
- is selected.
+ url="Documentation.htm#Interfaces">routefilter interface
+ option is selected.
@@ -1426,10 +1579,10 @@ Creating input Chains...
Answer: Shorewall has facilities for limiting SYN and ICMP
- packets. Netfilter as included in standard Linux kernels
- doesn't support per-remote-host limiting except by explicit
- rule that specifies the host IP address; that form of limiting is
- supported by Shorewall.
+ packets. Netfilter as included in standard Linux kernels doesn't
+ support per-remote-host limiting except by explicit rule that
+ specifies the host IP address; that form of limiting is supported
+ by Shorewall.
@@ -1446,16 +1599,39 @@ Creating input Chains...
and it is silly to continue to run it simply because it is bundled with
an ancient Debian release.
+
+
+ (FAQ 36) Does Shorewall Work with the 2.6 Linux Kernel?
+
+ Shorewall works with the 2.6 Kernels with a couple of
+ caveats:
+
+
+
+ Netfilter/iptables doesn't fully support IPSEC in the 2.6
+ Kernels -- there are interim instructions linked from the Shorewall IPSEC page.
+
+
+
+ The 2.6 Kernels do not provide support for the logunclean and
+ dropunclean options in
+ /etc/shorewall/interfaces. Note that support
+ for those options was also removed from Shorewall in version
+ 2.0.0.
+
+
+ RFC 1918
- (FAQ 14) I'm connected via a cable modem and it has an
- internal web server that allows me to configure/monitor it but as
- expected if I enable rfc1918 blocking for my eth0 interface (the
- internet one), it also blocks the cable modems web server.
+ (FAQ 14) I'm connected via a cable modem and it has an internal
+ web server that allows me to configure/monitor it but as expected if I
+ enable rfc1918 blocking for my eth0 interface (the internet one), it
+ also blocks the cable modems web server.Is there any way it can add a rule before the rfc1918 blocking
that will let all traffic to and from the 192.168.100.1 address of the
@@ -1473,7 +1649,8 @@ Creating input Chains...
first copy /usr/share/shorewall/rfc1918 to
/etc/shorewall/rfc1918):
- Be sure that you add the entry ABOVE the entry for 192.168.0.0/16.
+ Be sure that you add the entry ABOVE the entry for
+ 192.168.0.0/16.#SUBNET TARGET
192.168.100.1 RETURN
@@ -1491,10 +1668,9 @@ Creating input Chains...
- (FAQ 14a) Even though it assigns public IP addresses, my
- ISP's DHCP server has an RFC 1918 address. If I enable RFC 1918
- filtering on my external interface, my DHCP client cannot renew its
- lease.
+ (FAQ 14a) Even though it assigns public IP addresses, my ISP's
+ DHCP server has an RFC 1918 address. If I enable RFC 1918 filtering on
+ my external interface, my DHCP client cannot renew its lease.The solution is the same as above.
Simply substitute the IP address of your ISPs DHCP server.
@@ -1520,9 +1696,9 @@ Creating input Chains...
(FAQ 19) I have added entries to /etc/shorewall/tcrules but they
- don't seem to do anything. Why?
+ don't seem to do anything. Why?
- You probably haven't set TC_ENABLED=Yes in
+ You probably haven't set TC_ENABLED=Yes in
/etc/shorewall/shorewall.conf so the contents of the tcrules file are
simply being ignored.
@@ -1531,19 +1707,21 @@ Creating input Chains...
(FAQ 20) I have just set up a server. Do I have to change
Shorewall to allow access to my server from the internet?
- Yes. Consult the QuickStart
- guide that you used during your initial setup for information
- about how to set up rules for your server.
+ Yes. Consult the QuickStart guide that you
+ used during your initial setup for information about how to set up rules
+ for your server.
- (FAQ 24) How can I allow conections to let's say the ssh port
+ (FAQ 24) How can I allow conections to let's say the ssh port
only from specific IP Addresses on the internet?In the SOURCE column of the rule, follow net by a
- colon and a list of the host/subnet addresses as a comma-separated list.
+ colon and a list of the host/subnet addresses as a comma-separated
+ list.
- net:<ip1>,<ip2>,...
+ net:<ip1>,<ip2>,...Example:
@@ -1555,15 +1733,16 @@ Creating input Chains...
(FAQ 26) When I try to use any of the SYN options in nmap on or
behind the firewall, I get operation not permitted. How
- can I use nmap with Shorewall?"
+ can I use nmap with Shorewall?"
- Edit /etc/shorewall/shorewall.conf and change NEWNOTSYN=No
- to NEWNOTSYN=Yes then restart Shorewall.
+ Edit /etc/shorewall/shorewall.conf and change
+ NEWNOTSYN=No to NEWNOTSYN=Yes then restart
+ Shorewall.(FAQ 26a) When I try to use the -O option of
- nmap from the firewall system, I get operation not permitted.
- How do I allow this option?
+ nmap from the firewall system, I get operation not
+ permitted. How do I allow this option?
Add this command to your /etc/shorewall/start file:
@@ -1572,34 +1751,35 @@ Creating input Chains...
- (FAQ 27) I'm compiling a new kernel for my firewall. What
- should I look out for?
+ (FAQ 27) I'm compiling a new kernel for my firewall. What should
+ I look out for?First take a look at the Shorewall kernel
configuration page. You probably also want to be sure that you
have selected the NAT of local connections
(READ HELP) on the Netfilter Configuration menu.
- Otherwise, DNAT rules with your firewall as the source zone won't
- work with your new kernel.
+ Otherwise, DNAT rules with your firewall as the source zone won't work
+ with your new kernel.
(FAQ 27a) I just built and installed a new kernel and now
- Shorewall won't start. I know that my kernel options are correct.
+ Shorewall won't start. I know that my kernel options are
+ correct.
The last few lines of a startup
trace are these:+ run_iptables2 -t nat -A eth0_masq -s 192.168.2.0/24 -d 0.0.0.0/0 -j
MASQUERADE
-+ '[' 'x-t nat -A eth0_masq -s 192.168.2.0/24 -d 0.0.0.0/0 -j
-MASQUERADE' = 'x-t nat -A eth0_masq -s 192.168.2.0/24 -d 0.0.0.
-0/0 -j MASQUERADE' ']'
++ '[' 'x-t nat -A eth0_masq -s 192.168.2.0/24 -d 0.0.0.0/0 -j
+MASQUERADE' = 'x-t nat -A eth0_masq -s 192.168.2.0/24 -d 0.0.0.
+0/0 -j MASQUERADE' ']'
+ run_iptables -t nat -A eth0_masq -s 192.168.2.0/24 -d 0.0.0.0/0 -j
MASQUERADE
+ iptables -t nat -A eth0_masq -s 192.168.2.0/24 -d 0.0.0.0/0 -j
MASQUERADE
iptables: Invalid argument
-+ '[' -z '' ']'
++ '[' -z '' ']'
+ stop_firewall
+ set +x
@@ -1621,32 +1801,275 @@ iptables: Invalid argument
Revision History
- 1.202004-03-05TEAdded
- Bridging link.1.202004-02-27TEAdded
- FAQ 35.1.192004-02-22TEAdded
- mention of nosmurfs option under FAQ 31.1.182004-02-15TEAdded
- FAQ 34.1.172004-02-11TEAdded
- FAQ 33.1.162004-02-03TEUpdated
- for Shorewall 2.0.1.152004-01-25TEUpdated
- FAQ 32 to mention masquerading. Remove tables.1.142004-01-24TEAdded
- FAQ 27a regarding kernel/iptables incompatibility.1.132004-01-24TEAdd
- a note about the detectnets interface
- option in FAQ 9.1.122004-01-20TEImprove
- FAQ 16 answer.1.112004-01-14TECorrected
- broken link1.102004-01-09TEAdded
- a couple of more legacy FAQ numbers.1.92004-01-08TECorrected
- typo in FAQ 26a. Added warning to FAQ 2 regarding source address of
- redirected requests.1.82003-12-31TEAdditions
- to FAQ 4.1.72003-12-30TERemove
- dead link from FAQ 1.1.62003.12-18TEAdd
- external link reference to FAQ 17.1.52003-12-16TEAdded
- a link to a Sys Admin article about multiple internet interfaces. Added
- Legal Notice. Moved "abstract" to the body of the document. Moved
- Revision History to this Appendix.1.42003-12-13TECorrected
- formatting problems1.32003-12-10TEChanged
- the title of FAQ 171.22003-12-09TEAdded
- Copyright and legacy FAQ numbers1.12003-12-04MNConverted
- to Simplified DocBook XML1.02002-08-13TEInitial
- revision
+
+
+ 1.25
+
+ 2004-04-25
+
+ TE
+
+ Update for Shorewall 2.0.2
+
+
+
+ 1.24
+
+ 2004-04-25
+
+ TE
+
+ Add MA Brown's notes on multi-ISP routing.
+
+
+
+ 1.23
+
+ 2004-04-22
+
+ TE
+
+ Refined SNAT rule in FAQ #2.
+
+
+
+ 1.22
+
+ 2004-04-06
+
+ TE
+
+ Added FAQ 36.
+
+
+
+ 1.21
+
+ 2004-03-05
+
+ TE
+
+ Added Bridging link.
+
+
+
+ 1.20
+
+ 2004-02-27
+
+ TE
+
+ Added FAQ 35.
+
+
+
+ 1.19
+
+ 2004-02-22
+
+ TE
+
+ Added mention of nosmurfs option under FAQ
+ 31.
+
+
+
+ 1.18
+
+ 2004-02-15
+
+ TE
+
+ Added FAQ 34.
+
+
+
+ 1.17
+
+ 2004-02-11
+
+ TE
+
+ Added FAQ 33.
+
+
+
+ 1.16
+
+ 2004-02-03
+
+ TE
+
+ Updated for Shorewall 2.0.
+
+
+
+ 1.15
+
+ 2004-01-25
+
+ TE
+
+ Updated FAQ 32 to mention masquerading. Remove
+ tables.
+
+
+
+ 1.14
+
+ 2004-01-24
+
+ TE
+
+ Added FAQ 27a regarding kernel/iptables
+ incompatibility.
+
+
+
+ 1.13
+
+ 2004-01-24
+
+ TE
+
+ Add a note about the detectnets interface option in FAQ
+ 9.
+
+
+
+ 1.12
+
+ 2004-01-20
+
+ TE
+
+ Improve FAQ 16 answer.
+
+
+
+ 1.11
+
+ 2004-01-14
+
+ TE
+
+ Corrected broken link
+
+
+
+ 1.10
+
+ 2004-01-09
+
+ TE
+
+ Added a couple of more legacy FAQ numbers.
+
+
+
+ 1.9
+
+ 2004-01-08
+
+ TE
+
+ Corrected typo in FAQ 26a. Added warning to FAQ 2
+ regarding source address of redirected requests.
+
+
+
+ 1.8
+
+ 2003-12-31
+
+ TE
+
+ Additions to FAQ 4.
+
+
+
+ 1.7
+
+ 2003-12-30
+
+ TE
+
+ Remove dead link from FAQ 1.
+
+
+
+ 1.6
+
+ 2003.12-18
+
+ TE
+
+ Add external link reference to FAQ 17.
+
+
+
+ 1.5
+
+ 2003-12-16
+
+ TE
+
+ Added a link to a Sys Admin article about multiple
+ internet interfaces. Added Legal Notice. Moved "abstract" to the
+ body of the document. Moved Revision History to this
+ Appendix.
+
+
+
+ 1.4
+
+ 2003-12-13
+
+ TE
+
+ Corrected formatting problems
+
+
+
+ 1.3
+
+ 2003-12-10
+
+ TE
+
+ Changed the title of FAQ 17
+
+
+
+ 1.2
+
+ 2003-12-09
+
+ TE
+
+ Added Copyright and legacy FAQ numbers
+
+
+
+ 1.1
+
+ 2003-12-04
+
+ MN
+
+ Converted to Simplified DocBook XML
+
+
+
+ 1.0
+
+ 2002-08-13
+
+ TE
+
+ Initial revision
+
+
\ No newline at end of file
diff --git a/Shorewall-docs2/FTP.xml b/Shorewall-docs2/FTP.xml
index 40a09696b..6b3c96afe 100644
--- a/Shorewall-docs2/FTP.xml
+++ b/Shorewall-docs2/FTP.xml
@@ -15,11 +15,13 @@
- 2003-12-01
+ 2004-04-262003
+ 2004
+
Thomas M. Eastep
@@ -62,6 +64,27 @@
+
+ Mandrake have done it again with their 10.0
+ release. This time, they have decided that kernel modules should have
+ "ko.gz" for their suffix. If you are having problems with Mandrake
+ 10.0 and FTP, change your /etc/shorewall/conf file
+ definition of MODULE_SUFFIX as follows:
+
+ MODULE_SUFFIX="o gz ko o.gz ko.gz"
+
+ The version of insmod shipped with 10.0 also does
+ not comprehend these module files so you will also need to change
+ /usr/share/shorewall/firewall -- replace the line
+ that reads:
+
+ insmod $modulefile $*
+
+ with:
+
+ modprobe $modulename $*
+
+
FTP Protocol
diff --git a/Shorewall-docs2/IPSEC.xml b/Shorewall-docs2/IPSEC.xml
index 52e4423f2..b76627e79 100644
--- a/Shorewall-docs2/IPSEC.xml
+++ b/Shorewall-docs2/IPSEC.xml
@@ -15,7 +15,7 @@
- 2004-03-20
+ 2004-05-042001-2004
@@ -29,7 +29,8 @@
1.2 or any later version published by the Free Software Foundation; with
no Invariant Sections, with no Front-Cover, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
- GNU Free Documentation License.
+ GNU Free Documentation
+ License.
@@ -38,9 +39,10 @@
Linux Kernel. David Hollis has provided information
about how to set up a simple tunnel under 2.6. One important point
- that is not made explicit in David's post is that the vpn zone must be defined before the net zone in /etc/shorewall/zones.
+ role="bold">net zone in
+ /etc/shorewall/zones.
@@ -54,7 +56,8 @@
IPSEC and Proxy ARP do not work unless you are running Shorewall
2.0.1 Beta 3 or later or unless you have installed the fix to Shorewall
- 2.0.0 available from the Errata Page.
+ 2.0.0 available from the Errata
+ Page.
@@ -187,30 +190,111 @@ conn packetdefault
VPNYou need to define a zone for the remote subnet or include it in
- your local zone. In this example, we'll assume that you have created
- a zone called vpn to represent the remote subnet.
+ your local zone. In this example, we'll assume that you have created a
+ zone called vpn to represent the remote subnet.
-
You will need to allow traffic between the vpn zone
and the loc zone -- if you simply want to admit all
traffic in both directions, you can use the policy file:
-
/etc/shorewall/policy local & remoteSOURCEDESTPOLICYLOG LEVELlocvpnACCEPTvpnlocACCEPT
Once you have these entries in place, restart Shorewall (type
shorewall restart); you are now ready to configure the tunnel in In /etc/shorewall/tunnels on systems B and C, we would have:
- /etc/shorewall/tunnels system B & C
+ /etc/shorewall/tunnels system B & C
@@ -376,7 +460,7 @@ conn packetdefault
On systems B and C:
- /etc/shorewall/zones system B & C
+ /etc/shorewall/zones system B & C
@@ -434,7 +518,8 @@ conn packetdefault
- The /etc/shorewall/hosts file on system A defines the two VPN zones:
+ The /etc/shorewall/hosts file on system A defines the two VPN
+ zones:
/etc/shorewall/hosts system A
@@ -474,7 +559,7 @@ conn packetdefault
following in /etc/shorewall/interfaces:
- /etc/shorewall/interfaces system B & C
+ /etc/shorewall/interfaces system B & C
@@ -575,7 +660,7 @@ conn packetdefault
policy file entries on all three gateways:
- /etc/shorewall/policy system B & C
+ /etc/shorewall/policy system B & C
@@ -616,7 +701,8 @@ conn packetdefault
Once you have the Shorewall entries added, restart Shorewall on each
gateway (type shorewall restart); you are now ready to configure the
- tunnels in FreeS/WAN.
+ tunnels in FreeS/WAN.
to allow traffic between the networks attached to systems B and C,
@@ -684,27 +770,75 @@ conn packetdefault
Road Warrior VPNYou need to define a zone for the laptop or include it in your
- local zone. In this example, we'll assume that you have created a
- zone called vpn to represent the remote host.
+ local zone. In this example, we'll assume that you have created a zone
+ called vpn to represent the remote host.
-
In this instance, the mobile system (B) has IP address 134.28.54.2
but that cannot be determined in advance. In the /etc/shorewall/tunnels
file on system A, the following entry should be made:
-
/etc/shorewall/tunnels system ATYPEZONEGATEWAYGATEWAY ZONEipsecnet0.0.0.0/0vpn
+
+ /etc/shorewall/tunnels system A
- the GATEWAY ZONE column contains the name of the zone
- corresponding to peer subnetworks. This indicates that the gateway
- system itself comprises the peer subnetwork; in other words, the remote
- gateway is a standalone system.
+
+
+
+ TYPE
+
+ ZONE
+
+ GATEWAY
+
+ GATEWAY ZONE
+
+
+
+
+
+ ipsec
+
+ net
+
+ 0.0.0.0/0
+
+ vpn
+
+
+
+
+
+
+ the GATEWAY ZONE column contains the name of the zone
+ corresponding to peer subnetworks. This indicates that the gateway
+ system itself comprises the peer subnetwork; in other words, the
+ remote gateway is a standalone system.
+ You will need to configure /etc/shorewall/interfaces and establish
your through the tunnel policy as shown under the first
@@ -717,7 +851,11 @@ conn packetdefault
Beginning with Shorewall release 1.3.10, you can define multiple VPN
zones and add and delete remote endpoints dynamically using
- /sbin/shorewall. In /etc/shorewall/zones:
+ /sbin/shorewall. With Shorewall 2.0.2 Beta 1 and later versions, this
+ capability must be enabled by setting DYNAMIC_ZONES=Yes in shorewall.conf.
+
+ In /etc/shorewall/zones:
/etc/shorewall/zones
@@ -801,7 +939,8 @@ conn packetdefault
a different updown script that adds the remote station to the appropriate
zone when the connection comes up and that deletes the remote station when
the connection comes down. For example, when 134.28.54.2 connects for the
- vpn2 zone the up part of the script will issue the command:
+ vpn2 zone the up part of the script will issue the
+ command:
/sbin/shorewall add ipsec0:134.28.54.2 vpn2
@@ -818,11 +957,45 @@ conn packetdefault
dyn=dynamic zone
- ACTIONSOURCEDESTINATIONPROTOCOLPORT(S)CLIENT PORT(S)ORIGINAL DESTINATIONDNATz!dynloc:192.168.1.3tcp80
+
+
+
+
+ ACTION
+
+ SOURCE
+
+ DESTINATION
+
+ PROTOCOL
+
+ PORT(S)
+
+ CLIENT PORT(S)
+
+ ORIGINAL DESTINATION
+
+
+
+
+
+ DNAT
+
+ z!dyn
+
+ loc:192.168.1.3
+
+ tcp
+
+ 80
+
+
+
+
+
+
+
+ Dynamic changes to the zone dyn
will have no effect on the above rule.
diff --git a/Shorewall-docs2/Install.xml b/Shorewall-docs2/Install.xml
index 7849f1ef9..659c588c0 100644
--- a/Shorewall-docs2/Install.xml
+++ b/Shorewall-docs2/Install.xml
@@ -15,7 +15,7 @@
- 2004-03-01
+ 2004-05-072001
@@ -35,7 +35,8 @@
1.2 or any later version published by the Free Software Foundation; with
no Invariant Sections, with no Front-Cover, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
- GNU Free Documentation License.
+ GNU Free Documentation
+ License.
@@ -44,9 +45,9 @@
Before attempting installation, I strongly urge you to read and
- print a copy of the Shorewall
- QuickStart Guide for the configuration that most closely matches
- your own.
+ print a copy of the Shorewall QuickStart Guide
+ for the configuration that most closely matches your own.
@@ -64,14 +65,15 @@
Install the RPM
- rpm -ivh <shorewall rpm>
+ rpm -ivh <shorewall rpm>Some SuSE users have encountered a problem whereby rpm reports
- a conflict with kernel <= 2.2 even though a 2.4 kernel is
- installed. If this happens, simply use the --nodeps option to rpm.
+ a conflict with kernel <= 2.2 even though a 2.4 kernel is
+ installed. If this happens, simply use the --nodeps option to
+ rpm.
- rpm -ivh --nodeps <shorewall rpm>
+ rpm -ivh --nodeps <shorewall rpm>
@@ -82,9 +84,10 @@
error: failed dependencies:iproute is needed by shorewall-1.4.x-1
- This may be worked around by using the --nodeps option of rpm.
+ This may be worked around by using the --nodeps option of
+ rpm.
- rpm -ivh --nodeps <shorewall rpm>
+ rpm -ivh --nodeps <shorewall rpm>
@@ -116,9 +119,9 @@
Before attempting installation, I strongly urge you to read and
- print a copy of the Shorewall
- QuickStart Guide for the configuration that most closely matches
- your own.
+ print a copy of the Shorewall QuickStart Guide
+ for the configuration that most closely matches your own.
To install Shorewall using the tarball and install script:
@@ -134,14 +137,19 @@
- If you are using Caldera,
- RedHat, Mandrake, Corel, SuSe, Slackware or Debian/Gentoo then type
+ If you are running Slackware, edit the install.sh
+ file and change the line
+
+ DEST=""
+
+ to
+
+ DEST="/etc/rc.d"
+
+
+
+ Type./install.sh
@@ -152,9 +160,10 @@
- Enable Startup by removing /etc/shorewall/startup_disabled
- (Debian users will edit /etc/default/shorewall
- and set startup=1).
+ Enable Startup by removing
+ /etc/shorewall/startup_disabled (Debian users
+ will edit /etc/default/shorewall and set
+ startup=1).
@@ -166,7 +175,8 @@
If the install script was unable to configure Shorewall to be
started automatically at boot, see these instructions.
+ url="starting_and_stopping_shorewall.htm">these
+ instructions.
@@ -176,15 +186,16 @@
Before attempting installation, I strongly urge you to read and
- print a copy of the Shorewall
- QuickStart Guide for the configuration that most closely matches
- your own.
+ print a copy of the Shorewall QuickStart Guide
+ for the configuration that most closely matches your own.
To install my version of Shorewall on a fresh Bering disk, simply
replace the shorwall.lrp file on the image with the file
that you downloaded. See the two-interface
- QuickStart Guide for information about further steps required.
+ QuickStart Guide for information about further steps
+ required.
@@ -204,22 +215,23 @@
please check your /etc/shorewall/interfaces file to be sure that it
contains an entry for each interface mentioned in the hosts file. Also,
there are certain 1.2 rule forms that are no longer supported under 1.4
- (you must use the new 1.4 syntax). See the
- upgrade issues for details.
+ (you must use the new 1.4 syntax). See the upgrade issues for details.
Upgrade the RPM
- rpm -Uvh <shorewall rpm file>
+ rpm -Uvh <shorewall rpm file>Some SuSE users have encountered a problem whereby rpm reports
- a conflict with kernel <= 2.2 even though a 2.4 kernel is
- installed. If this happens, simply use the --nodeps option to rpm.
+ a conflict with kernel <= 2.2 even though a 2.4 kernel is
+ installed. If this happens, simply use the --nodeps option to
+ rpm.
- rpm -Uvh --nodeps <shorewall rpm>
+ rpm -Uvh --nodeps <shorewall rpm>
@@ -230,15 +242,17 @@
error: failed dependencies:iproute is needed by shorewall-1.4.0-1
- This may be worked around by using the --nodeps option of rpm.
+ This may be worked around by using the --nodeps option of
+ rpm.
- rpm -Uvh --nodeps <shorewall rpm>
+ rpm -Uvh --nodeps <shorewall rpm>See if there are any incompatibilities between your
- configuration and the new Shorewall version and correct as necessary.
+ configuration and the new Shorewall version and correct as
+ necessary.
shorewall check
@@ -268,8 +282,8 @@
please check your /etc/shorewall/interfaces file to be sure that it
contains an entry for each interface mentioned in the hosts file. Also,
there are certain 1.2 rule forms that are no longer supported under 1.4
- (you must use the new 1.4 syntax). See the
- upgrade issues for details.
+ (you must use the new 1.4 syntax). See the upgrade issues for details.
@@ -285,21 +299,27 @@
- If you are using Caldera,
- RedHat, Mandrake, Corel, SuSe, Slackware or Debian/Gentoo then type
+ If you are running Slackware, edit the install.sh
+ file and change the line
+
+ DEST=""
+
+ to
+
+ DEST="/etc/rc.d"
+
+
+
+ Type./install.shSee if there are any incompatibilities between your
- configuration and the new Shorewall version and correct as necessary.
+ configuration and the new Shorewall version and correct as
+ necessary.
shorewall check
@@ -313,7 +333,8 @@
If the install script was unable to configure Shorewall to be
started automatically at boot, see these instructions.
+ url="starting_and_stopping_shorewall.htm">these
+ instructions.
@@ -342,6 +363,7 @@
Uninstall/Fallback
- See Fallback and Uninstall.
+ See Fallback and
+ Uninstall.
\ No newline at end of file
diff --git a/Shorewall-docs2/PPTP.xml b/Shorewall-docs2/PPTP.xml
index e77fd236b..ffbee2a2b 100644
--- a/Shorewall-docs2/PPTP.xml
+++ b/Shorewall-docs2/PPTP.xml
@@ -15,7 +15,7 @@
- 2003-12-23
+ 2004-04-152001
@@ -24,6 +24,8 @@
2003
+ 2004
+
Thomas M. Eastep
@@ -37,6 +39,16 @@
+
+ 1.2
+
+ 2004-04-15
+
+ TE
+
+ Revised instructions regarding PPTP conntrack patch.
+
+
1.1
@@ -909,14 +921,16 @@ esac
You shouldn't have to take any special action for this case
unless you wish to connect multiple clients to the same external server.
- In that case, you will need to follow the instructions at http://www.impsec.org/linux/masquerade/ip_masq_vpn.html.
- I recommend that you also add these three lines to your
+ In that case, you must install the PPTP connection/tracking and NAT patch
+ from Netfilter Patch-O-Matic
+ (some distributions are now shipping with this patch installed). I
+ recommend that you also add these four lines to your
/etc/shorewall/modules file:loadmodule ip_conntrack_proto_gre
loadmodule ip_conntrack_pptp
-loadmodule ip_nat_pptp
+loadmodule ip_nat_pptp
+loadmodule ip_nat_proto_gre
For LEAF/Bering users, the 2.4.20 kernel as already been patched as
described at the URL above and the three modules are included in the
diff --git a/Shorewall-docs2/Shorewall_Squid_Usage.xml b/Shorewall-docs2/Shorewall_Squid_Usage.xml
index 401fc5bdb..1443a9b38 100644
--- a/Shorewall-docs2/Shorewall_Squid_Usage.xml
+++ b/Shorewall-docs2/Shorewall_Squid_Usage.xml
@@ -15,7 +15,7 @@
- 2004-03-29
+ 2004-04-192003-2004
@@ -153,7 +153,7 @@ REDIRECT loc 3228 tcp www - !206.124.146.
In /etc/shorewall/init, put:if [ -z "`ip rule list | grep www.out`" ] ; then
- ip rule add fwmark 202 table www.out
+ ip rule add fwmark CA table www.out # Note 0xCA = 202
ip route add default via 192.168.1.3 dev eth1 table www.out
ip route flush cache
echo 0 > /proc/sys/net/ipv4/conf/eth1/send_redirects
@@ -232,7 +232,7 @@ chkconfig --level 35 iptables onIn /etc/shorewall/init, put:if [ -z "`ip rule list | grep www.out`" ] ; then
- ip rule add fwmark 202 table www.out
+ ip rule add fwmark CA table www.out # Note 0xCA = 202
ip route add default via 192.0.2.177 dev eth1 table www.out
ip route flush cache
fi
diff --git a/Shorewall-docs2/bridge.xml b/Shorewall-docs2/bridge.xml
index 36022d12b..6127c0017 100755
--- a/Shorewall-docs2/bridge.xml
+++ b/Shorewall-docs2/bridge.xml
@@ -15,7 +15,7 @@
- 2004-04-05
+ 2004-04-122004
@@ -152,7 +152,7 @@
Configuring the Bridge
- Configuring the bridge itself is quite simple and used the
+ Configuring the bridge itself is quite simple and uses the
brctl utility from the bridge-utils package. Bridge
configuration information may be found at http://bridge.sf.net.
@@ -334,7 +334,7 @@ dmz br0:eth2
Limitations
- Bridging doesn' t work with wireless cards — see Bridging doesn' t work with some wireless cards — see http://bridge.sf.net.
\ No newline at end of file
diff --git a/Shorewall-docs2/configuration_file_basics.xml b/Shorewall-docs2/configuration_file_basics.xml
index 272005a22..48d2685cb 100644
--- a/Shorewall-docs2/configuration_file_basics.xml
+++ b/Shorewall-docs2/configuration_file_basics.xml
@@ -15,7 +15,7 @@
- 2004-04-03
+ 2004-04-202001-2004
@@ -93,6 +93,16 @@
and modify the copy.
+
+ Special Note about /etc/shorewall/shorewall.conf
+
+ It is a good idea to modify your /etc/shorewall/shorewall.conf file,
+ even if you just add a comment that says "I modified this file".
+ That way, your package manager won't overwrite the file with future
+ updated versions. Such overwrites can cause unwanted changes in the
+ behavior of Shorewall.
+
+
Comments
@@ -381,9 +391,12 @@ DNAT net loc:192.168.1.3 tcp 4000:4100
Using MAC AddressesMedia Access Control (MAC) addresses can be used to specify packet
- source in several of the configuration files. To use this feature, your
- kernel must have MAC Address Match support (CONFIG_IP_NF_MATCH_MAC)
- included.
+ source in several of the configuration files. In order to control traffic
+ to/from a host by its MAC address, the host must be on the same network as
+ the firewall.
+
+ To use this feature, your kernel must have MAC Address Match support
+ (CONFIG_IP_NF_MATCH_MAC) included.MAC addresses are 48 bits wide and each Ethernet Controller has a
unique MAC address.
diff --git a/Shorewall-docs2/errata.xml b/Shorewall-docs2/errata.xml
index 0d15d66df..524d5b0a5 100644
--- a/Shorewall-docs2/errata.xml
+++ b/Shorewall-docs2/errata.xml
@@ -13,7 +13,7 @@
- 2004-03-20
+ 2004-05-032001-2004
@@ -27,7 +27,8 @@
1.2 or any later version published by the Free Software Foundation; with
no Invariant Sections, with no Front-Cover, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
- GNU Free Documentation License.
+ GNU Free Documentation
+ License.
@@ -55,9 +56,9 @@
DO NOT INSTALL CORRECTED COMPONENTS ON A
- RELEASE EARLIER THAN THE ONE THAT THEY ARE LISTED UNDER BELOW.
- For example, do NOT install the 1.3.9a firewall script if you are
- running 1.3.7c.
+ RELEASE EARLIER THAN THE ONE THAT THEY ARE LISTED UNDER
+ BELOW. For example, do NOT install the 1.3.9a firewall
+ script if you are running 1.3.7c.
@@ -65,7 +66,8 @@
RFC1918 File
- Here
+ Here
is the most up to date version of the rfc1918 file. This file only
applies to Shorewall version 2.0.0 and its bugfix updates. In Shorewall
@@ -75,9 +77,75 @@
url="shorewall_setup_guide.htm#RFC1918">RFC 1918.
+
+ Bogons File
+
+ Here
+ is the most up to date version of the bogons file.
+
+
Problems in Version 2.0
+
+ Shorewall 2.0.1
+
+
+
+ Confusing message mentioning IPV6 occur at startup.
+
+
+
+ Modules listed in /etc/shorewall/modules don't load or produce
+ errors on Mandrake 10.0 Final.
+
+
+
+ The shorewall delete command does not
+ remove all dynamic rules pertaining to the host(s) being
+ deleted.
+
+
+
+ These problems are corrected in this
+ firewall script which may be installed in
+ /usr/share/shorewall/firewall as described
+ above.
+
+
+
+ When run on a SuSE system, the install.sh script fails to
+ configure Shorewall to start at boot time. That problem is corrected
+ in this
+ version of the script.
+
+
+
+
+
+ Shorewall 2.0.1/2.0.0
+
+
+
+ On Debian systems, an install using the tarball results in an
+ inability to start Shorewall at system boot. If you already have
+ this problem, install this
+ file as /etc/init.d/shorewall (replacing the existing file
+ with that name). If you are just installing or upgrading to
+ Shorewall 2.0.0 or 2.0.1, then replace the
+ init.debian.sh file in the Shorewall
+ distribution directory (shorewall-2.0.x) with the updated file
+ before running install.sh from that
+ directory.
+
+
+
+
Shorewall 2.0.0
@@ -95,11 +163,13 @@
- The first problem has been corrected in Shorewall update 2.0.0a.
+ The first problem has been corrected in Shorewall update
+ 2.0.0a.All of these problems may be corrected by installing this
- firewall script in /usr/share/shorewall as described above.
+ firewall script in /usr/share/shorewall as described
+ above.
@@ -111,118 +181,12 @@
- Problem with iptables version 1.2.3
+ Problem with iptables 1.2.9
- There are a couple of serious bugs in iptables 1.2.3 that prevent it
- from working with Shorewall. Regrettably, RedHat released this buggy
- iptables in RedHat 7.2.
-
- I have built a corrected
- 1.2.3 rpm which you can download here and I have also
- built an iptables-1.2.4
- rpm which you can download here. If you are currently running
- RedHat 7.1, you can install either of these RPMs before you upgrade to
- RedHat 7.2.
-
- Update 11/9/2001: RedHat has
- released an iptables-1.2.4 RPM of their own which you can download from
- http://www.redhat.com/support/errata/RHSA-2001-144.html.I
- have installed this RPM on my firewall and it works fine.
-
- If you would like to patch iptables 1.2.3 yourself, the patches are
- available for download. This patch
- which corrects a problem with parsing of the --log-level specification
- while this patch
- corrects a problem in handling the TOS target.
-
- To install one of the above patches: cd iptables-1.2.3/extensions
- patch -p0 < the-patch-file
-
-
-
- Problems with kernels >= 2.4.18 and RedHat iptables
-
- Users who use RedHat iptables RPMs and who upgrade to kernel
- 2.4.18/19 may experience the following:
-
-