Compare commits

..

140 Commits

Author SHA1 Message Date
Tom Eastep
ec0ff7f305 Remove $OPTIONS from Shorewall-init service files.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-12 14:38:48 -08:00
Tom Eastep
7100af5380 Correct .service files
- Make them match earlier versions

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-11 18:05:04 -08:00
Tom Eastep
f9932d2b08 Correct typos in the -lite manpages
- Remove redundant 'a specify'.
- Change reference to /etc/shorewall[6]/started.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-11 07:48:57 -08:00
Thomas D
2bf80ee3d9 Patches for shorewall manpage
Hi,

here is the patch set for the shorewall6-lite man page.

-Thomas

>From d3fc3bd79f6313e8c940f6df49ae6ea3e05fa590 Mon Sep 17 00:00:00 2001
From: Thomas D <whissi@whissi.de>
Date: Tue, 11 Nov 2014 01:23:44 +0100
Subject: [PATCH 2/2] Fixes for the "commands" section.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-11 07:41:18 -08:00
Tom Eastep
22ac37b51e Patches for Shorewall6 manpage from Thomas D
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-10 07:50:28 -08:00
Tom Eastep
c4171a92f6 Change spacing in shorewall[6] usage output
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-10 07:38:58 -08:00
Thomas D
a5b2886ae9 Patches for shorewall manpage
Hi,

I corrected some errors in the manpages. I started with "shorewall".

Tom, please tell me if you like this format and the patches at all.
If you like them, I can send you a similar patch set for shorewall6, too.

-Thomas

From 2aaeaa4f2da7aae92177ced0530f1deff86f44a9 Mon Sep 17 00:00:00 2001
From: Thomas D <whissi@whissi.de>
Date: Sun, 9 Nov 2014 15:45:29 +0100
Subject: [PATCH 11/14] The "-i" option from the "reload" command wasn't marked
 as an option.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-09 07:40:59 -08:00
Tom Eastep
9a6047b3c4 Correct reversed naming of SHA chains
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-06 08:18:52 -08:00
Tom Eastep
6f5de7ef3f Add now logging modules to the modules files.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-05 16:19:30 -08:00
Tom Eastep
5b4e3bc07c Accomodate new module names for LOG_BACKEND
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-05 12:51:24 -08:00
Tom Eastep
dc3f163e71 Change the names of the sha1 chains for uniqueness
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-04 17:54:38 -08:00
Tom Eastep
2f545012a6 More documentation updates for -C
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-02 09:25:58 -08:00
Tom Eastep
c97226c46c Correct behavior of 'start -fC'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-02 09:25:23 -08:00
Tom Eastep
8c0c1bd1e0 Omit the 'shorewall' chain from .ip[6]tables-restore-input
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-02 08:16:47 -08:00
Tom Eastep
8b825c4c4c Avoid failure of ip[6]tables-restore.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-02 07:56:05 -08:00
Tom Eastep
4493b2ab6b Correct typo in 'rules' manpages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-02 06:50:40 -08:00
Tom Eastep
9598ac6fad Correct a couple of problems with -C
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-01 10:09:04 -07:00
Tom Eastep
8fb73026c8 Replace SAVE_COUNTERS with the -C command option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-11-01 09:37:57 -07:00
Tom Eastep
4546cbaff7 Use chains with names derived from a digest to identify ruleset
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-31 11:36:53 -07:00
Tom Eastep
a83c146636 Cleanup
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-30 20:27:06 -07:00
Tom Eastep
2ffc97867c Correct syntax error in the generated script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-30 19:59:20 -07:00
Tom Eastep
f08803e293 Preserve counts on 'restart' without compilation.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-30 18:38:45 -07:00
Tom Eastep
b7ab82dba4 Implement -f option in the -lite products' start command
- Remove 'recover' command

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-30 10:42:39 -07:00
Tom Eastep
113f95c11e Provide STARTOPTIONS and RESTARTOPTIONS in all cases
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-30 10:22:39 -07:00
Tom Eastep
3454e10525 Add SAVE_COUNTERS option.
- Also implement recover command

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-30 08:57:56 -07:00
Tom Eastep
edc30fcc8d Process the params file with SHOREWALL_SHELL
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-29 12:22:00 -07:00
Tom Eastep
85e5669fc7 Rename function interface_up() to interface_enabled()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-27 18:38:22 -07:00
Tom Eastep
055fceb82f Update policy manpages for duel limits
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-22 12:27:27 -07:00
Tom Eastep
f5bdc9e7f4 Allow two limits in the RATE LIMIT columns
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-22 11:21:43 -07:00
Tom Eastep
54461a9a90 Correct indentation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-20 12:29:45 -07:00
Tom Eastep
b60d6dd6e5 Avoid duplicate module loads
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-20 10:42:53 -07:00
Tom Eastep
4bc91e89db Remove debugging code from Shorewall-init installer
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-19 08:28:41 -07:00
Tom Eastep
2784e93307 Load xt_LOG in both helpers files
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-19 08:28:36 -07:00
Tom Eastep
90d1e41dcb Correct IPv4 Helpers file
- Change xt_ULOG to ipt_ULOG

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-19 08:28:29 -07:00
Tom Eastep
20c8bf02b1 Correct Shorewall6 helpers file
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-19 08:28:19 -07:00
Tom Eastep
38d4b1c5a9 Revert "Correct last patch"
This reverts commit b528625329.
2014-10-19 08:28:11 -07:00
Tom Eastep
e3a332ec27 Correct last patch
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-19 08:28:00 -07:00
Tom Eastep
49218a4d28 ipt_LOG in helpers file
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-15 18:07:09 -07:00
Tom Eastep
3236cd2660 Reinstate IPv6 DropSmurfs
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-13 12:34:25 -07:00
Tom Eastep
e3b10343a5 Change SYSTEMDDIR to SERVICEDIR
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-13 11:56:26 -07:00
Tom Eastep
286bc50bb3 Remove 'optional' from the Universal interfaces file
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-13 08:07:14 -07:00
Tom Eastep
a5086f785f Avoid confusing output when 4.6.4 CLI executes a 'save'
- If a down-rev firewall is running, the savesets command produces
  confusing usage output

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-10 18:40:55 -07:00
Tom Eastep
19482ac197 Allow Shorewall-init installer to create SBINDIR if configure == 0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-09 10:14:23 -07:00
Tom Eastep
42363da458 Add new .service files
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-09 10:00:53 -07:00
Tom Eastep
c5074bddb2 Rename the .service files to .service.214
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-09 09:45:52 -07:00
Tom Eastep
4b9d8ad5f6 Merge branch '4.6.4'
Conflicts:
	Shorewall-init/shorewall-init.service
2014-10-08 18:26:42 -07:00
Tom Eastep
8e9d769723 Add iptables.service to Shorewall-init conflicts
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-08 18:24:53 -07:00
Tom Eastep
77015ebb4d Adjust the .service files
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-08 17:33:33 -07:00
Tom Eastep
12458d111a Adjust the .service files
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-08 17:28:22 -07:00
Tom Eastep
815e93e80c Rename SYSTEMD to SYSTEMDDIR
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-07 16:46:16 -07:00
Tom Eastep
7771e5d48f More ipset article tweaks
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-07 13:37:56 -07:00
Tom Eastep
0cd694370e Add nat link from Shorewall6 manpages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-07 12:21:44 -07:00
Tom Eastep
5fd7c573fc Clarify Shorewall-init SAVE_IPSETS setting
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-07 11:41:57 -07:00
Tom Eastep
80c024c4aa Amplify the 4.6.4 SAVE_IPSETS changes in the ipset article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-07 09:52:15 -07:00
Tom Eastep
3bae6e61cf Eliminate syntax errors in the generated script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-07 07:53:26 -07:00
Tom Eastep
5204cbc95f Suppress 'No ipsets were saved' warning when SAVE_IPSETS=No
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-07 07:50:12 -07:00
Tom Eastep
ea1b8ac63a Correct handling of empty LOG_BACKEND
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-07 07:34:55 -07:00
Tuomo Soini
a31fd20f22 Shorewall6/nat: clearly make it ipv6 specific 2014-10-07 12:42:57 +03:00
Tom Eastep
2c7ffb525d Updagte Shorewall6-nat manpage
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-05 20:09:18 -07:00
Tom Eastep
316866482b Add ipv6 nat file and manpage
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-05 19:54:19 -07:00
Tom Eastep
6c6a1d82d9 Make Debian installation work with SANDBOX
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-05 16:52:59 -07:00
Tom Eastep
a72a1ef7a6 Update the install document
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-05 13:30:28 -07:00
Tom Eastep
4398fb23d1 Create INITDIR in the Shorewall init installer
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 18:49:55 -07:00
Tom Eastep
e3a7a4fc98 Fix typo in the -lite installer
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 17:48:20 -07:00
Tom Eastep
e36b34ce15 Fix -lite installer for MANDIR
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 14:26:12 -07:00
Tom Eastep
178d1fbc26 Correct typo
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 14:19:48 -07:00
Tom Eastep
c9fd390782 Final cleanup of the uninstallers
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 14:07:33 -07:00
Tom Eastep
3206021278 Another round of uninstall fixes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 13:50:39 -07:00
Tom Eastep
8571e0dca0 Another round of uninstall fixes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 13:29:51 -07:00
Tom Eastep
9dc2bba025 More uninstall corrections.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 09:39:03 -07:00
Tom Eastep
2fce05b3ab Correct a couple of errors
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 09:11:29 -07:00
Tom Eastep
70bb9147cd Correct Shorewall-init installer handling of SANDBOX
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 09:00:12 -07:00
Tom Eastep
00b0489047 Implement SANDBOX variable in the installers/uninstallers
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-04 07:50:30 -07:00
Tom Eastep
f9a21bd90e Add -n option to the uninstallers.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-03 17:10:36 -07:00
Tom Eastep
5e81bdfe19 Another install script fix
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-03 17:07:03 -07:00
Tom Eastep
f2cc68b93b Correct -lite installer and uninstaller
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-03 16:41:27 -07:00
Tom Eastep
8a5e71a56f Implement the -n option in the installers
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-03 07:59:41 -07:00
Tom Eastep
483ea3e437 Create INITDIR in -lite installs.
- Also don't link the init script if it isn't installed.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-02 17:42:08 -07:00
Tom Eastep
2ec3adcc44 Don't link the init script if SYSTEMD is set.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-02 16:23:26 -07:00
Tom Eastep
205dd6e250 Add FAQ 104
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-10-01 19:47:56 -07:00
Tom Eastep
770a505cd2 Delete DropSmurfs from IPv6 actions.std
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-30 16:16:53 -07:00
Tom Eastep
4071b9d337 Update SuSE shorewallrc for SBINDIR
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-30 16:16:33 -07:00
Tom Eastep
820c769499 Correct silly bug in last change
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-29 07:08:39 -07:00
Tom Eastep
e6b0666ac9 Save ipsets during normal stop (duh)
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-28 18:43:11 -07:00
Tom Eastep
2a463e06aa More documentation changes regarding SAVE_IPSETS.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-28 17:10:45 -07:00
Tom Eastep
3174454300 Correct SAVE_IPSETS logic in Config.pm
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-28 14:38:01 -07:00
Tom Eastep
ce1c367d1d Re-commit the fix that saves only the appropriate family
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-28 14:09:20 -07:00
Tom Eastep
3e2c903a41 Revert "Only save ipsets of the proper family"
This reverts commit b053cab630.
2014-09-28 13:32:32 -07:00
Tom Eastep
b053cab630 Only save ipsets of the proper family
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-28 12:58:52 -07:00
Tom Eastep
6f7d063921 Remove the target file before saving ipsets in the savesets command
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-28 11:53:52 -07:00
Tom Eastep
cbcb1ff7e1 Add SAVE_IPSETS to shorewall6.conf.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-28 11:37:24 -07:00
Tom Eastep
3858683e94 Allow saving a specified list of ipsets
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-28 11:19:41 -07:00
Tom Eastep
38a18ac9ac Allow indefinite alternative to 'yes' and 'no'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-27 15:06:18 -07:00
Tom Eastep
a09484356c Support 'yes', 'no, <other> values for simple config options
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-27 07:57:46 -07:00
Tom Eastep
bc8588a68e Fix rule numbers in trace output
- Don't increment $number needlessly when not tracing

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-27 07:57:09 -07:00
Tom Eastep
10df9d31c4 Correct typo in the actions manpages (4.6.5 s/b 4.6.4).
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-25 14:47:27 -07:00
Tom Eastep
4989f694cd Correct trace output
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-25 14:47:00 -07:00
Tom Eastep
b84a9e16e6 Correct typo in the config basics document
- SOURCE/DEST example had extra colon

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-25 10:59:18 -07:00
Tom Eastep
053df2a5fb Go back to original insert_irule() fix.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-25 09:21:20 -07:00
Tom Eastep
976a1f3deb Merge branch '4.6.3'
Conflicts:
	Shorewall/Perl/Shorewall/Misc.pm
2014-09-25 08:06:16 -07:00
Tom Eastep
ea40068c10 Fix ADMINISABSENTMINDED=No used with stoppedrules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-25 08:03:35 -07:00
Tom Eastep
56649e2183 Don't compile routestopped during check if there is stoppedrules.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-24 19:24:13 -07:00
Tom Eastep
520d21c056 Another tweak to LOG_BACKEND
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-24 17:12:05 -07:00
Tom Eastep
540eff24aa Correctons to LOG_BACKEND implementation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-24 16:35:41 -07:00
Tom Eastep
580e00dabd Implement LOG_BACKEND option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-24 15:26:13 -07:00
Tom Eastep
4815f7eba3 Correct warning message in stoppedrules processing.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-24 11:05:15 -07:00
Tom Eastep
a7b57ad32c Clarify iptrace logging.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-24 09:14:38 -07:00
Tom Eastep
ba7f88c912 Re-apply 'terminating' changes to the actions manpages.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-23 09:33:57 -07:00
Tom Eastep
7481514a97 Implement the 'terminating' action option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-23 09:29:13 -07:00
Tom Eastep
20c68dddf2 Merge branch 'master' of ssh://server.shorewall.net/home/teastep/shorewall/code 2014-09-23 09:24:44 -07:00
Tom Eastep
35e60aa10c Fix actions manpage
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-23 09:24:32 -07:00
Tom Eastep
1f5439257a Revert "Implement the 'terminating' action option"
This reverts commit 6851744cb7.
2014-09-23 07:39:25 -07:00
Tom Eastep
4495ed687b Merge branch 'master' of ssh://git.code.sf.net/p/shorewall/code 2014-09-23 07:10:46 -07:00
Tom Eastep
d97d45f4ad Merge branch '4.6.3' 2014-09-23 07:10:17 -07:00
Tom Eastep
a69cec5228 Add link to Events article
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-23 07:09:56 -07:00
Tuomo Soini
a03f00bf0f systemd services: multi-user is not same as old runlevel 3 so use basic
add conflicts to obviously conflicting services
remove old version number from init files
remove legacy syslog.target which is not needed on modern systems
fix formatting of email address onold Copyright text

Signed-off-by: Tuomo Soini <tis@foobar.fi>
2014-09-23 16:44:03 +03:00
Tuomo Soini
8f05d0f16d install.sh: support install on centos7 and foobar7
Signed-off-by: Tuomo Soini <tis@foobar.fi>
2014-09-23 13:19:09 +03:00
Tom Eastep
f9d98b74a2 Merge branch '4.6.2' into 4.6.3
Conflicts:
	Shorewall/Perl/Shorewall/Providers.pm

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-16 08:09:20 -07:00
Tom Eastep
0d23b9c542 Don't verify required interfaces during 'stop' or 'clear'.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-14 09:29:04 -07:00
Tom Eastep
a7bdfcc47b Refine the rule reduction fix
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-11 20:58:01 -07:00
Tom Eastep
988ee64621 Eliminate Redundant Rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-11 10:17:01 -07:00
Tom Eastep
9947f4d968 Re-enable SECTION PREROUTING in the accounting file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-10 12:53:08 -07:00
Tom Eastep
feb747260d Add /etc/shorewall/params to the multi-ISP LSM example
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-03 06:59:37 -07:00
Tom Eastep
fc58dab66d Remove redundant 'run' command from help output
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-02 12:57:04 -07:00
Tom Eastep
9e039e30e5 Issue warning message when /etc/iproute2/rt_tables is not writeable
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-02 08:11:33 -07:00
Tom Eastep
771e487b02 Merge branch '4.6.3' 2014-09-01 09:10:55 -07:00
Tom Eastep
0b66c475a7 Make <command> replacable in the run synopsis
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-01 09:10:03 -07:00
Tom Eastep
8727a6f1d8 Correct 'run' command synopsis in the shorewall[6] manpages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-01 08:52:09 -07:00
Tom Eastep
f9a62e1650 Correct builtin example in the actions manpages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-01 08:29:29 -07:00
Tom Eastep
6851744cb7 Implement the 'terminating' action option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-09-01 08:16:42 -07:00
Tom Eastep
f963adccf5 Correct silly typo in Chains.pm
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-08-31 16:57:24 -07:00
Tom Eastep
48549b35ac Correct inaccuracy in default.debian
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-08-30 08:25:58 -07:00
Tom Eastep
9001643996 Merge branch 'master' into 4.6.3 2014-08-30 07:18:55 -07:00
Tom Eastep
045d5ac048 Correct typo in error messages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-08-24 08:34:04 -07:00
Tom Eastep
e4a8cb31ba Clean up the Goto Meeting macro a bit
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-08-24 08:16:11 -07:00
Tom Eastep
9e6fffc231 Goto-Meeting Macro from Eric Teeter
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-08-23 16:05:38 -07:00
Tom Eastep
8236ce572e Apply Louis Lagendijk's patch for Shorewall-init
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-08-12 16:39:52 -07:00
Tom Eastep
bf5be7198b Make dump work correctly on RHEL5
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-08-12 16:18:42 -07:00
Tom Eastep
6f777098d7 Add 'wildcard' member to the interface table
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-08-12 06:51:17 -07:00
Tom Eastep
e545329eb9 Modify the preceding fix to work with wildcard interfaces
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2014-08-12 06:50:59 -07:00
93 changed files with 2594 additions and 820 deletions

View File

@@ -195,6 +195,10 @@ elif [ -n "${options[VARDIR]}" ]; then
fi
fi
if [ -z "${options[SERVICEDIR]}" ]; then
$options[SERVICEDIR]="${options[SYSTEMD]}"
fi
for on in \
HOST \
PREFIX \
@@ -209,7 +213,7 @@ for on in \
INITFILE \
AUXINITSOURCE \
AUXINITFILE \
SYSTEMD \
SERVICEDIR \
SERVICEFILE \
SYSCONFFILE \
SYSCONFDIR \

View File

@@ -154,6 +154,8 @@ if ( $options{VARLIB} ) {
$options{VARDIR} = '${VARLIB}/${PRODUCT}';
}
$options{SERVICEDIR}=$options{SYSTEMD} unless $options{SERVICEDIR};
for ( qw/ HOST
PREFIX
SHAREDIR
@@ -167,8 +169,8 @@ for ( qw/ HOST
INITFILE
AUXINITSOURCE
AUXINITFILE
SYSTEMD
SERVICEFILE
SERVICEDIR
SERVICEFILE
SYSCONFFILE
SYSCONFDIR
SPARSE

View File

@@ -198,7 +198,7 @@ if [ -z "$BUILD" ]; then
eval $(cat /etc/os-release | grep ^ID)
case $ID in
fedora|rhel)
fedora|rhel|centos|foobar)
BUILD=redhat
;;
debian)
@@ -329,9 +329,13 @@ if [ -n "${SYSCONFDIR}" ]; then
chmod 755 ${DESTDIR}${SYSCONFDIR}
fi
if [ -n "${SYSTEMD}" ]; then
mkdir -p ${DESTDIR}${SYSTEMD}
chmod 755 ${DESTDIR}${SYSTEMD}
if [ -z "${SERVICEDIR}" ]; then
SERVICEDIR="$SYSTEMD"
fi
if [ -n "${SERVICEDIR}" ]; then
mkdir -p ${DESTDIR}${SERVICEDIR}
chmod 755 ${DESTDIR}${SERVICEDIR}
fi
mkdir -p ${DESTDIR}${SBINDIR}

View File

