diff --git a/Shorewall-docs/Documentation.htm b/Shorewall-docs/Documentation.htm index e250081f8..b8dbf4ef3 100644 --- a/Shorewall-docs/Documentation.htm +++ b/Shorewall-docs/Documentation.htm @@ -1,3168 +1,3350 @@ - + - + - + Shorewall 1.4 Documentation - + + - + - + - + - - - - + + + +

Shorewall 1.4 Reference

+ + + +
- - -

Shorewall 1.4 Reference

-
+ -
- -

This documentation is intended primarily for reference. - Step-by-step instructions for configuring Shorewall - in common setups may be found in the QuickStart Guides.

- + +

This documentation is intended primarily for reference. + Step-by-step instructions for configuring +Shorewall in common setups may be found in the +QuickStart Guides.

+

Components

- +

Shorewall consists of the following components:

- + - +

/etc/shorewall/params

- -

You may use the file /etc/shorewall/params file to set shell variables - that you can then use in some of the other configuration - files.

- + +

You may use the file /etc/shorewall/params file to set shell variables + that you can then use in some of the other configuration + files.

+

It is suggested that variable names begin with an upper case letter to distinguish them from variables used internally - within the Shorewall programs

- + size="1"> to distinguish them from variables used internally + within the Shorewall programs

+

Example:

- +
 	NET_IF=eth0
NET_BCAST=130.252.100.255
NET_OPTIONS=blacklist,norfc1918
- +

Example (/etc/shorewall/interfaces record):

- +
	net $NET_IF $NET_BCAST $NET_OPTIONS
- +

The result will be the same as if the record had been written

- +
	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.

+

/etc/shorewall/zones

- -

This file is used to define the network zones. There is one entry - in /etc/shorewall/zones for each zone; Columns in - an entry are:

- + +

This file is used to define the network zones. There is one entry + in /etc/shorewall/zones for each zone; Columns + in an entry are:

+ - +

The /etc/shorewall/zones file released with Shorewall is as follows:

- + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +
ZONE DISPLAY COMMENTS
netNetInternet
locLocalLocal networks
dmzDMZDemilitarized - zone
ZONE DISPLAY COMMENTS
netNetInternet
locLocalLocal networks
dmzDMZDemilitarized + 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.

+

Warning 1: If you rename or delete a zone, you should perform "shorewall - stop; shorewall start" to install the change rather - than "shorewall restart".

- + color="#ff0000"> If you rename or delete a zone, you should perform "shorewall + stop; shorewall start" to install the change +rather than "shorewall restart".

+

Warning 2: The order of entries in the /etc/shorewall/zones file is - significant in some cases.

- + color="#ff0000">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 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:

- + +

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:

+ - +

My recommendations concerning options:
-

- +

+ - +

- -

Example 1: 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:

- -
+ +

Example 1: 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:

+ +
- - - - - - - - - - - - - - - - - - - + - - -
ZONE INTERFACE BROADCAST OPTIONS
neteth0detectdhcp,norfc1918,blacklist
loceth1detect
-
-
- -

Example 2: You have a standalone dialup GNU/Linux System. Your /etc/shorewall/interfaces - file would be:

- -
- - - - - - - - - - - - - - - - - - -
ZONE INTERFACE BROADCAST OPTIONS
netppp0
-

-
-
- -

Example 3: You have local interface eth1 with two IP addresses - - 192.168.1.1/24 and 192.168.12.1/24

- -
- - - - - - - - - - - - - - - - - - -
ZONE INTERFACE BROADCAST OPTIONS
loceth1192.168.1.255,192.168.12.255
-
-
- -

/etc/shorewall/hosts - Configuration

- -

For most applications, specifying zones entirely in terms of network - interfaces is sufficient. There may be times though where you need to define -a zone to be a more general collection of hosts. This is the purpose of -the /etc/shorewall/hosts file.

- -

WARNING: The only times that you need entries -in /etc/shorewall/hosts are:
-

- -
    -
  1. You have more than one zone connecting through a single - interface; or
  2. -
  3. You have a zone that has multiple subnetworks that -connect through a single interface and you want the Shorewall box to -route traffic between those subnetworks.
    -
  4. - -
- IF YOU DON'T HAVE EITHER OF THOSE SITUATIONS THEN DON'T TOUCH - THIS FILE!! -

Columns in this file are:

- - - -
-
    -
  1. An IP -address (example - eth1:192.168.1.3)
  2. -
  3. A subnet - in CIDR notation (example -- eth2:192.168.2.0/24)
  4. - -
- -

The interface name much match an entry in /etc/shorewall/interfaces.

-
- - - -
-

routeback (Added in version 1.4.2) - This option causes Shorewall - to set up handling for routing packets sent by this host group back -back to the same group.
-
- maclist -
Added in version 1.3.10. If specified, connection - requests from the hosts specified in this entry are subject - to MAC Verification. This option -is only valid for ethernet interfaces.
-

-
- -

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.

- -

Note: 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.

- -

Example 1:

- -

Your local interface is eth1 and you have two groups of local hosts that - you want to make into separate zones:

- - - -

Your /etc/shorewall/interfaces file might look like:

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
ZONE INTERFACE BROADCAST OPTIONS
neteth0detectdhcp,norfc1918
-eth1192.168.1.127,192.168.1.255
-

-
-
- -

The '-' in the ZONE column for eth1 tells Shorewall that eth1 interfaces - to multiple zones.

- -

Your /etc/shorewall/hosts file might look like:

- -
- - - - - - - - - - - - - - - - - - - - - - -
ZONE HOST(S) OPTIONS
loc1eth1:192.168.1.0/25
-
loc2eth1:192.168.1.128/25
-
-
- -

Example 2:

- -

Your local interface is eth1 and you have two groups of local hosts that - you want to consider as one zone and you want Shorewall to route between - them:

