2009-04-20 02:37:36 +02:00
|
|
|
Shorewall 4.3.10
|
2009-02-26 17:34:31 +01:00
|
|
|
|
|
|
|
Shorewall 4.3 is the development thread for Shorewall 4.4 which will be
|
|
|
|
released late in 2009.
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2008-12-17 22:06:30 +01:00
|
|
|
----------------------------------------------------------------------------
|
2009-02-27 17:52:31 +01:00
|
|
|
R E L E A S E 4 . 3 H I G H L I G H T S
|
2008-12-17 22:06:30 +01:00
|
|
|
----------------------------------------------------------------------------
|
2008-12-13 21:45:23 +01:00
|
|
|
|
2009-02-24 00:39:46 +01:00
|
|
|
1) Support for Shorewall-shell has been discontinued. Shorewall-perl
|
|
|
|
has been combined with Shorewall-common to produce a single
|
|
|
|
Shorewall package.
|
|
|
|
|
2009-04-04 19:22:17 +02:00
|
|
|
2) The Shorewall documentation and man pages have been purged of
|
|
|
|
information about earlier Shorewall releases. The documentation
|
|
|
|
describes only the behavior of Shorewall 4.3 and later versions.
|
|
|
|
|
|
|
|
3) The interfaces file OPTIONs have been extended to largely remove the
|
2009-02-27 17:52:31 +01:00
|
|
|
need for the hosts file.
|
|
|
|
|
2009-04-04 19:22:17 +02:00
|
|
|
4) It is now possible to define PREROUTING and OUTPUT marking rules
|
2009-02-27 17:52:31 +01:00
|
|
|
that cause new connections to use the same provider as an existing
|
|
|
|
connection of the same kind.
|
|
|
|
|
2009-04-04 19:22:17 +02:00
|
|
|
5) Dynamic Zone support is once again available for IPv4; ipset support is
|
2009-03-06 21:25:59 +01:00
|
|
|
required in your kernel and in iptables.
|
|
|
|
|
2009-04-04 19:22:17 +02:00
|
|
|
6) A new AUTOMAKE option has been added to shorewall.conf and
|
2009-04-02 03:12:34 +02:00
|
|
|
shorewall6.conf. Setting this option will allow Shorewall to skip
|
|
|
|
the compilation phase during start/restart if no configuration
|
|
|
|
changes have occurred since the last start/restart.
|
|
|
|
|
2009-04-07 19:35:06 +02:00
|
|
|
7) The LIMIT:BURST column in /etc/shorewall/policy
|
|
|
|
(/etc/shorewall6/policy) and the RATE LIMIT column in
|
|
|
|
/etc/shorewall/rules (/etc/shorewall6/rules) may now be used to
|
|
|
|
limit on a per source IP or per destination IP basis.
|
|
|
|
|
2009-04-19 19:25:14 +02:00
|
|
|
8) Support for per-IP traffic shaping classes has been added.
|
|
|
|
|
2009-03-01 20:46:30 +01:00
|
|
|
----------------------------------------------------------------------------
|
|
|
|
M I G R A T I O N I S S U E S
|
|
|
|
----------------------------------------------------------------------------
|
2009-02-26 17:34:31 +01:00
|
|
|
|
2009-03-01 20:46:30 +01:00
|
|
|
1) The 'shorewall stop', 'shorewall clear', 'shorewall6 stop' and
|
|
|
|
'shorewall6 clear' commands no longer read the 'routestopped'
|
|
|
|
file. The 'routestopped' file used is the one that was present at
|
|
|
|
the last 'start', 'restart' or 'restore' command.
|
2009-02-26 17:34:31 +01:00
|
|
|
|
2009-03-16 19:01:42 +01:00
|
|
|
2) The old macro parameter syntax (e.g., SSH/ACCEPT) is now deprecated
|
|
|
|
in favor of the new syntax (e.g., SSH(ACCEPT)). The 4.3 documentation
|
|
|
|
uses the new syntax exclusively, although the old syntax
|
|
|
|
continues to be supported.
|
|
|
|
|
2009-04-01 03:31:04 +02:00
|
|
|
3) Support for the SAME target in /etc/shorewall/masq and
|
|
|
|
/etc/shorewall/rules has been removed, following the removal of the
|
|
|
|
underlying support in the Linux kernel.
|
|
|
|
|
2009-03-01 20:46:30 +01:00
|
|
|
----------------------------------------------------------------------------
|
2009-04-20 02:37:36 +02:00
|
|
|
P R O B L E M S C O R R E C T E D I N 4 . 3 . 10
|
2009-03-01 20:46:30 +01:00
|
|
|
----------------------------------------------------------------------------
|
2008-12-28 18:52:28 +01:00
|
|
|
|
2009-04-20 02:37:36 +02:00
|
|
|
None.
|
2009-04-18 00:57:59 +02:00
|
|
|
|
2009-03-01 20:46:30 +01:00
|
|
|
----------------------------------------------------------------------------
|
|
|
|
K N O W N P R O B L E M S R E M A I N I N G
|
|
|
|
----------------------------------------------------------------------------
|
2008-12-28 18:52:28 +01:00
|
|
|
|
2009-02-22 18:43:56 +01:00
|
|
|
None.
|
2009-02-21 18:21:51 +01:00
|
|
|
|
2009-03-01 20:46:30 +01:00
|
|
|
----------------------------------------------------------------------------
|
2009-04-20 02:37:36 +02:00
|
|
|
N E W F E A T U R E S I N 4 . 3 . 10
|
2009-03-01 20:46:30 +01:00
|
|
|
----------------------------------------------------------------------------
|
2009-02-27 17:52:31 +01:00
|
|
|
|
2009-04-20 02:37:36 +02:00
|
|
|
None.
|
2009-04-19 21:58:04 +02:00
|
|
|
|
2009-03-01 20:46:30 +01:00
|
|
|
----------------------------------------------------------------------------
|
|
|
|
N E W F E A T U R E S IN 4 . 3
|
|
|
|
----------------------------------------------------------------------------
|
2009-02-24 00:39:46 +01:00
|
|
|
|
|
|
|
1) The Shorewall packaging has been completely revamped in Shorewall
|
2009-02-27 17:52:31 +01:00
|
|
|
4.3.
|
2009-02-24 00:39:46 +01:00
|
|
|
|
|
|
|
The new packages are:
|
|
|
|
|
|
|
|
- Shorewall. Includes the former Shorewall-common and
|
|
|
|
Shorewall-perl packages. Includes everything needed
|
|
|
|
to create an IPv4 firewall.
|
|
|
|
|
|
|
|
- Shorewall6. Requires Shorewall. Adds the components necessary to
|
|
|
|
create an IPv6 firewall.
|
|
|
|
|
|
|
|
- Shorewall-lite
|
|
|
|
|
|
|
|
May be installed on a firewall system to run
|
|
|
|
IPv4 firewall scripts generated by Shorewall.
|
|
|
|
|
|
|
|
- Shorewall6-lite
|
|
|
|
|
|
|
|
May be installed on a firewall system to run
|
2009-03-28 20:21:03 +01:00
|
|
|
IPv6 firewall scripts generated by Shorewall6.
|
2009-02-24 00:39:46 +01:00
|
|
|
|
|
|
|
2) The interfaces file supports a new 'nets=' option. This option
|
|
|
|
allows users to restrict a zone's definition to particular networks
|
|
|
|
through an interface without having to use the hosts file.
|
|
|
|
|
|
|
|
Example interfaces file:
|
|
|
|
|
|
|
|
#ZONE INTERFACE BROADCAST OPTIONS
|
|
|
|
loc eth3 detect dhcp,logmartians=1,routefilter=1,nets=172.20.1.0/24
|
|
|
|
dmz eth4 detect logmartians=1,routefilter=1,nets=206.124.146.177
|
|
|
|
net eth0 detect dhcp,blacklist,tcpflags,optional,routefilter=0,nets=(!172.20.0.0/24,206.124.146.177)
|
|
|
|
net eth2 detect dhcp,blacklist,tcpflags,optional,upnp,routefilter=0,nets=(!172.20.0.0/24,206.124.146.177)
|
|
|
|
loc tun+ detect nets=172.20.0.0/24
|
|
|
|
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
|
|
|
|
|
|
|
|
Note that when more than one network address is listed, the list
|
|
|
|
must be enclosed in parentheses. Notice also that exclusion may be
|
|
|
|
used.
|
|
|
|
|
|
|
|
The first entry in the above interfaces file is equivalent to the
|
|
|
|
following:
|
|
|
|
|
|
|
|
interfaces:
|
|
|
|
|
|
|
|
#ZONE INTERFACE BROADCAST OPTIONS
|
|
|
|
- eth0 detect dhcp,logmartians=1,routefilter=1
|
|
|
|
|
|
|
|
hosts:
|
|
|
|
|
|
|
|
#ZONE HOST(S) OPTIONS
|
|
|
|
loc $INT_IF:192.20.1.0/24 broadcast
|
|
|
|
|
|
|
|
Note that the 'broadcast' option is automatically assumed and need
|
|
|
|
not be explicitly specified.
|
2009-02-25 18:39:32 +01:00
|
|
|
|
|
|
|
3) Some websites run applications that require multiple connections
|
|
|
|
from a client browser. Where multiple 'balanced' providers are
|
|
|
|
configured, this can lead to problems when some of the connections
|
|
|
|
are routed through one provider and some through another.
|
|
|
|
|
|
|
|
To work around this issue, the SAME target has been added to
|
2009-02-25 22:04:17 +01:00
|
|
|
/etc/shorewall/tcrules. SAME may be used in the PREROUTING and
|
|
|
|
OUTPUT chains. When used in PREROUTING, it causes matching
|
|
|
|
connections from an individual local system to all use the same
|
|
|
|
provider.
|
2009-02-25 18:39:32 +01:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
SAME:P 192.168.1.0/24 - tcp 80,443
|
|
|
|
|
|
|
|
If a host in 192.168.1.0/24 attempts a connection on TCP port 80 or
|
|
|
|
443 and it has sent a packet on either of those ports in the last
|
2009-02-25 22:04:17 +01:00
|
|
|
five minutes then the new connection will use the same provider as
|
2009-02-25 18:39:32 +01:00
|
|
|
the connection over which that last packet was sent.
|
2009-02-25 22:04:17 +01:00
|
|
|
|
|
|
|
When used in the OUTPUT chain, it causes all matching connections
|
|
|
|
to an individual remote system to all use the same provider.
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
SAME $FW - tcp 80,443
|
|
|
|
|
|
|
|
If the firewall attempts a connection on TCP port 80 or
|
|
|
|
443 and it has sent a packet on either of those ports in the last
|
|
|
|
five minutes to the same remote system then the new connection will
|
|
|
|
use the same provider as the connection over which that last packet
|
|
|
|
was sent.
|
2009-02-26 00:47:38 +01:00
|
|
|
|
|
|
|
Important note: SAME only works with providers that have the
|
|
|
|
'track' option specified in /etc/shorewall/providers.
|
|
|
|
|
2009-03-17 19:51:17 +01:00
|
|
|
4) The file /var/lib/shorewall/.restore has been renamed to
|
|
|
|
/var/lib/shorewall/firewall. A similar change has been made in
|
|
|
|
Shorewall6.
|
|
|
|
|
|
|
|
When a successful start or restart is completed, the script that
|
|
|
|
executed the command copies itself to to
|
2009-03-17 20:55:34 +01:00
|
|
|
/var/lib/shorewall[6]/firewall.
|
2009-03-17 19:51:17 +01:00
|
|
|
|
|
|
|
5) Dynamic zone support is once again available for IPv4. This support
|
2009-03-28 20:21:36 +01:00
|
|
|
is built on top of ipsets so you must have the xtables-addons
|
|
|
|
installed on the firewall system.
|
2009-03-17 19:51:17 +01:00
|
|
|
|
|
|
|
Dynamic zones are available when Shorewall-lite is used as well.
|
|
|
|
|
|
|
|
Note that the dynamic zone support built into Shorewall provides no
|
|
|
|
additional functionality over what is provided by simply defining a
|
|
|
|
zone in terms of an ipset (see
|
|
|
|
http://www1.shorewall.net/ipsets.html#Dynamic).
|
|
|
|
|
|
|
|
You define a zone as having dynamic content in one of two ways:
|
|
|
|
|
|
|
|
- By specifying nets=dynamic in the OPTIONS column of an entry for
|
|
|
|
the zone in /etc/shorewall/interfaces; or
|
|
|
|
|
|
|
|
- By specifying <interface>:dynamic in the HOST(S) column of an
|
|
|
|
entry for the zone in /etc/shorewall/hosts.
|
|
|
|
|
|
|
|
When there are any dynamic zones present in your configuration,
|
|
|
|
Shorewall (Shorewall-lite) will:
|
|
|
|
|
|
|
|
a) Execute the following commands during 'shorewall start' or
|
|
|
|
'shorewall-lite start'.
|
|
|
|
|
|
|
|
ipset -U :all: :all:
|
|
|
|
ipset -U :all: :default:
|
|
|
|
ipset -F
|
|
|
|
ipset -X
|
|
|
|
ipset -R < ${VARDIR}/ipsets.save
|
|
|
|
|
|
|
|
where $VARDIR normally contains /var/lib/shorewall
|
|
|
|
(/var/lib/shorewall-lite) but may be modified by
|
|
|
|
/etc/shorewall/vardir (/etc/shorewall-lite/vardir).
|
|
|
|
|
|
|
|
|
|
|
|
b) During 'start', 'restart' and 'restore' processing, Shorewall
|
|
|
|
will then attempt to create an ipset named <zone>_<interface>
|
|
|
|
for each zone/interface pair that has been specified as
|
|
|
|
dynamic. The type of ipset created is 'iphash' so that only
|
|
|
|
individual IPv4 addresses may be added to the set.
|
|
|
|
|
|
|
|
c) Execute the following commands during 'shorewall stop' or
|
|
|
|
'shorewall-lite stop':
|
|
|
|
|
|
|
|
if ipset -S > ${VARDIR}/ipsets.tmp; then
|
|
|
|
mv -f ${VARDIR}/ipsets.tmp ${VARDIR}/ipsets.save
|
|
|
|
fi
|
|
|
|
|
|
|
|
The 'shorewall add' and 'shorewall delete' commands are supported
|
|
|
|
with their original syntax:
|
|
|
|
|
|
|
|
add <interface>[:<host-list>] ... <zone>
|
|
|
|
|
|
|
|
delete <interface>[:<host-list>] ... <zone>
|
|
|
|
|
|
|
|
In addition, the 'show dynamic' command is added that lists the dynamic
|
|
|
|
content of a zone.
|
|
|
|
|
|
|
|
show dynamic <zone>
|
|
|
|
|
|
|
|
These commands are supported by shorewall-lite as well.
|
2009-04-09 20:45:21 +02:00
|
|
|
|
|
|
|
6) The generated program now attempts to detect all dynamic
|
|
|
|
information when it first starts. If any of those steps fail, an
|
|
|
|
error message is generated and the state of the firewall is not
|
|
|
|
changed.
|
|
|
|
|
|
|
|
7) Shorewall will now attempt to detect a dynamic gateway by reading
|
|
|
|
the dhclient lease file for the interface
|
|
|
|
(/var/run/dhcp/dhclient-<if>.lease).
|
|
|
|
|
|
|
|
8) To improve readability of the configuration files, Shorewall now
|
|
|
|
allows leading white space in continuation lines when the continued
|
|
|
|
line ends in ":" or ",".
|
|
|
|
|
|
|
|
Example (/etc/shorewall/rules):
|
|
|
|
|
|
|
|
#ACTION SOURCE DEST PROTO DEST
|
|
|
|
# PORT(S)
|
|
|
|
ACCEPT net:\
|
|
|
|
206.124.146.177,\
|
|
|
|
206.124.146.178,\
|
|
|
|
206.124.146.180\
|
|
|
|
dmz tcp 873
|
|
|
|
|
|
|
|
The leading white space on the lines that contain just an IP
|
|
|
|
address is ignored so the SOURCE column effectively contains
|
|
|
|
"net:206.124.146.177,206.124.147.178,206.124.146.180".
|
|
|
|
|
|
|
|
9) The generated script now uses iptables[6]-restore to instantiate
|
|
|
|
the Netfilter ruleset during processing of the 'stop' command. As a
|
|
|
|
consequence, the 'critical' option in /etc/shorewall/route_stopped
|
|
|
|
is no longer needed and will result in a warning.
|
|
|
|
|
|
|
|
10) A new AUTOMAKE option has been added to shorewall.conf and
|
|
|
|
shorewall6.conf. When set to 'Yes', this option causes new behavior
|
|
|
|
during processing of the 'start' and 'restart' commands; if no
|
|
|
|
files in /etc/shorewall/ (/etc/shorewall6) have changed since the last
|
|
|
|
'start' or 'restart', then the compilation step is skipped and the
|
|
|
|
script used during the last 'start' or 'restart' is used to
|
|
|
|
start/restart the firewall.
|
|
|
|
|
|
|
|
Note that if a <directory> is specified in the start/restart
|
|
|
|
command (e.g., "shorewall restart /etc/shorewall.new") then the
|
|
|
|
setting of AUTOMAKE is ignored.
|
|
|
|
|
|
|
|
Note that the 'make' utility must be installed on the firewall
|
|
|
|
system in order for AUTOMAKE=Yes to work correctly.
|
|
|
|
|
|
|
|
11) The 'compile' command now allows you to omit the <pathname>. When
|
|
|
|
you do that, the <pathname> defaults to /var/lib/shorewall/firewall
|
|
|
|
(/var/lib/shorewall6/firewall) unless you have overridden VARDIR
|
|
|
|
using /etc/shorewall/vardir (/etc/shorewall6/vardir).
|
|
|
|
|
|
|
|
When combined with AUTOMAKE=Yes, it allows the following:
|
|
|
|
|
|
|
|
gateway:~ # shorewall compile
|
|
|
|
Compiling...
|
|
|
|
Shorewall configuration compiled to /root/shorewall/firewall
|
|
|
|
gateway:~ #
|
|
|
|
...
|
|
|
|
gateway:~ # shorewall restart
|
|
|
|
Restarting Shorewall....
|
|
|
|
done.
|
|
|
|
gateway:~ #
|
|
|
|
|
|
|
|
In other words, you can compile the current configuration then
|
|
|
|
install it at a later time.
|
|
|
|
|
|
|
|
12) Thanks to I. Buijs, it is now possible to rate-limit connections by
|
|
|
|
source IP or destination IP. The LIMIT:BURST column in
|
|
|
|
/etc/shorewall/policy (/etc/shorewall6/policy) and the RATE LIMIT
|
|
|
|
column /etc/shorewall/rules (/etc/shorewall6/rules) have been
|
|
|
|
extended as follows:
|
|
|
|
|
|
|
|
[{s|d}:[[<name>]:]]<rate>/{sec|min}[:<burst>]
|
|
|
|
|
|
|
|
When s: is specified, the rate is per source IP address.
|
|
|
|
When d: is specified, the rate is per destination IP address.
|
|
|
|
The <name> specifies the name of a hash table -- you get to choose
|
|
|
|
the name. If you don't specify a name, the name 'shorewall' is
|
|
|
|
assumed. Rules with the same name have their connection counts
|
|
|
|
aggregated and the individual rates are applied to the aggregate.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
ACCEPT net fw tcp 22 - - s:ssh:3/min
|
|
|
|
|
|
|
|
This will limit SSH connections from net->fw to 3 per minute.
|
|
|
|
|
|
|
|
ACCEPT net fw tcp 25 - - s:mail:3/min
|
|
|
|
ACCEPT net fw tcp 587 - - s:mail:3/min
|
|
|
|
|
|
|
|
Since the same hash table name is used in both rules, the above is
|
|
|
|
equivalent to this single rule:
|
|
|
|
|
|
|
|
ACCEPT net fw tcp 25,587 - - s:mail:3/min
|
2009-04-20 02:37:36 +02:00
|
|
|
|
|
|
|
13) Rules that specify a log level with a target other than LOG or NFLOG
|
|
|
|
are now implemented through a separate chain. While this may increase
|
|
|
|
the processing cost slightly for packets that match these rules, it
|
|
|
|
is expected to reduce the overall cost of such rules because each
|
|
|
|
packet that doesn't match the rules only has to be processed once
|
|
|
|
per rule rather than twice.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
/etc/shorewall/rules:
|
|
|
|
|
|
|
|
REJECT:info loc net tcp 25
|
|
|
|
|
|
|
|
This previously generated these two rules (long rules folded):
|
|
|
|
|
|
|
|
-A loc2net -p 6 --dport 25 -j LOG --log-level 6
|
|
|
|
--log-prefix "Shorewall:loc2net:reject:"
|
|
|
|
-A loc2net -p 6 --dport 25 -j reject
|
|
|
|
|
|
|
|
It now generates these rules:
|
|
|
|
|
|
|
|
:log0 - [0:0]
|
|
|
|
...
|
|
|
|
-A loc2net -p 6 --dport 25 -g log0
|
|
|
|
...
|
|
|
|
-A log0 -j LOG --log-level 6
|
|
|
|
--log-prefix "Shorewall:loc2net:REJECT:"
|
|
|
|
-A log0 -p 6 --dport 25 -j reject
|
|
|
|
|
|
|
|
Notice that now there is only a single rule generated in the
|
|
|
|
'loc2net' chain where before there were two. Packets for other than
|
|
|
|
TCP port 25 had to be processed by both rules.
|
|
|
|
|
|
|
|
Notice also that the new LOG rule reflects the original action
|
|
|
|
("REJECT") rather than what Shorewall maps that to ("reject").
|
|
|
|
|
|
|
|
14) Shorewall6 has now been tested on kernel 2.6.24 (Ubuntu Hardy) and
|
|
|
|
hence will now start successfully when running on that kernel.
|
|
|
|
|
|
|
|
15) Three new options (IP, TC and IPSET) have been added to
|
|
|
|
shorewall.conf and shorwall6.conf. These options specify the name
|
|
|
|
of the executable for the 'ip', 'tc' and 'ipset' utilities
|
|
|
|
respectively.
|
|
|
|
|
|
|
|
If not specified, the default values are:
|
|
|
|
|
|
|
|
IP=ip
|
|
|
|
TC=tc
|
|
|
|
IPSET=ipset
|
|
|
|
|
|
|
|
In other words, the utilities will be located via the current PATH
|
|
|
|
setting.
|
|
|
|
|
|
|
|
16) There has been a desire in the user community to limit traffic by
|
|
|
|
IP address using Shorewall traffic shaping. Heretofore, that has
|
|
|
|
required a very inefficient process:
|
|
|
|
|
|
|
|
a) Define a tcclass for each internal host (two, if shaping both in
|
|
|
|
and out).
|
|
|
|
b) Define a tcrule for each host to mark to classify the packets
|
|
|
|
accordingly.
|
|
|
|
|
|
|
|
Beginning with Shorewall 4.3.9, this process is made easier IF YOU
|
|
|
|
ARE WILLING TO INSTALL xtables-addons. The feature requires IPMARK
|
|
|
|
support in iptables[6] and your kernel. That support is available
|
|
|
|
in xtables-addons.
|
|
|
|
|
|
|
|
The new facility has two components:
|
|
|
|
|
|
|
|
a) A new IPMARK MARKing command in /etc/shorewall/tcrules.
|
|
|
|
b) A new 'occurs' OPTION in /etc/shorewall/tcclasses.
|
|
|
|
|
|
|
|
The IPMARK target assigns a mark to each matching packet based on
|
|
|
|
the either the source or destination IP address. By default, it
|
|
|
|
assigns a mark value equal to the low-order 8 bits of the source
|
|
|
|
address.
|
|
|
|
|
|
|
|
The syntax is as follows:
|
|
|
|
|
|
|
|
IPMARK[([{src|dst}][,[<mask1>][,[<mask2>][,[<shift>]]]])]
|
|
|
|
|
|
|
|
Default values are:
|
|
|
|
|
|
|
|
src
|
|
|
|
<mask1> = 0xFF
|
|
|
|
<mask2> = 0x00
|
|
|
|
<shift> = 0
|
|
|
|
|
|
|
|
'src' and 'dst' specify whether the mark is to be based on the
|
|
|
|
source or destination address respectively.
|
|
|
|
|
|
|
|
The selected address is first LANDed with <mask1> then LORed with
|
|
|
|
<mask2>.
|
|
|
|
|
|
|
|
The result is then shifted <shift> bits to the right.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
IPMARK(dst, 0XFF00, 0x8000,8)
|
|
|
|
|
|
|
|
Destination IP address is 192.168.4.3 = 0xc0a80103
|
|
|
|
|
|
|
|
0xc0a80403 LAND 0xFF00 = 0x0400
|
|
|
|
0x0400 LOR 0x80 = 0x8400
|
|
|
|
0x8400 >> 8 = 0x84
|
|
|
|
|
|
|
|
Mark = 0x84 = 132
|
|
|
|
|
|
|
|
The 'occurs' option causes the class definition to be replicated
|
|
|
|
many times. The synax is:
|
|
|
|
|
|
|
|
occurs=<number>
|
|
|
|
|
|
|
|
When 'occurs' is used:
|
|
|
|
|
|
|
|
a) The associated device may not have the 'classify' option.
|
|
|
|
b) The class may not be the default class.
|
|
|
|
c) The class may not have any 'tos=' options (including
|
|
|
|
'tcp-ack').
|
|
|
|
|
|
|
|
The 'RATE' and 'CEIL' parameters apply to each instance of the
|
|
|
|
class. So the total RATE represented by an entry with 'occurs' will
|
|
|
|
be the listed RATE multiplied by the 'occurs' number.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
#DEVICE MARK RATE CEIL PRIORITY OPTIONS
|
|
|
|
eth0 100 1kbit 230kbit 4 occurs=32
|
|
|
|
|
|
|
|
The above defines 32 classes with MARK values 100-131. Each
|
|
|
|
class has a guaranteed rate of 1kbit/second.
|
|
|
|
|
|
|
|
As part of this change, the generation of class ids from mark
|
|
|
|
values has been changed. The class number is now
|
|
|
|
|
|
|
|
( <devnum> << 10 ) | <mask>
|
|
|
|
|
|
|
|
/sbin/shorewall has an 'encode' and 'decode' command to translate a
|
|
|
|
device number, mark pair to/from a classid:
|
|
|
|
|
|
|
|
encode <devnum> <mark>
|
|
|
|
decode <classnum>
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
$ shorewall decode 3172
|
|
|
|
Device = 3 Mark = 100
|
|
|
|
$ shorewall encode 3 100
|
|
|
|
Class number = 3172
|
|
|
|
$
|
|
|
|
|