@@ -367,6 +367,17 @@ resolve_arptables() {
esac
}
#
# Try to run the 'savesets' command
#
savesets() {
local supported
supported=$(run_it ${VARDIR}/firewall help | fgrep savesets )
[ -n "$supported" ] && run_it ${VARDIR}/firewall savesets ${g_restorepath}-ipsets
}
#
# Save currently running configuration
#
@@ -428,45 +439,47 @@ do_save() {
;;
esac
case ${SAVE_IPSETS:=No} in
[Yy]es)
case ${IPSET:=ipset} in
*/*)
if [ ! -x "$IPSET" ]; then
error_message "ERROR: IPSET=$IPSET does not exist or is not executable - ipsets are not saved"
IPSET=
if ! savesets; then
case ${SAVE_IPSETS:=No} in
[Yy]es)
case ${IPSET:=ipset} in
*/*)
if [ ! -x "$IPSET" ]; then
error_message "ERROR: IPSET=$IPSET does not exist or is not executable - ipsets are not saved"
IPSET=
fi
;;
*)
IPSET="$(mywhich $IPSET)"
[ -n "$IPSET" ] || error_message "ERROR: The ipset utility cannot be located - ipsets are not saved"
;;
esac
if [ -n "$IPSET" ]; then
if [ -f /etc/debian_version ] && [ $(cat /etc/debian_version) = 5.0.3 ]; then
#
# The 'grep -v' is a hack for a bug in ipset's nethash implementation when xtables-addons is applied to Lenny
#
hack='| grep -v /31'
else
hack=
fi
;;
*)
IPSET="$(mywhich $IPSET)"
[ -n "$IPSET" ] || error_message "ERROR: The ipset utility cannot be located - ipsets are not saved"
;;
esac
if [ -n "$IPSET" ]; then
if [ -f /etc/debian_version ] && [ $(cat /etc/debian_version) = 5.0.3 ]; then
#
# The 'grep -v' is a hack for a bug in ipset's nethash implementation when xtables-addons is applied to Lenny
#
hack='| grep -v /31'
else
hack=
if eval $IPSET -S $hack > ${VARDIR}/ipsets.tmp; then
#
# Don't save an 'empty' file
#
grep -qE -- '^(-N|create )' ${VARDIR}/ipsets.tmp && mv -f ${VARDIR}/ipsets.tmp ${g_restorepath}-ipsets
fi
fi
if eval $IPSET -S $hack > ${VARDIR}/ipsets.tmp; then
#
# Don't save an 'empty' file
#
grep -qE -- '^(-N|create )' ${VARDIR}/ipsets.tmp && mv -f ${VARDIR}/ipsets.tmp ${g_restorepath}-ipsets
fi
fi
;;
[Nn]o)
;;
*)
error_message "WARNING: Invalid value ($SAVE_IPSETS) for SAVE_IPSETS"
;;
esac
;;
[Nn]o)
;;
*)
error_message "WARNING: Invalid value ($SAVE_IPSETS) for SAVE_IPSETS"
;;
esac
fi
return $status
}
@@ -480,6 +493,8 @@ save_config() {
[ -x $iptables_save ] || echo "$iptables-save does not exist or is not executable" >&2
[ -n "$g_counters" ] && iptables_save="$iptables_save --counters"
if product_is_started ; then
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
@@ -1470,10 +1485,22 @@ do_dump_command() {
$g_tool -t rawpost -L $g_ipt_options
fi
local count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
local max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
local count
local max
heading "Conntrack Table ($count out of $max)"
if [ -f /proc/sys/net/netfilter/nf_conntrack_count ]; then
count=$(cat /proc/sys/net/netfilter/nf_conntrack_count)
max=$(cat /proc/sys/net/netfilter/nf_conntrack_max)
heading "Conntrack Table ($count out of $max)"
elif [ -f /proc/sys/net/ipv4/netfilter/ip_conntrack_count ]; then
count=$(cat /proc/sys/net/ipv4/netfilter/ip_conntrack_count)
max=$(cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max)
heading "Conntrack Table ($count out of $max)"
else
heading "Conntrack Table"
fi
if [ $g_family -eq 4 ]; then
[ -f /proc/net/ip_conntrack ] && cat /proc/net/ip_conntrack || grep -v '^ipv6' /proc/net/nf_conntrack
@@ -1599,6 +1626,15 @@ restore_command() {
g_noroutes=Yes
option=${option#n}
;;
p*)
[ -n "$(which conntrack)" ] || fatal_error "The '-p' option requires the conntrack utility which does not appear to be installed on this system"
g_purge=Yes
option=${option%p}
;;
C*)
g_counters=Yes
option=${option#C}
;;
*)
usage 1
;;
@@ -3083,11 +3119,45 @@ reject_command() {
}
save_command() {
local finished
finished=0
shift
while [ $finished -eq 0 -a $# -gt 0 ]; do
option=$1
case $option in
-*)
option=${option#-}
while [ -n "$option" ]; do
case $option in
-)
finished=1
option=
;;
C*)
g_counters=Yes
option=${option#C}
;;
*)
usage 1
;;
esac
done
shift
;;
*)
finished=1
;;
esac
done
case $# in
1)
0)
;;
2)
RESTOREFILE="$2"
1)
RESTOREFILE="$1"
validate_restorefile '<restore file>'
;;
*)
@@ -3382,7 +3452,11 @@ start_command() {
[ -n "$g_nolock" ] || mutex_on
if [ -x ${VARDIR}/firewall ]; then
run_it ${VARDIR}/firewall $g_debugging start
if [ -n "$g_fast" -a -x ${VARDIR}/${RESTOREFILE} -a ! ${VARDIR}/firewall -nt ${VARDIR}/${RESTOREFILE} ]; then
run_it ${VARDIR}/${RESTOREFILE} $g_debugging restore
else
run_it ${VARDIR}/firewall $g_debugging start
fi
rc=$?
else
error_message "${VARDIR}/firewall is missing or is not executable"
@@ -3418,6 +3492,14 @@ start_command() {
finished=1
option=
;;
f*)
g_fast=Yes
option=${option#f}
;;
C*)
g_counters=Yes
option=${option#C}
;;
p*)
[ -n "$(which conntrack)" ] || fatal_error "The '-p' option requires the conntrack utility which does not appear to be installed on this system"
g_purge=Yes
@@ -3479,6 +3561,10 @@ restart_command() {
g_purge=Yes
option=${option%p}
;;
C*)
g_counters=Yes
option=${option#C}
;;
*)
usage 1
;;
@@ -3552,10 +3638,10 @@ usage() # $1 = exit status
echo " logwatch [<refresh interval>]"
echo " reject <address> ..."
echo " reset [ <chain> ... ]"
echo " restart [ -n ] [ -p ] [ -f ] [ <directory> ]"
echo " restore [ -n ] [ <file name> ]"
echo " restart [ -n ] [ -p ] [ -f ] [ -C ] [ <directory> ]"
echo " restore [ -n ] [ -p ] [ -C ] [ <file name> ]"
echo " run <command> [ <parameter> ... ]"
echo " save [ <file name> ]"
echo " save [ -C ] [ <file name> ]"
echo " [ show | list | ls ] [ -b ] [ -x ] [ -t {filter|mangle|nat} ] [ {chain [<chain> [ <chain> ... ]"
echo " [ show | list | ls ] [ -f ] capabilities"
echo " [ show | list | ls ] arptables"
@@ -3580,10 +3666,9 @@ usage() # $1 = exit status
echo " [ show | list | ls ] tc [ device ]"
echo " [ show | list | ls ] vardir"
echo " [ show | list | ls ] zones"
echo " start [ -f ] [ -p ] [ <directory> ]"
echo " start [ -f ] [ -p ] [ -C ] [ <directory> ]"
echo " stop"
echo " status [ -i ]"
echo " run <function> [ function ... ]"
echo " version [ -a ]"
echo
exit $1
@@ -3633,6 +3718,7 @@ shorewall_cli() {
g_directives=
g_inline=
g_tcrules=
g_counters=
VERBOSE=
VERBOSITY=1

View File

@@ -157,6 +157,7 @@ run_it() {
[ -n "$g_timestamp" ] && options=${options}t
[ -n "$g_purge" ] && options=${options}p
[ -n "$g_recovering" ] && options=${options}r
[ -n "$g_counters" ] && options=${options}c
options="${options}V $VERBOSITY"

View File

@@ -14,7 +14,7 @@ INITDIR= #Unused on OS X
INITFILE= #Unused on OS X
INITSOURCE= #Unused on OS X
ANNOTATED= #Unused on OS X
SYSTEMD= #Unused on OS X
SYSTEMDDIR= #Unused on OS X
SERVICEFILE= #Unused on OS X
SYSCONFDIR= #Unused on OS X
SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR.

View File

@@ -15,7 +15,7 @@ INITFILE= #Name of the product's installed SysV ini
INITSOURCE= #Name of the distributed file to be installed as the SysV init script
ANNOTATED= #If non-zero, annotated configuration files are installed
SYSCONFDIR= #Directory where SysV init parameter files are installed
SYSTEMD=/usr/lib/systemd/system #Directory where .service files are installed (systems running systemd only)
SYSTEMDDIR=/usr/lib/systemd/system #Directory where .service files are installed (systems running systemd only)
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/var/lib #Directory where product variable data is stored.

View File

@@ -14,7 +14,7 @@ INITDIR=/etc/init.d #Unused on Cygwin
INITFILE= #Unused on Cygwin
INITSOURCE= #Unused on Cygwin
ANNOTATED= #Unused on Cygwin
SYSTEMD= #Unused on Cygwin
SYSTEMDDIR= #Unused on Cygwin
SERVICEFILE= #Unused on Cygwin
SYSCONFDIR= #Unused on Cygwin
SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR.

View File

@@ -17,7 +17,7 @@ ANNOTATED= #If non-zero, annotated configuration fi
SYSCONFFILE=default.debian #Name of the distributed file to be installed in $SYSCONFDIR
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
SYSCONFDIR=/etc/default #Directory where SysV init parameter files are installed
SYSTEMD= #Directory where .service files are installed (systems running systemd only)
SYSTEMDDIR= #Directory where .service files are installed (systems running systemd only)
SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
VARLIB=/var/lib #Directory where product variable data is stored.
VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored.

View File

@@ -14,7 +14,7 @@ INITDIR=/etc/init.d #Directory where SysV init scripts are i
INITFILE=$PRODUCT #Name of the product's installed SysV init script
INITSOURCE=init.sh #Name of the distributed file to be installed as the SysV init script
ANNOTATED= #If non-zero, annotated configuration files are installed
SYSTEMD= #Directory where .service files are installed (systems running systemd only)
SYSTEMDDIR= #Directory where .service files are installed (systems running systemd only)
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
SYSCONFFILE= #Name of the distributed file to be installed in $SYSCONFDIR
SYSCONFDIR= #Directory where SysV init parameter files are installed

View File

@@ -14,7 +14,7 @@ INITDIR=/etc/rc.d/init.d #Directory where SysV init scripts are i
INITFILE=$PRODUCT #Name of the product's installed SysV init script
INITSOURCE=init.fedora.sh #Name of the distributed file to be installed as the SysV init script
ANNOTATED= #If non-zero, annotated configuration files are installed
SYSTEMD=/lib/systemd/system #Directory where .service files are installed (systems running systemd only)
SYSTEMDDIR=/lib/systemd/system #Directory where .service files are installed (systems running systemd only)
SYSCONFFILE=sysconfig #Name of the distributed file to be installed as $SYSCONFDIR/$PRODUCT
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init parameter files are installed

View File

@@ -15,7 +15,7 @@ AUXINITSOURCE=init.slackware.firewall.sh #Name of the distributed file to be i
AUXINITFILE=rc.firewall #Name of the product's installed SysV init script
INITSOURCE=init.slackware.$PRODUCT.sh #Name of the distributed file to be installed as a second SysV init script
INITFILE=rc.$PRODUCT #Name of the product's installed second init script
SYSTEMD= #Name of the directory where .service files are installed (systems running systemd only)
SYSTEMDDIR= #Name of the directory where .service files are installed (systems running systemd only)
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
SYSCONFFILE= #Name of the distributed file to be installed in $SYSCONFDIR
SYSCONFDIR= #Name of the directory where SysV init parameter files are installed.

View File

@@ -8,13 +8,13 @@ CONFDIR=/etc #Directory where subsystem
SHAREDIR=${PREFIX}/share #Directory for arch-neutral files.
LIBEXECDIR=${PREFIX}/lib #Directory for executable scripts.
PERLLIBDIR=${PREFIX}/lib/perl5/vendor_perl/5.14.2 #Directory to install Shorewall Perl module directory
SBINDIR=/sbin #Directory where system administration programs are installed
SBINDIR=/usr/sbin #Directory where system administration programs are installed
MANDIR=${SHAREDIR}/man/ #Directory where manpages are installed.
INITDIR=/etc/init.d #Directory where SysV init scripts are installed.
INITFILE=$PRODUCT #Name of the product's SysV init script
INITSOURCE=init.suse.sh #Name of the distributed file to be installed as the SysV init script
ANNOTATED= #If non-zero, annotated configuration files are installed
SYSTEMD= #Directory where .service files are installed (systems running systemd only)
SYSTEMDDIR= #Directory where .service files are installed (systems running systemd only)
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
SYSCONFFILE=sysconfig #Name of the distributed file to be installed in $SYSCONFDIR
SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init parameter files are installed

View File

@@ -35,6 +35,7 @@ usage() # $1 = exit status
echo "usage: $ME [ <configuration-file> ]"
echo " $ME -v"
echo " $ME -h"
echo " $ME -n"
exit $1
}
@@ -105,9 +106,12 @@ PRODUCT=shorewall-init
T='-T'
finished=0
configure=1
while [ $finished -eq 0 ] ; do
case "$1" in
option="$1"
case "$option" in
-*)
option=${option#-}
@@ -120,6 +124,10 @@ while [ $finished -eq 0 ] ; do
echo "Shorewall-init Firewall Installer Version $VERSION"
exit 0
;;
n*)
configure=0
option=${option#n}
;;
*)
usage 1
;;
@@ -176,6 +184,8 @@ for var in SHAREDIR LIBEXECDIR CONFDIR SBINDIR VARLIB VARDIR; do
require $var
done
[ -n "$SANDBOX" ] && configure=0
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
if [ -z "$BUILD" ]; then
@@ -191,7 +201,7 @@ if [ -z "$BUILD" ]; then
eval $(cat /etc/os-release | grep ^ID=)
case $ID in
fedora|rhel)
fedora|rhel|centos|foobar)
BUILD=redhat
;;
debian|ubuntu)
@@ -306,6 +316,7 @@ fi
# Install the Firewall Script
#
if [ -n "$INITFILE" ]; then
mkdir -p ${DESTDIR}${INITDIR}
install_file $INITSOURCE ${DESTDIR}${INITDIR}/$INITFILE 0544
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${INITDIR}/$INITFILE
@@ -319,13 +330,17 @@ fi
#
# Install the .service file
#
if [ -n "$SYSTEMD" ]; then
mkdir -p ${DESTDIR}${SYSTEMD}
if [ -z "${SERVICEDIR}" ]; then
SERVICEDIR="$SYSTEMD"
fi
if [ -n "$SERVICEDIR" ]; then
mkdir -p ${DESTDIR}${SERVICEDIR}
[ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service
run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMD}/$PRODUCT.service
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMD}/$PRODUCT.service
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMD}/$PRODUCT.service"
if [ -n "$DESTDIR" ]; then
run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SERVICEDIR}/$PRODUCT.service
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SERVICEDIR}/$PRODUCT.service
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SERVICEDIR}/$PRODUCT.service"
if [ -n "$DESTDIR" -o $configure -eq 0 ]; then
mkdir -p ${DESTDIR}${SBINDIR}
chmod 755 ${DESTDIR}${SBINDIR}
fi
@@ -366,14 +381,24 @@ if [ $HOST = debian ]; then
if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/network/if-up.d/
mkdir -p ${DESTDIR}/etc/network/if-down.d/
mkdir -p ${DESTDIR}/etc/network/if-post-down.d/
elif [ $configure -eq 0 ]; then
mkdir -p ${DESTDIR}${CONFDIR}/network/if-up.d/
mkdir -p ${DESTDIR}${CONFDIR}/network/if-down.d/
mkdir -p ${DESTDIR}${CONFDIR}/network/if-post-down.d/
fi
if [ ! -f ${DESTDIR}/etc/default/shorewall-init ]; then
if [ ! -f ${DESTDIR}${CONFDIR}/default/shorewall-init ]; then
if [ -n "${DESTDIR}" ]; then
mkdir ${DESTDIR}/etc/default
fi
install_file sysconfig ${DESTDIR}/etc/default/shorewall-init 0644
if [ $configure -eq 1 ]; then
install_file sysconfig ${DESTDIR}/etc/default/shorewall-init 0644
else
mkdir -p ${DESTDIR}${CONFDIR}/default
install_file sysconfig ${DESTDIR}${CONFDIR}/default/shorewall-init 0644
fi
fi
IFUPDOWN=ifupdown.debian.sh
@@ -384,7 +409,7 @@ else
if [ -z "$RPM" ]; then
if [ $HOST = suse ]; then
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d
elif [ $HOST = gentoo ]; then
# Gentoo does not support if-{up,down}.d
/bin/true
@@ -415,17 +440,33 @@ mkdir -p ${DESTDIR}${LIBEXECDIR}/shorewall-init
install_file ifupdown ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown 0544
if [ -d ${DESTDIR}/etc/NetworkManager ]; then
install_file ifupdown ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
if [ $configure -eq 1 ]; then
install_file ifupdown ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
else
mkdir -p ${DESTDIR}${CONFDIR}/NetworkManager/dispatcher.d/
install_file ifupdown ${DESTDIR}${CONFDIR}/NetworkManager/dispatcher.d/01-shorewall 0544
fi
fi
case $HOST in
debian)
install_file ifupdown ${DESTDIR}/etc/network/if-up.d/shorewall 0544
install_file ifupdown ${DESTDIR}/etc/network/if-down.d/shorewall 0544
install_file ifupdown ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
if [ $configure -eq 1 ]; then
install_file ifupdown ${DESTDIR}/etc/network/if-up.d/shorewall 0544
install_file ifupdown ${DESTDIR}/etc/network/if-down.d/shorewall 0544
install_file ifupdown ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
else
install_file ifupdown ${DESTDIR}${CONFDIR}/network/if-up.d/shorewall 0544
install_file ifupdown ${DESTDIR}${CONFDIR}/network/if-down.d/shorewall 0544
install_file ifupdown ${DESTDIR}${CONFDIR}/network/if-post-down.d/shorewall 0544
fi
;;
suse)
if [ -z "$RPM" ]; then
if [ $configure -eq 0 ]; then
mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-up.d/
mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d/
fi
install_file ifupdown ${DESTDIR}${SYSCONFDIR}/network/if-up.d/shorewall 0544
install_file ifupdown ${DESTDIR}${SYSCONFDIR}/network/if-down.d/shorewall 0544
fi
@@ -453,7 +494,7 @@ case $HOST in
esac
if [ -z "$DESTDIR" ]; then
if [ -n "$first_install" ]; then
if [ $configure -eq 1 -a -n "$first_install" ]; then
if [ $HOST = debian ]; then
if mywhich insserv; then
if insserv ${INITDIR}/shorewall-init; then
@@ -476,7 +517,7 @@ if [ -z "$DESTDIR" ]; then
# not by the installer
/bin/true
else
if [ -n "$SYSTEMD" ]; then
if [ -n "$SERVICEDIR" ]; then
if systemctl enable shorewall-init.service; then
echo "Shorewall Init will start automatically at boot"
fi
@@ -505,7 +546,7 @@ if [ -z "$DESTDIR" ]; then
fi
fi
else
if [ -n "$first_install" ]; then
if [ $configure -eq 1 -a -n "$first_install" ]; then
if [ $HOST = debian ]; then
if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/rcS.d

View File