- - - -

Your /etc/shorewall/interfaces file might look like:

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
ZONE INTERFACE BROADCAST OPTIONS
neteth0detectdhcp,norfc1918
loc
-
eth1192.168.1.127,192.168.1.255
-

-
-
- -

Your /etc/shorewall/hosts file might look like:

- -
- - - - - - - - - - - - - - - - - - - - - - -
ZONE HOST(S) OPTIONS
loceth1:192.168.1.0/25
-
loceth1:192.168.1.128/25
-
-
- -

Nested and Overlapping Zones

- -

The /etc/shorewall/interfaces and /etc/shorewall/hosts file allow -you to define nested or overlapping zones. Such overlapping/nested zones - are allowed and Shorewall processes zones in the order -that they appear in the /etc/shorewall/zones file. So if -you have nested zones, you want the sub-zone to appear before -the super-zone and in the case of overlapping zones, the rules - that will apply to hosts that belong to both zones is determined - by which zone appears first in /etc/shorewall/zones.

- -

Hosts that belong to more than one zone may be managed by the rules - of all of those zones. This is done through use of -the special CONTINUE policy described -below.

- -

/etc/shorewall/policy - Configuration.

- -

This file is used to describe the firewall policy regarding establishment - of connections. Connection establishment is described - in terms of clients who initiate connections and - servers who receive those connection requests. -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.

- -

Four policies are defined:

- - - -

For each policy specified in /etc/shorewall/policy, you can indicate - 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:

- -
    - -
  1. SOURCE - The name of a client zone -(a zone defined in the /etc/shorewall/zones - file , the name of the firewall -zone or "all").
  2. - -
  3. DEST - The name of a destination zone -(a zone defined in the /etc/shorewall/zones - file , the name of the firewall zone -or "all"). Shorewall automatically allows all traffic from the -firewall to itself so the name of the firewall zone -cannot appear in both the SOURCE and DEST columns.
  4. - -
  5. POLICY - The default policy for connection - requests from the SOURCE zone to the DESTINATION zone.
  6. - -
  7. LOG LEVEL - Optional. If left empty, -no log message is generated when the policy is applied. -Otherwise, this column should contain an integer or name -indicating a syslog level.
  8. - -
  9. LIMIT:BURST - Optional. 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 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.
  10. - -
- -

In the SOURCE and DEST columns, you can enter "all" to indicate all - zones.

- -

The policy file installed by default is as follows:

- -
- - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + - - + +
SOURCEDEST POLICY LOG LEVELLIMIT:BURST
locnetACCEPT
-

-
ZONE INTERFACE BROADCAST OPTIONS
netallDROPinfo
-
allallREJECTinfo
-
neteth0detectdhcp,norfc1918,blacklist
loceth1detect
+
-
- -

This table may be interpreted as follows:

- - - -

WARNING:

- -

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.

- -
- +
+ +

Example 2: You have a standalone dialup GNU/Linux System. Your /etc/shorewall/interfaces + file would be:

+ +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + + + + + + + + + + + + +
SOURCEDESTPOLICYLOG LEVELLIMIT:BURST
locallACCEPT
-

-
netallDROPinfo
-
loclocREJECTinfo
-
ZONE INTERFACE BROADCAST OPTIONS
netppp0
+

+
-
- -

IntraZone Traffic

- Shorewall allows a zone to be associated with more than one -interface or with multiple networks that interface through a single -interface. Beginning with Shorewall 1.4.1, Shorewall will ACCEPT all -traffic from a zone to itself provided that there is no explicit policy -governing traffic from that zone to itself (an explicit policy does not -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.
- -

Any time that you have multiple interfaces associated with a single zone, - you should ask yourself if you really want traffic routed between those - interfaces. Cases where you might not want that behavior are:
-

- +
+ +

Example 3: You have local interface eth1 with two IP addresses - + 192.168.1.1/24 and 192.168.12.1/24

+ +
+ + + + + + + + + + + + + + + + + + +
ZONE INTERFACE BROADCAST OPTIONS
loceth1192.168.1.255,192.168.12.255
+
+
+ +

/etc/shorewall/hosts + Configuration

+ +

For most applications, specifying zones entirely in terms of network + interfaces is sufficient. There may be times though where you need to +define a zone to be a more general collection of hosts. This is the purpose +of the /etc/shorewall/hosts file.

+ +

WARNING: The only times that you need +entries in /etc/shorewall/hosts are:
+

+
    -
  1. Multiple 'net' interfaces to different ISPs. You don't -want to route traffic from one ISP to the other through your firewall.
  2. -
  3. Multiple VPN clients. You don't necessarily want them -to all be able to communicate between themselves using your gateway/router.
    -
  4. - +
  5. You have more than one zone connecting through +a single interface; or
  6. +
  7. You have a zone that has multiple subnetworks +that connect through a single interface and you want the Shorewall +box to route traffic between those subnetworks.
    +
  8. +
- -

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:

- -

/etc/shorewall/zones:

- -
+ IF YOU DON'T HAVE EITHER OF THOSE SITUATIONS THEN DON'T + TOUCH THIS FILE!! +

Columns in this file are:

+ + + +
+
    +
  1. An + IP address (example - eth1:192.168.1.3)
  2. +
  3. A + subnet in CIDR notation (example + - eth2:192.168.2.0/24)
  4. + + +
+ + +

The interface name much match an entry in /etc/shorewall/interfaces.

+
+ + + +
+

routeback (Added in version 1.4.2) - This option causes Shorewall + to set up handling for routing packets sent by this host group back + back to the same group.
+
+ maclist -
Added in version 1.3.10. If specified, connection + requests from the hosts specified in this entry are subject + to MAC Verification. This option + is only valid for ethernet interfaces.
+

+
+ +

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.

+ +

Note: 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.

+ +

Example 1:

+ +

Your local interface is eth1 and you have two groups of local hosts that + you want to make into separate zones:

+ + + +

Your /etc/shorewall/interfaces file might look like:

+ +
- + + + + + + + + + + + + + + + + + + + + + + + +
ZONE INTERFACE BROADCAST OPTIONS
neteth0detectdhcp,norfc1918
-eth1192.168.1.127,192.168.1.255
+

+
+
+ +

The '-' in the ZONE column for eth1 tells Shorewall that eth1 interfaces + to multiple zones.

+ +

Your /etc/shorewall/hosts file might look like:

+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
ZONE HOST(S) OPTIONS
loc1eth1:192.168.1.0/25
+
loc2eth1:192.168.1.128/25
+
+
+ +

Example 2:

+ +

Your local interface is eth1 and you have two groups of local hosts that + you want to consider as one zone and you want Shorewall to route +between them:

+ + + +

Your /etc/shorewall/interfaces file might look like:

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
ZONE INTERFACE BROADCAST OPTIONS
neteth0detectdhcp,norfc1918
loc
+
eth1192.168.1.127,192.168.1.255
+

+
+
+ +

Your /etc/shorewall/hosts file might look like:

+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
ZONE HOST(S) OPTIONS
loceth1:192.168.1.0/25
+
loceth1:192.168.1.128/25
+
+
+ +

Nested and Overlapping +Zones

+ +

The /etc/shorewall/interfaces and /etc/shorewall/hosts file allow you + to define nested or overlapping zones. Such overlapping/nested zones + are allowed and Shorewall processes zones in the order that + they appear in the /etc/shorewall/zones file. So if you have + nested zones, you want the sub-zone to appear before the +super-zone and in the case of overlapping zones, the rules + that will apply to hosts that belong to both zones is determined + by which zone appears first in /etc/shorewall/zones.

+ +

Hosts that belong to more than one zone may be managed by the rules + of all of those zones. This is done through use +of the special CONTINUE policy described + below.

+ +

/etc/shorewall/policy + Configuration.

+ +

This file is used to describe the firewall policy regarding establishment + of connections. Connection establishment is described + in terms of clients who initiate connections +and servers who receive those connection requests. + 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.

+ +

Four policies are defined:

+ + + +

For each policy specified in /etc/shorewall/policy, you can indicate + 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:

+ +
    + +
  1. SOURCE - The name of a client + zone (a zone defined in the /etc/shorewall/zones + file , the name of the firewall + zone or "all").
  2. + +
  3. DEST - The name of a destination + zone (a zone defined in the /etc/shorewall/zones + file , the name of the firewall +zone or "all"). Shorewall automatically allows all traffic +from the firewall to itself so the name of the +firewall zone cannot appear in both the SOURCE and DEST columns.
  4. + +
  5. POLICY - The default policy +for connection requests from the SOURCE zone to the DESTINATION + zone.
  6. + +
  7. LOG LEVEL - Optional. If left + empty, no log message is generated when the policy is applied. + Otherwise, this column should contain an integer or + name indicating a syslog level.
  8. + +
  9. LIMIT:BURST - Optional. 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 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.
  10. + +
+ +

In the SOURCE and DEST columns, you can enter "all" to indicate all + zones.

+ +

The policy file installed by default is as follows:

+ +
+ + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + +
ZONE DISPLAY COMMENTS
samSamSam's system -at home
netInternetThe Internet
locLocLocal Network
SOURCEDEST POLICY LOG +LEVELLIMIT:BURST
locnetACCEPT
+

+
netallDROPinfo
+
allallREJECTinfo
+
-
- +
+ +

This table may be interpreted as follows:

+ + + +

WARNING:

+ +

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.

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SOURCEDESTPOLICYLOG LEVELLIMIT:BURST
locallACCEPT
+

+
netallDROPinfo
+
loclocREJECTinfo
+
+
+ +

IntraZone Traffic

+ Shorewall allows a zone to be associated with more than +one interface or with multiple networks that interface through a single + interface. Beginning with Shorewall 1.4.1, Shorewall will ACCEPT all + traffic from a zone to itself provided that there is no explicit policy + governing traffic from that zone to itself (an explicit policy does +not 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.
+ +

Any time that you have multiple interfaces associated with a single zone, + you should ask yourself if you really want traffic routed between + those interfaces. Cases where you might not want that behavior are:
+

+ +
    +
  1. Multiple 'net' interfaces to different ISPs. You +don't want to route traffic from one ISP to the other through your +firewall.
  2. +
  3. Multiple VPN clients. You don't necessarily want +them to all be able to communicate between themselves using your gateway/router.
    +
  4. + +
+ +

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:

+ +

/etc/shorewall/zones:

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
ZONE DISPLAY COMMENTS
samSamSam's system + at home
netInternetThe Internet
locLocLocal Network
+
+

/etc/shorewall/interfaces:

- -
+ +
- - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - + +
ZONE INTERFACE BROADCAST OPTIONS
-eth0detectdhcp,norfc1918
loceth1detect
-
ZONE INTERFACE BROADCAST OPTIONS
-eth0detectdhcp,norfc1918
loceth1detect
+
-
- +
+

/etc/shorewall/hosts:

- +
- + face="Century Gothic, Arial, Helvetica"> + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - + +
ZONE HOST(S) OPTIONS
neteth0:0.0.0.0/0
-
sameth0:206.191.149.197
-
ZONE HOST(S) OPTIONS
neteth0:0.0.0.0/0
+
sameth0:206.191.149.197
+
-
- -

Note that 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.

- + + +

Note that 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:

- +
- + face="Century Gothic, Arial, Helvetica"> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + +
SOURCE DEST POLICY LOG LEVEL
locnetACCEPT
-
samallCONTINUE
-
netallDROPinfo
allallREJECTinfo
+ SOURCE + DEST POLICY LOG +LEVEL
locnetACCEPT
+
samallCONTINUE
+
netallDROPinfo
allallREJECTinfo
-
- -

The second entry above says that when Sam is the client, connection - requests should first be process under rules where - the source 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).

- + + +

The second entry above says that when Sam is the client, connection + requests should first be process under rules where + the source 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).