@@ -63,18 +63,19 @@ shorewall_start () {
for PRODUCT in $PRODUCTS; do
setstatedir
if [ -x ${STATEDIR}/$PRODUCT/firewall ]; then
if [ -x ${STATEDIR}/firewall ]; then
#
# Run in a sub-shell to avoid name collisions
#
(
if ! ${STATEDIR}/$PRODUCT/firewall status > /dev/null 2>&1; then
${STATEDIR}/$PRODUCT/firewall ${OPTIONS} stop || exit 1
if ! ${STATEDIR}/firewall status > /dev/null 2>&1; then
${STATEDIR}/firewall ${OPTIONS} stop || exit 1
else
exit 1
fi
)
else
echo ERROR: ${STATEDIR}/firewall does not exist or is not executable!
exit 1
fi
done
@@ -95,8 +96,8 @@ shorewall_stop () {
for PRODUCT in $PRODUCTS; do
setstatedir
if [ -x ${STATEDIR}/$PRODUCT/firewall ]; then
${STATEDIR}/$PRODUCT/firewall ${OPTIONS} clear || exit 1
if [ -x ${STATEDIR}/firewall ]; then
${STATEDIR}/firewall ${OPTIONS} clear || exit 1
fi
done

View File

@@ -1,20 +1,20 @@
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.4
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
#
# Copyright 2011 Jonathan Underwood (jonathan.underwood@gmail.com)
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
#
[Unit]
Description=Shorewall IPv4 firewall
After=syslog.target
Description=Shorewall IPv4 firewall (bootup security)
Before=network.target
Conflicts=iptables.service firewalld.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall-init
StandardOutput=syslog
ExecStart=/sbin/shorewall-init $OPTIONS start
ExecStop=/sbin/shorewall-init $OPTIONS stop
ExecStart=/sbin/shorewall-init start
ExecStop=/sbin/shorewall-init stop
[Install]
WantedBy=multi-user.target
WantedBy=basic.target

View File

@@ -0,0 +1,21 @@
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
#
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
#
[Unit]
Description=Shorewall IPv4 firewall (bootup security)
Before=network-pre.target
Wants=network-pre.target
Conflicts=iptables.service firewalld.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall-init
StandardOutput=syslog
ExecStart=/sbin/shorewall-init start
ExecStop=/sbin/shorewall-init stop
[Install]
WantedBy=basic.target

View File

@@ -1,4 +1,4 @@
\#!/bin/sh
#!/bin/sh
#
# Script to back uninstall Shoreline Firewall
#
@@ -69,6 +69,42 @@ remove_file() # $1 = file to restore
fi
}
finished=0
configure=1
while [ $finished -eq 0 ]; do
option=$1
case "$option" in
-*)
option=${option#-}
while [ -n "$option" ]; do
case $option in
h)
usage 0
;;
v)
echo "$Product Firewall Installer Version $VERSION"
exit 0
;;
n*)
configure=0
option=${option#n}
;;
*)
usage 1
;;
esac
done
shift
;;
*)
finished=1
;;
esac
done
#
# Read the RC file
#
@@ -114,22 +150,29 @@ fi
echo "Uninstalling Shorewall Init $VERSION"
[ -n "$SANDBOX" ] && configure=0
INITSCRIPT=${CONFDIR}/init.d/shorewall-init
if [ -f "$INITSCRIPT" ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall-init remove
elif mywhich insserv ; then
insserv -r $INITSCRIPT
elif mywhich chkconfig ; then
chkconfig --del $(basename $INITSCRIPT)
elif mywhich systemctl ; then
systemctl disable shorewall-init
if [ $configure -eq 1 ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall-init remove
elif mywhich insserv ; then
insserv -r $INITSCRIPT
elif mywhich chkconfig ; then
chkconfig --del $(basename $INITSCRIPT)
fi
fi
remove_file $INITSCRIPT
fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable shorewall-init.service
rm -f $SYSTEMD/shorewall-init.service
fi
[ "$(readlink -m -q ${SBINDIR}/ifup-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifup-local
[ "$(readlink -m -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifdown-local
@@ -159,8 +202,9 @@ if [ -d ${CONFDIR}/ppp ]; then
done
fi
rm -f ${SBINDIR}/shorewall-init
rm -rf ${SHAREDIR}/shorewall-init
rm -rf ${LIBEXEC}/shorewall-init
rm -rf ${LIBEXECDIR}/shorewall-init
echo "Shorewall Init Uninstalled"

View File

@@ -39,7 +39,7 @@ fi
start() {
echo -n $"Starting Shorewall: "
$shorewall $OPTIONS start 2>&1 | $logger
$shorewall $OPTIONS start $STARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then
touch $lockfile
@@ -69,7 +69,7 @@ restart() {
# Note that we don't simply stop and start since shorewall has a built in
# restart which stops the firewall if running and then starts it.
echo -n $"Restarting Shorewall: "
$shorewall $OPTIONS restart 2>&1 | $logger
$shorewall $OPTIONS restart $RESTARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then
touch $lockfile

View File

@@ -30,6 +30,7 @@ usage() # $1 = exit status
echo "usage: $ME [ <configuration-file> ]"
echo " $ME -v"
echo " $ME -h"
echo " $ME -n"
exit $1
}
@@ -113,9 +114,13 @@ fi
# Parse the run line
#
finished=0
configure=1
while [ $finished -eq 0 ] ; do
case "$1" in
option=$1
case "$option" in
-*)
option=${option#-}
@@ -128,6 +133,10 @@ while [ $finished -eq 0 ] ; do
echo "$Product Firewall Installer Version $VERSION"
exit 0
;;
n*)
configure=0
option=${option#n}
;;
*)
usage 1
;;
@@ -186,6 +195,8 @@ done
PATH=${SBINDIR}:/bin:/usr${SBINDIR}:/usr/bin:/usr/local/bin:/usr/local${SBINDIR}
[ -n "$SANDBOX" ] && configure=0
#
# Determine where to install the firewall script
#
@@ -206,7 +217,7 @@ if [ -z "$BUILD" ]; then
eval $(cat /etc/os-release | grep ^ID)
case $ID in
fedora|rhel)
fedora|rhel|centos|foobar)
BUILD=redhat
;;
debian)
@@ -346,6 +357,7 @@ fi
delete_file ${DESTDIR}/usr/share/$PRODUCT/xmodules
install_file $PRODUCT ${DESTDIR}${SBINDIR}/$PRODUCT 0544
[ -n "${INITFILE}" ] && install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
echo "$Product control program installed in ${DESTDIR}${SBINDIR}/$PRODUCT"
@@ -358,7 +370,7 @@ mkdir -p ${DESTDIR}${LIBEXECDIR}/$PRODUCT
mkdir -p ${DESTDIR}${VARDIR}
chmod 755 ${DESTDIR}${CONFDIR}/$PRODUCT
chmod 755 ${DESTDIR}/usr/share/$PRODUCT
chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT
if [ -n "$DESTDIR" ]; then
mkdir -p ${DESTDIR}${CONFDIR}/logrotate.d
@@ -380,12 +392,16 @@ fi
#
# Install the .service file
#
if [ -n "$SYSTEMD" ]; then
mkdir -p ${DESTDIR}${SYSTEMD}
if [ -z "${SERVICEDIR}" ]; then
SERVICEDIR="$SYSTEMD"
fi
if [ -n "$SERVICEDIR" ]; then
mkdir -p ${DESTDIR}${SERVICEDIR}
[ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service
run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMD}/$PRODUCT.service
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMD}/$PRODUCT.service
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMD}/$PRODUCT.service"
run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SERVICEDIR}/$PRODUCT.service
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SERVICEDIR}/$PRODUCT.service
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SERVICEDIR}/$PRODUCT.service"
fi
#
# Install the config file
@@ -466,18 +482,18 @@ done
if [ -d manpages ]; then
cd manpages
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${SHAREDIR}/man/man5/ ${DESTDIR}${SHAREDIR}/man/man8/
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
for f in *.5; do
gzip -c $f > $f.gz
run_install $T $INSTALLD $OWNERSHIP -m 0644 $f.gz ${DESTDIR}${SHAREDIR}/man/man5/$f.gz
echo "Man page $f.gz installed to ${DESTDIR}${SHAREDIR}/man/man5/$f.gz"
run_install $T $INSTALLD $OWNERSHIP -m 0644 $f.gz ${DESTDIR}${MANDIR}/man5/$f.gz
echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man5/$f.gz"
done
for f in *.8; do
gzip -c $f > $f.gz
run_install $T $INSTALLD $OWNERSHIP -m 0644 $f.gz ${DESTDIR}${SHAREDIR}/man/man8/$f.gz
echo "Man page $f.gz installed to ${DESTDIR}${SHAREDIR}/man/man8/$f.gz"
run_install $T $INSTALLD $OWNERSHIP -m 0644 $f.gz ${DESTDIR}${MANDIR}/man8/$f.gz
echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man8/$f.gz"
done
cd ..
@@ -499,7 +515,7 @@ chmod 644 ${DESTDIR}${SHAREDIR}/$PRODUCT/version
# Remove and create the symbolic link to the init script
#
if [ -z "$DESTDIR" ]; then
if [ -z "${DESTDIR}" -a -n "${INITFILE}" ]; then
rm -f ${SHAREDIR}/$PRODUCT/init
ln -s ${INITDIR}/${INITFILE} ${SHAREDIR}/$PRODUCT/init
fi
@@ -526,8 +542,8 @@ if [ ${SHAREDIR} != /usr/share ]; then
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}/${SBINDIR}/$PRODUCT
fi
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then
if [ -n "$SYSTEMD" ]; then
if [ $configure -eq 1 -a -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then
if [ -n "$SERVICEDIR" ]; then
if systemctl enable ${PRODUCT}.service; then
echo "$Product will start automatically at boot"
fi

View File

@@ -299,7 +299,7 @@
<arg><option>-n</option></arg>
<arg><option>-p</option></arg>
<arg><option>-p</option><arg><option>-C</option></arg></arg>
<arg><replaceable>directory</replaceable></arg>
</cmdsynopsis>
@@ -314,6 +314,8 @@
<arg choice="plain"><option>restore</option></arg>
<arg><option>-C</option></arg>
<arg><replaceable>filename</replaceable></arg>
</cmdsynopsis>
@@ -340,7 +342,8 @@
<arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>save</option></arg>
<arg
choice="plain"><option>save</option><arg><option>-C</option></arg></arg>
<arg choice="opt"><replaceable>filename</replaceable></arg>
</cmdsynopsis>
@@ -474,6 +477,10 @@
<arg><option>-n</option></arg>
<arg><option>-p</option></arg>
<arg><option>-f</option></arg>
<arg><option>-C</option></arg>
</cmdsynopsis>
<cmdsynopsis>
@@ -526,8 +533,9 @@
<para>The nolock <option>option</option> prevents the command from
attempting to acquire the Shorewall-lite lockfile. It is useful if you
need to include <command>shorewall</command> commands in
<filename>/etc/shorewall/started</filename>.</para>
need to include <command>shorewall</command> commands in the
<filename>started</filename> <ulink
url="../shorewall_extension_scripts.html">extension script</ulink>.</para>
<para>The <emphasis>options</emphasis> control the amount of output that
the command produces. They consist of a sequence of the letters <emphasis
@@ -538,8 +546,8 @@
role="bold">v</emphasis> adds one to the effective verbosity and each
<emphasis role="bold">q</emphasis> subtracts one from the effective
VERBOSITY. Alternately, <emphasis role="bold">v</emphasis> may be followed
immediately with one of -1,0,1,2 to specify a specify VERBOSITY. There may
be no white-space between <emphasis role="bold">v</emphasis> and the
immediately with one of -1,0,1,2 to specify VERBOSITY. There may be no
white-space between <emphasis role="bold">v</emphasis> and the
VERBOSITY.</para>
<para>The <emphasis>options</emphasis> may also include the letter
@@ -819,6 +827,12 @@
<para>The <option>-p</option> option causes the connection tracking
table to be flushed; the <command>conntrack</command> utility must
be installed to use this option.</para>
<para>The <option>-C</option> option was added in Shorewall 4.6.5.
If the specified (or implicit) firewall script is the one that
generated the current running configuration, then the running
netfilter configuration will be reloaded as is so as to preserve the
iptables packet and byte counters.</para>
</listitem>
</varlistentry>
@@ -834,6 +848,19 @@
<emphasis>filename</emphasis> is given then Shorewall-lite will be
restored from the file specified by the RESTOREFILE option in <ulink
url="shorewall.conf.html">shorewall.conf</ulink>(5).</para>
<caution>
<para>If your iptables ruleset depends on variables that are
detected at run-time, either in your params file or by
Shorewall-generated code, <command>restore</command> will use the
values that were current when the ruleset was saved, which may be
different from the current values.</para>
</caution>
<para>The <option>-C</option> option was added in Shorewall 4.6.5.
If the <option>-C</option> option was specified during <emphasis
role="bold">shorewall save</emphasis>, then the counters saved by
that operation will be restored.</para>
</listitem>
</varlistentry>
@@ -865,6 +892,10 @@
<emphasis>filename</emphasis> is not given then the state is saved
in the file specified by the RESTOREFILE option in <ulink
url="shorewall.conf.html">shorewall.conf</ulink>(5).</para>
<para>The <option>-C</option> option, added in Shorewall 4.6.5,
causes the iptables packet and byte counters to be saved along with
the chains and rules.</para>
</listitem>
</varlistentry>
@@ -1102,6 +1133,22 @@
<para>The <option>-p</option> option causes the connection tracking
table to be flushed; the <command>conntrack</command> utility must
be installed to use this option.</para>
<para>The <option>-m</option> option prevents the firewall script
from modifying the current routing configuration.</para>
<para>The <option>-f</option> option was added in Shorewall 4.6.5.
If the RESTOREFILE named in <ulink
url="shorewall.conf.html">shorewall.conf</ulink>(5) exists, is
executable and is not older than the current filewall script, then
that saved configuration is restored.</para>
<para>The <option>-C</option> option was added in Shorewall 4.6.5
and is only meaningful when the <option>-f</option> option is also
specified. If the previously-saved configuration is restored, and if
the <option>-C</option> option was also specified in the <emphasis
role="bold">save</emphasis> command, then the packet and byte
counters will be restored.</para>
</listitem>
</varlistentry>

View File

@@ -1,20 +1,20 @@
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.4
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
#
# Copyright 2011 Jonathan Underwood (jonathan.underwood@gmail.com)
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
#
[Unit]
Description=Shorewall IPv4 firewall (lite)
After=syslog.target
After=network.target
Conflicts=iptables.service firewalld.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall-lite
StandardOutput=syslog
ExecStart=/sbin/shorewall-lite $OPTIONS start
ExecStart=/sbin/shorewall-lite $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall-lite $OPTIONS stop
[Install]
WantedBy=multi-user.target
WantedBy=basic.target

View File

@@ -0,0 +1,20 @@
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
#
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
#
[Unit]
Description=Shorewall IPv4 firewall (lite)
After=network-online.target
Conflicts=iptables.service firewalld.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall-lite
StandardOutput=syslog
ExecStart=/sbin/shorewall-lite $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall-lite $OPTIONS stop
[Install]
WantedBy=basic.target

View File

@@ -27,11 +27,16 @@
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=xxx #The Build script inserts the actual version
PRODUCT=shorewall-lite
usage() # $1 = exit status
{
ME=$(basename $0)
echo "usage: $ME [ <shorewallrc file> ]"
echo "usage: $ME [ <option> ] [ <shorewallrc file> ]"
echo "where <option> is one of"
echo " -h"
echo " -v"
echo " -n"
exit $1
}
@@ -69,6 +74,42 @@ remove_file() # $1 = file to restore
fi
}
finished=0
configure=1
while [ $finished -eq 0 ]; do
option=$1
case "$option" in
-*)
option=${option#-}
while [ -n "$option" ]; do
case $option in
h)
usage 0
;;
v)
echo "$Product Firewall Installer Version $VERSION"
exit 0
;;
n*)
configure=0
option=${option#n}
;;
*)
usage 1
;;
esac
done
shift
;;
*)
finished=1
;;
esac
done
#
# Read the RC file
#
@@ -112,8 +153,12 @@ fi
echo "Uninstalling Shorewall Lite $VERSION"
if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall ]; then
shorewall-lite clear
[ -n "$SANDBOX" ] && configure=0
if [ $configure -eq 1 ]; then
if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall ]; then
shorewall-lite clear
fi
fi
if [ -L ${SHAREDIR}/shorewall-lite/init ]; then
@@ -123,28 +168,34 @@ elif [ -n "$INITFILE" ]; then
fi
if [ -f "$FIREWALL" ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall-lite remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif [ mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
elif mywhich systemctl ; then
systemctl disable shorewall-lite
if [ $configure -eq 1 ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall-lite remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
fi
fi
remove_file $FIREWALL
fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
rm -f $SYSTEMD/shorewall-lite.service
fi
rm -f ${SBINDIR}/shorewall-lite
rm -rf ${SBINDIR}/shorewall-lite
rm -rf ${CONFDIR}/shorewall-lite
rm -rf ${VARDIR}/shorewall-lite
rm -rf ${SHAREDIR}/shorewall-lite
rm -rf ${LIBEXEC}/shorewall-lite
rm -rf ${LIBEXECDIR}/shorewall-lite
rm -f ${CONFDIR}/logrotate.d/shorewall-lite
[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/shorewall-lite.service
rm -f ${MANDIR}/man5/shorewall-lite*
rm -f ${MANDIR}/man8/shorewall-lite*
echo "Shorewall Lite Uninstalled"

View File

@@ -0,0 +1,12 @@
#
# Shorewall version 4 - Citrix/Goto Meeting macro
#
# /usr/share/shorewall/macro.Goto-Meeting
# by Eric Teeter
# This macro handles Citrix/Goto Meeting
# Assumes that ports 80 and 443 are already open
# If needed, use the macros that open Http and Https to reduce redundancy
####################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
# PORT(S) PORT(S) LIMIT GROUP
PARAM - - tcp 8200 # Goto Meeting only needed (TCP outbound)

View File

@@ -155,8 +155,6 @@ sub process_accounting_rule1( $$$$$$$$$$$ ) {
my ($action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark, $ipsec, $headers ) = @_;
$acctable = $config{ACCOUNTING_TABLE};
$jumpchainref = 0;
$asection = LEGACY if $asection < 0;
@@ -453,6 +451,8 @@ sub setup_accounting() {
set_section_function( &process_section );
$acctable = $config{ACCOUNTING_TABLE};
first_entry "$doing $fn...";
my $nonEmpty = 0;

View File

@@ -73,6 +73,7 @@ our @EXPORT = ( qw(
allow_optimize
allow_delete
allow_move
make_terminating
set_optflags
reset_optflags
has_return
@@ -104,7 +105,6 @@ our @EXPORT = ( qw(
AUDIT
HELPER
INLINE
TERMINATING
STATEMATCH
USERBUILTIN
INLINERULE
@@ -262,6 +262,7 @@ our %EXPORT_TAGS = (
set_global_variables
save_dynamic_chains
load_ipsets
create_save_ipsets
validate_nfobject
create_nfobjects
create_netfilter_load
@@ -793,6 +794,13 @@ sub decr_cmd_level( $ ) {
assert( --$_[0]->{cmdlevel} >= 0, $_[0] );
}
#
# Mark an action as terminating
#
sub make_terminating( $ ) {
$terminating{$_[0]} = 1;
}
#
# Transform the passed iptables rule into an internal-form hash reference.
# Most of the compiler has been converted to use the new form natively.
@@ -1654,7 +1662,8 @@ sub insert_rule($$$) {
sub insert_irule( $$$$;@ ) {
my ( $chainref, $jump, $target, $number, @matches ) = @_;
my $ruleref = {};
my $rulesref = $chainref->{rules};
my $ruleref = {};
$ruleref->{mode} = ( $ruleref->{cmdlevel} = $chainref->{cmdlevel} ) ? CMD_MODE : CAT_MODE;
@@ -1673,7 +1682,15 @@ sub insert_irule( $$$$;@ ) {
$ruleref->{comment} = shortlineinfo( $chainref->{origin} ) || $ruleref->{comment} || $comment;
splice( @{$chainref->{rules}}, $number, 0, $ruleref );
if ( $number >= @$rulesref ) {
#
# Avoid failure in spice if we insert beyond the end of the chain
#
$number = @$rulesref;
push @$rulesref, $ruleref;
} else {
splice( @$rulesref, $number, 0, $ruleref );
}
trace( $chainref, 'I', ++$number, format_rule( $chainref, $ruleref ) ) if $debug;
@@ -4859,62 +4876,79 @@ my %norate = ( DROP => 1, REJECT => 1 );
# Create a "-m limit" match for the passed LIMIT/BURST
#
sub do_ratelimit( $$ ) {
my ( $rate, $action ) = @_;
my ( $rates, $action ) = @_;
return '' unless $rate and $rate ne '-';
return '' unless $rates and $rates ne '-';
fatal_error "Rate Limiting not available with $action" if $norate{$action};
#
# "-m hashlimit" match for the passed LIMIT/BURST
#
if ( $rate =~ /^[sd]:{1,2}/ ) {
require_capability 'HASHLIMIT_MATCH', 'Per-ip rate limiting' , 's';
my $limit = "-m hashlimit ";
my $match = have_capability( 'OLD_HL_MATCH' ) ? 'hashlimit' : 'hashlimit-upto';
my $units;
my @rates = split_list $rates, 'rate';
if ( $rate =~ /^[sd]:((\w*):)?((\d+)(\/(sec|min|hour|day))?):(\d+)$/ ) {
fatal_error "Invalid Rate ($3)" unless $4;
fatal_error "Invalid Burst ($7)" unless $7;
$limit .= "--$match $3 --hashlimit-burst $7 --hashlimit-name ";
$limit .= $2 ? $2 : 'shorewall' . $hashlimitset++;
$limit .= ' --hashlimit-mode ';
$units = $6;
} elsif ( $rate =~ /^[sd]:((\w*):)?((\d+)(\/(sec|min|hour|day))?)$/ ) {
fatal_error "Invalid Rate ($3)" unless $4;
$limit .= "--$match $3 --hashlimit-name ";
$limit .= $2 ? $2 : 'shorewall' . $hashlimitset++;
$limit .= ' --hashlimit-mode ';
$units = $6;
} else {
fatal_error "Invalid rate ($rate)";
}
if ( @rates == 2 ) {
$rates[0] = 's:' . $rates[0];
$rates[1] = 'd:' . $rates[1];
} elsif ( @rates > 2 ) {
fatal error "Only two rates may be specified";
}
$limit .= $rate =~ /^s:/ ? 'srcip ' : 'dstip ';
my $limit = '';
if ( $units && $units ne 'sec' ) {
my $expire = 60000; # 1 minute in milliseconds
for my $rate ( @rates ) {
#
# "-m hashlimit" match for the passed LIMIT/BURST
#
if ( $rate =~ /^([sd]):{1,2}/ ) {
require_capability 'HASHLIMIT_MATCH', 'Per-ip rate limiting' , 's';
if ( $units ne 'min' ) {
$expire *= 60; #At least an hour
$expire *= 24 if $units eq 'day';
my $match = have_capability( 'OLD_HL_MATCH' ) ? 'hashlimit' : 'hashlimit-upto';
my $units;
$limit .= "-m hashlimit ";
if ( $rate =~ /^[sd]:((\w*):)?((\d+)(\/(sec|min|hour|day))?):(\d+)$/ ) {
fatal_error "Invalid Rate ($3)" unless $4;
fatal_error "Invalid Burst ($7)" unless $7;
$limit .= "--$match $3 --hashlimit-burst $7 --hashlimit-name ";
$limit .= $2 ? $2 : 'shorewall' . $hashlimitset++;
$limit .= ' --hashlimit-mode ';
$units = $6;
} elsif ( $rate =~ /^[sd]:((\w*):)?((\d+)(\/(sec|min|hour|day))?)$/ ) {
fatal_error "Invalid Rate ($3)" unless $4;
$limit .= "--$match $3 --hashlimit-name ";
$limit .= $2 ? $2 : 'shorewall' . $hashlimitset++;
$limit .= ' --hashlimit-mode ';
$units = $6;
} else {
fatal_error "Invalid rate ($rate)";
}
$limit .= "--hashlimit-htable-expire $expire ";
}
$limit .= $rate =~ /^s:/ ? 'srcip ' : 'dstip ';
$limit;
} elsif ( $rate =~ /^((\d+)(\/(sec|min|hour|day))?):(\d+)$/ ) {
fatal_error "Invalid Rate ($1)" unless $2;
fatal_error "Invalid Burst ($5)" unless $5;
"-m limit --limit $1 --limit-burst $5 ";
} elsif ( $rate =~ /^(\d+)(\/(sec|min|hour|day))?$/ ) {
fatal_error "Invalid Rate (${1}${2})" unless $1;
"-m limit --limit $rate ";
} else {
fatal_error "Invalid rate ($rate)";
if ( $units && $units ne 'sec' ) {
my $expire = 60000; # 1 minute in milliseconds
if ( $units ne 'min' ) {
$expire *= 60; #At least an hour
$expire *= 24 if $units eq 'day';
}
$limit .= "--hashlimit-htable-expire $expire ";
}
} else {
if ( $rate =~ /^((\d+)(\/(sec|min|hour|day))?):(\d+)$/ ) {
fatal_error "Invalid Rate ($1)" unless $2;
fatal_error "Invalid Burst ($5)" unless $5;
$limit = "-m limit --limit $1 --limit-burst $5 ";
} elsif ( $rate =~ /^(\d+)(\/(sec|min|hour|day))?$/ ) {
fatal_error "Invalid Rate (${1}${2})" unless $1;
$limit = "-m limit --limit $rate ";
} else {
fatal_error "Invalid rate ($rate)";
}
}
}
$limit;
}
#
@@ -6487,7 +6521,6 @@ sub set_chain_variables() {
emit( 'IPTABLES_RESTORE=${IPTABLES}-restore',
'[ -x "$IPTABLES_RESTORE" ] || startup_error "$IPTABLES_RESTORE does not exist or is not executable"' );
emit( 'g_tool=$IPTABLES' );
} else {
if ( $config{IP6TABLES} ) {
@@ -6502,7 +6535,6 @@ sub set_chain_variables() {
emit( 'IP6TABLES_RESTORE=${IP6TABLES}-restore',
'[ -x "$IP6TABLES_RESTORE" ] || startup_error "$IP6TABLES_RESTORE does not exist or is not executable"' );
emit( 'g_tool=$IP6TABLES' );
}
@@ -7570,7 +7602,7 @@ sub expand_rule( $$$$$$$$$$$;$ )
$exceptionrule,
$actparms{disposition} || $disposition,
$target ),
$terminating{$basictarget} || ( $targetref || $targetref->{complete} ),
$terminating{$basictarget} || ( $targetref && $targetref->{complete} ),
$matches );
}
@@ -7875,14 +7907,18 @@ sub emitr1( $$ ) {
sub save_dynamic_chains() {
my $tool;
my $tool = $family == F_IPV4 ? '${IPTABLES}' : '${IP6TABLES}';
my $utility = $family == F_IPV4 ? 'iptables-restore' : 'ip6tables-restore';
emit ( 'if [ "$COMMAND" = restart -o "$COMMAND" = refresh ]; then' );
push_indent;
if ( have_capability 'IPTABLES_S' ) {
$tool = $family == F_IPV4 ? '${IPTABLES}' : '${IP6TABLES}';
emit( 'if [ -n "$g_counters" ]; then' ,
" ${tool}-save --counters | grep -vE '[ :]shorewall ' > \${VARDIR}/.${utility}-input",
"fi\n"
);
if ( have_capability 'IPTABLES_S' ) {
emit <<"EOF";
if chain_exists 'UPnP -t nat'; then
$tool -t nat -S UPnP | tail -n +2 > \${VARDIR}/.UPnP
@@ -7902,6 +7938,7 @@ else
rm -f \${VARDIR}/.dynamic
fi
EOF
} else {
$tool = $family == F_IPV4 ? '${IPTABLES}-save' : '${IP6TABLES}-save';
@@ -7979,11 +8016,99 @@ sub ensure_ipset( $ ) {
}
}
#
# Generate the save_ipsets() function
#
sub create_save_ipsets() {
my @ipsets = all_ipsets;
emit( "#\n#Save the ipsets specified by the SAVE_IPSETS setting and by dynamic zones\n#",
'save_ipsets() {' );
if ( @ipsets || @{$globals{SAVED_IPSETS}} || ( $config{SAVE_IPSETS} && have_ipset_rules ) ) {
emit( ' local file' ,
'',
' file=$1'
);
if ( @ipsets ) {
emit '';
ensure_ipset( $_ ) for @ipsets;
}
if ( $config{SAVE_IPSETS} ) {
if ( $family == F_IPV6 || $config{SAVE_IPSETS} eq 'ipv4' ) {
my $select = $family == F_IPV4 ? '^create.*family inet ' : 'create.*family inet6 ';
emit( '' ,
' rm -f $file' ,
' touch $file' ,
' local set' ,
);
if ( @ipsets ) {
emit '';
emit( " \$IPSET -S $_ >> \$file" ) for @ipsets;
}
emit( '',
" for set in \$(\$IPSET save | grep '$select' | cut -d' ' -f2); do" ,
" \$IPSET save \$set >> \$file" ,
" done" );
} else {
emit ( '' ,
' if [ -f /etc/debian_version ] && [ $(cat /etc/debian_version) = 5.0.3 ]; then' ,
' #',
' # The \'grep -v\' is a hack for a bug in ipset\'s nethash implementation when xtables-addons is applied to Lenny' ,
' #',
' hack=\'| grep -v /31\'' ,
' else' ,
' hack=' ,
' fi' ,
'',
' if eval $IPSET -S $hack > ${VARDIR}/ipsets.tmp; then' ,
" grep -qE -- \"^(-N|create )\" \${VARDIR}/ipsets.tmp && mv -f \${VARDIR}/ipsets.tmp \$file" ,
' fi' );
}
emit("}\n" );
} elsif ( @ipsets || $globals{SAVED_IPSETS} ) {
emit( '' ,
' rm -f ${VARDIR}/ipsets.tmp' ,
' touch ${VARDIR}/ipsets.tmp' ,
);
if ( @ipsets ) {
emit '';
emit( " \$IPSET -S $_ >> \${VARDIR}/ipsets.tmp" ) for @ipsets;
}
emit( '' ,
" if qt \$IPSET list $_; then" ,
" \$IPSET save $_ >> \${VARDIR}/ipsets.tmp" ,
' else' ,
" error_message 'ipset $_ not saved (not found)'" ,
" fi\n" ) for @{$globals{SAVED_IPSETS}};
emit( '' ,
" grep -qE -- \"(-N|^create )\" \${VARDIR}/ipsets.tmp && cat \${VARDIR}/ipsets.tmp >> \$file\n" ,
'' ,
"}\n" );
}
} elsif ( $config{SAVE_IPSETS} ) {
emit( ' error_message "WARNING: No ipsets were saved"',
"}\n" );
} else {
emit( ' true',
"}\n" );
}
}
sub load_ipsets() {
my @ipsets = all_ipsets;
if ( @ipsets || ( $config{SAVE_IPSETS} && have_ipset_rules ) ) {
if ( @ipsets || @{$globals{SAVED_IPSETS}} || ( $config{SAVE_IPSETS} && have_ipset_rules ) ) {
emit ( '',
'local hack',
'',
@@ -8010,9 +8135,25 @@ sub load_ipsets() {
emit ( '' );
ensure_ipset( $_ ) for @ipsets;
emit ( '' );
emit ( ' if [ -f ${VARDIR}/ipsets.save ]; then' ,
' $IPSET flush' ,
' $IPSET destroy' ,
' $IPSET restore < ${VARDIR}/ipsets.save' ,
" fi\n" ) for @{$globals{SAVED_IPSETS}};
}
} else {
ensure_ipset( $_ ) for @ipsets;
if ( @{$globals{SAVED_IPSETS}} ) {
emit ( '' );
emit ( ' if [ -f ${VARDIR}/ipsets.save ]; then' ,
' $IPSET flush' ,
' $IPSET destroy' ,
' $IPSET restore < ${VARDIR}/ipsets.save' ,
" fi\n" ) for @{$globals{SAVED_IPSETS}};
}
}
emit ( 'elif [ "$COMMAND" = restore -a -z "$g_recovering" ]; then' );
@@ -8036,6 +8177,12 @@ sub load_ipsets() {
}
} else {
ensure_ipset( $_ ) for @ipsets;
emit ( ' if [ -f ${VARDIR}/ipsets.save ]; then' ,
' $IPSET flush' ,
' $IPSET destroy' ,
' $IPSET restore < ${VARDIR}/ipsets.save' ,
" fi\n" ) for @{$globals{SAVED_IPSETS}};
}
if ( @ipsets ) {
@@ -8043,36 +8190,14 @@ sub load_ipsets() {
ensure_ipset( $_ ) for @ipsets;
}
emit( 'elif [ "$COMMAND" = stop ]; then' );
if ( @ipsets ) {
ensure_ipset( $_ ) for @ipsets;
emit( '' );
}
if ( $family == F_IPV4 ) {
emit ( ' if [ -f /etc/debian_version ] && [ $(cat /etc/debian_version) = 5.0.3 ]; then' ,
' #',
' # The \'grep -v\' is a hack for a bug in ipset\'s nethash implementation when xtables-addons is applied to Lenny' ,
' #',
' hack=\'| grep -v /31\'' ,
' else' ,
' hack=' ,
' fi' ,
'',
' if eval $IPSET -S $hack > ${VARDIR}/ipsets.tmp; then' ,
' grep -qE -- "^(-N|create )" ${VARDIR}/ipsets.tmp && mv -f ${VARDIR}/ipsets.tmp ${VARDIR}/ipsets.save' ,
' fi' );
} else {
emit ( ' if eval $IPSET -S > ${VARDIR}/ipsets.tmp; then' ,
' grep -qE -- "^(-N|create )" ${VARDIR}/ipsets.tmp && mv -f ${VARDIR}/ipsets.tmp ${VARDIR}/ipsets.save' ,
' fi' );
}
emit( 'elif [ "$COMMAND" = stop ]; then' ,
' save_ipsets'
);
if ( @ipsets ) {
emit( 'elif [ "$COMMAND" = refresh ]; then' );
ensure_ipset( $_ ) for @ipsets;
}
};
emit ( 'fi' ,
'' );
@@ -8118,17 +8243,29 @@ sub create_netfilter_load( $ ) {
'# Create the input to iptables-restore/ip6tables-restore and pass that input to the utility',
'#',
'setup_netfilter()',
'{'
);
'{',
' local option',
);
push_indent;
my $utility = $family == F_IPV4 ? 'iptables-restore' : 'ip6tables-restore';
my $UTILITY = $family == F_IPV4 ? 'IPTABLES_RESTORE' : 'IP6TABLES_RESTORE';
save_progress_message "Preparing $utility input...";
emit( '',
'if [ "$COMMAND" = restart -a -n "$g_counters" ] && chain_exists $g_sha1sum1 && chain_exists $g_sha1sum2 ; then',
' option="--counters"',
'',
' progress_message "Reusing existing ruleset..."',
'',
'else'
);
emit '';
push_indent;
emit 'option=';
save_progress_message "Preparing $utility input...";
emit "exec 3>\${VARDIR}/.${utility}-input";
@@ -8168,6 +8305,14 @@ sub create_netfilter_load( $ ) {
push @chains, $chainref;
}
}
#
# SHA1SUM chains for handling 'restart -s'
#
if ( $table eq 'filter' ) {
emit_unindented ':$g_sha1sum1 - [0:0]';
emit_unindented ':$g_sha1sum2 - [0:0]';
}
#
# Then emit the rules
#
@@ -8182,20 +8327,24 @@ sub create_netfilter_load( $ ) {
}
enter_cmd_mode;
pop_indent, emit "fi\n";
#
# Now generate the actual ip[6]tables-restore command
#
emit( 'exec 3>&-',
'',
'[ -n "$g_debug_iptables" ] && command=debug_restore_input || command=$' . $UTILITY,
'',
'progress_message2 "Running $command..."',
'',
"cat \${VARDIR}/.${utility}-input | \$command # Use this nonsensical form to appease SELinux",
'if [ $? != 0 ]; then',
qq( fatal_error "iptables-restore Failed. Input is in \${VARDIR}/.${utility}-input"),
"fi\n"
);
'' );
emit( '[ -n "$g_debug_iptables" ] && command=debug_restore_input || command="$' . $UTILITY . ' $option"' );
emit( '',
'progress_message2 "Running $command..."',
'',
"cat \${VARDIR}/.${utility}-input | \$command # Use this nonsensical form to appease SELinux",
'if [ $? != 0 ]; then',
qq( fatal_error "iptables-restore Failed. Input is in \${VARDIR}/.${utility}-input"),
"fi\n"
);
pop_indent;

View File

@@ -308,13 +308,14 @@ sub generate_script_2() {
set_global_variables(1);
handle_optional_interfaces(0);
if ( $global_variables & NOT_RESTORE ) {
handle_optional_interfaces(0);
emit ';;';
pop_indent;
pop_indent;
emit ( 'esac' );
} else {
handle_optional_interfaces(1);
}
} else {
emit( 'true' ) unless handle_optional_interfaces(1);
@@ -347,10 +348,12 @@ sub generate_script_3($) {
create_netfilter_load( $test );
create_arptables_load( $test ) if $have_arptables;
create_chainlist_reload( $_[0] );
create_save_ipsets;
emit "#\n# Start/Restart the Firewall\n#";
emit 'define_firewall() {';
emit( 'define_firewall() {',
' local options' );
push_indent;
@@ -468,10 +471,12 @@ sub generate_script_3($) {
emit( '',
'if [ $COMMAND = restore ]; then',
' iptables_save_file=${VARDIR}/$(basename $0)-iptables',
' if [ -f $iptables_save_file ]; then' );
' if [ -f $iptables_save_file ]; then',
' [ -n "$g_counters" ] && options=--counters'
);
if ( $family == F_IPV4 ) {
emit( ' cat $iptables_save_file | $IPTABLES_RESTORE # Use this nonsensical form to appease SELinux' );
emit( ' cat $iptables_save_file | $IPTABLES_RESTORE $options # Use this nonsensical form to appease SELinux' );
emit( '',
' arptables_save_file=${VARDIR}/$(basename $0)-arptables',
@@ -481,7 +486,7 @@ sub generate_script_3($) {
if $config{SAVE_ARPTABLES};
} else {
emit ' cat $iptables_save_file | $IP6TABLES_RESTORE # Use this nonsensical form to appease SELinux'
emit ' cat $iptables_save_file | $IP6TABLES_RESTORE $options # Use this nonsensical form to appease SELinux'
}
emit( ' else',
@@ -510,45 +515,41 @@ EOF
#
# Use a parameter list rather than 'here documents' to avoid an extra blank line
#
emit(
' run_refreshed_exit',
' do_iptables -N shorewall' );
emit( ' run_refreshed_exit',
' do_iptables -N shorewall' );
emit ( ' do_iptables -A shorewall -m recent --set --name %CURRENTTIME' ) if have_capability 'RECENT_MATCH';
emit(
" set_state Started $config_dir",
' [ $0 = ${VARDIR}/firewall ] || cp -f $(my_pathname) ${VARDIR}/firewall',
'else',
' setup_netfilter'
" set_state Started $config_dir",
' [ $0 = ${VARDIR}/firewall ] || cp -f $(my_pathname) ${VARDIR}/firewall',
'else',
' setup_netfilter'
);
push_indent;
emit 'setup_arptables' if $have_arptables;
setup_load_distribution;
pop_indent;
emit<<'EOF';
conditionally_flush_conntrack
EOF
emit( " conditionally_flush_conntrack\n" );
push_indent;
initialize_switches;
setup_forwarding( $family , 0 );
pop_indent;
emit<<"EOF";
run_start_exit
do_iptables -N shorewall
EOF
emit( ' run_start_exit',
' do_iptables -N shorewall',
'' );
emit ( ' do_iptables -A shorewall -m recent --set --name %CURRENTTIME' ) if have_capability 'RECENT_MATCH';
emit( ' do_iptables -A shorewall -m recent --set --name %CURRENTTIME' ) if have_capability 'RECENT_MATCH';
emit<<"EOF";
set_state Started $config_dir
my_pathname=\$(my_pathname)
[ \$my_pathname = \${VARDIR}/firewall ] || cp -f \$my_pathname \${VARDIR}/firewall
run_started_exit
fi
EOF
emit( " set_state Started $config_dir",
' my_pathname=$(my_pathname)',
' [ $my_pathname = ${VARDIR}/firewall ] || cp -f $my_pathname ${VARDIR}/firewall',
' run_started_exit',
"fi\n" );
emit<<'EOF';
date > ${VARDIR}/restarted
@@ -741,6 +742,8 @@ sub compiler {
}
setup_source_routing($family);
setup_log_backend($family);
#
# Proxy Arp/Ndp
#
@@ -974,8 +977,7 @@ sub compiler {
# compile_stop_firewall() also validates the routestopped file. Since we don't
# call that function during normal 'check', we must validate routestopped here.
#
process_routestopped;
process_stoppedrules;
process_routestopped unless process_stoppedrules;
}
#
# Report used/required capabilities

View File

@@ -40,6 +40,7 @@ use Cwd qw(abs_path getcwd);
use autouse 'Carp' => qw(longmess confess);
use Scalar::Util 'reftype';
use FindBin;
use Digest::SHA qw(sha1_hex);
our @ISA = qw(Exporter);
#
@@ -88,6 +89,7 @@ our @EXPORT = qw(
our @EXPORT_OK = qw( $shorewall_dir initialize shorewall);
our %EXPORT_TAGS = ( internal => [ qw( create_temp_script
generate_sha1
finalize_script
enable_script
disable_script
@@ -741,6 +743,7 @@ sub initialize( $;$$) {
RPFILTER_LOG_LEVEL => undef,
INVALID_LOG_LEVEL => undef,
UNTRACKED_LOG_LEVEL => undef,
LOG_BACKEND => undef,
#
# Location of Files
#
@@ -1105,7 +1108,8 @@ sub initialize( $;$$) {
$family == F_IPV4 ? 'shorewall' : 'shorewall6'
) if defined $shorewallrc;
$globals{SHAREDIRPL} = "$shorewallrc{SHAREDIR}/shorewall/";
$globals{SHAREDIRPL} = "$shorewallrc{SHAREDIR}/shorewall/";
$globals{SAVED_IPSETS} = [];
if ( $family == F_IPV4 ) {
$globals{SHAREDIR} = "$shorewallrc{SHAREDIR}/shorewall";
@@ -1758,6 +1762,13 @@ sub create_temp_script( $$ ) {
}
# Generate the SHA1 digest of the (incomplete script)
#
sub generate_sha1() {
my $data = `cat $tempfile`;
sha1_hex $data;
}
#
# Finalize the script file
#
@@ -1767,6 +1778,19 @@ sub finalize_script( $ ) {
$script = 0;
if ( $file ne '-' ) {
my $sha1sum = generate_sha1;
my $sha1sum1 = join( '-', 'sha-lh', substr( $sha1sum, 0, 20 ) );
my $sha1sum2 = join( '-', 'sha-rh', substr( $sha1sum, -20 ) );
@ARGV = ( $tempfile );
$^I = '';
while ( <> ) {
s/g_sha1sum1=/g_sha1sum1=$sha1sum1/;
s/g_sha1sum2=/g_sha1sum2=$sha1sum2/;
print;
}
rename $tempfile, $file or fatal_error "Cannot Rename $tempfile to $file: $!";
chmod 0700, $file or fatal_error "Cannot secure $file for execute access";
progress_message3 "Shorewall configuration compiled to $file" unless $export;
@@ -3502,8 +3526,9 @@ sub default ( $$ ) {
#
# Provide a default value for a yes/no configuration variable.
#
sub default_yes_no ( $$ ) {
my ( $var, $val ) = @_;
sub default_yes_no ( $$;$ ) {
my ( $var, $val, $other ) = @_;
my $result = 1;
my $curval = $config{$var};
@@ -3512,12 +3537,31 @@ sub default_yes_no ( $$ ) {
if ( $curval eq 'no' ) {
$config{$var} = '';
} elsif ( defined( $other ) ) {
if ( $other eq '*' ) {
if ( $curval eq 'yes' ) {
$config{$var} = 'Yes';
} else {
$result = 0;
}
} elsif ( $curval eq $other ) {
#
# Downshift value for later comparison
#
$config{$var} = $curval;
}
} else {
fatal_error "Invalid value for $var ($curval)" unless $curval eq 'yes';
#
# Make Case same as default
#
$config{$var} = 'Yes';
}
} else {
$config{$var} = $val;
}
$result;
}
sub default_yes_no_ipv4 ( $$ ) {
@@ -5034,15 +5078,23 @@ sub unsupported_yes_no_warning( $ ) {
#
# Process the params file
#
sub get_params() {
sub get_params( $ ) {
my $export = $_[0];
my $fn = find_file 'params';
my %reserved = ( COMMAND => 1, CONFDIR => 1, SHAREDIR => 1, VARDIR => 1 );
if ( -f $fn ) {
my $shellpath = $export ? '/bin/sh' : $config{SHOREWALL_SHELL} || '/bin/sh';
$shellpath = which( $shellpath ) unless $shellpath =~ '/';
fatal_error "SHOREWALL_SHELL ($shellpath) is not found or is not executable" unless -x $shellpath;
progress_message2 "Processing $fn ...";
my $command = "$FindBin::Bin/getparams $fn " . join( ':', @config_path ) . " $family";
my $command = "$shellpath $FindBin::Bin/getparams $fn " . join( ':', @config_path ) . " $family";
#
# getparams silently sources the params file under 'set -a', then executes 'export -p'
#
@@ -5312,7 +5364,7 @@ sub get_configuration( $$$$$ ) {
ensure_config_path;
get_params;
get_params( $export );
process_shorewall_conf( $update, $annotate, $directives );
@@ -5549,7 +5601,16 @@ sub get_configuration( $$$$$ ) {
unsupported_yes_no 'BRIDGING';
unsupported_yes_no_warning 'RFC1918_STRICT';
default_yes_no 'SAVE_IPSETS' , '';
unless (default_yes_no 'SAVE_IPSETS', '', '*' ) {
$val = $config{SAVE_IPSETS};
unless ( $val eq 'ipv4' ) {
my @sets = split_list( $val , 'ipset' );
$globals{SAVED_IPSETS} = \@sets;
require_capability 'IPSET_V5', 'A saved ipset list', 's';
$config{SAVE_IPSETS} = '';
}
}
default_yes_no 'SAVE_ARPTABLES' , '';
default_yes_no 'STARTUP_ENABLED' , 'Yes';
default_yes_no 'DELAYBLACKLISTLOAD' , '';
@@ -5747,6 +5808,20 @@ sub get_configuration( $$$$$ ) {
default_log_level 'INVALID_LOG_LEVEL', '';
default_log_level 'UNTRACKED_LOG_LEVEL', '';
if ( supplied( $val = $config{LOG_BACKEND} ) ) {
if ( $family == F_IPV4 && $val eq 'ULOG' ) {
$val = 'ipt_ULOG';
} elsif ( $val eq 'netlink' ) {
$val = 'nfnetlink_log';
} elsif ( $val eq 'LOG' ) {
$val = $family == F_IPV4 ? 'ipt_LOG' : 'ip6t_log';
} else {
fatal_error "Invalid LOG Backend ($val)";
}
$config{LOG_BACKEND} = $val;
}
warning_message "RFC1918_LOG_LEVEL=$config{RFC1918_LOG_LEVEL} ignored. The 'norfc1918' interface/host option is no longer supported" if $config{RFC1918_LOG_LEVEL};
default_log_level 'SMURF_LOG_LEVEL', '';

View File

@@ -690,11 +690,10 @@ sub process_stoppedrules() {
my $result;
if ( my $fn = open_file 'stoppedrules' , 1, 1 ) {
first_entry sub() {
progress_message2("$doing $fn...");
first_entry sub () {
progress_message2( "$doing $fn..." );
unless ( $config{ADMINISABSENTMINDED} ) {
warning_message("Entries in the routestopped file are processed as if ADMINISABSENTMINDED=Yes");
$config{ADMINISABSENTMINDED} = 'Yes';
insert_ijump $filter_table ->{$_}, j => 'ACCEPT', 0, state_imatch 'ESTABLISHED,RELATED' for qw/INPUT FORWARD/;
}
};
@@ -994,7 +993,7 @@ sub add_common_rules ( $$ ) {
for my $hostref ( @$list ) {
$interface = $hostref->[0];
my $ipsec = $hostref->[1];
my @policy = have_ipsec ? ( policy => "--pol $ipsec --dir in" ) : ();
my @policy = $ipsec && have_ipsec ? ( policy => "--pol $ipsec --dir in" ) : ();
my $target = source_exclusion( $hostref->[3], $chainref );
for $chain ( option_chains $interface ) {
@@ -1118,7 +1117,8 @@ sub add_common_rules ( $$ ) {
for my $hostref ( @$list ) {
my $interface = $hostref->[0];
my $target = source_exclusion( $hostref->[3], $chainref );
my @policy = have_ipsec ? ( policy => "--pol $hostref->[1] --dir in" ) : ();
my $ipsec = $hostref->[1];
my @policy = $ipsec && have_ipsec ? ( policy => "--pol $ipsec --dir in" ) : ();
for $chain ( option_chains $interface ) {
add_ijump( $filter_table->{$chain} , j => $target, p => 'tcp', imatch_source_net( $hostref->[2] ), @policy );
@@ -1289,7 +1289,7 @@ sub setup_mac_lists( $ ) {
for my $hostref ( @$maclist_hosts ) {
my $interface = $hostref->[0];
my $ipsec = $hostref->[1];
my @policy = have_ipsec ? ( policy => "--pol $ipsec --dir in" ) : ();
my @policy = $ipsec && have_ipsec ? ( policy => "--pol $ipsec --dir in" ) : ();
my @source = imatch_source_net $hostref->[2];
my @state = have_capability( 'RAW_TABLE' ) ? state_imatch 'NEW,UNTRACKED' : state_imatch 'NEW';
@@ -2606,42 +2606,11 @@ EOF
my @ipsets = all_ipsets;
if ( @ipsets || ( $config{SAVE_IPSETS} && have_ipset_rules ) ) {
emit <<'EOF';
case $IPSET in
*/*)
if [ ! -x "$IPSET" ]; then
error_message "ERROR: IPSET=$IPSET does not exist or is not executable - ipsets are not saved"
IPSET=
fi
;;
*)
IPSET="$(mywhich $IPSET)"
[ -n "$IPSET" ] || error_message "ERROR: The ipset utility cannot be located - ipsets are not saved"
;;
esac
if [ -n "$IPSET" ]; then
if [ -f /etc/debian_version ] && [ $(cat /etc/debian_version) = 5.0.3 ]; then
#
# The 'grep -v' is a hack for a bug in ipset's nethash implementation when xtables-addons is applied to Lenny
#
hack='| grep -v /31'
else
hack=
fi
if eval $IPSET -S $hack > ${VARDIR}/ipsets.tmp; then
#
# Don't save an 'empty' file
#
grep -qE '^(-N|create )' ${VARDIR}/ipsets.tmp && mv -f ${VARDIR}/ipsets.tmp ${VARDIR}/ipsets.save
fi
fi
EOF
if ( @ipsets || @{$globals{SAVED_IPSETS}} || ( $config{SAVE_IPSETS} && have_ipset_rules ) ) {
emit( '',
' save_ipsets ${VARDIR}/ipsets.save' );
}
emit '
set_state "Stopped"

View File

@@ -42,6 +42,7 @@ our @EXPORT = qw(
setup_source_routing
setup_accept_ra
setup_forwarding
setup_log_backend
);
our @EXPORT_OK = qw( setup_interface_proc );
our $VERSION = 'MODULEVERSION';
@@ -348,5 +349,43 @@ sub setup_interface_proc( $ ) {
}
}
sub setup_log_backend($) {
if ( my $setting = $config{LOG_BACKEND} ) {
my $family = shift;
my $file = '/proc/sys/net/netfilter/nf_log/' . ( $family == F_IPV4 ? '2' : '10' );
emit( 'progress_message2 "Setting up log backend"',
'',
"if [ -f $file ]; then"
);
if ( $setting =~ /ip6?t_log/i ) {
my $alternative = 'nf_log_ipv' . $family;
emit( " setting=$setting",
'',
" fgrep -q $setting /proc/net/netfilter/nf_log || setting=$alternative",
'',
" if echo \$setting > $file; then",
' progress_message "Log Backend set to $setting"',
' else',
' error_message "WARNING: Unable to set log backend to $setting"',
' fi',
'else',
" error_message 'WARNING: $file does not exist - log backend not set'",
"fi\n"
);
} else {
emit( " if echo $setting > $file; then",
" progress_message 'Log Backend set to $setting'",
' else',
" error_message 'WARNING: Unable to set log backend to $setting'",
' fi',
'else',
" error_message 'WARNING: $file does not exist - log backend not set'",
"fi\n" );
}
}
}
1;

View File

@@ -460,6 +460,9 @@ sub process_a_provider( $ ) {
fatal_error "A bridge port ($interface) may not be configured as a provider interface" if port_to_bridge $interface;
#
# Switch to the logical name if a physical name was passed
#
my $physical;
if ( $interface eq $interfaceref->{name} ) {
@@ -1293,9 +1296,11 @@ sub start_providers() {
emit_unindented "$providers{$_}{number}\t$_" unless $providers{$_}{pseudo};
}
emit_unindented "EOF\n";
emit_unindented 'EOF';
emit "fi\n";
emit( 'else',
' error_message "WARNING: /etc/iproute2/rt_tables is missing or is not writeable"',
"fi\n" );
}
emit ( '#',
@@ -1892,8 +1897,10 @@ sub handle_optional_interfaces( $ ) {
if ( @$interfaces ) {
my $require = $config{REQUIRE_INTERFACE};
my $gencase = shift;
verify_required_interfaces( shift );
verify_required_interfaces( $gencase );
emit '' if $gencase;
emit( 'HAVE_INTERFACE=', '' ) if $require;
#

View File

@@ -1748,14 +1748,15 @@ sub process_actions() {
undef, #Columns
1 ); #Allow inline matches
my $type = ( $action eq $config{REJECT_ACTION} ? INLINE : ACTION );
my $noinline = 0;
my $nolog = ( $type == INLINE ) || 0;
my $builtin = 0;
my $raw = 0;
my $mangle = 0;
my $filter = 0;
my $nat = 0;
my $type = ( $action eq $config{REJECT_ACTION} ? INLINE : ACTION );
my $noinline = 0;
my $nolog = ( $type == INLINE ) || 0;
my $builtin = 0;
my $raw = 0;
my $mangle = 0;
my $filter = 0;
my $nat = 0;
my $terminating = 0;
if ( $action =~ /:/ ) {
warning_message 'Default Actions are now specified in /etc/shorewall/shorewall.conf';
@@ -1774,6 +1775,8 @@ sub process_actions() {
$nolog = 1;
} elsif ( $_ eq 'builtin' ) {
$builtin = 1;
} elsif ( $_ eq 'terminating' ) {
$terminating = 1;
} elsif ( $_ eq 'mangle' ) {
$mangle = 1;
} elsif ( $_ eq 'raw' ) {
@@ -1822,6 +1825,8 @@ sub process_actions() {
}
$targets{$action} = $actiontype;
make_terminating( $action ) if $terminating;
} else {
fatal_error "Table names are only allowed for builtin actions" if $mangle || $raw || $nat || $filter;
new_action $action, $type, $noinline, $nolog;

View File

@@ -2121,14 +2121,26 @@ sub have_ipsec() {
sub find_hosts_by_option( $ ) {
my $option = $_[0];
my @hosts;
my %done;
for my $interface ( @interfaces ) {
my $value = $interfaces{$interface}{options}{$option};
if ( ! $interfaces{$interface}{zone} && $value ) {
push @hosts, [ $interface, '', ALLIP , [], $value ];
$done{$interface} = 1;
}
}
for my $zone ( grep ! ( $zones{$_}{type} & FIREWALL ) , @zones ) {
while ( my ($type, $interfaceref) = each %{$zones{$zone}{hosts}} ) {
while ( my ( $interface, $arrayref) = ( each %{$interfaceref} ) ) {
for my $host ( @{$arrayref} ) {
if ( my $value = $host->{options}{$option} ) {
for my $net ( @{$host->{hosts}} ) {
push @hosts, [ $interface, $host->{ipsec} , $net , $host->{exclusions}, $value ];
my $ipsec = $host->{ipsec};
unless ( $done{$interface} ) {
if ( my $value = $host->{options}{$option} ) {
for my $net ( @{$host->{hosts}} ) {
push @hosts, [ $interface, $ipsec , $net , $host->{exclusions}, $value ];
}
}
}
}
@@ -2136,12 +2148,6 @@ sub find_hosts_by_option( $ ) {
}
}
for my $interface ( @interfaces ) {
if ( ! $interfaces{$interface}{zone} && $interfaces{$interface}{options}{$option} ) {
push @hosts, [ $interface, 'none', ALLIP , [] ];
}
}
\@hosts;
}

View File

@@ -587,7 +587,7 @@ debug_restore_input() {
done
}
interface_up() {
interface_enabled() {
return $(cat ${VARDIR}/$1.status)
}
@@ -604,7 +604,7 @@ distribute_load() {
totalload=0
for interface in $@; do
if interface_up $interface; then
if interface_enabled $interface; then
load=$(cat ${VARDIR}/${interface}_load)
eval ${interface}_load=$load
mark=$(cat ${VARDIR}/${interface}_mark)

View File

@@ -20,6 +20,7 @@ usage() {
echo " run <command> [ <parameter> ... ]"
echo " status"
echo " up <interface>"
echo " savesets <file>"
echo " version"
echo
echo "Options are:"
@@ -28,6 +29,7 @@ usage() {
echo " -n Don't update routing configuration"
echo " -p Purge Conntrack Table"
echo " -t Timestamp progress Messages"
echo " -c Save/restore iptables counters"
echo " -V <verbosity> Set verbosity explicitly"
echo " -R <file> Override RESTOREFILE setting"
exit $1
@@ -85,6 +87,17 @@ g_purge=$PURGE
g_noroutes=$NOROUTES
g_timestamp=$TIMESTAMP
g_recovering=$RECOVERING
#
# These two variables contain the high-order and low-order parts respectively of
# an SHA1 digest of this file. The digest is generated before the two following
# lines are updated to contain the value of that digest.
#
g_sha1sum1=
g_sha1sum2=
#
# Other Globals
#
g_counters=
initialize
@@ -136,6 +149,10 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
g_recovering=Yes
option=${option#r}
;;
c*)
g_counters=Yes
option=${option#c}
;;
V*)
option=${option#V}
@@ -383,6 +400,13 @@ case "$COMMAND" in
error_message "ERROR: Missing command"
fi
;;
savesets)
if [ $# -eq 2 ]; then
save_ipsets $2
else
usage 2
fi
;;
version)
[ $# -ne 1 ] && usage 2
echo $SHOREWALL_VERSION

View File

@@ -11,4 +11,4 @@
###############################################################################
#ZONE INTERFACE OPTIONS
- lo ignore
net all dhcp,physical=+,routeback,optional
net all dhcp,physical=+,routeback

View File

@@ -25,6 +25,8 @@ BLACKLIST_LOG_LEVEL=
INVALID_LOG_LEVEL=
LOG_BACKEND=
LOG_MARTIANS=Yes
LOG_VERBOSITY=2

View File

@@ -36,6 +36,8 @@ BLACKLIST_LOG_LEVEL=
INVALID_LOG_LEVEL=
LOG_BACKEND=
LOG_MARTIANS=Yes
LOG_VERBOSITY=2

View File

@@ -33,6 +33,8 @@ BLACKLIST_LOG_LEVEL=
INVALID_LOG_LEVEL=
LOG_BACKEND=
LOG_MARTIANS=Yes
LOG_VERBOSITY=2

View File

@@ -36,6 +36,8 @@ BLACKLIST_LOG_LEVEL=
INVALID_LOG_LEVEL=
LOG_BACKEND=
LOG_MARTIANS=Yes
LOG_VERBOSITY=2

View File

@@ -25,6 +25,8 @@ BLACKLIST_LOG_LEVEL=
INVALID_LOG_LEVEL=
LOG_BACKEND=
LOG_MARTIANS=Yes
LOG_VERBOSITY=2

View File

@@ -16,7 +16,7 @@ startup=0
# wait_interface=
#
# Global start/restart/stop options
# Global start/restart options
#
OPTIONS=""

View File

@@ -57,3 +57,15 @@ loadmodule nf_nat_proto_gre
loadmodule nf_nat_sip
loadmodule nf_nat_snmp_basic
loadmodule nf_nat_tftp
#
# While not actually helpers, these are included here so that
# LOG_BACKEND can work correctly. Not all of them will be
# loaded, since at least one of them will be an alias on any
# given system.
#
loadmodule ipt_LOG
loadmodule nf_log_ipv4
loadmodule xt_LOG
loadmodule xt_NFLOG
loadmodule ipt_ULOG
loadmodule nfnetlink_log

View File

@@ -39,7 +39,7 @@ fi
start() {
echo -n $"Starting Shorewall: "
$shorewall $OPTIONS start 2>&1 | $logger
$shorewall $OPTIONS start $STARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then
touch $lockfile
@@ -69,7 +69,7 @@ restart() {
# Note that we don't simply stop and start since shorewall has a built in
# restart which stops the firewall if running and then starts it.
echo -n $"Restarting Shorewall: "
$shorewall $OPTIONS restart 2>&1 | $logger
$shorewall $OPTIONS restart $RESTARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then
touch $lockfile

View File

@@ -10,15 +10,16 @@
OPTIONS=""
# Use /etc/default shorewall to specify $OPTIONS to run at startup, however this
# this might prevent shorewall from starting. use at your own risk
# Use /etc/default shorewall to specify $OPTIONS and STARTOPTIONS to
# run at startup, however this this might prevent shorewall from
# starting. use at your own risk
if [ -f /etc/default/shorewall ] ; then
. /etc/default/shorewall
fi
start() {
echo "Starting IPv4 shorewall rules..."
exec /sbin/shorewall $OPTIONS start
exec /sbin/shorewall $OPTIONS start $STARTOPTIONS
}
stop() {
@@ -28,7 +29,7 @@ stop() {
restart() {
echo "Restarting IPv4 shorewall rules..."
exec /sbin/shorewall restart
exec /sbin/shorewall restart $RESTARTOPTIONS
}
status() {

View File

@@ -35,6 +35,7 @@ usage() # $1 = exit status
echo " $ME -h"
echo " $ME -s"
echo " $ME -a"
echo " $ME -n"
exit $1
}
@@ -118,6 +119,7 @@ T="-T"
INSTALLD='-D'
finished=0
configure=1
while [ $finished -eq 0 ]; do
option=$1
@@ -147,6 +149,10 @@ while [ $finished -eq 0 ]; do
ANNOTATED=
option=${option#p}
;;
n*)
configure=0
option=${option#n}
;;
*)
usage 1
;;
@@ -203,6 +209,8 @@ done
[ -n "${INITFILE}" ] && require INITSOURCE && require INITDIR
[ -n "$SANDBOX" ] && configure=0
if [ -z "$BUILD" ]; then
case $(uname) in
cygwin*|CYGWIN*)
@@ -216,7 +224,7 @@ if [ -z "$BUILD" ]; then
eval $(cat /etc/os-release | grep ^ID)
case $ID in
fedora|rhel)
fedora|rhel|centos|foobar)
BUILD=redhat
;;
debian)
@@ -324,6 +332,7 @@ if [ $PRODUCT = shorewall ]; then
if ! perl -e 'use Digest::SHA;' 2> /dev/null ; then
if perl -e 'use Digest::SHA1;' 2> /dev/null ; then
sed -i 's/Digest::SHA/Digest::SHA1/' Perl/Shorewall/Chains.pm
sed -i 's/Digest::SHA/Digest::SHA1/' Perl/Shorewall/Config.pm
DIGEST=SHA1
else
echo "ERROR: Shorewall $VERSION requires either Digest::SHA or Digest::SHA1" >&2
@@ -417,12 +426,16 @@ fi
#
# Install the .service file
#
if [ -n "$SYSTEMD" ]; then
mkdir -p ${DESTDIR}${SYSTEMD}
if [ -z "${SERVICEDIR}" ]; then
SERVICEDIR="$SYSTEMD"
fi
if [ -n "$SERVICEDIR" ]; then
mkdir -p ${DESTDIR}${SERVICEDIR}
[ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service
run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMD}/$PRODUCT.service
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMD}/$PRODUCT.service
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMD}/$PRODUCT.service"
run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SERVICEDIR}/$PRODUCT.service
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SERVICEDIR}/$PRODUCT.service
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SERVICEDIR}/$PRODUCT.service"
fi
#
@@ -1120,7 +1133,7 @@ chmod 644 ${DESTDIR}${SHAREDIR}/$PRODUCT/version
# Remove and create the symbolic link to the init script
#
if [ -z "$DESTDIR" ]; then
if [ -z "${DESTDIR}" -a -n "${INITFILE}" ]; then
rm -f ${SHAREDIR}/$PRODUCT/init
ln -s ${INITDIR}/${INITFILE} ${SHAREDIR}/$PRODUCT/init
fi
@@ -1167,8 +1180,8 @@ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PR
echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
fi
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then
if [ -n "$SYSTEMD" ]; then
if [ $configure -eq 1 -a -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then
if [ -n "$SERVICEDIR" ]; then
if systemctl enable ${PRODUCT}.service; then
echo "$Product will start automatically at boot"
fi

View File

@@ -534,6 +534,10 @@ start_command() {
g_inline=Yes
option=${option#i}
;;
C*)
g_counters=Yes
option=${option#C}
;;
*)
usage 1
;;
@@ -570,14 +574,14 @@ start_command() {
esac
if [ -n "${g_fast}${AUTOMAKE}" ]; then
if [ -z "$g_fast" -o -z "$LEGACY_FASTSTART" ]; then
if [ -z "$g_fast" -o -z "${LEGACY_FASTSTART}${g_counters}" ]; then
#
# Automake or LEGACY_FASTSTART=No -- use the last compiled script
# Automake or ( LEGACY_FASTSTART=No and not -C ) -- use the last compiled script
#
object=firewall
else
#
# 'start -f' with LEGACY_FASTSTART=Yes -- use last saved configuration
# 'start -f' with ( LEGACY_FASTSTART=Yes or -C ) -- use last saved configuration
#
object=$RESTOREFILE
fi
@@ -943,6 +947,10 @@ restart_command() {
g_inline=Yes
option=${option#i}
;;
C*)
g_counters=Yes
option=${option#C}
;;
*)
usage 1
;;
@@ -1673,12 +1681,12 @@ usage() # $1 = exit status
echo " reject <address> ..."
echo " reload [ -s ] [ -c ] [ -r <root user> ] [ -T ] [ -i ] [ <directory> ] <system>"
echo " reset [ <chain> ... ]"
echo " restart [ -n ] [ -p ] [-d] [ -f ] [ -c ] [ -T ] [ -i ] [ <directory> ]"
echo " restore [ -n ] [ <file name> ]"
echo " restart [ -n ] [ -p ] [-d] [ -f ] [ -c ] [ -T ] [ -i ] [ -C ] [ <directory> ]"
echo " restore [ -n ] [ -p ] [ -C ] [ <file name> ]"
echo " run <command> [ <parameter> ... ]"
echo " safe-restart [ -t <timeout> ] [ <directory> ]"
echo " safe-start [ -t <timeout> ] [ <directory> ]"
echo " save [ <file name> ]"
echo " save [ -C ] [ <file name> ]"
echo " [ show | list | ls ] [ -x ] [ -t {filter|mangle|nat|raw|rawpost} ] [ {chain [<chain> [ <chain> ... ]"
echo " [ show | list | ls ] actions"
echo " [ show | list | ls ] [ -x ] {bl|blacklists}"
@@ -1705,11 +1713,11 @@ usage() # $1 = exit status
echo " [ show | list | ls ] tc [ device ]"
echo " [ show | list | ls ] vardir"
echo " [ show | list | ls ] zones"
echo " start [ -f ] [ -n ] [ -p ] [ -c ] [ -T ] [ -i ] [ <directory> ]"
echo " start [ -f ] [ -n ] [ -p ] [ -c ] [ -T ] [ -i ] [ -C ] [ <directory> ]"
echo " status [ -i ]"
echo " stop"
echo " try <directory> [ <timeout> ]"
echo " update [ -a ] [ -b ] [ -r ] [ -T ] [ -D ] [ -i ] [-t] [-A] [ <directory> ]"
echo " update [ -a ] [ -b ] [ -r ] [ -T ] [ -D ] [ -i ] [-t] [-A] [ <directory> ]"
echo " version [ -a ]"
echo
exit $1

View File

@@ -71,10 +71,17 @@
role="bold">raw</emphasis>. If no table name(s) are given,
then <emphasis role="bold">filter</emphasis> is assumed. The
table names follow <emphasis role="bold">builtin</emphasis>
and are separated by commas; for example,
"FOOBAR,filter,mangle" would specify FOOBAR as a builtin
and are separated by commas; for example, "FOOBAR
builtin,filter,mangle" would specify FOOBAR as a builtin
target that can be used in the filter and mangle
tables.</para>
<para>Beginning with Shorewall 4.6.4, you may specify the
<emphasis role="bold">terminating</emphasis> option with
<emphasis role="bold">builtin</emphasis> to indicate to the
Shorewall optimizer that the action is terminating (the
current packet will not be passed to the next rule in the
chain).</para>
</listitem>
</varlistentry>
@@ -133,6 +140,17 @@
a subset of the rules.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>terminating</term>
<listitem>
<para>Added in Shorewall 4.6.4. When used with
<replaceable>builtin</replaceable>, indicates that the
built-in action is termiating (i.e., if the action is jumped
to, the next rule in the chain is not evaluated).</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

View File

@@ -242,13 +242,34 @@
<varlistentry>
<term><emphasis role="bold">BURST:LIMIT</emphasis> (limit) -
[{<emphasis>s</emphasis>|<emphasis
role="bold">d</emphasis>}:[[<replaceable>name</replaceable>]:]]]<emphasis>rate</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">second</emphasis>|<emphasis
role="bold">minute</emphasis>}[:<emphasis>burst</emphasis>]</term>
[-|<replaceable>limit</replaceable>]</term>
<listitem>
<para>where limit is one of:</para>
<simplelist>
<member>[<emphasis
role="bold">-</emphasis>|[{<emphasis>s</emphasis>|<emphasis
role="bold">d</emphasis>}:[[<replaceable>name</replaceable>]:]]]<emphasis>rate</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst</emphasis>]</member>
<member>[<replaceable>name</replaceable>1]:<emphasis>rate1</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst1</emphasis>],[<replaceable>name</replaceable>2]:<emphasis>rate2</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst2</emphasis>]</member>
</simplelist>
<para>If passed, specifies the maximum TCP connection
<emphasis>rate</emphasis> and the size of an acceptable
<emphasis>burst</emphasis>. If not specified, TCP connections are
@@ -261,9 +282,19 @@
the user and specifies a hash table to be used to count matching
connections. If not give, the name <emphasis
role="bold">shorewall</emphasis> is assumed. Where more than one
POLICY specifies the same name, the connections counts for the
policies are aggregated and the individual rates apply to the
POLICY or rule specifies the same name, the connections counts for
the policies are aggregated and the individual rates apply to the
aggregated count.</para>
<para>Beginning with Shorewall 4.6.5, two<replaceable>
limit</replaceable>s may be specified, separated by a comma. In this
case, the first limit (<replaceable>name1</replaceable>,
<replaceable>rate1</replaceable>, burst1) specifies the per-source
IP limit and the second limit specifies the per-destination IP
limit.</para>
<para>Example: <emphasis
role="bold">client:10/sec:20,:60/sec:100</emphasis></para>
</listitem>
</varlistentry>

View File

@@ -1001,7 +1001,7 @@
role="bold">DNAT-</emphasis>, the connections will be assigned to
addresses in the range in a round-robin fashion.</para>
<para>If you kernel and iptables have ipset match support then you
<para>If your kernel and iptables have ipset match support then you
may give the name of an ipset prefaced by "+". The ipset name may be
optionally followed by a number from 1 to 6 enclosed in square
brackets ([]) to indicate the number of levels of destination
@@ -1226,22 +1226,41 @@
</varlistentry>
<varlistentry>
<term><emphasis role="bold">RATE LIMIT</emphasis> (rate) - [<emphasis
role="bold">-</emphasis>|[{<emphasis>s</emphasis>|<emphasis
role="bold">d</emphasis>}:[[<replaceable>name</replaceable>]:]]]<emphasis>rate</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst</emphasis>]</term>
<term><emphasis role="bold">RATE LIMIT</emphasis> (rate) -
<replaceable>limit</replaceable></term>
<listitem>
<para>where <replaceable>limit</replaceable> is one of:</para>
<simplelist>
<member>[<emphasis
role="bold">-</emphasis>|[{<emphasis>s</emphasis>|<emphasis
role="bold">d</emphasis>}:[[<replaceable>name</replaceable>]:]]]<emphasis>rate</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst</emphasis>]</member>
<member>[<replaceable>name</replaceable>1]:<emphasis>rate1</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst1</emphasis>],[<replaceable>name</replaceable>2]:<emphasis>rate2</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst2</emphasis>]</member>
</simplelist>
<para>You may optionally rate-limit the rule by placing a value in
this column:</para>
<para><emphasis>rate</emphasis> is the number of connections per
<para><emphasis>rate*</emphasis> is the number of connections per
interval (<emphasis role="bold">sec</emphasis> or <emphasis
role="bold">min</emphasis>) and <emphasis>burst</emphasis> is the
role="bold">min</emphasis>) and <emphasis>burst</emphasis>* is the
largest burst permitted. If no <emphasis>burst</emphasis> is given,
a value of 5 is assumed. There may be no no white-space embedded in
the specification.</para>
@@ -1250,15 +1269,28 @@
<para>When <option>s:</option> or <option>d:</option> is specified,
the rate applies per source IP address or per destination IP address
respectively. The <replaceable>name</replaceable> may be chosen by
the user and specifies a hash table to be used to count matching
respectively. The <replaceable>name</replaceable>s may be chosen by
the user and specifiy a hash table to be used to count matching
connections. If not given, the name <emphasis
role="bold">shorewallN</emphasis> (where N is a unique integer) is
assumed. Where more than one rule specifies the same name, the
connections counts for the rules are aggregated and the individual
rates apply to the aggregated count.</para>
assumed. Where more than one rule or POLICY specifies the same name,
the connections counts for the rules are aggregated and the
individual rates apply to the aggregated count.</para>
<para>Example: <emphasis role="bold">s:ssh:3/min:5</emphasis></para>
<para>Beginning with Shorewall 4.6.5, two<replaceable>
limit</replaceable>s may be specified, separated by a comma. In this
case, the first limit (<replaceable>name1</replaceable>,
<replaceable>rate1</replaceable>, burst1) specifies the per-source
IP limit and the second limit specifies the per-destination IP
limit.</para>
<para>Example: <emphasis
role="bold">client:10/sec:20,:60/sec:100</emphasis></para>
<para>In this example, the 'client' hash table will be used to
enforce the per-source limit and the compiler will pick a unique
name for the hash table that tracks the per-destination
limit.</para>
</listitem>
</varlistentry>

View File

@@ -309,17 +309,22 @@
<term>stoppedrules</term>
<listitem>
<para>If ADMINISABSENTMINDED=No, a warning message is issued
and the setting is ignored.</para>
<para>In addition to connections matching entries in
<filename>stoppedrules</filename>, existing connections
continue to work and all new connections from the firewall
system itself are allowed. To sever all existing connections
when the firewall is stopped, install the conntrack utility
and place the command <command>conntrack -F</command> in the
stopped user exit
<para>All existing connections continue to work. To sever all
existing connections when the firewall is stopped, install the
conntrack utility and place the command <command>conntrack
-F</command> in the stopped user exit
(<filename>/etc/shorewall/stopped</filename>).</para>
<para>If ADMINISABSENTMINDED=No, only new connections matching
entries in <filename>stoppedrules</filename> are accepted when
Shorewall is stopped. Response packets and related connections
are automatically accepted.</para>
<para>If ADMINISABSENTMINDED=Yes, in addition to connections
matching entries in <filename>stoppedrules</filename>, all new
connections from the firewall system itself are allowed when
the firewall is stopped. Response packets and related
connections are automatically accepted.</para>
</listitem>
</varlistentry>
</variablelist>
@@ -1306,6 +1311,45 @@ net all DROP info</programlisting>then the chain name is 'net-all'
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">LOG_BACKEND=</emphasis>[<emphasis>backend</emphasis>]</term>
<listitem>
<para>Added in Shorewall 4.6.4. LOG_BACKEND determines the logging
backend to be used for the <command>iptrace</command> command (see
<ulink url="manpages/shorewall.html">shorewall(8)</ulink>).</para>
<para><replaceable>backend</replaceable> is one of:</para>
<variablelist>
<varlistentry>
<term>LOG</term>
<listitem>
<para>Use standard kernel logging.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>ULOG</term>
<listitem>
<para>Use ULOG logging to ulogd.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>netlink</term>
<listitem>
<para>Use netlink logging to ulogd version 2 or later.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">LOG_MARTIANS=</emphasis>[<emphasis
role="bold">Yes</emphasis>|<emphasis
@@ -2425,7 +2469,8 @@ INLINE - - - ; -j REJECT
<varlistentry>
<term><emphasis role="bold">SAVE_IPSETS=</emphasis>{<emphasis
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>}</term>
role="bold">Yes</emphasis>|<emphasis
role="bold">No|ipv4|<replaceable>setlist</replaceable></emphasis>}</term>
<listitem>
<para>Re-enabled in Shorewall 4.4.6. If SAVE_IPSETS=Yes, then the
@@ -2434,6 +2479,11 @@ INLINE - - - ; -j REJECT
role="bold">shorewall save</emphasis> commands and restored by the
<emphasis role="bold">shorewall start</emphasis> and <emphasis
role="bold">shorewall restore</emphasis> commands.</para>
<para>Beginning with Shorewall 4.6.4, you can restrict the set of
ipsets saved by specifying a setlist (a comma-separated list of ipv4
ipset names). You may also restrict the saved sets to just the ipv4
ones by specifying <emphasis role="bold">ipv4</emphasis>.</para>
</listitem>
</varlistentry>

View File

@@ -441,6 +441,8 @@
<arg><option>-i</option></arg>
<arg><option>-C</option></arg>
<arg><replaceable>directory</replaceable></arg>
</cmdsynopsis>
@@ -452,7 +454,8 @@
<arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>restore</option></arg>
<arg
choice="plain"><option>restore</option><arg><option>-n</option></arg><arg><option>-p</option></arg><arg><option>-C</option></arg></arg>
<arg><replaceable>filename</replaceable></arg>
</cmdsynopsis>
@@ -467,7 +470,7 @@
<arg choice="plain"><option>run</option></arg>
<arg choice="plain">function</arg>
<arg choice="plain"><replaceable>command</replaceable></arg>
<arg><replaceable>parameter ...</replaceable></arg>
</cmdsynopsis>
@@ -517,7 +520,8 @@
<arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>save</option></arg>
<arg
choice="plain"><option>save</option><arg><option>-C</option></arg></arg>
<arg choice="opt"><replaceable>filename</replaceable></arg>
</cmdsynopsis>
@@ -671,6 +675,8 @@
<arg><option>-T</option><arg><option>-i</option></arg></arg>
<arg><option>-C</option></arg>
<arg><replaceable>directory</replaceable></arg>
</cmdsynopsis>
@@ -768,7 +774,7 @@
used for debugging. See <ulink
url="/starting_and_stopping_shorewall.htm#Trace">http://www.shorewall.net/starting_and_stopping_shorewall.htm#Trace</ulink>.</para>
<para>The nolock <option>option</option> prevents the command from
<para>The <option>nolock</option> option prevents the command from
attempting to acquire the Shorewall lockfile. It is useful if you need to
include <command>shorewall</command> commands in
<filename>/etc/shorewall/started</filename>.</para>
@@ -871,10 +877,11 @@
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line
contains alternative input specifications following a semicolon
(";"). Such lines will be handled incorrectly if INLINE_MATCHES is
set to Yes in
<ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).</para>
</listitem>
@@ -914,18 +921,17 @@
compile -- -</command>) to suppress the 'Compiling...' message
normally generated by <filename>/sbin/shorewall</filename>.</para>
<para>When -e is specified, the compilation is being performed on a
system other than where the compiled script will run. This option
disables certain configuration options that require the script to be
compiled where it is to be run. The use of -e requires the presence
of a configuration file named <filename>capabilities</filename>
which may be produced using the command <emphasis
role="bold">shorewall-lite show -f capabilities &gt;
capabilities</emphasis> on a system with Shorewall Lite
<para>When <option>-e</option> is specified, the compilation is being
performed on a system other than where the compiled script will run.
This option disables certain configuration options that require the
script to be compiled where it is to be run. The use of <option>-e</option>
requires the presence of a configuration file named <filename>capabilities</filename>
which may be produced using the command <command>shorewall-lite show -f
capabilities &gt; capabilities</command> on a system with Shorewall Lite
installed</para>
<para>The <emphasis role="bold">-c</emphasis> option was added in
Shorewall 4.5.17 and causes conditional compilation of a script. The
<para>The <option>-c</option> option was added in Shorewall 4.5.17
and causes conditional compilation of a script. The
script specified by <replaceable>pathname</replaceable> (or implied
if <emphasis role="bold">pathname</emphasis> is omitted) is compiled
if it doesn't exist or if there is any file in the
@@ -945,8 +951,8 @@
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0 and
causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
@@ -1015,9 +1021,10 @@
<para>The <emphasis role="bold">-x</emphasis> option causes actual
packet and byte counts to be displayed. Without that option, these
counts are abbreviated. The <emphasis role="bold">-m</emphasis>
option causes any MAC addresses included in Shorewall log messages
to be displayed.</para>
counts are abbreviated.</para>
<para>The <emphasis role="bold">-m</emphasis> option causes any MAC
addresses included in Shorewall log messages to be displayed.</para>
<para>The <emphasis role="bold">-l</emphasis> option causes the rule
number for each Netfilter rule to be displayed.</para>
@@ -1129,11 +1136,10 @@
be one or more matches that may appear in both the raw table OUTPUT
and raw table PREROUTING chains.</para>
<para>The trace records are written to the kernel's log buffer with
facility = kernel and priority = warning, and they are routed from
there by your logging daemon (syslogd, rsyslog, syslog-ng, ...) --
Shorewall has no control over where the messages go; consult your
logging daemon's documentation.</para>
<para>The log message destination is determined by the
currently-selected IPv4 <ulink
url="/shorewall_logging.html#Backends">logging
backend</ulink>.</para>
</listitem>
</varlistentry>
@@ -1183,8 +1189,8 @@
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0 and
causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
@@ -1269,21 +1275,21 @@
<para>The <option>-n</option> option was added in Shorewall 4.5.3
causes Shorewall to avoid updating the routing table(s).</para>
<para>The <option>-d </option>option was added in Shorewall 4.5.3
<para>The <option>-d</option> option was added in Shorewall 4.5.3
causes the compiler to run under the Perl debugger.</para>
<para>The <option>-T</option> option was added in Shorewall 4.5.3
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).</para>
<para>The -<option>D</option> option was added in Shorewall 4.5.3
<para>The <option>-D</option> option was added in Shorewall 4.5.3
and causes Shorewall to look in the given
<emphasis>directory</emphasis> first for configuration files.</para>
@@ -1345,8 +1351,8 @@
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
@@ -1381,7 +1387,7 @@
table to be flushed; the <command>conntrack</command> utility must
be installed to use this option.</para>
<para>The <option>-d </option>option causes the compiler to run
<para>The <option>-d</option> option causes the compiler to run
under the Perl debugger.</para>
<para>The <option>-f</option> option suppresses the compilation step
@@ -1393,19 +1399,27 @@
and performs the compilation step unconditionally, overriding the
AUTOMAKE setting in <ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5). When
both <option>-f</option> and <option>-c</option>are present, the
both <option>-f</option> and <option>-c</option> are present, the
result is determined by the option that appears last.</para>
<para>The <option>-T</option> option was added in Shorewall 4.5.3
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).</para>
<para>The <option>-C</option> option was added in Shorewall 4.6.5
and is only meaningful when AUTOMAKE=Yes in <ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5). If an
existing firewall script is used and if that script was the one that
generated the current running configuration, then the running
netfilter configuration will be reloaded as is so as to preserve the
iptables packet and byte counters.</para>
</listitem>
</varlistentry>
@@ -1421,6 +1435,27 @@
<emphasis>filename</emphasis> is given then Shorewall will be
restored from the file specified by the RESTOREFILE option in <ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).</para>
<caution>
<para>If your iptables ruleset depends on variables that are
detected at run-time, either in your params file or by
Shorewall-generated code, <command>restore</command> will use the
values that were current when the ruleset was saved, which may be
different from the current values.</para>
</caution>
<para>The <option>-n</option> option causes Shorewall to avoid
updating the routing table(s).</para>
<para>The <option>-p</option> option, added in Shorewall 4.6.5,
causes the connection tracking table to be flushed; the
<command>conntrack</command> utility must be installed to use this
option.</para>
<para>The <option>-C</option> option was added in Shorewall 4.6.5.
If the <option>-C</option> option was specified during <emphasis
role="bold">shorewall save</emphasis>, then the counters saved by
that operation will be restored.</para>
</listitem>
</varlistentry>
@@ -1509,6 +1544,10 @@
<emphasis>filename</emphasis> is not given then the state is saved
in the file specified by the RESTOREFILE option in <ulink
url="/manpages/shorewall.conf.html">shorewall.conf</ulink>(5).</para>
<para>The <option>-C</option> option, added in Shorewall 4.6.5,
causes the iptables packet and byte counters to be saved along with
the chains and rules.</para>
</listitem>
</varlistentry>
@@ -1535,7 +1574,7 @@
<listitem>
<para>Added in Shorewall 4.6.2. Displays the dynamic chain
along with any chains produced by entries in
shorewall-blrules(5).The <emphasis role="bold">-x</emphasis>
shorewall-blrules(5). The <emphasis role="bold">-x</emphasis>
option is passed directly through to iptables and causes
actual packet and byte counts to be displayed. Without this
option, those counts are abbreviated.</para>
@@ -1701,7 +1740,7 @@
<listitem>
<para>Displays the Netfilter nat table using the command
<emphasis role="bold">iptables -t nat -L -n -v</emphasis>.The
<emphasis role="bold">iptables -t nat -L -n -v</emphasis>. The
<emphasis role="bold">-x</emphasis> option is passed directly
through to iptables and causes actual packet and byte counts
to be displayed. Without this option, those counts are
@@ -1734,7 +1773,7 @@
<listitem>
<para>Displays the Netfilter raw table using the command
<emphasis role="bold">iptables -t raw -L -n -v</emphasis>.The
<emphasis role="bold">iptables -t raw -L -n -v</emphasis>. The
<emphasis role="bold">-x</emphasis> option is passed directly
through to iptables and causes actual packet and byte counts
to be displayed. Without this option, those counts are
@@ -1813,6 +1852,13 @@
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
url="/manpages/shorewall.conf.html">shorewall.conf(5)</ulink>.</para>
<para>The <option>-C</option> option was added in Shorewall 4.6.5
and is only meaningful when the <option>-f</option> option is also
specified. If the previously-saved configuration is restored, and if
the <option>-C</option> option was also specified in the <emphasis
role="bold">save</emphasis> command, then the packet and byte
counters will be restored.</para>
</listitem>
</varlistentry>

View File

@@ -28,4 +28,3 @@ loadmodule iptable_nat
loadmodule iptable_raw
loadmodule xt_state
loadmodule xt_tcpudp
loadmodule ipt_LOG

View File

@@ -32,7 +32,6 @@ loadmodule ipt_ipp2p
loadmodule ipt_iprange
loadmodule ipt_length
loadmodule ipt_limit
loadmodule ipt_LOG
loadmodule ipt_mac
loadmodule ipt_mark
loadmodule ipt_MARK
@@ -58,4 +57,3 @@ loadmodule ipt_tos
loadmodule ipt_TOS
loadmodule ipt_ttl
loadmodule ipt_TTL
loadmodule ipt_ULOG

View File

@@ -31,7 +31,6 @@ loadmodule xt_mac
loadmodule xt_mark
loadmodule xt_MARK
loadmodule xt_multiport
loadmodule xt_NFLOG
loadmodule xt_NFQUEUE
loadmodule xt_owner
loadmodule xt_physdev

View File

@@ -1,20 +1,20 @@
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.4
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
#
# Copyright 2011 Jonathan Underwood (jonathan.underwood@gmail.com)
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
#
[Unit]
Description=Shorewall IPv4 firewall
After=syslog.target
After=network.target
Conflicts=iptables.service firewalld.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall
StandardOutput=syslog
ExecStart=/sbin/shorewall $OPTIONS start
ExecStart=/sbin/shorewall $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall $OPTIONS stop
[Install]
WantedBy=multi-user.target
WantedBy=basic.target

View File

@@ -0,0 +1,20 @@
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
#
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
#
[Unit]
Description=Shorewall IPv4 firewall
After=network-online.target
Conflicts=iptables.service firewalld.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall
StandardOutput=syslog
ExecStart=/sbin/shorewall $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall $OPTIONS stop
[Install]
WantedBy=basic.target

View File

@@ -27,11 +27,16 @@
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=xxx #The Build script inserts the actual version
PRODUCT=shorewall
usage() # $1 = exit status
{
ME=$(basename $0)
echo "usage: $ME [ <shorewallrc file> ]"
echo "usage: $ME [ <option> ] [ <shorewallrc file> ]"
echo "where <option> is one of"
echo " -h"
echo " -v"
echo " -n"
exit $1
}
@@ -69,6 +74,43 @@ remove_file() # $1 = file to restore
fi
}
finished=0
configure=1
while [ $finished -eq 0 ]; do
option=$1
case "$option" in
-*)
option=${option#-}
while [ -n "$option" ]; do
case $option in
h)
usage 0
;;
v)
echo "$Product Firewall Installer Version $VERSION"
exit 0
;;
n*)
configure=0
option=${option#n}
;;
*)
usage 1
;;
esac
done
shift
;;
*)
finished=1
;;
esac
done
if [ $# -eq 0 ]; then
if [ -f ./shorewallrc ]; then
. ./shorewallrc
@@ -110,24 +152,39 @@ fi
echo "Uninstalling shorewall $VERSION"
if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall-lite ]; then
shorewall clear
[ -n "$SANDBOX" ] && configure=0
if [ $configure -eq 1 ]; then
if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall-lite ]; then
shorewall clear
fi
fi
rm -f ${SBINDIR}/shorewall
if [ -f "$INITSCRIPT" ]; then
if mywhich updaterc.d ; then
updaterc.d ${PRODUCT} remove
elif mywhich insserv ; then
insserv -r $INITSCRIPT
elif mywhich chkconfig ; then
chkconfig --del $(basename $INITSCRIPT)
elif mywhich systemctl ; then
systemctl disable ${PRODUCT}
if [ -L ${SHAREDIR}/shorewall6/init ]; then
FIREWALL=$(readlink -m -q ${SHAREDIR}/shorewall6/init)
elif [ -n "$INITFILE" ]; then
FIREWALL=${INITDIR}/${INITFILE}
fi
if [ -f "$FIREWALL" ]; then
if [ $configure -eq 1 ]; then
if mywhich updaterc.d ; then
updaterc.d ${PRODUCT} remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
fi
fi
remove_file $INITSCRIPT
remove_file $FIREWALL
fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
rm -f $SYSTEMD/shorewall.service
fi
rm -rf ${SHAREDIR}/shorewall/version
@@ -139,8 +196,8 @@ if [ -n "$SYSCONFDIR" ]; then
fi
rm -rf ${VARDIR}/shorewall
rm -rf ${PERLLIB}/Shorewall/*
rm -rf ${LIBEXEC}/shorewall
rm -rf ${PERLLIBDIR}/Shorewall/*
rm -rf ${LIBEXECDIR}/shorewall
rm -rf ${SHAREDIR}/shorewall/configfiles/
rm -rf ${SHAREDIR}/shorewall/Samples/
rm -rf ${SHAREDIR}/shorewall/Shorewall/

View File

@@ -39,7 +39,7 @@ fi
start() {
echo -n $"Starting Shorewall: "
$shorewall $OPTIONS start 2>&1 | $logger
$shorewall $OPTIONS start $STARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then
touch $lockfile
@@ -69,7 +69,7 @@ restart() {
# Note that we don't simply stop and start since shorewall has a built in
# restart which stops the firewall if running and then starts it.
echo -n $"Restarting Shorewall: "
$shorewall $OPTIONS restart 2>&1 | $logger
$shorewall $OPTIONS restart $RESTARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then
touch $lockfile

View File

@@ -301,6 +301,8 @@
<arg><option>-p</option></arg>
<arg><option>-C</option></arg>
<arg><replaceable>directory</replaceable></arg>
</cmdsynopsis>
@@ -314,6 +316,8 @@
<arg choice="plain"><option>restore</option></arg>
<arg><option>-C</option></arg>
<arg><replaceable>filename</replaceable></arg>
</cmdsynopsis>
@@ -342,6 +346,8 @@
<arg choice="plain"><option>save</option></arg>
<arg><option>-C</option></arg>
<arg choice="opt"><replaceable>filename</replaceable></arg>
</cmdsynopsis>
@@ -474,6 +480,10 @@
<arg><option>-n</option></arg>
<arg><option>-p</option></arg>
<arg><option>-f</option></arg>
<arg><option>-C</option></arg>
</cmdsynopsis>
<cmdsynopsis>
@@ -524,10 +534,11 @@
used for debugging. See <ulink
url="http://www.shorewall.net/starting_and_stopping_shorewall.htm#Trace">http://www.shorewall.net/starting_and_stopping_shorewall.htm#Trace</ulink>.</para>
<para>The nolock <option>option</option> prevents the command from
<para>The <option>nolock</option> option prevents the command from
attempting to acquire the shorewall6-lite lockfile. It is useful if you
need to include <command>shorewall</command> commands in
<filename>/etc/shorewall/started</filename>.</para>
need to include <command>shorewall</command> commands in the
<filename>started</filename> <ulink
url="../shorewall_extension_scripts.html">extension script</ulink>.</para>
<para>The <emphasis>options</emphasis> control the amount of output that
the command produces. They consist of a sequence of the letters <emphasis
@@ -538,8 +549,8 @@
role="bold">v</emphasis> adds one to the effective verbosity and each
<emphasis role="bold">q</emphasis> subtracts one from the effective
VERBOSITY. Alternately, <emphasis role="bold">v</emphasis> may be followed
immediately with one of -1,0,1,2 to specify a specify VERBOSITY. There may
be no white-space between <emphasis role="bold">v</emphasis> and the
immediately with one of -1,0,1,2 to specify VERBOSITY. There may be no
white-space between <emphasis role="bold">v</emphasis> and the
VERBOSITY.</para>
<para>The <emphasis>options</emphasis> may also include the letter
@@ -560,19 +571,21 @@
<para>Adds a list of hosts or subnets to a dynamic zone usually used
with VPN's.</para>
<para>The <emphasis>interface</emphasis> argument names an interface
defined in the <ulink
<para>The <replaceable>interface</replaceable> argument names an
interface defined in the <ulink
url="shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
file. A <emphasis>host-list</emphasis> is comma-separated list whose
elements are host or network addresses.<caution>
<para>The <command>add</command> command is not very robust. If
there are errors in the <replaceable>host-list</replaceable>,
you may see a large number of error messages yet a subsequent
<command>shorewall6-lite show zones</command> command will
indicate that all hosts were added. If this happens, replace
<command>add</command> by <command>delete</command> and run the
same command again. Then enter the correct command.</para>
</caution></para>
file. A <replaceable>host-list</replaceable> is comma-separated list
whose elements are host or network addresses.</para>
<caution>
<para>The <command>add</command> command is not very robust. If
there are errors in the <replaceable>host-list</replaceable>, you
may see a large number of error messages yet a subsequent
<command>shorewall6-lite show zones</command> command will
indicate that all hosts were added. If this happens, replace
<command>add</command> by <command>delete</command> and run the
same command again. Then enter the correct command.</para>
</caution>
</listitem>
</varlistentry>
@@ -581,10 +594,9 @@
<listitem>
<para>Re-enables receipt of packets from hosts previously
blacklisted by a <emphasis role="bold">drop</emphasis>, <emphasis
role="bold">logdrop</emphasis>, <emphasis
role="bold">reject</emphasis>, or <emphasis
role="bold">logreject</emphasis> command.</para>
blacklisted by a <command>drop</command>,
<command>logdrop</command>, <command>reject</command>, or
<command>logreject</command> command.</para>
</listitem>
</varlistentry>
@@ -598,10 +610,9 @@
the firewall is causing connection problems.</para>
<para>If <option>-f</option> is given, the command will be processed
by the compiled script that executed the last successful <emphasis
role="bold">start</emphasis>, <emphasis
role="bold">restart</emphasis> or <emphasis
role="bold">refresh</emphasis> command if that script exists.</para>
by the compiled script that executed the last successful
<command>start</command>, <command>restart</command> or
<command>refresh</command> command if that script exists.</para>
</listitem>
</varlistentry>
@@ -609,14 +620,14 @@
<term><emphasis role="bold">delete</emphasis></term>
<listitem>
<para>The delete command reverses the effect of an earlier <emphasis
role="bold">add</emphasis> command.</para>
<para>The delete command reverses the effect of an earlier
<command>add</command> command.</para>
<para>The <emphasis>interface</emphasis> argument names an interface
defined in the <ulink
<para>The <replaceable>interface</replaceable> argument names an
interface defined in the <ulink
url="shorewall-interfaces.html">shorewall-interfaces</ulink>(5)
file. A <emphasis>host-list</emphasis> is comma-separated list whose
elements are a host or network address.</para>
file. A <replaceable>host-list</replaceable> is comma-separated list
whose elements are a host or network address.</para>
</listitem>
</varlistentry>
@@ -636,8 +647,8 @@
<term><emphasis role="bold">drop</emphasis></term>
<listitem>
<para>Causes traffic from the listed <emphasis>address</emphasis>es
to be silently dropped.</para>
<para>Causes traffic from the listed
<replaceable>address</replaceable>es to be silently dropped.</para>
</listitem>
</varlistentry>
@@ -648,14 +659,15 @@
<para>Produces a verbose report about the firewall configuration for
the purpose of problem analysis.</para>
<para>The <emphasis role="bold">-x</emphasis> option causes actual
packet and byte counts to be displayed. Without that option, these
counts are abbreviated. The <emphasis role="bold">-m</emphasis>
option causes any MAC addresses included in shorewall6-lite log
messages to be displayed.</para>
<para>The <option>-x</option> option causes actual packet and byte
counts to be displayed. Without that option, these counts are
abbreviated.</para>
<para>The <emphasis role="bold">-l</emphasis> option causes the rule
number for each Netfilter rule to be displayed.</para>
<para>The <option>-m</option> option causes any MAC addresses
included in shorewall6-lite log messages to be displayed.</para>
<para>The <option>-l</option> option causes the rule number for each
Netfilter rule to be displayed.</para>
</listitem>
</varlistentry>
@@ -675,10 +687,11 @@
<term><emphasis role="bold">forget</emphasis></term>
<listitem>
<para>Deletes /var/lib/shorewall6-lite/<emphasis>filename</emphasis>
and /var/lib/shorewall6-lite/save. If no
<emphasis>filename</emphasis> is given then the file specified by
RESTOREFILE in <ulink
<para>Deletes
<filename>/var/lib/shorewall6-lite/<replaceable>filename</replaceable></filename>
and <filename>/var/lib/shorewall6-lite/save</filename>. If no
<replaceable>filename</replaceable> is given then the file specified
by RESTOREFILE in <ulink
url="shorewall.conf.html">shorewall6.conf</ulink>(5) is
assumed.</para>
</listitem>
@@ -744,10 +757,11 @@
<term><emphasis role="bold">logdrop</emphasis></term>
<listitem>
<para>Causes traffic from the listed <emphasis>address</emphasis>es
to be logged then discarded. Logging occurs at the log level
specified by the BLACKLIST_LOGLEVEL setting in <ulink
url="shorewall.conf.html">shorewall6.conf</ulink> (5).</para>
<para>Causes traffic from the listed
<replaceable>address</replaceable>es to be logged then discarded.
Logging occurs at the log level specified by the BLACKLIST_LOGLEVEL
setting in <ulink url="shorewall.conf.html">shorewall6.conf</ulink>
(5).</para>
</listitem>
</varlistentry>
@@ -758,15 +772,18 @@
<para>Monitors the log file specified by the LOGFILE option in
<ulink url="shorewall.conf.html">shorewall6.conf</ulink>(5) and
produces an audible alarm when new shorewall6-lite messages are
logged. The <emphasis role="bold">-m</emphasis> option causes the
MAC address of each packet source to be displayed if that
information is available. The
<replaceable>refresh-interval</replaceable> specifies the time in
seconds between screen refreshes. You can enter a negative number by
preceding the number with "--" (e.g., <command>shorewall6-lite
logwatch -- -30</command>). In this case, when a packet count
changes, you will be prompted to hit any key to resume screen
refreshes.</para>
logged.</para>
<para>The <option>-m</option> option causes the MAC address of each
packet source to be displayed if that information is
available.</para>
<para>The <replaceable>refresh-interval</replaceable> specifies the
time in seconds between screen refreshes. You can enter a negative
number by preceding the number with "--" (e.g.,
<command>shorewall6-lite logwatch -- -30</command>). In this case,
when a packet count changes, you will be prompted to hit any key to
resume screen refreshes.</para>
</listitem>
</varlistentry>
@@ -774,10 +791,11 @@
<term><emphasis role="bold">logreject</emphasis></term>
<listitem>
<para>Causes traffic from the listed <emphasis>address</emphasis>es
to be logged then rejected. Logging occurs at the log level
specified by the BLACKLIST_LOGLEVEL setting in <ulink
url="shorewall.conf.html">shorewall6.conf</ulink> (5).</para>
<para>Causes traffic from the listed
<replaceable>address</replaceable>es to be logged then rejected.
Logging occurs at the log level specified by the BLACKLIST_LOGLEVEL
setting in <ulink url="shorewall.conf.html">shorewall6.conf</ulink>
(5).</para>
</listitem>
</varlistentry>
@@ -807,9 +825,17 @@
<term><emphasis role="bold">restart</emphasis></term>
<listitem>
<para>Restart is similar to <emphasis role="bold">shorewall6-lite
start</emphasis> except that it assumes that the firewall is already
started. Existing connections are maintained.</para>
<para>Restart is similar to <command>shorewall6-lite start</command>
except that it assumes that the firewall is already started.
Existing connections are maintained.</para>
<caution>
<para>If your ip6tables ruleset depends on variables that are
detected at run-time, either in your params file or by
Shorewall-generated code, <command>restore</command> will use the
values that were current when the ruleset was saved, which may be
different from the current values.</para>
</caution>
<para>The <option>-n</option> option causes shorewall6-lite to avoid
updating the routing table(s).</para>
@@ -817,6 +843,12 @@
<para>The <option>-p</option> option causes the connection tracking
table to be flushed; the <command>conntrack</command> utility must
be installed to use this option.</para>
<para>The <option>-C</option> option was added in Shorewall 4.6.5.
If the specified (or implicit) firewall script is the one that
generated the current running configuration, then the running
netfilter configuration will be reloaded as is so as to preserve the
iptables packet and byte counters.</para>
</listitem>
</varlistentry>
@@ -824,14 +856,21 @@
<term><emphasis role="bold">restore</emphasis></term>
<listitem>
<para>Restore shorewall6-lite to a state saved using the <emphasis
role="bold">shorewall6-lite save</emphasis> command. Existing
connections are maintained. The <emphasis>filename</emphasis> names
a restore file in /var/lib/shorewall6-lite created using <emphasis
role="bold">shorewall6-lite save</emphasis>; if no
<emphasis>filename</emphasis> is given then shorewall6-lite will be
restored from the file specified by the RESTOREFILE option in <ulink
<para>Restore shorewall6-lite to a state saved using the
<command>shorewall6-lite save</command> command. Existing
connections are maintained. The <replaceable>filename</replaceable>
names a restore file in <filename
class="directory">/var/lib/shorewall6-lite</filename> created using
<command>shorewall6-lite save</command>; if no
<replaceable>filename</replaceable> is given then shorewall6-lite
will be restored from the file specified by the RESTOREFILE option
in <ulink
url="shorewall.conf.html">shorewall6.conf</ulink>(5).</para>
<para>The <option>-C</option> option was added in Shorewall 4.6.5.
If the <option>-C</option> option was specified during
<command>shorewall7-lite save</command>, then the counters saved by
that operation will be restored.</para>
</listitem>
</varlistentry>
@@ -857,12 +896,17 @@
<listitem>
<para>The dynamic blacklist is stored in
/var/lib/shorewall6-lite/save. The state of the firewall is stored
in /var/lib/shorewall6-lite/<emphasis>filename</emphasis> for use by
the <emphasis role="bold">shorewall6-lite restore</emphasis>. If
<emphasis>filename</emphasis> is not given then the state is saved
in the file specified by the RESTOREFILE option in <ulink
<filename>/var/lib/shorewall6-lite/save</filename>. The state of the
firewall is stored in
<filename>/var/lib/shorewall6-lite/<replaceable>filename</replaceable></filename>
for use by the <command>shorewall6-lite restore</command> command.
If <replaceable>filename</replaceable> is not given then the state
is saved in the file specified by the RESTOREFILE option in <ulink
url="shorewall.conf.html">shorewall6.conf</ulink>(5).</para>
<para>The <option>-C</option> option, added in Shorewall 4.6.5,
causes the ip6tables packet and byte counters to be saved along with
the chains and rules.</para>
</listitem>
</varlistentry>
@@ -880,10 +924,10 @@
<listitem>
<para>Added in Shorewall 4.6.2. Displays the dynamic chain
along with any chains produced by entries in
shorewall6-blrules(5).The <emphasis role="bold">-x</emphasis>
option is passed directly through to ip6tables and causes
actual packet and byte counts to be displayed. Without this
option, those counts are abbreviated.</para>
shorewall6-blrules(5).The <option>-x</option> option is passed
directly through to ip6tables and causes actual packet and
byte counts to be displayed. Without this option, those counts
are abbreviated.</para>
</listitem>
</varlistentry>
@@ -892,9 +936,9 @@
<listitem>
<para>Displays your kernel/iptables capabilities. The
<emphasis role="bold">-f</emphasis> option causes the display
to be formatted as a capabilities file for use with <emphasis
role="bold">compile -e</emphasis>.</para>
<option>-f</option> option causes the display to be formatted
as a capabilities file for use with <command>compile
-e</command>.</para>
</listitem>
</varlistentry>
@@ -908,25 +952,26 @@
-L</emphasis> <emphasis>chain</emphasis> <emphasis
role="bold">-n -v</emphasis> command. If no
<emphasis>chain</emphasis> is given, all of the chains in the
filter table are displayed. The <emphasis
role="bold">-x</emphasis> option is passed directly through to
iptables and causes actual packet and byte counts to be
displayed. Without this option, those counts are abbreviated.
The <emphasis role="bold">-t</emphasis> option specifies the
Netfilter table to display. The default is <emphasis
filter table are displayed.</para>
<para>The <option>-x</option> option is passed directly
through to iptables and causes actual packet and byte counts
to be displayed. Without this option, those counts are
abbreviated.</para>
<para>The <option>-t</option> option specifies the Netfilter
table to display. The default is <emphasis
role="bold">filter</emphasis>.</para>
<para>The <emphasis role="bold">-b</emphasis> ('brief') option
causes rules which have not been used (i.e. which have zero
packet and byte counts) to be omitted from the output. Chains
with no rules displayed are also omitted from the
output.</para>
<para>The <option>-b</option> ('brief') option causes rules
which have not been used (i.e. which have zero packet and byte
counts) to be omitted from the output. Chains with no rules
displayed are also omitted from the output.</para>
<para>The <emphasis role="bold">-l</emphasis> option causes
the rule number for each Netfilter rule to be
displayed.</para>
<para>The <option>-l</option> option causes the rule number
for each Netfilter rule to be displayed.</para>
<para>If the <emphasis role="bold">t</emphasis> option and the
<para>If the <option>-t</option> option and the
<option>chain</option> keyword are both omitted and any of the
listed <replaceable>chain</replaceable>s do not exist, a usage
message is displayed.</para>
@@ -1004,10 +1049,11 @@
<listitem>
<para>Displays the last 20 shorewall6-lite messages from the
log file specified by the LOGFILE option in <ulink
url="shorewall.conf.html">shorewall6.conf</ulink>(5). The
<emphasis role="bold">-m</emphasis> option causes the MAC
address of each packet source to be displayed if that
information is available.</para>
url="shorewall.conf.html">shorewall6.conf</ulink>(5).</para>
<para>The <option>-m</option> option causes the MAC address of
each packet source to be displayed if that information is
available.</para>
</listitem>
</varlistentry>
@@ -1026,10 +1072,10 @@
<listitem>
<para>Displays the Netfilter nat table using the command
<emphasis role="bold">iptables -t nat -L -n -v</emphasis>.The
<emphasis role="bold">-x</emphasis> option is passed directly
through to iptables and causes actual packet and byte counts
to be displayed. Without this option, those counts are
<command>iptables -t nat -L -n -v</command>.The
<option>-x</option> option is passed directly through to
iptables and causes actual packet and byte counts to be
displayed. Without this option, those counts are
abbreviated.</para>
</listitem>
</varlistentry>
@@ -1059,10 +1105,10 @@
<listitem>
<para>Displays the Netfilter raw table using the command
<emphasis role="bold">iptables -t raw -L -n -v</emphasis>.The
<emphasis role="bold">-x</emphasis> option is passed directly
through to iptables and causes actual packet and byte counts
to be displayed. Without this option, those counts are
<command>iptables -t raw -L -n -v</command>.The
<option>-x</option> option is passed directly through to
iptables and causes actual packet and byte counts to be
displayed. Without this option, those counts are
abbreviated.</para>
</listitem>
</varlistentry>
@@ -1092,7 +1138,7 @@
<term><emphasis role="bold">start</emphasis></term>
<listitem>
<para>Start Shorewall Lite. Existing connections through
<para>Start Shorewall6 Lite. Existing connections through
shorewall6-lite managed interfaces are untouched. New connections
will be allowed only if they are allowed by the firewall rules or
policies.</para>
@@ -1100,6 +1146,22 @@
<para>The <option>-p</option> option causes the connection tracking
table to be flushed; the <command>conntrack</command> utility must
be installed to use this option.</para>
<para>The <option>-m</option> option prevents the firewall script
from modifying the current routing configuration.</para>
<para>The <option>-f</option> option was added in Shorewall 4.6.5.
If the RESTOREFILE named in <ulink
url="shorewall.conf.html">shorewall.conf</ulink>(5) exists, is
executable and is not older than the current filewall script, then
that saved configuration is restored.</para>
<para>The <option>-C</option> option was added in Shorewall 4.6.5
and is only meaningful when the <option>-f</option> option is also
specified. If the previously-saved configuration is restored, and if
the <option>-C</option> option was also specified in the
<command>save</command> command, then the packet and byte counters
will be restored.</para>
</listitem>
</varlistentry>
@@ -1118,10 +1180,9 @@
or by ADMINISABSENTMINDED.</para>
<para>If <option>-f</option> is given, the command will be processed
by the compiled script that executed the last successful <emphasis
role="bold">start</emphasis>, <emphasis
role="bold">restart</emphasis> or <emphasis
role="bold">refresh</emphasis> command if that script exists.</para>
by the compiled script that executed the last successful
<command>start</command>, <command>restart</command> or
<command>refresh</command> command if that script exists.</para>
</listitem>
</varlistentry>
@@ -1132,7 +1193,7 @@
<para>Produces a short report about the state of the
Shorewall-configured firewall.</para>
<para>The <option>-i </option>option was added in Shorewall 4.6.2
<para>The <option>-i</option> option was added in Shorewall 4.6.2
and causes the status of each optional or provider interface to be
displayed.</para>
</listitem>

View File

@@ -1,20 +1,20 @@
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.4
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
#
# Copyright 2011 Jonathan Underwood (jonathan.underwood@gmail.com)
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
#
[Unit]
Description=Shorewall IPv6 firewall (lite)
After=syslog.target
After=network.target
Conflicts=ip6tables.service firewalld.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall6-lite
StandardOutput=syslog
ExecStart=/sbin/shorewall6-lite $OPTIONS start
ExecStart=/sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall6-lite $OPTIONS stop
[Install]
WantedBy=multi-user.target
WantedBy=basic.target

View File

@@ -0,0 +1,20 @@
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
#
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
#
[Unit]
Description=Shorewall IPv6 firewall (lite)
After=network-online.target
Conflicts=ip6tables.service firewalld.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall6-lite
StandardOutput=syslog
ExecStart=/sbin/shorewall6-lite $OPTIONS start
ExecStop=/sbin/shorewall6-lite $OPTIONS stop
[Install]
WantedBy=basic.target

View File

@@ -27,6 +27,7 @@
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=xxx #The Build script inserts the actual version
PRODUCT=shorewall6-lite
usage() # $1 = exit status
{
@@ -69,6 +70,42 @@ remove_file() # $1 = file to restore
fi
}
finished=0
configure=1
while [ $finished -eq 0 ]; do
option=$1
case "$option" in
-*)
option=${option#-}
while [ -n "$option" ]; do
case $option in
h)
usage 0
;;
v)
echo "$Product Firewall Installer Version $VERSION"
exit 0
;;
n*)
configure=0
option=${option#n}
;;
*)
usage 1
;;
esac
done
shift
;;
*)
finished=1
;;
esac
done
#
# Read the RC file
#
@@ -112,38 +149,50 @@ fi
echo "Uninstalling Shorewall Lite $VERSION"
if qt ip6tables -L shorewall -n && [ ! -f ${SBINDIR)/shorewall6 ]; then
${SBINDIR}/shorewall6-lite clear
[ -n "$SANDBOX" ] && configure=0
if [ $configure -eq 1 ]; then
if qt ip6tables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall6 ]; then
${SBINDIR}/shorewall6-lite clear
fi
fi
if [ -l ${SHAREDIR}/shorewall6-lite/init ]; then
if [ -f ${SHAREDIR}/shorewall6-lite/init ]; then
FIREWALL=$(readlink -m -q ${SHAREDIR}/shorewall6-lite/init)
elif [ -n "$INITFILE" ]; then
FIREWALL=${INITDIR}/${INITFILE}
fi
if [ -f "$FIREWALL" ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall6-lite remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
elif mywhich systemctl ; then
systemctl disable shorewall6-lite
if [ $configure -eq 1 ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall6-lite remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
elif mywhich systemctl ; then
systemctl disable shorewall6-lite
fi
fi
remove_file $FIREWALL
fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
rm -f $SYSTEMD/shorewall6-lite.service
fi
rm -f ${SBINDIR}/shorewall6-lite
rm -rf ${CONFDIR}/shorewall6-lite
rm -rf ${VARDIR}/shorewall6-lite
rm -rf ${SHAREDIR}/shorewall6-lite
rm -rf ${LIBEXEC}/shorewall6-lite
rm -rf ${LIBEXECDIR}/shorewall6-lite
rm -f ${CONFDIR}/logrotate.d/shorewall6-lite
[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/shorewall6-lite.service
rm -f ${MANDIR}/man5/shorewall6-lite*
rm -f ${MANDIR}/man8/shorewall6-lite*
echo "Shorewall6 Lite Uninstalled"

View File

@@ -26,6 +26,8 @@ BLACKLIST_LOG_LEVEL=
INVALID_LOG_LEVEL=
LOG_BACKEND=
LOG_VERBOSITY=2
LOGALLNEW=
@@ -187,6 +189,8 @@ REQUIRE_INTERFACE=Yes
RESTORE_ROUTEMARKS=Yes
SAVE_IPSETS=No
TC_ENABLED=No
TC_EXPERT=No

View File

@@ -26,6 +26,8 @@ BLACKLIST_LOG_LEVEL=
INVALID_LOG_LEVEL=
LOG_BACKEND=
LOG_VERBOSITY=2
LOGALLNEW=
@@ -187,6 +189,8 @@ REQUIRE_INTERFACE=No
RESTORE_ROUTEMARKS=Yes
SAVE_IPSETS=No
TC_ENABLED=No
TC_EXPERT=No

View File

@@ -26,6 +26,8 @@ BLACKLIST_LOG_LEVEL=
INVALID_LOG_LEVEL=
LOG_BACKEND=
LOG_VERBOSITY=2
LOGALLNEW=
@@ -187,6 +189,8 @@ REQUIRE_INTERFACE=No
RESTORE_ROUTEMARKS=Yes
SAVE_IPSETS=No
TC_ENABLED=No
TC_EXPERT=No

View File

@@ -26,6 +26,8 @@ BLACKLIST_LOG_LEVEL=
INVALID_LOG_LEVEL=
LOG_BACKEND=
LOG_VERBOSITY=2
LOGALLNEW=
@@ -187,6 +189,8 @@ REQUIRE_INTERFACE=No
RESTORE_ROUTEMARKS=Yes
SAVE_IPSETS=No
TC_ENABLED=No
TC_EXPERT=No

View File

@@ -0,0 +1,11 @@
#
# Shorewall6 version 4 - Nat File
#
# For information about entries in this file, type "man shorewall6-nat"
#
# The manpage is also online at
# http://www.shorewall.net/manpages6/shorewall6-nat.html
#
###############################################################################
#EXTERNAL INTERFACE INTERNAL ALL LOCAL
# INTERFACES

View File

@@ -26,6 +26,8 @@ BLACKLIST_LOG_LEVEL=
INVALID_LOG_LEVEL=
LOG_BACKEND=
LOG_VERBOSITY=2
LOGALLNEW=
@@ -187,6 +189,8 @@ REQUIRE_INTERFACE=No
RESTORE_ROUTEMARKS=Yes
SAVE_IPSETS=No
TC_ENABLED=No
TC_EXPERT=No

View File

@@ -34,3 +34,14 @@ loadmodule nf_conntrack_proto_sctp
loadmodule nf_conntrack_sip
loadmodule nf_conntrack_tftp
loadmodule nf_conntrack_sane
#
# While not actually helpers, these are included here so that
# LOG_BACKEND can work correctly. Not all of them will be
# loaded, since at least one of them will be an alias on any
# given system.
#
loadmodule ip6t_LOG
loadmodule nf_log_ipv6
loadmodule xt_LOG
loadmodule xt_NFLOG
loadmodule nfnetlink_log

View File

@@ -39,7 +39,7 @@ fi
start() {
echo -n $"Starting Shorewall: "
$shorewall $OPTIONS start 2>&1 | $logger
$shorewall $OPTIONS start $STARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then
touch $lockfile
@@ -69,7 +69,7 @@ restart() {
# Note that we don't simply stop and start since shorewall has a built in
# restart which stops the firewall if running and then starts it.
echo -n $"Restarting Shorewall: "
$shorewall $OPTIONS restart 2>&1 | $logger
$shorewall $OPTIONS restart $RESTARTOPTIONS 2>&1 | $logger
retval=${PIPESTATUS[0]}
if [[ $retval == 0 ]]; then
touch $lockfile

View File

@@ -10,8 +10,9 @@
OPTIONS=""
# Use /etc/default shorewall6 to specify $OPTIONS to run at startup, however this
# this might prevent shorewall6 from starting. use at your own risk
# Use /etc/default shorewall6 to specify $OPTIONS and STARTOPTIONS to
# run at startup, however this this might prevent shorewall6 from
# starting. use at your own risk
if [ -f /etc/default/shorewall6 ] ; then
. /etc/default/shorewall6
fi
@@ -19,7 +20,7 @@ fi
start() {
echo "Starting IPv6 shorewall rules..."
exec /sbin/shorewall6 $OPTIONS start
exec /sbin/shorewall6 $OPTIONS start $STARTOPTIONS
}
stop() {
@@ -29,7 +30,7 @@ stop() {
restart() {
echo "Restarting IPv6 shorewall rules..."
exec /sbin/shorewall6 restart
exec /sbin/shorewall6 restart $RESTARTOPTIONS
}
status() {

View File

@@ -71,10 +71,18 @@
role="bold">mangle</emphasis> and <emphasis
role="bold">raw</emphasis>. If no table name(s) are given,
then <emphasis role="bold">filter</emphasis> is assumed. The
table names follow builtin and are separated by commas; for
example, "FOOBAR,filter,mangle" would specify FOOBAR as a
builtin target that can be used in the filter and mangle
table names follow <emphasis role="bold">builtin</emphasis>
and are separated by commas; for example, "FOOBAR
builtin,filter,mangle" would specify FOOBAR as a builtin
target that can be used in the filter and mangle
tables.</para>
<para>Beginning with Shorewall 4.6.4, you may specify the
<emphasis role="bold">terminating</emphasis> option with
<emphasis role="bold">builtin</emphasis> to indicate to the
Shorewall optimizer that the action is terminating (the
current packet will not be passed to the next rule in the
chain).</para>
</listitem>
</varlistentry>
@@ -133,6 +141,17 @@
a subset of the rules.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>terminating</term>
<listitem>
<para>Added in Shorewall 4.6.4. When used with
<replaceable>builtin</replaceable>, indicates that the
built-in action is termiating (i.e., if the action is jumped
to, the next rule in the chain is not evaluated).</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

View File

@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<refentry>
<refmeta>
<refentrytitle>shorewall6-nat</refentrytitle>
<manvolnum>5</manvolnum>
<refmiscinfo>Configuration Files</refmiscinfo>
</refmeta>
<refnamediv>
<refname>nat</refname>
<refpurpose>Shorewall6 one-to-one NAT file</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>/etc/shorewall6/nat</command>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>This file is used to define one-to-one Network Address Translation
(NAT).</para>
<warning>
<para>If all you want to do is simple port forwarding, do NOT use this
file. See <ulink
url="/FAQ.htm#faq1">http://www.shorewall.net/FAQ.htm#faq1</ulink>.
</para>
</warning>
<para>The columns in the file are as follows (where the column name is
followed by a different name in parentheses, the different name is used in
the alternate specification syntax).</para>
<variablelist>
<varlistentry>
<term><emphasis role="bold">EXTERNAL</emphasis> -
{<emphasis>address</emphasis>|[?]COMMENT}</term>
<listitem>
<para>External IP Address - this should NOT be the primary IP
address of the interface named in the next column and must not be a
DNS Name.</para>
<para>If you put COMMENT in this column, the rest of the line will
be attached as a comment to the Netfilter rule(s) generated by the
following entries in the file. The comment will appear delimited by
"/* ... */" in the output of "shorewall show nat"</para>
<para>To stop the comment from being attached to further rules,
simply include COMMENT on a line by itself.</para>
<note>
<para>Beginning with Shorewall 4.5.11, ?COMMENT is a synonym for
COMMENT and is preferred.</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">INTERFACE</emphasis> -
<emphasis>interfacelist</emphasis>[<emphasis
role="bold">:</emphasis>[<emphasis>digit</emphasis>]]</term>
<listitem>
<para>Interfaces that have the <emphasis
role="bold">EXTERNAL</emphasis> address. If ADD_IP_ALIASES=Yes in
<ulink
url="/manpages/shorewall.conf.html">shorewall6.conf</ulink>(5),
Shorewall will automatically add the EXTERNAL address to this
interface. Also if ADD_IP_ALIASES=Yes, you may follow the interface
name with ":" and a <emphasis>digit</emphasis> to indicate that you
want Shorewall to add the alias with this name (e.g., "eth0:0").
That allows you to see the alias with ifconfig. <emphasis
role="bold">That is the only thing that this name is good for -- you
cannot use it anywhere else in your Shorewall configuration.
</emphasis></para>
<para>Each interface must match an entry in <ulink
url="/manpages/shorewall6-interfaces.html">shorewall6-interfaces</ulink>(5).
Shorewall allows loose matches to wildcard entries in <ulink
url="/manpages/shorewall-interfaces.html">shorewall6-interfaces</ulink>(5).
For example, <filename class="devicefile">ppp0</filename> in this
file will match a <ulink
url="/manpages/shorewall6-interfaces.html">shorewall6-interfaces</ulink>(5)
entry that defines <filename
class="devicefile">ppp+</filename>.</para>
<para>If you want to override ADD_IP_ALIASES=Yes for a particular
entry, follow the interface name with ":" and no digit (e.g.,
"eth0:").</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">INTERNAL</emphasis> -
<emphasis>address</emphasis></term>
<listitem>
<para>Internal Address (must not be a DNS Name).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">ALL INTERFACES</emphasis> (allints) -
[<emphasis role="bold">Yes</emphasis>|<emphasis
role="bold">No</emphasis>]</term>
<listitem>
<para>If Yes or yes, NAT will be effective from all hosts. If No or
no (or left empty) then NAT will be effective only through the
interface named in the <emphasis role="bold">INTERFACE</emphasis>
column.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">LOCAL</emphasis> - [<emphasis
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
<listitem>
<para>If <emphasis role="bold">Yes</emphasis> or <emphasis
role="bold">yes</emphasis>, NAT will be effective from the firewall
system</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>FILES</title>
<para>/etc/shorewall6/nat</para>
</refsect1>
<refsect1>
<title>See ALSO</title>
<para><ulink
url="/NAT.htm">http://www.shorewall.net/NAT.htm</ulink></para>
<para><ulink
url="/configuration_file_basics.htm#Pairs">http://www.shorewall.net/configuration_file_basics.htm#Pairs</ulink></para>
</refsect1>
</refentry>

View File

@@ -242,13 +242,34 @@
<varlistentry>
<term><emphasis role="bold">BURST:LIMIT</emphasis> (limit) -
[{<emphasis>s</emphasis>|<emphasis
role="bold">d</emphasis>}:[[<replaceable>name</replaceable>]:]]]<emphasis>rate</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">second</emphasis>|<emphasis
role="bold">minute</emphasis>}[:<emphasis>burst</emphasis>]</term>
[-|<replaceable>limit</replaceable>]</term>
<listitem>
<para>where limit is one of:</para>
<simplelist>
<member>[<emphasis
role="bold">-</emphasis>|[{<emphasis>s</emphasis>|<emphasis
role="bold">d</emphasis>}:[[<replaceable>name</replaceable>]:]]]<emphasis>rate</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst</emphasis>]</member>
<member>[<replaceable>name</replaceable>1]:<emphasis>rate1</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst1</emphasis>],[<replaceable>name</replaceable>2]:<emphasis>rate2</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst2</emphasis>]</member>
</simplelist>
<para>If passed, specifies the maximum TCP connection
<emphasis>rate</emphasis> and the size of an acceptable
<emphasis>burst</emphasis>. If not specified, TCP connections are
@@ -261,9 +282,19 @@
the user and specifies a hash table to be used to count matching
connections. If not give, the name <emphasis
role="bold">shorewall</emphasis> is assumed. Where more than one
POLICY specifies the same name, the connections counts for the
policies are aggregated and the individual rates apply to the
POLICY or rule specifies the same name, the connections counts for
the policies are aggregated and the individual rates apply to the
aggregated count.</para>
<para>Beginning with Shorewall 4.6.5, two<replaceable>
limit</replaceable>s may be specified, separated by a comma. In this
case, the first limit (<replaceable>name1</replaceable>,
<replaceable>rate1</replaceable>, burst1) specifies the per-source
IP limit and the second limit specifies the per-destination IP
limit.</para>
<para>Example: <emphasis
role="bold">client:10/sec:20,:60/sec:100</emphasis></para>
</listitem>
</varlistentry>

View File

@@ -943,7 +943,7 @@
<para>Restriction: MAC addresses are not allowed (this is a
Netfilter restriction).</para>
<para>If you kernel and ip6tables have ipset match support then you
<para>If your kernel and ip6tables have ipset match support then you
may give the name of an ipset prefaced by "+". The ipset name may be
optionally followed by a number from 1 to 6 enclosed in square
brackets ([]) to indicate the number of levels of destination
@@ -1127,22 +1127,41 @@
</varlistentry>
<varlistentry>
<term><emphasis role="bold">RATE LIMIT</emphasis> (rate) - [<emphasis
role="bold">-</emphasis>|[{<emphasis>s</emphasis>|<emphasis
role="bold">d</emphasis>}:[[<replaceable>name</replaceable>]:]]]<emphasis>rate</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst</emphasis>]</term>
<term><emphasis role="bold">RATE LIMIT</emphasis> (rate) -
<replaceable>limit</replaceable></term>
<listitem>
<para>where <replaceable>limit</replaceable> is one of:</para>
<simplelist>
<member>[<emphasis
role="bold">-</emphasis>|[{<emphasis>s</emphasis>|<emphasis
role="bold">d</emphasis>}:[[<replaceable>name</replaceable>]:]]]<emphasis>rate</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst</emphasis>]</member>
<member>[<replaceable>name</replaceable>1]:<emphasis>rate1</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst1</emphasis>],[<replaceable>name</replaceable>2]:<emphasis>rate2</emphasis><emphasis
role="bold">/</emphasis>{<emphasis
role="bold">sec</emphasis>|<emphasis
role="bold">min</emphasis>|<emphasis
role="bold">hour</emphasis>|<emphasis
role="bold">day</emphasis>}[:<emphasis>burst2</emphasis>]</member>
</simplelist>
<para>You may optionally rate-limit the rule by placing a value in
this column:</para>
<para><emphasis>rate</emphasis> is the number of connections per
<para><emphasis>rate*</emphasis> is the number of connections per
interval (<emphasis role="bold">sec</emphasis> or <emphasis
role="bold">min</emphasis>) and <emphasis>burst</emphasis> is the
role="bold">min</emphasis>) and <emphasis>burst</emphasis>* is the
largest burst permitted. If no <emphasis>burst</emphasis> is given,
a value of 5 is assumed. There may be no no white-space embedded in
the specification.</para>
@@ -1151,13 +1170,28 @@
<para>When <option>s:</option> or <option>d:</option> is specified,
the rate applies per source IP address or per destination IP address
respectively. The <replaceable>name</replaceable> may be chosen by
the user and specifies a hash table to be used to count matching
respectively. The <replaceable>name</replaceable>s may be chosen by
the user and specifiy a hash table to be used to count matching
connections. If not given, the name <emphasis
role="bold">shorewallN</emphasis> (where N is a unique integer) is
assumed. Where more than one POLICY specifies the same name, the
connections counts for the rules are aggregated and the individual
rates apply to the aggregated count.</para>
assumed. Where more than one rule or POLICY specifies the same name,
the connections counts for the rules are aggregated and the
individual rates apply to the aggregated count.</para>
<para>Beginning with Shorewall 4.6.5, two<replaceable>
limit</replaceable>s may be specified, separated by a comma. In this
case, the first limit (<replaceable>name1</replaceable>,
<replaceable>rate1</replaceable>, burst1) specifies the per-source
IP limit and the second limit specifies the per-destination IP
limit.</para>
<para>Example: <emphasis
role="bold">client:10/sec:20,:60/sec:100</emphasis></para>
<para>In this example, the 'client' hash table will be used to
enforce the per-source limit and the compiler will pick a unique
name for the hash table that tracks the per-destination
limit.</para>
</listitem>
</varlistentry>

View File

@@ -220,9 +220,9 @@
<listitem>
<para>The value of this variable affects Shorewall's stopped state.
The behavior differs depending on whether <ulink
url="shorewall-routestopped.html">shorewall6-routestopped</ulink>(5)
url="shorewall-routestopped.html">shorewall-routestopped</ulink>(5)
or <ulink
url="shorewall-stoppedrules.html">shorewall6-stoppedrules</ulink>(5)
url="shorewall-stoppedrules.html">shorewall-stoppedrules</ulink>(5)
is used:</para>
<variablelist>
@@ -245,17 +245,22 @@
<term>stoppedrules</term>
<listitem>
<para>If ADMINISABSENTMINDED=No, a warning message is issued
and the setting is ignored.</para>
<para>In addition to connections matching entries in
<filename>stoppedrules</filename>, existing connections
continue to work and all new connections from the firewall
system itself are allowed. To sever all existing connections
when the firewall is stopped, install the conntrack utility
and place the command <command>conntrack -F</command> in the
stopped user exit
<para>All existing connections continue to work. To sever all
existing connections when the firewall is stopped, install the
conntrack utility and place the command <command>conntrack
-F</command> in the stopped user exit
(<filename>/etc/shorewall6/stopped</filename>).</para>
<para>If ADMINISABSENTMINDED=No, only new connections matching
entries in <filename>stoppedrules</filename> are accepted when
Shorewall is stopped. Response packets and related connections
are automatically accepted.</para>
<para>If ADMINISABSENTMINDED=Yes, in addition to connections
matching entries in <filename>stoppedrules</filename>, all new
connections from the firewall system itself are allowed when
the firewall is stopped. Response packets and related
connections are automatically accepted.</para>
</listitem>
</varlistentry>
</variablelist>
@@ -1157,6 +1162,38 @@ net all DROP info</programlisting>then the chain name is 'net-all'
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">LOG_BACKEND=</emphasis>[<emphasis>backend</emphasis>]</term>
<listitem>
<para>Added in Shorewall 4.6.4. LOG_BACKEND determines the logging
backend to be used for the <command>iptrace</command> command (see
<ulink
url="manpages6/shorewall6.html">shorewall6(8)</ulink>).</para>
<para><replaceable>backend</replaceable> is one of:</para>
<variablelist>
<varlistentry>
<term>LOG</term>
<listitem>
<para>Use standard kernel logging.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>netlink</term>
<listitem>
<para>Use netlink logging to ulogd version 2 or later.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">LOG_VERBOSITY=</emphasis>[<emphasis>number</emphasis>]</term>
@@ -2085,6 +2122,25 @@ INLINE - - - ; -j REJECT
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">SAVE_IPSETS=</emphasis>{<emphasis
role="bold">Yes</emphasis>|<emphasis
role="bold">No|<replaceable>setlist</replaceable></emphasis>}</term>
<listitem>
<para>Re-enabled in Shorewall 4.4.6. If SAVE_IPSETS=Yes, then the
current contents of your ipsets will be saved by the <emphasis
role="bold">shorewall stop</emphasis> and <emphasis
role="bold">shorewall save</emphasis> commands and restored by the
<emphasis role="bold">shorewall start</emphasis> and <emphasis
role="bold">shorewall restore</emphasis> commands.</para>
<para>Beginning with Shorewall 4.6.4, you can restrict the set of
ipsets saved by specifying a setlist (a comma-separated list of ipv6
ipset names).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">SHOREWALL_SHELL=</emphasis>[<emphasis>pathname</emphasis>]</term>

View File

@@ -308,6 +308,18 @@
expression</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>shorewall6</command>
<arg
choice="opt"><option>trace</option>|<option>debug</option><arg><option>nolock</option></arg></arg>
<arg>-<replaceable>options</replaceable></arg>
<arg
choice="plain"><option>recover</option><arg><option>-n</option></arg><arg><option>-p</option></arg></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>shorewall6</command>
@@ -388,7 +400,7 @@
<arg><option>-T</option></arg>
<arg><option>-i</option></arg>
<arg><option>-i</option><arg><option>-C</option></arg></arg>
<arg><replaceable>directory</replaceable></arg>
</cmdsynopsis>
@@ -401,7 +413,8 @@
<arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>restore</option></arg>
<arg
choice="plain"><option>restore</option><arg><option>-C</option></arg></arg>
<arg><replaceable>filename</replaceable></arg>
</cmdsynopsis>
@@ -416,7 +429,7 @@
<arg choice="plain"><option>run</option></arg>
<arg choice="plain">function</arg>
<arg choice="plain"><replaceable>command</replaceable></arg>
<arg><replaceable>parameter ...</replaceable></arg>
</cmdsynopsis>
@@ -462,7 +475,8 @@
<arg>-<replaceable>options</replaceable></arg>
<arg choice="plain"><option>save</option></arg>
<arg
choice="plain"><option>save</option><arg><option>-C</option></arg></arg>
<arg choice="opt"><replaceable>filename</replaceable></arg>
</cmdsynopsis>
@@ -587,7 +601,7 @@
<arg><option>-T</option></arg>
<arg><option>-i</option></arg>
<arg><option>-i</option><arg><option>-C</option></arg></arg>
<arg><replaceable>directory</replaceable></arg>
</cmdsynopsis>
@@ -685,7 +699,7 @@
used for debugging. See <ulink
url="/starting_and_stopping_shorewall.htm#Trace">http://www.shorewall.net/starting_and_stopping_shorewall.htm#Trace</ulink>.</para>
<para>The nolock <option>option</option> prevents the command from
<para>The <option>nolock</option> option prevents the command from
attempting to acquire the Shorewall6 lockfile. It is useful if you need to
include <command>shorewall6</command> commands in
<filename>/etc/shorewall6/started</filename>.</para>
@@ -765,12 +779,13 @@
<para>Compiles the configuration in the specified
<emphasis>directory</emphasis> and discards the compiled output
script. If no <emphasis>directory</emphasis> is given, then
/etc/shorewall6 is assumed.</para>
<filename class="directory">/etc/shorewall6</filename> is
assumed.</para>
<para>The <emphasis role="bold">-e</emphasis> option causes the
<para>The <option>-e</option> option causes the
compiler to look for a file named capabilities. This file is
produced using the command <emphasis role="bold">shorewall6-lite
show -f capabilities &gt; capabilities</emphasis> on a system with
produced using the command <command>shorewall6-lite
show -f capabilities &gt; capabilities</command> on a system with
Shorewall6 Lite installed.</para>
<para>The <option>-d</option> option causes the compiler to be run
@@ -788,8 +803,8 @@
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
@@ -824,17 +839,17 @@
compile -- -</command>) to suppress the 'Compiling...' message
normally generated by <filename>/sbin/shorewall6</filename>.</para>
<para>When -e is specified, the compilation is being performed on a
system other than where the compiled script will run. This option
disables certain configuration options that require the script to be
compiled where it is to be run. The use of -e requires the presence
of a configuration file named <filename>capabilities</filename>
which may be produced using the command <emphasis
role="bold">shorewall6-lite show -f capabilities &gt;
capabilities</emphasis> on a system with Shorewall6 Lite
<para>When <option>-e</option> is specified, the compilation is
being performed on a system other than where the compiled script will
run. This option disables certain configuration options that require
the script to be compiled where it is to be run. The use of
<option>-e</option> requires the presence of a configuration file named
<filename>capabilities</filename> which may be produced using the
command <command>shorewall6-lite show -f capabilities &gt;
capabilities</command> on a system with Shorewall6 Lite
installed.</para>
<para>The <emphasis role="bold">-c</emphasis> option was added in
<para>The <option>-c</option> option was added in
Shorewall 4.5.17 and causes conditional compilation of a script. The
script specified by <replaceable>pathname</replaceable> (or implied
if <emphasis role="bold">pathname</emphasis> is omitted) is compiled
@@ -855,8 +870,8 @@
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
@@ -924,13 +939,14 @@
<para>Produces a verbose report about the firewall configuration for
the purpose of problem analysis.</para>
<para>The <emphasis role="bold">-x</emphasis> option causes actual
<para>The <option>-x</option> option causes actual
packet and byte counts to be displayed. Without that option, these
counts are abbreviated. The <emphasis role="bold">-m</emphasis>
option causes any MAC addresses included in Shorewall6 log messages
to be displayed.</para>
counts are abbreviated.</para>
<para>The <emphasis role="bold">-l</emphasis> option causes the rule
<para>The <option>-m</option> option causes any MAC addresses
included in Shorewall6 log messages to be displayed.</para>
<para>The <option>-l</option> option causes the rule
number for each Netfilter rule to be displayed.</para>
</listitem>
</varlistentry>
@@ -984,8 +1000,9 @@
<term><emphasis role="bold">forget</emphasis></term>
<listitem>
<para>Deletes /var/lib/shorewall6/<emphasis>filename</emphasis> and
/var/lib/shorewall6/save. If no <emphasis>filename</emphasis> is
<para>Deletes <filename>/var/lib/shorewall6/<replaceable>filename
</replaceable></filename> and <filename>/var/lib/shorewall6/save
</filename>. If no <emphasis>filename</emphasis> is
given then the file specified by RESTOREFILE in <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5) is
assumed.</para>
@@ -1012,11 +1029,10 @@
be one or more matches that may appear in both the raw table OUTPUT
and raw table PREROUTING chains.</para>
<para>The trace records are written to the kernel's log buffer with
facility = kernel and priority = warning, and they are routed from
there by your logging daemon (syslogd, rsyslog, syslog-ng, ...) --
Shorewall has no control over where the messages go; consult your
logging daemon's documentation.</para>
<para>The log message destination is determined by the
currently-selected IPv6 <ulink
url="/shorewall_logging.html#Backends">logging
backend</ulink>.</para>
</listitem>
</varlistentry>
@@ -1046,14 +1062,14 @@
Shorewall6 Lite on <replaceable>system</replaceable> is started via
ssh.</para>
<para>If <emphasis role="bold">-s</emphasis> is specified and the
<para>If <option>-s</option> is specified and the
<emphasis role="bold">start</emphasis> command succeeds, then the
remote Shorewall6-lite configuration is saved by executing <emphasis
role="bold">shorewall6-lite save</emphasis> via ssh.</para>
remote Shorewall6-lite configuration is saved by executing
<command>shorewall6-lite save</command> via ssh.</para>
<para>if <emphasis role="bold">-c</emphasis> is included, the
command <emphasis role="bold">shorewall6-lite show capabilities -f
&gt; /var/lib/shorewall6-lite/capabilities</emphasis> is executed
<para>if <option>-c</option> is included, the
command <command>shorewall6-lite show capabilities -f
&gt; /var/lib/shorewall6-lite/capabilities</command> is executed
via ssh then the generated file is copied to
<replaceable>directory</replaceable> using scp. This step is
performed before the configuration is compiled.</para>
@@ -1066,8 +1082,8 @@
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
@@ -1095,7 +1111,7 @@
<ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5) and
produces an audible alarm when new Shorewall6 messages are logged.
The <emphasis role="bold">-m</emphasis> option causes the MAC
The <option>-m</option> option causes the MAC
address of each packet source to be displayed if that information is
available. The <replaceable>refresh-interval</replaceable> specifies
the time in seconds between screen refreshes. You can enter a
@@ -1139,11 +1155,11 @@
performed by <command>refresh</command> with the exception that
<command>refresh</command> only recreates the chains specified in
the command while <command>restart</command> recreates the entire
Netfilter ruleset.When no chain name is given to the <emphasis
role="bold">refresh</emphasis> command, the mangle table is
Netfilter ruleset.When no chain name is given to the
<command>refresh</command> command, the mangle table is
refreshed along with the blacklist chain (if any). This allows you
to modify <filename>/etc/shorewall6/tcrules</filename>and install
the changes using <emphasis role="bold">refresh</emphasis>.</para>
the changes using <command>refresh</command>.</para>
<para>The listed chains are assumed to be in the filter table. You
can refresh chains in other tables by prefixing the chain name with
@@ -1155,15 +1171,15 @@
<para>The <option>-n</option> option was added in Shorewall 4.5.3
causes Shorewall to avoid updating the routing table(s).</para>
<para>The <option>-d </option>option was added in Shorewall 4.5.3
<para>The <option>-d</option> option was added in Shorewall 4.5.3
causes the compiler to run under the Perl debugger.</para>
<para>The <option>-T</option> option was added in Shorewall 4.5.3
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
@@ -1173,7 +1189,12 @@
and causes Shorewall to look in the given
<emphasis>directory</emphasis> first for configuration files.</para>
<para>Example:<programlisting><command>shorewall6 refresh net2fw nat:net_dnat</command> #Refresh the 'net2loc' chain in the filter table and the 'net_dnat' chain in the nat table</programlisting></para>
<example>
<title>Refresh the 'net-fw' chain in the filter table and the
'net_dnat' chain in the nat table</title>
<programlisting><command>shorewall6 refresh net-fw nat:net_dnat
</command></programlisting>
</example>
</listitem>
</varlistentry>
@@ -1203,14 +1224,14 @@
Shorewall6 Lite on <emphasis>system</emphasis> is restarted via
ssh.</para>
<para>If <emphasis role="bold">-s</emphasis> is specified and the
<emphasis role="bold">restart</emphasis> command succeeds, then the
remote Shorewall6-lite configuration is saved by executing <emphasis
role="bold">shorewall6-lite save</emphasis> via ssh.</para>
<para>If <option>-s</option> is specified and the
<command>restart</command> command succeeds, then the
remote Shorewall6-lite configuration is saved by executing
<command>shorewall6-lite save</command> via ssh.</para>
<para>if <emphasis role="bold">-c</emphasis> is included, the
command <emphasis role="bold">shorewall6-lite show capabilities -f
&gt; /var/lib/shorewall6-lite/capabilities</emphasis> is executed
<para>if <option>-c</option> is included, the
command <command>shorewall6-lite show capabilities -f
&gt; /var/lib/shorewall6-lite/capabilities</command> is executed
via ssh then the generated file is copied to
<emphasis>directory</emphasis> using scp. This step is performed
before the configuration is compiled.</para>
@@ -1223,8 +1244,8 @@
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
@@ -1248,8 +1269,8 @@
<term><emphasis role="bold">restart</emphasis></term>
<listitem>
<para>Restart is similar to <emphasis role="bold">shorewall6
start</emphasis> except that it assumes that the firewall is already
<para>Restart is similar to <command>shorewall6
start</command> except that it assumes that the firewall is already
started. Existing connections are maintained. If a
<emphasis>directory</emphasis> is included in the command,
Shorewall6 will look in that <emphasis>directory</emphasis> first
@@ -1262,31 +1283,40 @@
table to be flushed; the <command>conntrack</command> utility must
be installed to use this option.</para>
<para>The <option>-d </option>option causes the compiler to run
<para>The <option>-d</option> option causes the compiler to run
under the Perl debugger.</para>
<para>The <option>-f</option> option suppresses the compilation step
and simply reused the compiled script which last started/restarted
Shorewall, provided that /etc/shorewall6 and its contents have not
Shorewall, provided that <filename class="directory">/etc/shorewall6
</filename> and its contents have not
been modified since the last start/restart.</para>
<para>The <option>-c</option> option was added in Shorewall 4.4.20
and performs the compilation step unconditionally, overriding the
AUTOMAKE setting in <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).
When both <option>-f</option> and <option>-c </option>are present,
When both <option>-f</option> and <option>-c</option> are present,
the result is determined by the option that appears last.</para>
<para>The <option>-T</option> option was added in Shorewall 4.5.3
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).</para>
<para>The <option>-C</option> option was added in Shorewall 4.6.5
and is only meaningful when AUTOMAKE=Yes in <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5). If
an existing firewall script is used and if that script was the one
that generated the current running configuration, then the running
netfilter configuration will be reloaded as is so as to preserve the
iptables packet and byte counters.</para>
</listitem>
</varlistentry>
@@ -1294,14 +1324,27 @@
<term><emphasis role="bold">restore</emphasis></term>
<listitem>
<para>Restore Shorewall6 to a state saved using the <emphasis
role="bold">shorewall6 save</emphasis> command. Existing connections
<para>Restore Shorewall6 to a state saved using the
<command>shorewall6 save</command> command. Existing connections
are maintained. The <emphasis>filename</emphasis> names a restore
file in /var/lib/shorewall6 created using <emphasis
role="bold">shorewall6 save</emphasis>; if no
<emphasis>filename</emphasis> is given then Shorewall6 will be
file in <filename class="directory">/var/lib/shorewall6</filename>
created using <command>shorewall6 save</command>;
if no <emphasis>filename</emphasis> is given then Shorewall6 will be
restored from the file specified by the RESTOREFILE option in <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).</para>
<caution>
<para>If your ip6tables ruleset depends on variables that are
detected at run-time, either in your params file or by
Shorewall-generated code, <command>restore</command> will use the
values that were current when the ruleset was saved, which may be
different from the current values.</para>
</caution>
<para>The <option>-C</option> option was added in Shorewall 4.6.5.
If the <option>-C</option> option was specified during
<command>shorewall6 save</command>, then the counters saved by
that operation will be restored.</para>
</listitem>
</varlistentry>
@@ -1323,12 +1366,9 @@
<para>If there are files in the CONFIG_PATH that were modified after
the current firewall script was generated, the following warning
message is issued before the script's run command is
executed:</para>
<simplelist>
<member>WARNING: /var/lib/shorewall6/firewall is not up to
date</member>
</simplelist>
executed:
<screen>WARNING: /var/lib/shorewall6/firewall is not up to
date</screen></para>
</listitem>
</varlistentry>
@@ -1337,9 +1377,10 @@
<listitem>
<para>Only allowed if Shorewall6 is running. The current
configuration is saved in /var/lib/shorewall6/safe-restart (see the
save command below) then a <emphasis role="bold">shorewall6
restart</emphasis> is done. You will then be prompted asking if you
configuration is saved in <filename>/var/lib/shorewall6/safe-restart
</filename> (see the <emphasis role="bold">save</emphasis>
command below) then a <command>shorewall6 restart</command> is
done. You will then be prompted asking if you
want to accept the new configuration or not. If you answer "n" or if
you fail to answer within 60 seconds (such as when your new
configuration has disabled communication with your terminal), the
@@ -1383,14 +1424,19 @@
<term><emphasis role="bold">save</emphasis></term>
<listitem>
<para>The dynamic blacklist is stored in /var/lib/shorewall6/save.
The state of the firewall is stored in
/var/lib/shorewall6/<emphasis>filename</emphasis> for use by the
<emphasis role="bold">shorewall6 restore</emphasis> and <emphasis
role="bold">shorewall6 -f start</emphasis> commands. If
<emphasis>filename</emphasis> is not given then the state is saved
in the file specified by the RESTOREFILE option in <ulink
<para>The dynamic blacklist is stored in <filename>
/var/lib/shorewall6/save</filename>.
The state of the firewall is stored in <filename>
/var/lib/shorewall6/<replaceable>filename</replaceable></filename>
for use by the <command>shorewall6 restore</command> and <command>
shorewall6 -f start</command> commands. If <emphasis>filename
</emphasis> is not given then the state is saved in the file
specified by the RESTOREFILE option in <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).</para>
<para>The <option>-C</option> option, added in Shorewall 4.6.5,
causes the ip6tables packet and byte counters to be saved along with
the chains and rules.</para>
</listitem>
</varlistentry>
@@ -1417,7 +1463,7 @@
<listitem>
<para>Added in Shorewall 4.6.2. Displays the dynamic chain
along with any chains produced by entries in
shorewall-blrules(5).The <emphasis role="bold">-x</emphasis>
shorewall-blrules(5).The <option>-x</option>
option is passed directly through to ip6tables and causes
actual packet and byte counts to be displayed. Without this
option, those counts are abbreviated.</para>
@@ -1429,9 +1475,9 @@
<listitem>
<para>Displays your kernel/ip6tables capabilities. The
<emphasis role="bold">-f</emphasis> option causes the display
to be formatted as a capabilities file for use with <emphasis
role="bold">compile -e</emphasis>.</para>
<option>-f</option> option causes the display
to be formatted as a capabilities file for use with
<command>shorewall6 compile -e</command>.</para>
</listitem>
</varlistentry>
@@ -1441,29 +1487,29 @@
<listitem>
<para>The rules in each <emphasis>chain</emphasis> are
displayed using the <emphasis role="bold">ip6tables
-L</emphasis> <emphasis>chain</emphasis> <emphasis
displayed using the <command>ip6tables
-L</command> <emphasis>chain</emphasis> <emphasis
role="bold">-n -v</emphasis> command. If no
<emphasis>chain</emphasis> is given, all of the chains in the
filter table are displayed. The <emphasis
role="bold">-x</emphasis> option is passed directly through to
ip6tables and causes actual packet and byte counts to be
displayed. Without this option, those counts are abbreviated.
The <emphasis role="bold">-t</emphasis> option specifies the
filter table are displayed. The <option>-x</option> option is
passed directly through to ip6tables and causes actual packet
and byte counts to be displayed. Without this option, those
counts are abbreviated.
The <option>-t</option> option specifies the
Netfilter table to display. The default is <emphasis
role="bold">filter</emphasis>.</para>
<para>The <emphasis role="bold">-b</emphasis> ('brief') option
<para>The <option>-b</option> ('brief') option
causes rules which have not been used (i.e. which have zero
packet and byte counts) to be omitted from the output. Chains
with no rules displayed are also omitted from the
output.</para>
<para>The <emphasis role="bold">-l</emphasis> option causes
<para>The <option>-l</option> option causes
the rule number for each Netfilter rule to be
displayed.</para>
<para>If the <emphasis role="bold">-t</emphasis> option and
<para>If the <option>-t</option> option and
the <option>chain</option> keyword are both omitted and any of
the listed <replaceable>chain</replaceable>s do not exist, a
usage message is displayed.</para>
@@ -1531,7 +1577,7 @@
<para>Displays the last 20 Shorewall6 messages from the log
file specified by the LOGFILE option in <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).
The <emphasis role="bold">-m</emphasis> option causes the MAC
The <option>-m</option> option causes the MAC
address of each packet source to be displayed if that
information is available.</para>
</listitem>
@@ -1551,8 +1597,8 @@
<listitem>
<para>Displays the Netfilter mangle table using the command
<emphasis role="bold">ip6tables -t mangle -L -n
-v</emphasis>.The <emphasis role="bold">-x</emphasis> option
<command>ip6tables -t mangle -L -n
-v</command>.The <option>-x</option> option
is passed directly through to ip6tables and causes actual
packet and byte counts to be displayed. Without this option,
those counts are abbreviated.</para>
@@ -1619,22 +1665,24 @@
only if they are allowed by the firewall rules or policies. If a
<replaceable>directory</replaceable> is included in the command,
Shorewall6 will look in that <emphasis>directory</emphasis> first
for configuration files. If <emphasis role="bold">-f</emphasis> is
for configuration files. If <option>-f</option> is
specified, the saved configuration specified by the RESTOREFILE
option in <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5)
will be restored if that saved configuration exists and has been
modified more recently than the files in /etc/shorewall6. When
<emphasis role="bold">-f</emphasis> is given, a
<replaceable>directory</replaceable> may not be specified.</para>
modified more recently than the files in <filename
class="directory">/etc/shorewall6</filename>. When <option>-f
</option> is given, a <replaceable>directory</replaceable> may
not be specified.</para>
<para>Update: In Shorewall6 4.4.20, a new LEGACY_FASTSTART option
was added to <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).
When LEGACY_FASTSTART=No, the modification times of files in
/etc/shorewall6 are compared with that of
/var/lib/shorewall6/firewall (the compiled script that last
started/restarted the firewall).</para>
<filename class="directory">/etc/shorewall6</filename> are
compared with that of <filename>/var/lib/shorewall6/firewall
</filename> (the compiled script that last started/restarted the
firewall).</para>
<para>The <option>-n</option> option causes Shorewall6 to avoid
updating the routing table(s).</para>
@@ -1643,19 +1691,26 @@
and performs the compilation step unconditionally, overriding the
AUTOMAKE setting in <ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).
When both <option>-f</option> and <option>-c </option>are present,
When both <option>-f</option> and <option>-c</option> are present,
the result is determined by the option that appears last.</para>
<para>The <option>-T</option> option was added in Shorewall 4.5.3
and causes a Perl stack trace to be included with each
compiler-generated error and warning message.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink
url="/manpages6/shorewall6.conf.html">shorewall6.conf</ulink>(5).</para>
<para>The <option>-C</option> option was added in Shorewall 4.6.5
and is only meaningful when the <option>-f</option> option is also
specified. If the previously-saved configuration is restored, and if
the <option>-C</option> option was also specified in the
<command>save</command> command, then the packet and byte
counters will be restored along with the chains and rules.</para>
</listitem>
</varlistentry>
@@ -1682,7 +1737,7 @@
<para>Produces a short report about the state of the
Shorewall6-configured firewall.</para>
<para>The <option>-i </option>option was added in Shorewall 4.6.2
<para>The <option>-i</option> option was added in Shorewall 4.6.2
and causes the status of each optional or provider interface to be
displayed.</para>
</listitem>
@@ -1701,19 +1756,18 @@
role="bold">start</emphasis> command is performed using the
specified configuration <replaceable>directory</replaceable>. if an
error occurs during the compilation phase of the <emphasis
role="bold">restart</emphasis> or <emphasis
role="bold">start</emphasis>, the command terminates without
changing the Shorewall6 state. If an error occurs during the
<emphasis role="bold">restart</emphasis> phase, then a <emphasis
role="bold">shorewall6 restore</emphasis> is performed using the
saved configuration. If an error occurs during the <emphasis
role="bold">start</emphasis> phase, then Shorewall6 is cleared. If
the <emphasis role="bold">start</emphasis>/<emphasis
role="bold">restart</emphasis> succeeds and a
role="bold">restart</emphasis> or <emphasis role="bold">start
</emphasis>, the command terminates without changing the Shorewall6
state. If an error occurs during the <emphasis role="bold">restart
</emphasis> phase, then a <command>shorewall6 restore</command> is
performed using the saved configuration. If an error occurs during
the <emphasis role="bold">start</emphasis> phase, then Shorewall6
is cleared. If the <emphasis role="bold">start</emphasis>/
<emphasis role="bold">restart</emphasis> succeeds and a
<replaceable>timeout</replaceable> is specified then a <emphasis
role="bold">clear</emphasis> or <emphasis
role="bold">restore</emphasis> is performed after
<replaceable>timeout</replaceable> seconds.</para>
role="bold">clear</emphasis> or <emphasis role="bold">restore
</emphasis> is performed after <replaceable>timeout</replaceable>
seconds.</para>
<para>Beginning with Shorewall 4.5.0, the numeric
<replaceable>timeout</replaceable> may optionally be followed by an
@@ -1734,7 +1788,7 @@
options with non-defaults to a deprecated options section at the
bottom of the file. Your existing
<filename>shorewall6.conf</filename> file is renamed
<filename>shorewall6.conf.bak.</filename></para>
<filename>shorewall6.conf.bak</filename>.</para>
<para>The <option>-a</option> option causes the updated
<filename>shorewall6.conf</filename> file to be annotated with
@@ -1760,8 +1814,8 @@
updated, the original is saved in a .bak file in the same
directory.</para>
<para>The -i option was added in Shorewall 4.6.0 and causes a
warning message to be issued if the line current line contains
<para>The <option>-i</option> option was added in Shorewall 4.6.0
and causes a warning message to be issued if the line current line contains
alternative input specifications following a semicolon (";"). Such
lines will be handled incorrectly if INLINE_MATCHES is set to Yes in
<ulink

View File

@@ -24,4 +24,3 @@ loadmodule nf_conntrack_ipv6
loadmodule xt_state
loadmodule xt_tcpudp
loadmodule ip6t_REJECT
loadmodule ip6t_LOG

View File

@@ -30,7 +30,6 @@ loadmodule xt_mac
loadmodule xt_mark
loadmodule xt_MARK
loadmodule xt_multiport
loadmodule xt_NFLOG
loadmodule xt_NFQUEUE
loadmodule xt_owner
loadmodule xt_physdev

View File

@@ -1,20 +1,20 @@
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.4
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
#
# Copyright 2011 Jonathan Underwood (jonathan.underwood@gmail.com)
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
#
[Unit]
Description=Shorewall IPv6 firewall
After=syslog.target
After=network.target
Conflicts=ip6tables.service firewalld.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall6
StandardOutput=syslog
ExecStart=/sbin/shorewall6 $OPTIONS start
ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall6 $OPTIONS stop
[Install]
WantedBy=multi-user.target
WantedBy=basic.target

View File

@@ -0,0 +1,20 @@
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall
#
# Copyright 2011 Jonathan Underwood <jonathan.underwood@gmail.com>
#
[Unit]
Description=Shorewall IPv6 firewall
After=network-online.target
Conflicts=ip6tables.service firewalld.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall6
StandardOutput=syslog
ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall6 $OPTIONS stop
[Install]
WantedBy=basic.target

View File

@@ -27,6 +27,7 @@
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=xxx #The Build script inserts the actual version
PRODUCT=shorewall6
usage() # $1 = exit status
{
@@ -69,6 +70,43 @@ remove_file() # $1 = file to restore
fi
}
finished=0
configure=1
while [ $finished -eq 0 ]; do
option=$1
case "$option" in
-*)
option=${option#-}
while [ -n "$option" ]; do
case $option in
h)
usage 0
;;
v)
echo "$Product Firewall Installer Version $VERSION"
exit 0
;;
n*)
configure=0
option=${option#n}
;;
*)
usage 1
;;
esac
done
shift
;;
*)
finished=1
;;
esac
done
#
# Read the RC file
#
@@ -112,8 +150,12 @@ fi
echo "Uninstalling shorewall6 $VERSION"
if qt ip6tables -L shorewall6 -n && [ ! -f ${SBINDIR}/shorewall6-lite ]; then
${SBINDIR}/shorewall6 clear
[ -n "$SANDBOX" ] && configure=0
if [ $configure -eq 1 ]; then
if qt ip6tables -L shorewall6 -n && [ ! -f ${SBINDIR}/shorewall6-lite ]; then
${SBINDIR}/shorewall6 clear
fi
fi
if [ -L ${SHAREDIR}/shorewall6/init ]; then
@@ -123,23 +165,28 @@ elif [ -n "$INITFILE" ]; then
fi
if [ -f "$FIREWALL" ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall6 remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
elif mywhich systemctl ; then
systemctl disable shorewall6
if [ $configure -eq 1 ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall6 remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
fi
fi
remove_file $FIREWALL
fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
rm -f $SYSTEMD/shorewall6.service
fi
rm -f ${SBINDIR}/shorewall6
rm -rf ${CONFDIR}/shorewall6
rm -rf ${VARDIR}/shorewall6
rm -rf ${LIBEXEC}/shorewall6
rm -rf ${LIBEXECDIR}/shorewall6
rm -rf ${SHAREDIR}/shorewall6
for f in ${MANDIR}/man5/shorewall6* ${SHAREDIR}/man/man8/shorewall6*; do

View File

@@ -612,4 +612,102 @@ gateway:~#
<para>The <command>shorewall show nfacct</command> command is a thin
wrapper around the <command>nfacct list</command> command.</para>
</section>
<section>
<title>Preserving Counters over Restart and Reboot</title>
<para>Beginning with Shorewall 4.6.5, it is possible to preserve
<emphasis>all</emphasis> ip[6]tables packet and byte counters over
restarts and reboots through use of the <option>-C</option> option. This
option is available in several commands.</para>
<variablelist>
<varlistentry>
<term>save</term>
<listitem>
<para> Causes the packet and byte counters to be saved along with
the chains and rules.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>restore</term>
<listitem>
<para>Causes the packet and byte counters (if saved) to be restored
along with the chains and rules. </para>
<caution>
<para>If your iptables ruleset depends on variables that are
detected at run-time, either in your params file or by
Shorewall-generated code, <command>restore</command> will use the
values that were detected when the ruleset was saved, which may be
different from the current values.</para>
</caution>
</listitem>
</varlistentry>
<varlistentry>
<term>start</term>
<listitem>
<para>With Shorewall and Shorewall6, the -C option only has an
effect if the <option>-f </option>option is also specified. If a
previously-saved configuration is restored, then the packet and byte
counters (if saved) will be restored along with the chains and
rules. </para>
<caution>
<para>If your iptables ruleset depends on variables that are
detected at run-time, either in your params file or by
Shorewall-generated code, <option>-C</option> will use the values
that were detected when the ruleset was saved, which may be
different from the current values.</para>
</caution>
</listitem>
</varlistentry>
<varlistentry>
<term>restart</term>
<listitem>
<para>If an existing compiled script is used (no recompilation
required) and if that script generated the current running
configuration, then the current netfilter configuration is reloaded
as is so as to preserve the current packet and byte counters.</para>
<caution>
<para>If your iptables ruleset depends on variables that are
detected at run-time, either in your params file or by
Shorewall-generated code, <option>-C</option> will use the values
that were detected when the ruleset was previously started, which
may be different from the current values.</para>
</caution>
</listitem>
</varlistentry>
</variablelist>
<para> If you wish to (approximately) preserve the counters over a
possibly unexpected reboot, then: </para>
<itemizedlist>
<listitem>
<para>Create a cron job that periodically executes 'shorewall save
<option>-C</option>'.</para>
</listitem>
<listitem>
<para>Specify the<option> -C</option> and <option>-f</option> options
in the STARTOPTIONS variable in either
<filename>/etc/default/shorewall</filename> (
<filename>/etc/default/shorewall6</filename>, etc.) or
<filename>/etc/sysconfig/shorewall</filename>
(<filename>/etc/sysconfig/shorewall</filename>6, etc.), whichever is
supported by your distribution. Note that not all distributions
include these files so you may have to create the one(s) you
need.</para>
</listitem>
</itemizedlist>
</section>
</article>

View File

@@ -705,8 +705,9 @@ Knock net $FW tcp 22,1599-1601
<section id="Stateful">
<title>Stateful Port Knocking (knock with a sequence of ports)</title>
<para>Gerhard Wiesinger has contributed a Perl module that allows you to
define portknocking sequences. Download <ulink
<para><ulink url="http://www.wiesinger.com/">Gerhard Wiesinger</ulink>
has contributed a Perl module that allows you to define portknocking
sequences. Download <ulink
url="pub/shorewall/contrib/PortKnocking/KnockEnhanced.pm">the
module</ulink> and copy it into your site_perl directory.</para>

View File

@@ -2309,10 +2309,26 @@ gateway:~# </programlisting>
<title>(FAQ 103) Shorewall fails to start at boot but will start
immediately after</title>
<para>Answer: This is usually associated with SELinux. <ulink
<para><emphasis role="bold">Answer:</emphasis> This is usually
associated with SELinux. <ulink
url="https://lists.fedoraproject.org/pipermail/selinux/2010-June/012680.html">Here</ulink>
is an example.</para>
</section>
<section id="faq104">
<title>(FAQ 104) I see <emphasis>kernel</emphasis> messages in my log
when I start or restart Shorewall or Shorewall6</title>
<para>Example: </para>
<programlisting>&gt; Oct 1 13:04:39 deb kernel: [ 9570.619744] xt_addrtype: ipv6 does not support BROADCAST matching
</programlisting>
<para><emphasis role="bold">Answer:</emphasis> These are harmless.
Shorewall attempts to execute various commands to determine the
capabiities of your system. If you system doesn't support a command, it
will generally issue a kernel log message.</para>
</section>
</section>
<section id="MultiISP">

View File

@@ -683,6 +683,56 @@
<programlisting><command>./configure --vendor=redhat --systemd=</command></programlisting>
</section>
<section>
<title>Install for Packaging.</title>
<para>If you build your own packages, then you will want to install
the Shorewall products into it's own directory tree. This is done by
adding DESTDIR to the installer's environment. For example, to install
a product for Debian into the /tmp/package directory:</para>
<programlisting>DESTDIR=/tmp/package ./install.sh shorewallrc.debian</programlisting>
</section>
<section>
<title>Install into a Sandbox</title>
<para>When DESTDIR is used, the resulting configuration is not
runnable, because all configuration pathnames are relative to
$DESTDIR. Beginning with Shorewall 4.6.4, you can create runnable
configurations separate from your main configuration. Here is a sample
shorewallrc file:</para>
<programlisting> INSTALL_DIR=/usr/local/shorewall-custom
HOST=suse
PREFIX=${INSTALL_DIR}
SHAREDIR=${INSTALL_DIR}/share
LIBEXECDIR=${INSTALL_DIR}/lib
PERLLIBDIR=${INSTALL_DIR}/lib/perl5
CONFDIR=${INSTALL_DIR}/etc
SBINDIR=${INSTALL_DIR}/usr/sbin
MANDIR=${SHAREDIR}/man/
INITDIR=${INSTALL_DIR}/etc/init.d
INITSOURCE=init.suse.sh
INITFILE=${PRODUCT}
AUXINITSOURCE=
AUXINITFILE=
SYSTEMD=${INSTALL_DIR}/etc/systemd
SERVICEFILE=${PRODUCT}.service
SYSCONFFILE=sysconfig
SYSCONFDIR=${INSTALL_DIR}/etc/sysconfig
SPARSE=
ANNOTATED=
VARLIB=${INSTALL_DIR}/var/lib
VARDIR=${VARLIB}/${PRODUCT}
<emphasis role="bold">SANDBOX=Yes</emphasis></programlisting>
<para>The above shorewallrc creates a runnable configuration in
/usr/local/shorewall-custom. It is triggered by adding SANDBOX to the
shorewallrc file -- any non-empty value for that variable will prevent
the installer from replacing the current main configuraiton. </para>
</section>
</section>
<section>

View File

@@ -87,6 +87,9 @@
<member><ulink url="manpages6/shorewall6-modules.html">modules</ulink>
- Specify which kernel modules to load.</member>
<member><ulink url="manpages6/shorewall6-nat.html">nat</ulink> -
(added in Shorewall 4.6.4) Specify 1:1 NAT</member>
<member><ulink url="manpages6/shorewall6-nesting.html">nesting</ulink>
- How to define nested zones.</member>

View File

@@ -2123,6 +2123,11 @@ net eth1 detect <emphasis role="bold">optional</emphasis><
later.</para>
</warning>
<para><filename>/etc/shorewall/params:</filename></para>
<programlisting>EXT_IF=eth0
COM_IF=eth1</programlisting>
<para><filename>/etc/shorewall/isusable</filename>:</para>
<programlisting>local status=0

View File

@@ -890,7 +890,7 @@ DNAT { source=net dest=loc:10.0.0.1 proto=tcp dport=80 mark=88 }</programlisting
<listitem>
<para>Host 2002:ce7c:92b4:1:a00:27ff:feb1:46a9 in the <emphasis
role="bold">loc</emphasis> zone — <emphasis
role="bold">loc::[2002:ce7c:92b4:1:a00:27ff:feb1:46a9]</emphasis></para>
role="bold">loc:[2002:ce7c:92b4:1:a00:27ff:feb1:46a9]</emphasis></para>
</listitem>
<listitem>

View File

@@ -154,6 +154,22 @@ ACCEPT net:+sshok $FW tcp 22</programlisting></para>
firewall is first stopped.</para>
</listitem>
</orderedlist>
<para>Beginning with Shorewall 4.6.4, you can save selective ipsets by
setting SAVE_IPSETS to a comma-separated list of ipset names. You can also
restrict the group of sets saved to ipv4 sets by setting
SAVE_IPSETS=ipv4.</para>
<para>With Shorewall 4.6.4, the SAVE_IPSETS option may specify a list of
ipsets to be saved. When such a list is specified, only those ipsets
together with the ipsets supporting dynamic zones are saved. Shorewall6
support for the SAVE_IPSETS option was also added in 4.6.4. When
SAVE_IPSETS=Yes in <ulink
url="manpages6/shorewall6.conf.html">shorewall6.conf(5)</ulink>, only ipv6
ipsets are saved. For Shorewall, if SAVE_IPSETS=ipv4 in <ulink
url="manpages/shorewall.conf.html">shorewall.conf(5)</ulink>, then only
ipv4 ipsets are saved. Both features require ipset version 5 or
later.</para>
</section>
<section>
@@ -161,17 +177,28 @@ ACCEPT net:+sshok $FW tcp 22</programlisting></para>
<para>Ipset support in Shorewall6 was added in Shorewall 4.4.21.</para>
<para>Unlike iptables, which has separate configurations for IPv4 and
IPv6, ipset has a single configuration that handles both. This means the
SAVE_IPSETS=Yes in shorewall.conf or shorewall6.conf won't work correctly
because . To work around this issue, Shorewall-init is now capable
restoring ipset contents during 'start' and saving them during 'stop'. To
direct Shorewall-init to save/restore ipset contents, set the SAVE_IPSETS
option in /etc/sysconfig/shorewall-init (/etc/default/shorewall-init on
Debian and derivatives). The value of the option is a file name where the
contents of the ipsets will be save to and restored from. Shorewall-init
will create any necessary directories during the first 'save' operation.
If you configure Shorewall-init to save/restore ipsets, be sure to set
SAVE_IPSETS=No in shorewall.conf and shorewall6.conf.</para>
<para>Beginning with Shorewall 4.6.4, SAVE_IPSETS is available in <ulink
url="manpages6/shorewall6.conf.html">shorewall6-conf(5)</ulink>. When set
to Yes, the ipv6 ipsets will be saved. You can also save selective ipsets
by setting SAVE_IPSETS to a comma-separated list of ipset names.</para>
<para>Prior to Shorewall 4.6.4, SAVE_IPSETS=Yes in <ulink
url="manpages/shorewall.conf.html">shorewall.conf(5)</ulink> won't work
correctly because it saves both IPv4 and IPv6 ipsets. To work around this
issue, Shorewall-init is capable restoring ipset contents during 'start'
and saving them during 'stop'. To direct Shorewall-init to save/restore
ipset contents, set the SAVE_IPSETS option in
/etc/sysconfig/shorewall-init (/etc/default/shorewall-init on Debian and
derivatives). The value of the option is a file name where the contents of
the ipsets will be save to and restored from. Shorewall-init will create
any necessary directories during the first 'save' operation.</para>
<para>If you configure Shorewall-init to save/restore ipsets, be sure to
set SAVE_IPSETS=No in shorewall.conf and shorewall6.conf.</para>
<para>If you configure SAVE_IPSETS in <ulink
url="manpages/shorewall.conf.html">shorewall.conf(5)</ulink> and/or <ulink
url="manpages6/shorewall6.conf.html">shorewall6.conf(5)</ulink> then do
not set SAVE_IPSETS in shorewall-init.</para>
</section>
</article>

View File

@@ -320,6 +320,76 @@ ACCEPT:NFLOG(1,0,1) vpn fw tcp ssh,time,631,8080 </programlis
</section>
</section>
<section>
<title id="Backends">Log Backends</title>
<para>Netfilter logging allows configuration of multiple backends. Logging
backends provide the The low-level forward of log messages. There are
currently three backends:</para>
<variablelist>
<varlistentry>
<term>LOG (ipt_LOG and ip6t_LOG).</term>
<listitem>
<para>Normal kernel-based logging to a syslog daemon.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>ULOG (ipt_ULOG)</term>
<listitem>
<para>ULOG logging as described ablve. Only available for
IPv4.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>netlink (nfnetlink_log)</term>
<listitem>
<para>The logging backend behind NFLOG, defined above.</para>
</listitem>
</varlistentry>
</variablelist>
<para>The currently-available and currently-selected IPv4 and IPv6
backends are shown in /proc/sys/net/netfilter/nf_log:</para>
<programlisting>cat /proc/net/netfilter/nf_log
0 NONE (nfnetlink_log)
1 NONE (nfnetlink_log)
2 ipt_ULOG (ipt_ULOG,ipt_LOG,nfnetlink_log)
3 NONE (nfnetlink_log)
4 NONE (nfnetlink_log)
5 NONE (nfnetlink_log)
6 NONE (nfnetlink_log)
7 NONE (nfnetlink_log)
8 NONE (nfnetlink_log)
9 NONE (nfnetlink_log)
10 ip6t_LOG (ip6t_LOG,nfnetlink_log)
11 NONE (nfnetlink_log)
12 NONE (nfnetlink_log)</programlisting>
<para>The magic numbers (0-12) are Linux address family numbers (AF_INET
is 2 and AF_INET6 is 10).</para>
<para>The name immediately following the number is the currently-selected
backend, and the ones in parantheses are the ones that are available. You
can change the currently selected backend by echoing it's name into
/proc/net/netfilter/nf_log.<replaceable>number</replaceable>.</para>
<para>Example - change the IPv4 backend to LOG:</para>
<programlisting>sysctl net.netfilter.nf_log.2=ipt_LOG</programlisting>
<para>Beginning with Shorewall 4.6.4, you can configure the backend using
the LOG_BACKEND option in <ulink
url="manpages/shorewall.conf.html">shorewall.conf(5)</ulink> and <ulink
url="manpages6/shorewall6.conf.html">shorewall6.conf(5)</ulink>.</para>
</section>
<section id="Syslog-ng">
<title>Syslog-ng</title>