+

Partial /etc/shorewall/rules:

- +
- + face="Century Gothic, Arial, Helvetica"> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ACTIONSOURCEDEST PROTODEST
- PORT(S)
SOURCE
- PORT(S)
ORIGINAL
- DEST
...
-

-

-

-

-

-
DNATsamloc:192.168.1.3tcpssh-
-
DNATnetloc:192.168.1.5tcpwww-
-
...
-

-

-

-

-

-
-
- -

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:

- -
-

- - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
ACTIONSOURCEDEST PROTODEST
- PORT(S)
SOURCE
- PORT(S)
ORIGINAL
- DEST
ACTIONSOURCEDEST PROTODEST
+ PORT(S)
SOURCE
+ PORT(S)
ORIGINAL
+ DEST
...
+

+

+

+

+

+
DNATsamloc:192.168.1.3tcpssh-
+
DNATnetloc:192.168.1.5tcpwww-
+
...
+

+

+

+

+

+

-

-

-

-

-

-

-
...
-

-

-

-

-

-
DNATsamfwtcpssh-
-
DNATnet!samloc:192.168.1.3tcpssh-
-
...
-

-

-

-

-

-
-
- -

The first rule allows Sam SSH access to the firewall. The second - rule says that any clients from the net zone - with the exception of those in the 'sam' - zone should have their connection - port forwarded to 192.168.1.3. -If you need to exclude more -than one zone in this way, you - can list the zones separated by - commas (e.g., net!sam,joe,fred). This technique -also may be used when the ACTION -is REDIRECT.

- + + +

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:

+ +
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ACTIONSOURCEDEST PROTODEST
+ PORT(S)
SOURCE
+ PORT(S)
ORIGINAL
+ DEST

+

+

+

+

+

+

+
...
+

+

+

+

+

+
DNATsamfwtcpssh-
+
DNATnet!samloc:192.168.1.3tcpssh-
+
...
+

+

+

+

+

+
+
+ +

The first rule allows Sam SSH access to the firewall. The second + rule says that any clients from the net zone + with the exception of those in the 'sam' + zone should have their connection + port forwarded to 192.168.1.3. + If you need to exclude more + than one zone in this way, you + can list the zones separated by + commas (e.g., net!sam,joe,fred). This + technique also may be used when + the ACTION is REDIRECT.

+

/etc/shorewall/rules

- -

The /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.
-

- -

Shorewall automatically enables firewall->firewall traffic over the - loopback interface (lo) -- that traffic cannot be regulated - using rules and any rule that tries to regulate such traffic - will generate a warning and will be ignored.
-

- -

Entries in the file have the following columns:

- - + +

6/6/2002 - Why CVS Web access is Password Protected

- -

Last weekend, I installed the CVS Web package to provide brower-based -access to the Shorewall CVS repository. Since then, I have had several -instances where my server was almost unusable due to the high load generated -by website copying tools like HTTrack and WebStripper. These mindless tools:

+ +

Last weekend, I installed the CVS Web package to provide brower-based access + to the Shorewall CVS repository. Since then, I have had several instances +where my server was almost unusable due to the high load generated by website +copying tools like HTTrack and WebStripper. These mindless tools:

- + +
  • Should be classified as weapons rather than +tools.
  • -

    These tools/weapons are particularly damaging when combined with CVS Web - because they doggedly follow every link - in the cgi-generated HTML resulting in 1000s - of executions of the cvsweb.cgi script. Yesterday, - I spend several hours implementing measures to block -these tools but unfortunately, these measures resulted - in my server OOM-ing under even moderate load.

    + - -

    Until I have the time to understand the cause of the OOM (or until I buy - more RAM if that is what is required), - CVS Web access will remain Password Protected. +

    These tools/weapons are particularly damaging when combined with CVS Web + because they doggedly follow every link + in the cgi-generated HTML resulting in 1000s + of executions of the cvsweb.cgi script. Yesterday, + I spend several hours implementing measures to block these + tools but unfortunately, these measures resulted in + my server OOM-ing under even moderate load.

    + + + +

    Until I have the time to understand the cause of the OOM (or until I buy + more RAM if that is what is required), + CVS Web access will remain Password Protected.

    - +

    6/5/2002 - Shorewall 1.3.1 Debian Package Available

    - +

    Lorenzo Marignoni reports that the package is available at http://security.dsi.unimi.it/~lorenzo/debian.html.

    - +

    6/2/2002 - Samples Corrected

    - -

    The 1.3.0 samples configurations had several serious problems that prevented - DNS and SSH from working properly. These + +

    The 1.3.0 samples configurations had several serious problems that prevented + DNS and SSH from working properly. These problems have been corrected in the 1.3.1 samples.

    - +

    6/1/2002 - Shorewall 1.3.1 Released

    - +

    Hot on the heels of 1.3.0, this release:

    - + - +

    5/29/2002 - Shorewall 1.3.0 Released

    - -

    In addition to the changes in Beta 1, Beta 2 and RC1, Shorewall 1.3.0 - includes:

    + +

    In addition to the changes in Beta 1, Beta 2 and RC1, Shorewall 1.3.0 + includes:

    - + +
  • A 'filterping' interface option that allows + ICMP echo-request (ping) requests addressed + to the firewall to be handled by entries in /etc/shorewall/rules + and /etc/shorewall/policy.
  • + + +

    5/23/2002 - Shorewall 1.3 RC1 Available

    - -

    In addition to the changes in Beta 1 and Beta 2, RC1 (Version 1.2.92) - incorporates the following:

    + +

    In addition to the changes in Beta 1 and Beta 2, RC1 (Version 1.2.92) + incorporates the following:

    - + - +

    5/19/2002 - Shorewall 1.3 Beta 2 Available

    - -

    In addition to the changes in Beta 1, this release which carries the -designation 1.2.91 adds:

    + +

    In addition to the changes in Beta 1, this release which carries the + designation 1.2.91 adds:

    - + - +

    5/17/2002 - Shorewall 1.3 Beta 1 Available

    - -

    Beta 1 carries the version designation 1.2.90 and implements the following + +

    Beta 1 carries the version designation 1.2.90 and implements the following features:

    - + +
  • WARNING:  Compatibility with + the old parameterized sample configurations has NOT been + maintained. Users still running those configurations should + migrate to the new sample configurations before +upgrading to 1.3 Beta 1.
  • + + +

    5/4/2002 - Shorewall 1.2.13 is Available

    - +

    In this version:

    - + +
  • The order in which port forwarding DNAT and + Static DNAT can +now be reversed so that port forwarding rules can +override the contents of /etc/shorewall/nat. +
  • + + +

    4/30/2002 - Shorewall Debian News

    - -

    Lorenzo Marignoni reports that Shorewall 1.2.12 is now in both the -Debian - Testing Branch and the Debian - Unstable Branch.

    + +

    Lorenzo Marignoni reports that Shorewall 1.2.12 is now in both the Debian +Testing Branch and the Debian +Unstable Branch.

    - +

    4/20/2002 - Shorewall 1.2.12 is Available

    - + +
  • There is now a single RPM that also works with + SuSE.
  • + + +

    4/17/2002 - Shorewall Debian News

    - +

    Lorenzo Marignoni reports that:

    - + +
  • Shorewall 1.2.11 is in the Debian + Unstable Branch
  • + + +

    Thanks, Lorenzo!

    - +

    4/16/2002 - Shorewall 1.2.11 RPM Available for SuSE

    - -

    Thanks to Stefan Mohr, there + +

    Thanks to Stefan Mohr, there is now a Shorewall 1.2.11 - SuSE RPM available.

    + href="http://www.shorewall.net/pub/shorewall/shorewall-1.2-11.i686.suse73.rpm"> + SuSE RPM available.

    - +

    4/13/2002 - Shorewall 1.2.11 Available

    - +

    In this version:

    - + - +

    4/13/2002 - Hamburg Mirror now has FTP

    - +

    Stefan now has an FTP mirror at ftp://germany.shorewall.net/pub/shorewall.  + href="ftp://germany.shorewall.net/pub/shorewall"> ftp://germany.shorewall.net/pub/shorewall.  Thanks Stefan!

    - +

    4/12/2002 - New Mirror in Hamburg

    - -

    Thanks to Stefan Mohr, there - is now a mirror of the Shorewall website - at http://germany.shorewall.net. + +

    Thanks to Stefan Mohr, there + is now a mirror of the Shorewall website + at http://germany.shorewall.net.

    - +

    4/10/2002 - Shorewall QuickStart Guide Version 1.1 Available

    - -

    Version 1.1 of the QuickStart - Guide is now available. Thanks to - those who have read version 1.0 and offered their - suggestions. Corrections have also been made to the + +

    Version 1.1 of the QuickStart + Guide is now available. Thanks to + those who have read version 1.0 and offered their + suggestions. Corrections have also been made to the sample scripts.

    - +

    4/9/2002 - Shorewall QuickStart Guide Version 1.0 Available

    - -

    Version 1.0 of the QuickStart - Guide is now available. This Guide - and its accompanying sample configurations -are expected to provide a replacement for the recently - withdrawn parameterized samples.

    + +

    Version 1.0 of the QuickStart + Guide is now available. This Guide + and its accompanying sample configurations are + expected to provide a replacement for the recently + withdrawn parameterized samples.

    - +

    4/8/2002 - Parameterized Samples Withdrawn

    - +

    Although the parameterized - samples have allowed people to get - a firewall up and running quickly, they have - unfortunately set the wrong level of expectation among - those who have used them. I am therefore withdrawing -support for the samples and I am recommending that -they not be used in new Shorewall installations.

    + href="http://www.shorewall.net/pub/shorewall/samples-1.2.1/">parameterized + samples have allowed people to get + a firewall up and running quickly, they have + unfortunately set the wrong level of expectation among + those who have used them. I am therefore withdrawing support + for the samples and I am recommending that they not +be used in new Shorewall installations.

    - +

    4/2/2002 - Updated Log Parser

    - -

    John Lodge has provided an updated + +

    John Lodge has provided an updated version of his CGI-based log parser - with corrected date handling.

    + href="pub/shorewall/parsefw/">CGI-based log parser + with corrected date handling.

    - +

    3/30/2002 - Shorewall Website Search Improvements

    - -

    The quick search on the home page now excludes the mailing list archives. - The Extended - Search allows excluding the archives -or restricting the search to just the archives. An archive + +

    The quick search on the home page now excludes the mailing list archives. + The Extended + Search allows excluding the archives +or restricting the search to just the archives. An archive search form is also available on the mailing list information + href="http://lists.shorewall.net/mailing_list.htm">mailing list information page.

    - +

    3/28/2002 - Debian Shorewall News (From Lorenzo Martignoni)

    - + +
  • Shorewall 1.2.9 is now in the Debian + Unstable Distribution.
  • + + +

    3/25/2002 - Log Parser Available

    - +

    John Lodge has provided a CGI-based log parser for Shorewall. Thanks + href="pub/shorewall/parsefw/">CGI-based log parser for Shorewall. Thanks John.

    - +

    3/20/2002 - Shorewall 1.2.10 Released

    - +

    In this version:

    - + +
  • Copyright notices have been added to the documenation.
  • + + +

    3/11/2002 - Shorewall 1.2.9 Released

    - +

    In this version:

    - + - +

    3/1/2002 - 1.2.8 Debian Package is Available

    - +

    See http://security.dsi.unimi.it/~lorenzo/debian.html

    - +

    2/25/2002 - New Two-interface Sample

    - -

    I've enhanced the two interface sample to allow access from the firewall - to servers in the local zone - - http://www.shorewall.net/pub/shorewall/LATEST.samples/two-interfaces.tgz

    - +

    I've enhanced the two interface sample to allow access from the firewall + to servers in the local zone - + http://www.shorewall.net/pub/shorewall/LATEST.samples/two-interfaces.tgz

    + +

    2/23/2002 - Shorewall 1.2.8 Released

    - -

    Do to a serious problem with 1.2.7, I am releasing 1.2.8. It corrects - problems associated with the lock file used to prevent multiple state-changing - operations from occuring simultaneously. - My apologies for any inconvenience my carelessness + +

    Do to a serious problem with 1.2.7, I am releasing 1.2.8. It corrects + problems associated with the lock file used to prevent multiple state-changing + operations from occuring simultaneously. + My apologies for any inconvenience my carelessness may have caused.

    - +

    2/22/2002 - Shorewall 1.2.7 Released

    - +

    In this version:

    - + - +

    2/18/2002 - 1.2.6 Debian Package is Available

    - +

    See http://security.dsi.unimi.it/~lorenzo/debian.html

    - +

    2/8/2002 - Shorewall 1.2.6 Released

    - +

    In this version:

    - + +
  • A problem occurring when BLACKLIST_LOGLEVEL + was not set has been corrected.
  • + + +

    2/4/2002 - Shorewall 1.2.5 Debian Package Available

    - +

    see http://security.dsi.unimi.it/~lorenzo/debian.html

    - +

    2/1/2002 - Shorewall 1.2.5 Released

    - -

    Due to installation problems with Shorewall 1.2.4, I have released Shorewall - 1.2.5. Sorry for the rapid-fire development.

    + +

    Due to installation problems with Shorewall 1.2.4, I have released Shorewall + 1.2.5. Sorry for the rapid-fire development.

    - +

    In version 1.2.5:

    - + +
  • The default value of the STATEDIR variable in + /etc/shorewall/shorewall.conf has been changed + to /var/lib/shorewall in order to conform to the GNU/Linux + File Hierarchy Standard, Version 2.2.
  • + + +

    1/28/2002 - Shorewall 1.2.4 Released

    - + - +

    1/27/2002 - Shorewall 1.2.3 Debian Package Available -- see http://security.dsi.unimi.it/~lorenzo/debian.html

    - +

    1/20/2002 - Corrected firewall script available 

    - -

    Corrects a problem with BLACKLIST_LOGLEVEL. See the - errata for details.

    + +

    Corrects a problem with BLACKLIST_LOGLEVEL. See the + errata for details.

    - +

    1/19/2002 - Shorewall 1.2.3 Released

    - +

    This is a minor feature and bugfix release. The single new feature is:

    - + - +

    The following problems were corrected:

    - + - +

    1/18/2002 - Shorewall 1.2.2 packaged with new LEAF release

    - -

    Jacques Nilo and Eric Wolzak have released a kernel 2.4.16 LEAF distribution - that includes Shorewall 1.2.2. See http://leaf.sourceforge.net/devel/jnilo - for details.

    + +

    Jacques Nilo and Eric Wolzak have released a kernel 2.4.16 LEAF distribution + that includes Shorewall 1.2.2. See http://leaf.sourceforge.net/devel/jnilo + for details.

    - +

    1/11/2002 - Debian Package (.deb) Now Available - Thanks to Lorenzo Martignoni, a 1.2.2 - Shorewall Debian package is now available. + href="mailto:lorenzo.martignoni@milug.org">Lorenzo Martignoni, a 1.2.2 + Shorewall Debian package is now available. There is a link to Lorenzo's site from the Shorewall download page.

    - +

    1/9/2002 - Updated 1.2.2 /sbin/shorewall available - This corrected version restores + href="/pub/shorewall/errata/1.2.2/shorewall">This corrected version restores the "shorewall status" command to health.

    - +

    1/8/2002 - Shorewall 1.2.2 Released

    - +

    In version 1.2.2

    - + - +

    1/5/2002 - New Parameterized Samples (version 1.2.0) released. These are minor updates - to the previously-released samples. There + target="_blank">version 1.2.0) released. These are minor updates + to the previously-released samples. There are two new rules added:

    - + - - -

    See the README file for upgrade instructions.

    +
  • Orphan DNS replies are now silently dropped.
  • + + + +

    See the README file for upgrade instructions.

    + +

    1/1/2002 - Shorewall Mailing List Moving

    - -

    The Shorewall mailing list hosted at - Sourceforge is moving to Shorewall.net. - If you are a current subscriber to the list -at Sourceforge, please see these instructions. - If you would like to subscribe to the new + +

    The Shorewall mailing list hosted at + Sourceforge is moving to Shorewall.net. + If you are a current subscriber to the list at + Sourceforge, please see these instructions. + If you would like to subscribe to the new list, visit http://www.shorewall.net/mailman/listinfo/shorewall-users.

    - +

    12/31/2001 - Shorewall 1.2.1 Released

    - +

    In version 1.2.1:

    - + +
  • 'shorewall show tc' now correctly handles tunnels.
  • -

    12/21/2001 - Shorewall 1.2.0 Released! - I couldn't resist -releasing 1.2 on 12/21/2001

    - - - -

    Version 1.2 contains the following new features:

    - - - - - - -

    For the next month or so, I will continue to provide corrections to version - 1.1.18 as necessary so that current version - 1.1.x users will not be forced into a quick upgrade - to 1.2.0 just to have access to bug fixes.

    - - -

    For those of you who have installed one of the Beta RPMS, you will need - to use the "--oldpackage" option when -upgrading to 1.2.0:

    - - -
    - - - -

    rpm -Uvh --oldpackage shorewall-1.2-0.noarch.rpm

    -
    - - - -

    12/19/2001 - Thanks to Steve - Cowles, there is now a Shorewall mirror - in Texas. This web site is mirrored at http://www.infohiiway.com/shorewall - and the ftp site is at ftp://ftp.infohiiway.com/pub/mirrors/shorewall. 

    - - - -

    11/30/2001 - A new set of the parameterized Sample - Configurations has been released. In this version:

    - - - - - -

    11/20/2001 - The current version of Shorewall is 1.1.18. 

    - - - -

    In this version:

    - - - - - - - -

    11/19/2001 - Thanks to Juraj - Ontkanin, there is now a Shorewall - mirror in the Slovak Republic. The website - is now mirrored at http://www.nrg.sk/mirror/shorewall - and the FTP site is mirrored at ftp://ftp.nrg.sk/mirror/shorewall.

    - - - -

    11/2/2001 - Announcing Shorewall Parameter-driven Sample Configurations. - There are three sample configurations:

    - - - - +

    12/21/2001 - Shorewall 1.2.0 Released! - I couldn't resist releasing +1.2 on 12/21/2001

    +

    Version 1.2 contains the following new features:

    + + + + + + +

    For the next month or so, I will continue to provide corrections to version + 1.1.18 as necessary so that current +version 1.1.x users will not be forced into +a quick upgrade to 1.2.0 just to have access to bug fixes.

    + + +

    For those of you who have installed one of the Beta RPMS, you will need + to use the "--oldpackage" option when +upgrading to 1.2.0:

    + + +
    + + + +

    rpm -Uvh --oldpackage shorewall-1.2-0.noarch.rpm

    + +
    + + + +

    12/19/2001 - Thanks to Steve + Cowles, there is now a Shorewall +mirror in Texas. This web site is mirrored +at http://www.infohiiway.com/shorewall + and the ftp site is at ftp://ftp.infohiiway.com/pub/mirrors/shorewall. 

    + + + +

    11/30/2001 - A new set of the parameterized Sample +Configurations has been released. In this version:

    + + + + + + + +

    11/20/2001 - The current version of Shorewall is 1.1.18. 

    + + + +

    In this version:

    + + + + + + + +

    11/19/2001 - Thanks to Juraj + Ontkanin, there is now a Shorewall + mirror in the Slovak Republic. The website + is now mirrored at http://www.nrg.sk/mirror/shorewall + and the FTP site is mirrored at ftp://ftp.nrg.sk/mirror/shorewall.

    + + + +

    11/2/2001 - Announcing Shorewall Parameter-driven Sample Configurations. + There are three sample configurations:

    + + + + + + +

    Samples may be downloaded from ftp://ftp.shorewall.net/pub/shorewall/samples-1.1.17 - . See the README file for instructions.

    + href="ftp://ftp.shorewall.net/pub/shorewall/samples-1.1.17"> ftp://ftp.shorewall.net/pub/shorewall/samples-1.1.17 + . See the README file for instructions.

    - -

    11/1/2001 - The current version of Shorewall is 1.1.17.  I intend - this to be the last of the 1.1 -Shorewall releases.

    + +

    11/1/2001 - The current version of Shorewall is 1.1.17.  I intend + this to be the last of the 1.1 + Shorewall releases.

    - +

    In this version:

    - + - -

    10/22/2001 - The current version of Shorewall is 1.1.16. In this - version:

    + +

    10/22/2001 - The current version of Shorewall is 1.1.16. In this + version:

    - + - -

    10/15/2001 - The current version of Shorewall is 1.1.15. In this - version:

    + +

    10/15/2001 - The current version of Shorewall is 1.1.15. In this + version:

    + + + + + +

    10/4/2001 - The current version of Shorewall is 1.1.14. In this + version

    + 2. Copy to that directory any of your configuration + files that you want to change.
    - -

    10/4/2001 - The current version of Shorewall is 1.1.14. In this - version

    + 3. Modify the copied files as needed.
    - - - -

    9/12/2001 - The current version of Shorewall is 1.1.13. In this + +

    9/12/2001 - The current version of Shorewall is 1.1.13. In this version

    - + - -

    8/28/2001 - The current version of Shorewall is 1.1.12. In this + +

    8/28/2001 - The current version of Shorewall is 1.1.12. In this version

    - + - -

    7/28/2001 - The current version of Shorewall is 1.1.11. In this + +

    7/28/2001 - The current version of Shorewall is 1.1.11. In this version

    - + - -

    7/6/2001 - The current version of Shorewall is 1.1.10. In this -version

    + +

    7/6/2001 - The current version of Shorewall is 1.1.10. In this version

    - + - -

    6/23/2001 - The current version of Shorewall is 1.1.9. In this -version

    + +

    6/23/2001 - The current version of Shorewall is 1.1.9. In this version

    - + - -

    6/18/2001 - The current version of Shorewall is 1.1.8. In this -version

    + +

    6/18/2001 - The current version of Shorewall is 1.1.8. In this version

    - + - +

    6/2/2001 - The current version of Shorewall is 1.1.7. In this version

    - + - -

    5/25/2001 - The current version of Shorewall is 1.1.6. In this -version

    + +

    5/25/2001 - The current version of Shorewall is 1.1.6. In this version

    - + - -

    5/20/2001 - The current version of Shorewall is 1.1.5. In this -version

    + +

    5/20/2001 - The current version of Shorewall is 1.1.5. In this version

    - + - -

    5/10/2001 - The current version of Shorewall is 1.1.4. In this -version

    + +

    5/10/2001 - The current version of Shorewall is 1.1.4. In this version

    - + - -

    4/28/2001 - The current version of Shorewall is 1.1.3. In this -version

    + +

    4/28/2001 - The current version of Shorewall is 1.1.3. In this version

    - + - -

    4/12/2001 - The current version of Shorewall is 1.1.2. In this -version

    - +

    4/12/2001 - The current version of Shorewall is 1.1.2. In this version

    + + +
  • A couple of LRP-specific problems were corrected.
  • + + +

    4/8/2001 - Shorewall is now affiliated with the Leaf Project -

    +

    + -

    4/5/2001 - The current version of Shorewall is 1.1.1. In this version:

    - + +
  • DHCP DISCOVER packets with RFC1918 source addresses + no longer generate log messages. Linux DHCP clients + generate such packets and it's annoying to +see them logged. 
  • + + +

    3/25/2001 - The current version of Shorewall is 1.1.0. In this version:

    - + +
  • The Linux kernel's route filtering facility + can now be specified selectively on network +interfaces.
  • + + +

    3/19/2001 - The current version of Shorewall is 1.0.4. This version:

    - + +
  • Compresses the output of "shorewall monitor" + if awk is installed. Allows the command to work +if awk isn't installed (although it's not pretty).
  • -

    3/13/2001 - The current version of Shorewall is 1.0.3. This is a bug-fix - release with no new features.

    + - + +

    3/13/2001 - The current version of Shorewall is 1.0.3. This is a bug-fix + release with no new features.

    + + - -

    3/8/2001 - The current version of Shorewall is 1.0.2. It supports an - additional "gw" (gateway) zone for tunnels - and it supports IPSEC tunnels with end-points - on the firewall. There is also a .lrp available now.

    - -

    Updated 6/17/2003 - Tom Eastep +

    3/8/2001 - The current version of Shorewall is 1.0.2. It supports an + additional "gw" (gateway) zone for +tunnels and it supports IPSEC tunnels with +end-points on the firewall. There is also a .lrp available + now.

    + + + +

    Updated 7/4/2003 - Tom Eastep

    - + +

    Copyright © 2001, 2002 Thomas M. Eastep.
    -

    +

    +
    diff --git a/Shorewall-docs/Shorewall_Squid_Usage.html b/Shorewall-docs/Shorewall_Squid_Usage.html index 61a732279..a9d2b49fd 100644 --- a/Shorewall-docs/Shorewall_Squid_Usage.html +++ b/Shorewall-docs/Shorewall_Squid_Usage.html @@ -2,401 +2,367 @@ Shorewall Squid Usage - + - + - + - - - - - - - - -
    -
    -
    Using Shorewall with Squid
    -
    -
    -
    -
    - This page covers Shorewall configuration to use with Squid running as a Transparent - Proxy. If you are running Shorewall 1.3, please see this documentation.
    -
    - Caution -     Please observe the following general requirements:
    -
    - -     In all cases, Squid should be configured -to run as a transparent proxy as described at http://www.tldp.org/HOWTO/mini/TransparentProxy-4.html.
    -
    -
    -     The following instructions mention the files - /etc/shorewall/start and /etc/shorewall/init -- if you don't have those - files, siimply create them.
    -
    - -     When the Squid server is in the DMZ zone -or in the local zone, that zone must be defined ONLY by its interface -- -no /etc/shorewall/hosts file entries. That is because the packets being -routed to the Squid server still have their original destination IP addresses.
    -
    - -     You must have iptables installed on your -Squid server.
    -
    - -     You must have NAT and MANGLE enabled in -your /etc/shorewall/conf file
    -
    -         NAT_ENABLED=Yes
    -
            MANGLE_ENABLED=Yes
    -
    - Three different configurations are covered:
    - -
      -
    1. Squid running - on the Firewall.
    2. -
    3. Squid running in - the local network
    4. -
    5. Squid running in -the DMZ
    6. - -
    - -

    Squid Running on the Firewall

    - You want to redirect all local www connection requests EXCEPT - those to your own - http server (206.124.146.177) - to a Squid transparent - proxy running on the firewall and listening on port 3128. Squid - will of course require access to remote web servers.
    -
    - In /etc/shorewall/rules:
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    ACTIONSOURCEDEST PROTODEST
    - PORT(S)
    SOURCE
    - PORT(S)
    ORIGINAL
    - DEST
    REDIRECTloc3128tcpwww -
    -
    !206.124.146.177
    ACCEPTfwnettcpwww
    -

    -
    -
    -
    - There may be a requirement to exclude additional destination hosts -or networks from being redirected. For example, you might also want requests -destined for 130.252.100.0/24 to not be routed to Squid. In that case, you -must add a manual rule in /etc/shorewall/start:
    -
    -
    run_iptables -t nat -I loc_dnat -p tcp --dport www -d 130.252.100.0/24 -j RETURN
    -
    - To exclude additional hosts or networks, just add additional similar -rules.
    -

    Squid Running in the local network

    - You want to redirect all local www connection requests to a -Squid transparent - proxy running in your local zone at 192.168.1.3 and listening on port - 3128. Your local interface is eth1. There may also be a web server running -on 192.168.1.3. It is assumed that web access is already enabled from the -local zone to the internet.
    - -

    WARNING: This setup may conflict with - other aspects of your gateway including but not limited to traffic shaping - and route redirection. For that reason, I don't recommend it.
    -

    - - - -
    -
    echo 202 www.out >> /etc/iproute2/rt_tables
    -
    - - - -
    -
    if [ -z "`ip rule list | grep www.out`" ] ; then
    ip rule add fwmark 202 table www.out
    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
    fi
    -
    - -