Compare commits

..

1361 Commits

Author SHA1 Message Date
Tom Eastep
6caff51c98 Modify a comment are delete a silly identity assignment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-09-01 11:24:19 -07:00
Tom Eastep
62fcf1ae8b Adjust version of Raw.pm 2010-08-31 16:52:48 -07:00
Tom Eastep
dfebe5a35e Correct error message 2010-08-31 16:33:15 -07:00
Tom Eastep
f93413b2a7 Update Multi-ISP doc for variable name change in 4.4.8.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-31 15:33:22 -07:00
Tom Eastep
8f94137007 Fix last change 2010-08-30 16:47:45 -07:00
Tom Eastep
1da6d51d1a Reduce the Beta3 patch footprint by making the second arg to known_interface() optional 2010-08-30 16:43:30 -07:00
Tom Eastep
add76ed14e Bump version to 4.4.13 Beta 3
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-30 12:33:10 -07:00
Tom Eastep
7f0f4516d7 Rework handle_optional_interfaces() somewhat
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-30 12:29:39 -07:00
Tom Eastep
8077c9e1c3 Add FAQ 91 2010-08-30 11:07:37 -07:00
Tom Eastep
c18d206726 Use a function to generate the list of interfaces with an L3 address 2010-08-29 20:13:56 -07:00
Tom Eastep
57c54af6ed Re-implement optional interface handling
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-29 12:32:44 -07:00
Tom Eastep
d94f2cc86d Insure that the mapping to base names is deterministic
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-29 07:28:06 -07:00
Tom Eastep
be0231578f Insure uniqueness of chain_base mapping 2010-08-28 20:47:39 -07:00
Tom Eastep
95a09b996f Fix test for KLUDGEFREE 2010-08-28 20:47:15 -07:00
Tom Eastep
1531ad3bcd Re-implement interface->shell-variable mapping 2010-08-28 15:15:41 -07:00
Tom Eastep
3a36a9de4b Fix shell-variable creation 2010-08-28 14:48:47 -07:00
Tom Eastep
d8846b92d8 Fix optional 'upnpclient' interfaces - take 2 2010-08-28 14:46:29 -07:00
Tom Eastep
a440e7023e Fix optional 'upnpclient' interfaces 2010-08-28 14:18:48 -07:00
Tom Eastep
f45879c4f4 split_list1 removes () -- take 2 2010-08-28 13:40:44 -07:00
Tom Eastep
2a54e8cd24 split_list1 removes () 2010-08-28 13:37:19 -07:00
Tom Eastep
c2558af9c8 Document and correct implementation of EXCLUSION_MASK
1. Require KLUDGEFREE if existing rule uses mark match
2. Pretty up the code
3. Use MASK_BITS rather than TC_BITS when calculating the offset of EXCLUSION_MASK

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-28 08:29:47 -07:00
Tom Eastep
c98cf8aea6 Re-implement exclusion in CONTINUE/NONAT/ACCEPT+ rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-27 10:09:42 -07:00
Tom Eastep
57bcfee559 Add 'Mark in any table' capability 2010-08-27 08:35:33 -07:00
Tom Eastep
a1cd2ba0f3 Bring 'multiple space before comment' fix forward to master
Probably unneeded but better be safe

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-27 06:59:52 -07:00
Tom Eastep
12f48e1b97 Don't pass '-j' in target arg to expand_rule()
- use the target to locate chain for reference tracking

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-26 10:37:07 -07:00
Tom Eastep
15fbbdaac7 Fix exclusion in blacklist
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-26 10:33:57 -07:00
Tom Eastep
bd8bcabdf0 Use the 'disposition' argument to expand_rule() to specify the target chain
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-26 08:40:24 -07:00
Tom Eastep
dc74b88445 Fix typo in release notes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-26 07:16:28 -07:00
Tom Eastep
75e12148ac Bump version to Beta 2 2010-08-25 09:58:07 -07:00
Tom Eastep
4a865e0a6d Pretty up some come 2010-08-24 13:08:21 -07:00
Tom Eastep
91c5a2f80b Fix old ipset detection bug 2010-08-24 13:08:06 -07:00
Tom Eastep
5c49aa843c Generate warning when a rules file entry generates no iptables-restore input
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-24 08:38:49 -07:00
Tom Eastep
383e792807 Restore wildcard properties to zone lists 2010-08-24 06:52:53 -07:00
Tom Eastep
5a92c3262f Fix REQUIRE_INTERFACE=Yes 2010-08-23 17:19:41 -07:00
Tom Eastep
d74af30368 Fix zone-exclusion bug 2010-08-23 16:31:46 -07:00
Tom Eastep
8f94240e8f Fix a couple of optimization bugs 2010-08-23 16:00:40 -07:00
Tom Eastep
160ad231df Fix an old optimization bug 2010-08-23 15:14:09 -07:00
Tom Eastep
ec09b92c4c Correct Release Notes 2010-08-23 12:38:58 -07:00
Tom Eastep
5aceddbf37 Update Accounting Documents 2010-08-22 16:40:04 -07:00
Tom Eastep
647f4bf6eb Update release notes 2010-08-22 14:35:01 -07:00
Tom Eastep
335ac8cdca Improve IPSEC accounting.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-20 10:07:19 -07:00
Tom Eastep
e70d9c82d8 Revise and document IPSEC Accounting
- Place accounting rules in accipsecin and accipsecout
- Add warning when rule inserted into unreferenced accounting chain
- Add warning when an accounting chain has no references

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-20 08:24:45 -07:00
Tom Eastep
33ee9b1481 Add IPSEC Accounting (again) 2010-08-20 06:53:31 -07:00
Tom Eastep
d9d31ff132 Remove another 'our' variable 2010-08-19 15:34:04 -07:00
Tom Eastep
c80b1b3585 Correct types in do_ipsec() 2010-08-19 15:33:49 -07:00
Tom Eastep
6b0fa8b4e2 Change note about MARK_IN_FORWARD_CHAIN 2010-08-19 15:33:12 -07:00
Tom Eastep
af77eb08bc Back out IPSEC accounting rules 2010-08-19 15:13:01 -07:00
Tom Eastep
2a9bbbfe62 Eliminate an ugly 'our' variable.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-19 12:00:52 -07:00
Tom Eastep
676da7a2f1 More reorganization of process_rule()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-19 11:53:26 -07:00
Tom Eastep
d997ef1653 First cut at IPSEC support in the accounting file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-19 11:46:26 -07:00
Tom Eastep
4322d7b2af Zone exclusion
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-18 16:10:58 -07:00
Tom Eastep
4460b49842 Complete Zone list Support
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-18 14:38:53 -07:00
Tom Eastep
fafb0dea73 Update version to 4.4.13-Beta1 2010-08-18 12:40:34 -07:00
Tom Eastep
66d4379962 Reorder sections of the Release Notes.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-18 12:22:42 -07:00
Tom Eastep
255cd6cf9c Implement zone lists in rules file entries
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-18 12:18:58 -07:00
Tom Eastep
7a17b65368 Allow simple zone lists in rules 2010-08-18 07:26:38 -07:00
Tom Eastep
baf8e21a80 Add reference to manual chains article for the compile extension 2010-08-17 09:23:43 -07:00
Tom Eastep
12aecdef37 Use '&' trick to avoid prototype matching 2010-08-17 09:17:25 -07:00
Tom Eastep
a0dffa787d Add an assertion 2010-08-16 19:17:44 -07:00
Tom Eastep
2919c48ba0 Avoid forward reference to ensure_chain() 2010-08-16 13:25:01 -07:00
Tom Eastep
00837ed503 Add Shorewall::Chains::find_chain() 2010-08-16 13:12:12 -07:00
Tom Eastep
633eba6c90 Set version to 4.4.12 2010-08-15 08:50:45 -07:00
Tom Eastep
42362ea318 Document fix for AUTOMAKE
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-14 07:55:45 -07:00
Tom Eastep
72b8393c3a Fix AUTOMAKE=Yes 2010-08-14 07:32:53 -07:00
Tom Eastep
bc19a80ac4 Correct FAQ 2 for Shorewall-lite 2010-08-14 07:14:52 -07:00
Tom Eastep
1510e111c4 Fix typo in conf basics doc 2010-08-13 20:27:14 -07:00
Tom Eastep
b7f638ddb3 Document status command change 2010-08-12 19:46:57 -07:00
Tom Eastep
7281c9166e Record the config directory in the state file 2010-08-12 17:54:07 -07:00
Tom Eastep
36054b7784 Add additional vserver notes in rules manpages 2010-08-12 17:52:22 -07:00
Tom Eastep
e35e9d2c99 Clarify nesting of vserver zones
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-12 15:26:30 -07:00
Tom Eastep
15eec24672 Simplify logic for generating all parent zones
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-12 15:15:19 -07:00
Tom Eastep
7168257152 Document port range editing fix.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-12 11:52:43 -07:00
Tom Eastep
49053afdcb Fix port range validate issue 2010-08-12 09:49:26 -07:00
Tom Eastep
92eed0d23c Document fix for any bug 2010-08-12 07:35:45 -07:00
Tom Eastep
69eaf84078 Fix bug with 'any' 2010-08-12 07:31:37 -07:00
Tom Eastep
aa00acc310 Correct typo in release notes 2010-08-11 16:09:12 -07:00
Tom Eastep
000873575e Update Shorewall Lite Doc 2010-08-11 15:59:24 -07:00
Tom Eastep
e0780b9a84 Rename the first column of the masq file for clarity 2010-08-11 15:34:27 -07:00
Tom Eastep
965ad7ced1 Minor tweaks to the IPAddrs module 2010-08-11 11:46:26 -07:00
Tom Eastep
0234564a1b Add destination IP blacklisting 2010-08-10 17:33:50 -07:00
Tom Eastep
d9cbbea36a Delete extra item in enhancement list 2010-08-07 14:06:20 -07:00
Tom Eastep
da91ef8d2c Fix typo in install.sh 2010-08-07 10:56:15 -07:00
Tom Eastep
1a4d84d502 Document fix to install.sh 2010-08-07 09:34:19 -07:00
Tom Eastep
8d4498c9b8 Update Version to 4.4.12 RC 1 2010-08-06 19:31:36 -07:00
Tom Eastep
59829565f5 Add COMPLETE to release notes 2010-08-06 19:30:33 -07:00
Tom Eastep
0f02ee2628 Fix issue with set match generation 2010-08-06 10:17:54 -07:00
Tom Eastep
1efa50e6fa Try to make the masq manpage more obvious 2010-08-05 16:50:48 -07:00
Tom Eastep
364ad41cf5 Add support for new ipset match syntax 2010-08-03 21:06:17 -07:00
Tom Eastep
2774ee1bd6 Make 'icmp' a synonym for 'ipv6-icmp' in IPv6 compilations 2010-08-02 08:04:55 -07:00
Tom Eastep
c0dcb0edbf Tweak Universal .conf files 2010-08-02 06:40:45 -07:00
Tom Eastep
e31f80dce6 Fix Universal interfaces to include 'optional 2010-08-01 16:27:31 -07:00
Tom Eastep
3ce8ff5741 Bump version to Beta 4 2010-08-01 16:10:32 -07:00
Tom Eastep
f75c5809b5 Advocate use of 'ip' to examine routing tables 2010-08-01 11:56:06 -07:00
Tom Eastep
967629569b Taylor Universal config to work with Shorewall-init and streamline ruleset
- Make interface 'all' optional and set REQUIRE_INTERFACE=Yes
- Add COMPLETE option
- Set FASTACCEPT in Universal samples
- Reset SUBSYSLOCK in Universal samples

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-08-01 08:36:56 -07:00
Tom Eastep
a88e2afa69 Tweak the Universal documentation 2010-07-31 18:43:54 -07:00
Tom Eastep
c6404f1a74 Reword last title in Universal ruleset doc 2010-07-31 14:51:52 -07:00
Tom Eastep
2f08ec4dd6 Update version in release notes 2010-07-31 14:06:49 -07:00
Tom Eastep
0b9aa0f84b Fix the dump command 2010-07-31 13:52:28 -07:00
Tom Eastep
ee5d2a56da Add Universal doc 2010-07-31 13:52:09 -07:00
Tom Eastep
0b3dfcc844 Revert version to Beta 3 2010-07-31 13:23:53 -07:00
Tom Eastep
fdcc263023 Fix a couple of minor bugs 2010-07-31 13:11:46 -07:00
Tom Eastep
bebeba8cae Document Universal Configuration and allow for empty LOGFILE 2010-07-31 12:45:43 -07:00
Tom Eastep
4e02031985 Document Universal Configuration 2010-07-31 11:59:25 -07:00
Tom Eastep
375010d602 Add IPv6 'Universal' configuration 2010-07-31 11:40:28 -07:00
Tom Eastep
1765474fab Tweaks to 'Universal' configuration 2010-07-31 11:34:21 -07:00
Tom Eastep
ddba116e54 Add 'Univeral' Sample 2010-07-31 10:52:58 -07:00
Tom Eastep
0174045181 Fixes for Universal Sample 2010-07-31 10:49:49 -07:00
Tom Eastep
beeeb6efbc Allow '+' as a physical interface 2010-07-31 10:08:45 -07:00
Tom Eastep
fdeb9006fa Correct module versions 2010-07-31 09:02:51 -07:00
Tom Eastep
005b6f7b45 Use new hashlimit match syntax if available 2010-07-31 07:19:41 -07:00
Tom Eastep
637cfdaa14 Handle case where old hashlimit match is no longer supported 2010-07-29 17:14:36 -07:00
Tom Eastep
e598dc77b7 Correct/improve LOGLIMIT handling 2010-07-29 16:50:17 -07:00
Tom Eastep
d483725474 Update Accounting doc 2010-07-29 16:49:40 -07:00
Tom Eastep
0b8ddeeed4 Correct typo in release notes 2010-07-29 12:49:26 -07:00
Tom Eastep
8f531355c9 Update known problems for RC1 2010-07-29 12:40:46 -07:00
Tom Eastep
a639b75e36 Bump version to RC1 2010-07-29 11:40:15 -07:00
Tom Eastep
e00517f075 Add Vserver support as a release highlight 2010-07-29 11:38:43 -07:00
Tom Eastep
6a1fea3a40 Add 'user marks' 2010-07-27 11:02:36 -07:00
Tom Eastep
aac343b476 Document mark geometry capability 2010-07-27 08:05:54 -07:00
Tom Eastep
0c38ba815c Add LOGLIMIT to .conf files while deleting LOGRATE and LOGBURST 2010-07-27 06:44:10 -07:00
Tom Eastep
f1a8da61bc Use global log rate limiting, if any, for synflood logging 2010-07-26 14:58:38 -07:00
Tom Eastep
8f27a2461d Fix syntax diagram 2010-07-25 13:08:15 -07:00
Tom Eastep
bd5facda30 Implement per-IP log rate limiting 2010-07-25 12:42:39 -07:00
Tom Eastep
9bf06caa35 Bump version to Beta 2 2010-07-25 08:11:49 -07:00
Tom Eastep
7f4a7372ef Remove nic registration requirement for IRC channel 2010-07-24 16:04:21 -07:00
Tom Eastep
1528cc2094 Correct RE in split_action() 2010-07-24 11:50:10 -07:00
Tom Eastep
a9a19c4da6 Remove another link to a Russian-language page 2010-07-24 11:08:06 -07:00
Tom Eastep
242f13f6bd Delete foreign language links -- docs are very out of date 2010-07-24 09:33:47 -07:00
Tom Eastep
e956068959 Make default setting of MANGLE_ENABLED depend on the capability with the same name 2010-07-24 09:27:21 -07:00
Tom Eastep
9ab66c3b07 More config basic doc tweaks 2010-07-24 07:09:02 -07:00
Tom Eastep
039ac17fe6 Correct SOURCE/DEST section 2010-07-23 14:32:11 -07:00
Tom Eastep
93e5fc2deb Correct SOURCE/DEST section 2010-07-23 14:19:05 -07:00
Tom Eastep
c2717b9eec Correct SOURCE/DEST section 2010-07-23 14:17:38 -07:00
Tom Eastep
9817be72f8 Fix another couple of more locking bugs -- ported from 4.4.11.1 2010-07-23 13:58:40 -07:00
Tom Eastep
e5a7d2ae69 Fix syntax error in generated script 2010-07-23 11:24:42 -07:00
Tom Eastep
9eedf155bc Fix syntax error in generated script 2010-07-23 11:23:23 -07:00
Tom Eastep
55b596ddb2 Update release notes version and document Shorewall-init fixes 2010-07-23 11:09:05 -07:00
Tom Eastep
d161f4cd1f Fix updown script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-23 09:47:08 -07:00
Tom Eastep
2c6d1c8d14 Many fixes for Shorewall-init
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-23 09:26:47 -07:00
Tom Eastep
00352baba7 Add warning about Upstart 2010-07-23 07:38:28 -07:00
Tom Eastep
898274dd77 Syncronize shorewall-lite activities 2010-07-22 17:00:34 -07:00
Tom Eastep
3248fc8ab1 Add additional progress messages to updown() 2010-07-22 15:11:19 -07:00
Tom Eastep
49a8861f5b Pretty up the code 2010-07-22 13:57:34 -07:00
Tom Eastep
7db9645225 Avoid an extra blank line 2010-07-22 13:51:47 -07:00
Tom Eastep
666cc35b46 Don't slow down stop with 'wait' 2010-07-22 12:56:49 -07:00
Tom Eastep
055f92c3d2 Document fix for :random with REDIRECT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-22 07:28:43 -07:00
Tom Eastep
4e33efd8a6 Allow :random to work with REDIRECT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-22 07:26:38 -07:00
Tom Eastep
8959245375 Update version to 4.4.12-Beta1 2010-07-21 20:35:36 -07:00
Tom Eastep
411d392ccd Additional progress messages during up/down processing 2010-07-21 20:35:03 -07:00
Tom Eastep
c536680bd6 Add FAQ 90 2010-07-21 13:31:43 -07:00
Tom Eastep
eb2dcb46cd Remove mention of 4.5 from Manpages6 index
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-21 12:36:18 -07:00
Tom Eastep
46644a0336 Add instructions for disabling existing firewalls 2010-07-21 11:49:37 -07:00
Tom Eastep
d897635af5 Allow bizarre overriding of SOURCE/DEST with ipsets
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-20 16:03:12 -07:00
Tom Eastep
1de257be19 Make ADD and DELETE work with any type of ipset.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-20 15:42:11 -07:00
Tom Eastep
c9423491f2 Don't mention 4.5 on Manpages page 2010-07-19 15:11:55 -07:00
Tom Eastep
8eeb71dc1b Fix inconsistencies in manpages 2010-07-19 14:45:05 -07:00
Tom Eastep
79128605b1 Validate all IPSET Names 2010-07-18 17:18:10 -07:00
Tom Eastep
cbb524b067 Implement ADD/DEL commands
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-18 08:46:38 -07:00
Tom Eastep
d2bb96be88 Emphasize that you must have a Nic to post on the Shorewall channel 2010-07-18 07:34:03 -07:00
Tom Eastep
47961f3fd5 Update release notes to mention link local network error
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-16 10:19:29 -07:00
Tom Eastep
d99aff5e09 Use Perl Constants rather literals for IPv6 Networks
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-16 10:06:29 -07:00
Tom Eastep
27937f32e3 Document IPv6 multicast network fix 2010-07-16 09:37:38 -07:00
Tom Eastep
17bdcc1360 Eradicate incorrect multicast network address 2010-07-16 09:33:17 -07:00
Tom Eastep
e0ae48f4c4 Document fix for IPv6 shorecap program
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-15 13:32:10 -07:00
Tom Eastep
4768b0890e Fix bug in Shorewall6-lite/shorecap 2010-07-15 12:50:35 -07:00
Tom Eastep
9977f778ad Link to a better Netfilter Diagram 2010-07-15 11:07:14 -07:00
Tom Eastep
e4d35ee3cb Add 'yes' to valid ipsec options in /etc/shorewall/masq 2010-07-14 07:01:18 -07:00
Tom Eastep
f92f75196c Correct accidental modification of action.Drop 2010-07-14 06:27:27 -07:00
Tom Eastep
a29921c9d2 Reverse order of ICMPv6 and Multicast/anycast filtering 2010-07-13 13:03:55 -07:00
Tom Eastep
d447482dd6 Fix typo in rules manpages 2010-07-13 07:37:14 -07:00
Tom Eastep
b52b7c422f Drop multicast and anycast in Drop and Reject actions 2010-07-12 16:44:34 -07:00
Tom Eastep
c1b212225e Use uniform coding style in latest changes 2010-07-12 13:07:11 -07:00
Tom Eastep
328e1b7f6a Don't generate rules to link local net from vserver zones 2010-07-12 12:39:51 -07:00
Tom Eastep
59189d6324 Don't generate rules from link local net to vserver zones 2010-07-12 11:52:56 -07:00
Tom Eastep
eff84ae8a6 Add warning about ff80::/10 in shorewall6-interfaces manpage 2010-07-12 11:19:11 -07:00
Tom Eastep
4792d1e5f1 Fix nets= in Shorewall6 2010-07-11 19:52:18 -07:00
Tom Eastep
5a5546ef1b Set version to 4.4.11 2010-07-09 09:01:08 -07:00
Tom Eastep
d0c1c3d69c Change comment to clarify assumption about function arguments 2010-07-08 17:45:18 -07:00
Tom Eastep
9eca7fb37b Simplify logic in loopback helper functions 2010-07-08 17:11:27 -07:00
Tom Eastep
8d5f04d5a5 Correct TC_PRIO description in shorewall.conf and shorewall6.conf manpages 2010-07-07 15:35:26 -07:00
Tom Eastep
591a4bc7f6 Revert version of modules with only whitespace changes; rename a couple of functions for clarity 2010-07-07 06:43:07 -07:00
Tom Eastep
74092a9b14 Restrict Shorewall6 netstat call to IPv6 only 2010-07-06 06:42:37 -07:00
Tom Eastep
ecd22d34fa Reword warning message
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-05 13:15:13 -07:00
Tom Eastep
35a4b8e7f4 Update Vserver FAQ
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-05 13:12:06 -07:00
Tom Eastep
02fab09a14 Add PERL= option to shorewall.conf and shorewall6.conf
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-05 13:11:52 -07:00
Tom Eastep
4547067da9 Document fix for missing closing quote 2010-07-05 11:43:37 -07:00
Tom Eastep
31a9d24164 Fix missing quote when REQUIRE_INTERFACE=Yes 2010-07-05 09:47:03 -07:00
Tom Eastep
f977631af9 Just reset provider bits in FORWARD chain 2010-07-05 09:46:24 -07:00
Tom Eastep
b445b4fdd9 Fix compiler detection of FWMARK_RT_MASK -- take 2 2010-07-05 08:51:13 -07:00
Tom Eastep
0e87ccbcfd Fix compiler detection of FWMARK_RT_MASK 2010-07-05 08:39:32 -07:00
Tom Eastep
542557069e Back out a couple of harmless but unintended changes 2010-07-05 08:02:51 -07:00
Tom Eastep
aa6bb6e911 Improve wording of FORWARD_CLEAR_MARK description 2010-07-05 07:53:31 -07:00
Tom Eastep
898c3a045f Bump version to RC1 2010-07-05 07:08:06 -07:00
Tom Eastep
6a644716c9 Unconditionally use /usr/bin/perl 2010-07-04 17:13:33 -07:00
Tom Eastep
312624cef5 Fix NET3 bug (netmap) 2010-07-04 15:58:37 -07:00
Tom Eastep
7689831cd7 Minor cleanup of 4.4.11 Beta 3.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-04 09:29:16 -07:00
Tom Eastep
2ee4fd8f5a Add FWMARK_RT_MASK capability.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-04 09:08:04 -07:00
Tom Eastep
d3e30b5fe4 Add FORWARD_CLEAR_MARK option 2010-07-03 17:03:42 -07:00
Tom Eastep
5d1e19364a Bump version to Beta 3 2010-07-03 10:54:39 -07:00
Tom Eastep
148b251766 Only send loopback traffic to the 'loopback' chain 2010-07-03 10:53:25 -07:00
Tom Eastep
21ce6f9b84 Add new zone-list function to return all but firewall zone.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-03 08:33:10 -07:00
Tom Eastep
c8274f0538 Minor vserver doc update 2010-07-02 13:34:21 -07:00
Tom Eastep
63154367ad Forbid 'ipsec' in a vserver host entry
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-02 13:12:23 -07:00
Tom Eastep
e5d3ce582a Correct Old Defect in ipsec match generation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-02 13:11:57 -07:00
Tom Eastep
9e81a5101f Cleaner fix for ipsec/vserver issue
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-02 12:24:58 -07:00
Tom Eastep
261af19b4e Fix invalid policy match with vserver zone.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-02 12:18:18 -07:00
Tom Eastep
364cddf99b Update release documents for find_hosts_by_option() fix
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-02 07:40:30 -07:00
Tom Eastep
f2ca9e25c9 Make find_hosts_by_option() work with options specified on the interface 2010-07-02 07:19:52 -07:00
Tom Eastep
db8dba66db Correct defect in the handling of 'trace' and 'debug'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-01 15:56:57 -07:00
Tom Eastep
ba535b8937 Correct IPv6 zones file in Vserver doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-07-01 15:56:34 -07:00
Tom Eastep
f538aecd82 Update the Vserver article with IPv6 and a graphic 2010-07-01 15:13:29 -07:00
Tom Eastep
338c021272 Fix refression in handling of mss= 2010-07-01 09:05:25 -07:00
Tom Eastep
7dbf829e9b Clean up Vserver doc 2010-07-01 07:22:54 -07:00
Tom Eastep
64decb25fe Bump version to 4.4.11-Beta2 2010-07-01 07:08:11 -07:00
Tom Eastep
9f15ccb24f Update Raw.pm version.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-30 20:40:26 -07:00
Tom Eastep
e4afc15370 Finish Vserver Implementation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-30 20:35:46 -07:00
Tom Eastep
ac4349e930 Add more IPv6 configuration info 2010-06-27 17:46:12 -07:00
Tom Eastep
236269eafc Add IPv6 example to the OpenVPN doc 2010-06-27 16:26:40 -07:00
Tom Eastep
de3c28ded3 Add 6to4 to documented tunnel types
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-27 08:12:14 -07:00
Tom Eastep
9e37fe1ffa Deimplement flawed rate limiting with simple TC
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-26 07:42:08 -07:00
Tom Eastep
fc95cb8dc6 Run insserv when installed on Debian
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-26 07:34:34 -07:00
Tom Eastep
914d752f1d Fix latency parsing 2010-06-25 16:10:26 -07:00
Tom Eastep
ed72afd8a0 Add comment about the unfortunate name of the tcrules file 2010-06-25 06:33:14 -07:00
Tom Eastep
fe27554fd0 Document undefined value issue
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-24 14:18:48 -07:00
Tom Eastep
2909b6fd92 Quiet down the Perl interpreter on some boxen 2010-06-24 13:58:46 -07:00
Tom Eastep
cc376ab72e Update release documents for REQUIRE_INTERFACE
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-23 13:00:00 -07:00
Tom Eastep
3cda3d0315 Add REQUIRE_INTERFACE to shorewall*.conf
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-23 12:58:35 -07:00
Tom Eastep
1cb22d0bcf First feeble steps toward vserver zones 2010-06-22 16:42:20 -07:00
Tom Eastep
d5aaa97d4e Update release documents for changes ported from the 4.4.10 branch
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-22 08:40:07 -07:00
Tom Eastep
2d6647c445 Make 'shorewall6 show connections' more readable
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-22 08:32:15 -07:00
Tom Eastep
055ac41a23 Make IPv6 log output readable 2010-06-21 15:38:47 -07:00
Tom Eastep
6d6b8cf7d6 Fix crazy Debian start priority for shorewall-init 2010-06-21 15:38:25 -07:00
Tom Eastep
efa4cfa921 Update release documents for 4.4.11 Beta 1
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-18 12:09:43 -07:00
Tom Eastep
dbbe6b264d Fix the IPSET fix 2010-06-18 12:06:12 -07:00
Tom Eastep
e7340dabc0 Fix IPSET issue 2010-06-18 12:05:44 -07:00
Tom Eastep
503b1cf795 Update release note version banner 2010-06-16 16:46:56 -07:00
Tom Eastep
40f57bf926 Update Squid Document 2010-06-16 09:24:01 -07:00
Tom Eastep
32d8a9d996 Allow patch from Gabriel 2010-06-12 14:10:40 -07:00
Tom Eastep
d58127e51c Allow networks to be specified in a NETMAP rule 2010-06-12 13:50:58 -07:00
Tom Eastep
9acec39898 Fix a couple of issues with Simple TC 2010-06-12 13:50:11 -07:00
Tom Eastep
625f254d02 Add tcfilters to manpage index 2010-06-10 06:15:15 -07:00
Tom Eastep
6040f02bb0 Don't set variables needlessly 2010-06-08 16:33:54 -07:00
Tom Eastep
32d575a8c8 Remove extra logic 2010-06-08 16:18:23 -07:00
Tom Eastep
dcd64cd096 Move ipset-load code to Chains.pm. Better there than in Compiler.pm
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-08 16:18:14 -07:00
Tom Eastep
a5816c23d4 Move save_dynamic_chains to Chains.pm where it belongs.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-08 16:17:57 -07:00
Tom Eastep
6537c1e55a Improve readability 2010-06-08 16:16:23 -07:00
Tom Eastep
f50a609d1d Update the UPnP document with the 4.4.10 changes.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-08 11:34:37 -07:00
Tom Eastep
e061d15baf Update blacklisting doc with 4.4.10 behavior.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-08 11:32:39 -07:00
Tom Eastep
52a80e69a9 More tweaks to saving/restoring dynamic chains
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-08 11:27:09 -07:00
Tom Eastep
ec3fdbde98 More changes having to do with with dynamic chains
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-08 11:26:53 -07:00
Tom Eastep
aa4b0f71af Much cleaner implementation of save_dynamic_chains()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-07 10:11:33 -07:00
Tom Eastep
0978f3d41a More periodic removal of trailing white space 2010-06-07 09:16:56 -07:00
Tom Eastep
3467969c26 Periodic removal of trailing white space 2010-06-07 07:30:56 -07:00
Tom Eastep
04de6fac6d Make dynamic chain saving work with IPv6
Also, use hidden files to save the chain contents.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-07 07:18:21 -07:00
Tom Eastep
b741ff2a81 Document first 4.4.11 features 2010-06-06 20:40:39 -07:00
Tom Eastep
db138edbd1 Update versions of modified modules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-06 13:49:26 -07:00
Tom Eastep
b3370dfd78 Initiate 4.4.11
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-06 13:36:45 -07:00
Tom Eastep
17b6e370af Purge saved dynamic blacklist if the chain doesn't exist 2010-06-06 13:24:09 -07:00
Tom Eastep
25c0e3c7b3 Retain UPnP and dynamic blacklist over 'restart' 2010-06-06 13:23:49 -07:00
Tom Eastep
f412f96153 Add introduction to config file basics document
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-06 08:24:28 -07:00
Tom Eastep
ca7d145746 Don't enter command mode for upnpclient rule for non-optional interface
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-06 08:05:19 -07:00
Tom Eastep
99a0226a43 Slight improvement of regular expression used to insert chain name into rules after '-A'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-06 08:04:28 -07:00
Tom Eastep
fdc3b698a9 Version to 4.4.10 (again) 2010-06-05 15:58:23 -07:00
Tom Eastep
d388b29d70 Let Zones.pm export chain_base rather than Chains.pm 2010-06-05 08:40:00 -07:00
Tom Eastep
0e995d65ac Version to 4.4.10-RC2 2010-06-04 16:19:15 -07:00
Tom Eastep
742a3b2eef Make wait and required work on wildcard interfaces
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-04 10:35:45 -07:00
Tom Eastep
82a74d7534 Resolve Optional/Required interfaces with wildcard names
Optional is allowed
Required is not

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-04 08:46:29 -07:00
Tom Eastep
165535cd8b Disallow wildcard optional/required interfaces
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-04 07:18:55 -07:00
Tom Eastep
7625b4069b Delete references to prenet subsystem locks.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-03 12:31:39 -07:00
Tom Eastep
43afd03b9b Bump version to 4.4.10 2010-06-03 11:18:02 -07:00
Tom Eastep
5e74427332 Update the Build document with the current release model
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-02 16:23:09 -07:00
Tom Eastep
34e1826d59 Point out that example 5 uses a deprecated form 2010-06-01 12:45:41 -07:00
Tom Eastep
f29b06ec07 Update .spec files to use DESTDIR
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-01 07:18:37 -07:00
Tom Eastep
91840acb18 Remove unused RUNLEVELS variable from the install scripts.
Add some documentation

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-01 07:12:19 -07:00
Tom Eastep
fe55fa0f31 Rename PREFIX->DESTDIR
If DESTDIR is not supplied, look for PREFIX

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-06-01 06:42:11 -07:00
Tom Eastep
0553f232b5 Remove apparent restriction on files where shell variables can be used
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-31 10:25:53 -07:00
Tom Eastep
78aaea749e Mention Shorewall-init in the beginner HOWTOs 2010-05-31 09:40:20 -07:00
Tom Eastep
c52d0c4d9f Update release notes for 'version -a'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-31 08:05:33 -07:00
Tom Eastep
858a422da3 Extend 'version -a' behavior to all CLIs
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-31 07:32:17 -07:00
Tom Eastep
47c4cbd85a Remove extra step in DSL modem access 2010-05-30 11:31:41 -07:00
Tom Eastep
07366ac819 Enhance FAQ 89 -- DSL modem access 2010-05-30 09:30:56 -07:00
Tom Eastep
97d8fd1588 Add FAQ 89 -- DSL modem access 2010-05-30 08:59:38 -07:00
Tom Eastep
ab3c2ccd01 Two more instances of 'T' 2010-05-29 11:06:30 -07:00
Tom Eastep
347757a190 Yet more updates for build on the Mac 2010-05-29 10:57:27 -07:00
Tom Eastep
58ad0bc9e0 More updates for build on the Mac 2010-05-29 10:50:39 -07:00
Tom Eastep
226eb6ca3e Cleanup of optimization fix
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-29 09:56:14 -07:00
Tom Eastep
5bd1bac70d Document fix for optimization bug
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-29 09:13:52 -07:00
Tom Eastep
e29d6d080d Restore -a functionality to the version command
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-29 08:59:45 -07:00
Tom Eastep
50ce5bab68 Fix Optimization Bug
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-29 08:58:16 -07:00
Tom Eastep
ff5f2ab15a Emphasize 'routeback' in the OpenVZ doc 2010-05-28 17:14:31 -07:00
Tom Eastep
f457ec69f9 Don't copy SELinux context during Shorwall-init install/upgrade
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-28 10:20:19 -07:00
Tom Eastep
6056e619be Make Shorewall-init play nice with insserv on Debian
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-28 10:18:00 -07:00
Tom Eastep
d58480943a Bump version to 4.4.10 RC 1 2010-05-27 17:21:11 -07:00
Tom Eastep
77793fb899 Correct typo in install.sh 2010-05-27 14:16:28 -07:00
Tom Eastep
98dff075ca Mention SAFESTOP in the start/stop document 2010-05-27 13:55:07 -07:00
Tom Eastep
e1c04f5ad6 Add Shorewall Init Documentation 2010-05-27 13:36:00 -07:00
Tom Eastep
3125a4d0d3 Restore RPM RedHat compatibility
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-27 06:49:49 -07:00
Tom Eastep
d0bf4e016c Merge branch 'master' of ssh://shorewall.git.sourceforge.net/gitroot/shorewall/shorewall 2010-05-26 18:54:35 -07:00
Tom Eastep
cc269d5d19 Make RPM SuSE-only 2010-05-26 18:49:33 -07:00
Tom Eastep
f0a88bda62 Unconditionally install SuSE ifupdown scripts with the RPM
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-26 17:14:26 -07:00
Tom Eastep
a440a68f7f Fixes for revised file layout
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-26 17:04:58 -07:00
Tom Eastep
e627e0ea76 Bump version to 4.4.10-Beta4
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-26 16:47:49 -07:00
Tom Eastep
c256074c94 Change installation of ifupdown one more time 2010-05-26 16:45:09 -07:00
Roberto C. Sanchez
43a0d95697 Fix mode of installed file. 2010-05-26 15:34:53 -04:00
Tom Eastep
74043784ea Merge branch 'master' of ssh://shorewall.git.sourceforge.net/gitroot/shorewall/shorewall 2010-05-26 12:28:44 -07:00
Roberto C. Sanchez
0aa0669cae Fix new code section to track with the rest of Beta3 changes. 2010-05-26 15:01:15 -04:00
Tom Eastep
925de3cee9 Fix typo in tcrules manpages 2010-05-26 06:42:37 -07:00
Tom Eastep
84909de8b9 Fixes for Debian
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-25 16:02:57 -07:00
Tom Eastep
cdcb42ce9c Increment version to 4.4.10-Beta3.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-25 07:17:57 -07:00
Tom Eastep
3db31f2f65 Add SAFESTOP setting to /etc/default/shorewall*.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-25 07:16:02 -07:00
Tom Eastep
b972de959e Make reload ad force-reload a no-op on Debian 2010-05-24 16:26:50 -07:00
Tom Eastep
273b2252e3 Create symbolic link on RedHat
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-24 07:46:01 -07:00
Tom Eastep
f7580d52f7 Don't install NetworkManager script from the RPM
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-24 07:13:33 -07:00
Tom Eastep
ce139c5ca7 Don't install NetworkManager script on SuSE and Debian
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-24 07:11:49 -07:00
Tom Eastep
8e34b80f85 Fix small error in the Shorewall-init install script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-24 07:00:20 -07:00
Tom Eastep
cafeca0c0d Correct typo in Shorwall6-lite install script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-24 06:50:47 -07:00
Tom Eastep
ad9f66042d Fix manpage install in Shorewall6-lite
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-24 06:48:52 -07:00
Tom Eastep
2d19cd1ebb Add options to readlink
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-24 06:37:02 -07:00
Tom Eastep
9c0564831a Fix syntax error in generated shell script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-24 06:23:45 -07:00
Tom Eastep
f9425eeb1b Apply Tuomo's patch to shorewall-init.spec
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-24 06:23:26 -07:00
Tom Eastep
bfa93e2588 Fix install issues with Shorewall-init 2010-05-23 19:36:49 -07:00
Tom Eastep
f7d3bd933a Fixes to Shorewall-init 2010-05-23 17:49:51 -07:00
Tom Eastep
dcc66da50c Fixes to Shorewall-init 2010-05-23 17:49:06 -07:00
Tom Eastep
b7f03c5ada Fix some more install.sh issues 2010-05-23 17:43:17 -07:00
Tom Eastep
620f5cf76b More build fixes 2010-05-23 17:12:42 -07:00
Tom Eastep
0f7b4cf7f4 Fix logrotate issue 2010-05-23 17:01:31 -07:00
Tom Eastep
878e58fcf6 One more install.sh
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-23 16:36:23 -07:00
Tom Eastep
97306cb10c Rework shorewall-lite install.sh
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-23 16:26:14 -07:00
Tom Eastep
0ef4cd1653 Allow Debian install with PREFIX
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-23 16:10:36 -07:00
Tom Eastep
60c751b98f First stage rework of Shorewall install script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-23 16:02:28 -07:00
Tom Eastep
54e571fba9 Make install work with PREFIX and distro specified
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-23 15:34:42 -07:00
Tom Eastep
12f6933d5e Allow specification of distro when compiling with a PREFIX
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-23 14:44:35 -07:00
Tom Eastep
a539f4d646 Don'g clear the distro variables in the install script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-23 14:26:29 -07:00
Tom Eastep
78850c8169 Merge branch 'master' of ssh://shorewall.git.sourceforge.net/gitroot/shorewall/shorewall 2010-05-23 14:20:14 -07:00
Roberto C. Sanchez
f564a3f981 Implement required reload/force-reload parameters in init script. Make the DEBIAN and PREFIX environment variable not be mutually exclusive. 2010-05-23 17:10:50 -04:00
Tom Eastep
d32ed01cf0 Use readlink(1) where appropriate
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-23 13:37:26 -07:00
Tom Eastep
1b00aeb1bc Correct typo in install script
Replace /NetworkManager with /etc/NetworkManager

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-23 12:55:52 -07:00
Tom Eastep
2fc3fa0602 Some fixes for the RPM
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-23 12:53:56 -07:00
Tom Eastep
1fcff1d9cb Restore Required-start and Required-stop
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-21 12:46:22 -07:00
Tom Eastep
b9f7965a40 Correct run-levels
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-21 12:37:22 -07:00
Tom Eastep
66130f46c2 Add back Required-start and Required-stop
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-21 12:25:19 -07:00
Tom Eastep
abb20e909a Spec and init file fixes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-21 12:22:41 -07:00
Tom Eastep
4d0a3882be Replace calls to 'notdone'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-21 10:46:07 -07:00
Tom Eastep
d66206ba8b Correct issues with non-Debian init script
Remove 'Required*' lines
Correct PRODUCT->product

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-21 10:13:28 -07:00
Tom Eastep
1d87fc0102 Update .spec files with virtual requires/provides
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-21 10:12:37 -07:00
Tom Eastep
3db203cbb7 Revise summary and description in shorewall-init.spec 2010-05-21 07:17:16 -07:00
Tom Eastep
eaad566978 Update documents for Shorewall-lite 2010-05-20 17:06:53 -07:00
Tom Eastep
4264524448 Bump Version to 4.4.10-Beta2
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-20 14:13:38 -07:00
Tom Eastep
2a870088d8 Remove 'close' from CLI programs
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-20 14:09:40 -07:00
Tom Eastep
182f433772 Add note about supported distributions to release notes.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-20 06:32:34 -07:00
Tom Eastep
896e18be00 Document REQUIRE_INTERFACE
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-19 07:37:49 -07:00
Tom Eastep
50dc02da07 Implement the 'REQUIRE_INTERFACE' option.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-19 07:32:02 -07:00
Tom Eastep
62f3e5f009 Correct security on /usr/share/shorewall-init/ifupdown
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-19 06:55:07 -07:00
Tom Eastep
5a48ff978e Improve uninstall (both script and rpm)
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-19 06:29:28 -07:00
Tom Eastep
06a17c8973 Adjust manpage specifications in spec file 2010-05-18 20:59:24 -07:00
Tom Eastep
159ddfcc55 Fix problem in the shorewall-init manpage 2010-05-18 20:49:17 -07:00
Tom Eastep
4e748f9255 Add Shorewall-init manpage and update release notes.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 20:40:03 -07:00
Tom Eastep
4690075ed8 Start firewall on up event for optional interface.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 20:29:03 -07:00
Tom Eastep
fd696fbee7 Fix a silly bug in uninstall.sh
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 19:08:20 -07:00
Tom Eastep
00b79e8f3b Add .spec file 2010-05-18 16:34:49 -07:00
Tom Eastep
6983e9d3fe Uninstall Script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 15:42:26 -07:00
Tom Eastep
1eb5e5b081 Fail the install on unknown distros.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 15:30:53 -07:00
Tom Eastep
9c5fb89b4c Improve documentation in the release notes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 14:55:16 -07:00
Tom Eastep
13828bffbc Improve comments in the sysconfig file
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 14:47:00 -07:00
Tom Eastep
0c9a0150d2 Document Shorewall-init; delete old auto-stop code
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 14:42:39 -07:00
Tom Eastep
5b2affbd01 Changes to make RedHat work with NetworkManager
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 13:41:01 -07:00
Tom Eastep
592c9bbdbc Integrate Shorewall-init with NetworkManager on RedHat
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 12:49:09 -07:00
Tom Eastep
f9d187c288 Correct issues found in Fedora Testing
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 10:27:12 -07:00
Tom Eastep
bcf419fbce Correct problems with SuSE init.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-18 08:16:31 -07:00
Tom Eastep
9d3d66d4a2 Implement (untested) support for SuSE in shorewall-init
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-17 16:47:51 -07:00
Tom Eastep
9f535b670d Rename the ifupdown script.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-17 16:26:59 -07:00
Tom Eastep
499b0cddaa Log the text from startup errors.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-17 07:02:30 -07:00
Tom Eastep
a534bca914 Fix an existing bug in Shorewall6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-16 19:28:49 -07:00
Tom Eastep
a501222194 Fix some bugs in the Shorewall-init implementation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-16 17:41:09 -07:00
Tom Eastep
38cdd417eb Add Shorewall-init product
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-16 15:35:22 -07:00
Tom Eastep
4f428d8135 De-implement 'close'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-16 15:31:41 -07:00
Tom Eastep
749d6be64e Add 'optional' interfaces to updown processing.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-15 17:06:00 -07:00
Tom Eastep
a3589dc6e9 Implement the 'up' and 'down' script commands
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-15 12:48:04 -07:00
Tom Eastep
ff388ca5c4 Detect the 'closed' state in the status command
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-15 12:46:47 -07:00
Tom Eastep
b42d80cb29 Update 'wait' documentation.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-15 09:59:57 -07:00
Tom Eastep
88188202cc Add 'wait' interface option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-15 09:52:46 -07:00
Tom Eastep
16e451a7d8 Add 'required' interface option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-15 09:04:32 -07:00
Tom Eastep
a2758421ed Bump version to 4.4.10-Beta1
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-13 17:03:14 -07:00
Tom Eastep
5bab407da2 Remove mention of 4.5 from the Documentation Index
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-13 16:40:07 -07:00
Tom Eastep
46b3a2a81a Remove dire threats about installing remotely
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-13 16:40:01 -07:00
Tom Eastep
529f9a07b4 Update Rules.pm version to 4.4.10 2010-05-13 16:39:52 -07:00
Tom Eastep
a0a08c918d Apply patch from Fog_Watch 2010-05-13 16:39:39 -07:00
Tom Eastep
a04d8126e1 Finish implementing 'close'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-13 16:39:01 -07:00
Tom Eastep
1d0b8b1cec Correct syntax error in generated code
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-13 16:32:42 -07:00
Tom Eastep
449ca038ba Implement 'close' command 2010-05-13 16:29:25 -07:00
Tom Eastep
3a00254594 Merge branch 'master' of ssh://teastep@shorewall.git.sourceforge.net/gitroot/shorewall/shorewall 2010-05-08 16:32:42 -07:00
Tom Eastep
74c515016e Add back stuff merged earlier: 2010-05-08 16:32:03 -07:00
Tom Eastep
a2ad074179 Measure twice, cut once 2010-05-08 13:58:54 -07:00
Tom Eastep
4646920df4 fix typo 2010-05-08 13:55:33 -07:00
Tom Eastep
50e510702d Yet even more fixes for build on a Mac 2010-05-08 13:53:00 -07:00
Tom Eastep
caf2f79f6c Yet more fixes for build on a Mac 2010-05-08 13:42:41 -07:00
Tom Eastep
5f4d3cd2dc More fixes for build on a Mac 2010-05-08 13:35:21 -07:00
Tom Eastep
0c8007efa7 Don't set SPARSE when building on a Mac 2010-05-08 12:58:57 -07:00
Tom Eastep
111bfa9fef Modify first attempts to allow installaton on a Mac
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-08 12:51:04 -07:00
Roberto C. Sanchez
2a42998d97 Fix typo. 2010-05-08 15:03:17 -04:00
Tom Eastep
6991a844c8 Fix broken link 2010-05-07 20:33:37 -07:00
Tom Eastep
e9b836bbad Document OS X as an Administrative system
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-06 09:07:33 -07:00
Tom Eastep
679ad6cf04 Allow OS X to be an Administrative System
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-06 09:07:16 -07:00
Tom Eastep
65a5d34276 Update Module Versions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-03 12:46:29 -07:00
Tom Eastep
96bef5bd49 Assume 'routeback' in routestopped based on interface config.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-03 12:31:11 -07:00
Tom Eastep
13d5864f23 Update Shorewall6 mDNS macro.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-03 10:21:19 -07:00
Tom Eastep
fca404eeaf Update version to 4.4.9
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-03 10:02:02 -07:00
Tom Eastep
c7848be266 Back out the rest of the original change for dup / -[psiod]
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-03 09:59:25 -07:00
Tom Eastep
70c6a2cdf3 Update version to 4.4.9-RC2
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-02 07:25:50 -07:00
Tom Eastep
7d2df848c9 Tighten up the new mDNS rule 2010-05-01 12:13:02 -07:00
Tom Eastep
9bcd9fd12b Allow for mDNS multicast responses 2010-05-01 12:01:58 -07:00
Tom Eastep
639b3ea57d Simplify checking for /! -[piosd] /
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-01 09:13:16 -07:00
Tom Eastep
311372013d More fixes to optimization
Only disallow / ! -[piosd] / if the target is a chain

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-01 08:58:41 -07:00
Tom Eastep
5456c9fba3 Add instructions for proxying firewall-local connections
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-01 08:26:22 -07:00
Tom Eastep
518416ec2e Add a comment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-01 08:08:39 -07:00
Tom Eastep
94c6b37e8e Avoid leaving an orphan '!' behind.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-01 07:51:24 -07:00
Tom Eastep
219b2e0761 A more comprehensive solution to multiple -[piosd] matches.
- eliminate duplicate -[piosd] matches in merged rules
- avoid tracing !* unconditionally

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-01 07:26:25 -07:00
Tom Eastep
16161d9cfc Add new trace types.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-05-01 06:43:09 -07:00
Tom Eastep
1173518d78 More minor cleanup of first code
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-30 07:22:09 -07:00
Tom Eastep
2864841a9e Correct release notes
update version to RC1
correct typo

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-29 11:21:31 -07:00
Tom Eastep
076da4bd5c Couple of tweaks to my earliest code
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-29 11:19:50 -07:00
Tom Eastep
83d8d497d7 Correct typos in IPSEC article.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-28 08:12:41 -07:00
Tom Eastep
a997d6507d Update release notes with more common example of failure.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-28 08:09:10 -07:00
Tom Eastep
039668b333 Update release notes to reflect reality.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-28 06:57:45 -07:00
Tom Eastep
2c1cede54e Revise addressless bridge change
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-27 15:23:38 -07:00
Tom Eastep
013567496c Update manpages for addressless bridge
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-27 12:40:57 -07:00
Tom Eastep
d8b0f496df Allow simple configuration of a bridge with no IP address
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-27 12:26:58 -07:00
Tom Eastep
4b6bff7693 Add link from the netmap article to the OpenVPN doc.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-27 07:04:33 -07:00
Tom Eastep
eab6387817 Add solution for handling duplicate networks in an OpenVPN environment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-27 07:04:06 -07:00
Tom Eastep
40bc2cc4a2 Update Link
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-26 18:06:16 -07:00
Tom Eastep
988f7c4d7e More fixes for bad NAT optimization
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-26 16:50:18 -07:00
Tom Eastep
f49848bd5b Document rare optimization fix.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-26 16:32:53 -07:00
Tom Eastep
0e4698d57c Fix rare optimization bug
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-26 16:19:58 -07:00
Tom Eastep
6e04c7eec8 Mention 6in4 Tunnels in the Documentation Index
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-26 11:11:12 -07:00
Tom Eastep
6d61e962eb Use -m conntrack if available in place of -m state
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-25 13:35:41 -07:00
Tom Eastep
21e0c68ef2 Bump version to 4.4.9 RC1 2010-04-25 09:37:17 -07:00
Tom Eastep
fb2ddcee7b Bump Version to 4.4.9 Beta 5 2010-04-24 21:53:12 -07:00
Tom Eastep
33801bb8a9 Add 6in4 information to 6to4 article 2010-04-24 19:53:15 -07:00
Tom Eastep
f2f8bcd804 Add link to 2010 Linuxfest presentation 2010-04-24 08:06:07 -07:00
Tom Eastep
6053352f8c A better fix for find_first_interface_address()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-23 20:06:45 -07:00
Tom Eastep
2cb3bac946 Document fix for find_first_interface_address() 2010-04-23 12:18:51 -07:00
Tom Eastep
232fc21fe2 Allow find_first_interface_address[_if_any] to work properly in the params file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-23 11:54:36 -07:00
Tom Eastep
b821bdcdfd One more pass at improving regex's for target isolation and matching
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-22 14:45:34 -07:00
Tom Eastep
64bf772594 Set OUTPUT policy to ACCEPT when optimize_chain deletes all of its rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-22 13:38:38 -07:00
Tom Eastep
b0b39cfc39 Document optimization level 2 fix.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-22 11:55:13 -07:00
Tom Eastep
fb754b3a2e Don't remove a lone ACCEPT rule from the OUTPUT chain
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-22 11:35:14 -07:00
Tom Eastep
0dde75d345 Fix install scripts (again)
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-19 13:08:03 -07:00
Tom Eastep
a0abb11f67 Extend 'show log <ipaddr>' to search for a regular expression.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-19 13:02:21 -07:00
Tom Eastep
8c09f21e5d Implement 'show log <token>'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-19 10:20:28 -07:00
Tom Eastep
32d3e50c05 Remove extra <emphasis> <\emphasis>
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-17 08:54:37 -07:00
Tom Eastep
66a07c3ce6 Update copyright in UPnP Doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-17 08:51:57 -07:00
Tom Eastep
a620aa22f9 Remove outdated information from the UPnP doc.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-17 08:51:11 -07:00
Tom Eastep
a1a78cf09b Abandon the fantesy that multiple optimize 8 passes will achieve anything.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-16 17:12:08 -07:00
Tom Eastep
938cfd7ba4 Don't create fw-><bport> chains and rules.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-16 12:29:51 -07:00
Tom Eastep
c52a3dcd14 Don't generate policy chains for fw to bridgeport zones.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-16 09:56:11 -07:00
Tom Eastep
1030c852f9 Simplify a test
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-16 09:21:30 -07:00
Tom Eastep
e7a4aaafc1 Modify optimization 8 loop to continue until no chains are combined.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-16 09:17:57 -07:00
Tom Eastep
8e1284f74c Document OPTIMIZE=15
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-16 09:17:12 -07:00
Tom Eastep
4f00de0c57 Make additional optimize 8 passes.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-16 08:42:25 -07:00
Tom Eastep
21b44ac42b Change version to 4.4.9-Beta4
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-16 07:25:53 -07:00
Tom Eastep
0a9b7c75d0 Delete misleading wording in the explaination of rate limiting
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-16 06:24:35 -07:00
Tom Eastep
82d6ba511f Unify the REs that look for '-[jg] <chain>'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-15 18:02:31 -07:00
Tom Eastep
cec59360f6 Use '-j' rather than '-g' when jumping to tcpre, just to be safe
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-15 14:14:13 -07:00
Tom Eastep
46d207a86f Restore original amount of whitespace in maclist rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-15 14:13:37 -07:00
Tom Eastep
e9a94b0cfb Unify reference count adjustment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-15 14:12:48 -07:00
Tom Eastep
cf59d9ec68 Fix an optimize 8 bug.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-15 12:45:00 -07:00
Tom Eastep
dde540c42d Update release notes for optimize 4 problems.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-15 12:44:37 -07:00
Tom Eastep
c1bcf360ee Fix another 'add_rule' that should have been an 'add_jump'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-15 09:59:57 -07:00
Tom Eastep
f7e48a94da Fix install scripts.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-15 09:39:21 -07:00
Tom Eastep
96d69bd8c3 Centralize message generation; optimize optimization-8 loop
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-15 09:29:37 -07:00
Tom Eastep
9ad5ee1818 Add correct release id.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-15 07:25:35 -07:00
Tom Eastep
704eb1ee8e Fix lib.private in the Multi-ISP doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-14 19:05:42 -07:00
Tom Eastep
aeb90969f7 Optimize 8 Documentation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-14 17:12:25 -07:00
Tom Eastep
cff6f0010f Remove chain name after '-A' (again).
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-14 17:05:03 -07:00
Tom Eastep
f8bacb54ef Optimize 8
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-14 13:21:10 -07:00
Tom Eastep
3b6b7a4099 Add simple tc files to basics doc 2010-04-11 17:00:19 -07:00
Tom Eastep
b3f57ae5dc Add 'preview' to Perl doc 2010-04-11 14:31:32 -07:00
Tom Eastep
eb0abb3dd7 Remove 'Beta' status from 4.4 2010-04-11 12:49:30 -07:00
Tom Eastep
4137961169 Speed up the replace_references* functions.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-11 09:00:24 -07:00
Tom Eastep
715ea9ef32 Speed up delete_jumps()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-11 08:38:14 -07:00
Tom Eastep
91a711b34f Document startup log fix.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-10 11:54:54 -07:00
Tom Eastep
4365b83b15 Rationalize init logs
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-10 11:46:50 -07:00
Tom Eastep
76b9ef7005 Use unshift rather than splice for readability
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-10 09:25:29 -07:00
Tom Eastep
2e443df8e3 Adjust references in move_rules()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-10 09:09:46 -07:00
Tom Eastep
ff73d802da More cleanup of rule and chain deletion:
- Rename purge_jumps() to delete_jumps()
- Add delete_chain() function
- Remove an unnecessary assertion

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-10 08:37:17 -07:00
Tom Eastep
1de304bfd9 Relocate purge_jumps() and change the loop exit condition to be a bit safer.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-09 13:51:44 -07:00
Tom Eastep
14477d61fe Verify that purge_jumps() reset the 'to' chain's referenced flag.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-09 12:28:01 -07:00
Tom Eastep
627468432e Merge branch 'master' of ssh://shorewall.git.sourceforge.net/gitroot/shorewall/shorewall 2010-04-09 11:38:55 -07:00
Tom Eastep
2ff1df53da Unify chain deletion.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-09 11:38:18 -07:00
Tom Eastep
14a1a08337 Unify deletion of rules.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-09 11:32:34 -07:00
Tom Eastep
7a831107c7 Replace the complex rule deletion loops with C-stype for loops.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-09 09:58:32 -07:00
Tom Eastep
9dc8267888 Don't apply RE to rules that we've already checked.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-09 09:46:07 -07:00
Tom Eastep
1e078b8c8d Use splice() to delete rules from chains
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-09 09:38:03 -07:00
Tom Eastep
2f3f591af1 Document removal of fallback scripts.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-09 07:43:36 -07:00
Tom Eastep
b20d5ec227 Delete remaining fallback scripts
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-09 07:38:46 -07:00
Tom Eastep
56bc28a182 Prepare 4.4.9 Beta 3
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-09 07:32:21 -07:00
Tom Eastep
c2c0fb0dd2 Fix deletion of only rule in a chain
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-08 17:20:11 -07:00
Tom Eastep
ab1a27ca2a Update version to 4.4.9 Beta 2
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-08 13:14:51 -07:00
Tom Eastep
9a00191c88 Remove a 'defined' test that is no longer needed.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-08 13:12:17 -07:00
Tom Eastep
359c221783 Keep rules arrays compressed throughout the compilation process
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-08 12:53:30 -07:00
Tom Eastep
3937c10251 Keep rule arrays compressed during optimization
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-08 11:35:15 -07:00
Tom Eastep
9126cc63d9 Delete unused rules arrays
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-08 10:55:31 -07:00
Tom Eastep
c668707aac Update release docs with optimize 4 fix.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 20:18:56 -07:00
Tom Eastep
cca2c18370 Another case where reference counts are wrong
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 20:07:03 -07:00
Tom Eastep
aeb3b277b0 Fix reference count issue
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 19:47:49 -07:00
Tom Eastep
9d7d7e06d8 Update release documents
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 14:43:50 -07:00
Tom Eastep
48692f5c4a Fix find_first_interface_address() in IPv6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 14:38:56 -07:00
Tom Eastep
3711e64d71 Fix for 0 values propagated to the script
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 14:38:29 -07:00
Tom Eastep
3092a85999 SWAG regarding LOG_VERBOSITY issue
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 13:43:57 -07:00
Tom Eastep
c49e3076ec Recode fix for find_first_interface_address()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 13:28:07 -07:00
Tom Eastep
eb47b9b54f Add a comment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 13:17:11 -07:00
Tom Eastep
62c9cb7b36 Change 'first_install' tests
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 13:16:16 -07:00
Tom Eastep
f17365cf6d Fix find_first_interface_address()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-07 13:05:42 -07:00
Tom Eastep
7ab3c6a612 Add /etc/shorewall/interfaces to the IFB instructions.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-06 16:14:58 -07:00
Tom Eastep
450f2787ba Cover 1:1 NAT in FAQ 2d.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-06 08:06:06 -07:00
Tom Eastep
9bf87bc5e1 Add FAQ 2d.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-06 08:02:20 -07:00
Tom Eastep
a670c05043 Reword reference to RFC 4787.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-06 07:48:35 -07:00
Tom Eastep
5e30c5683c Tone down response to Shorewall FAQ 2 and provide RFC reference.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-06 07:44:43 -07:00
Tom Eastep
3b317afb2f Add mDNS macro from Vincent Smeets.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-04-03 15:57:50 -07:00
Tom Eastep
430cbf310f Revise FAQ 73 to match reality.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-31 08:38:29 -07:00
Tom Eastep
427b14b21d Clean up file headers in the .conf files.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-30 11:53:36 -07:00
Tom Eastep
ee8270aadf Correct typo in the FAQ.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-30 11:35:33 -07:00
Tom Eastep
9a720cf516 Further clarify the use of log levels with macros
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-30 08:14:32 -07:00
Tom Eastep
18bb6c94ca Improve formatting of 'rules' manpages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-30 08:08:57 -07:00
Tom Eastep
af893b6296 Add 'N' trace records for chain creation.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-30 07:32:38 -07:00
Tom Eastep
c57ee7d68d Update release notes with additional trace information.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-30 07:23:17 -07:00
Tom Eastep
b2d8039ff6 Remove unnecessary text and 'before' images from trace entries
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-30 07:12:22 -07:00
Tom Eastep
7e97e9519d Conditionally trace writes by copy2().
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-29 11:56:26 -07:00
Tom Eastep
51d4bf19b5 Conditionally trace writes by copy2().
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-29 11:56:06 -07:00
Tom Eastep
dc7d4bdb09 Document CS->GS trace change.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-29 09:50:42 -07:00
Tom Eastep
350a89e449 More complete generated script trace
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-29 09:48:23 -07:00
Tom Eastep
5c91fb40e2 Remove unneeded test; correct typo
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-29 09:04:45 -07:00
Tom Eastep
db2bed06d8 Add 'T' to the documented netfilter trace types.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-29 08:31:12 -07:00
Tom Eastep
b261a5b2ec Document netfilter trace types.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-29 07:23:17 -07:00
Tom Eastep
6d7226ae93 Remove special trace entries
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-28 16:31:03 -07:00
Tom Eastep
1fd656b8c9 Tweak trace facility
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-28 15:31:05 -07:00
Tom Eastep
3b07053d3b Document new 'trace' facility
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-28 14:37:22 -07:00
Tom Eastep
b0733d93ee Implement a more robust trace
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-28 13:09:04 -07:00
Tom Eastep
ef4237f5a0 Avoid verbosity overflow/underflow
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-28 07:27:27 -07:00
Tom Eastep
5ad0088ce7 Describe required quoting in shorewall[6].conf
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-28 07:12:16 -07:00
Tom Eastep
1236cccc6a Set 'forward=1' on all interfaces in the multi-interface samples
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-27 16:46:05 -07:00
Tom Eastep
3e215d0482 Minor cleanup in the Chains module.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-27 08:18:41 -07:00
Tom Eastep
1153ff0c75 Avoid a shell warning when brctl is not installed.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-27 07:33:40 -07:00
Tom Eastep
f30cd7e287 Clarify provisional policy handling.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-26 08:02:49 -07:00
Tom Eastep
ad08d2195e Add a short section about bridged OpenVPN configurations.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-25 15:30:46 -07:00
Tom Eastep
5a36606167 Document fix of EXTERNAL handling in proxyarp.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-25 12:13:52 -07:00
Tom Eastep
6cdc1ab7a2 Allow a logical interface name in the EXTERNAL column of the proxyarp file
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-25 11:41:06 -07:00
Tom Eastep
a0a5c55a63 Add omitted defect to 4.4.8 problems corrected
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-25 10:14:39 -07:00
Tom Eastep
7d91edc6ec Remove redundant line of code
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-23 12:49:06 -07:00
Tom Eastep
626b28fcd0 Auto-detect bridge when no options specified. Remove extra logic.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-23 09:28:11 -07:00
Tom Eastep
05752dcf0b Auto-detection of bridges -- release documents.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-23 08:58:44 -07:00
Tom Eastep
5e9aceae68 Detect bridges
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-23 08:38:54 -07:00
Tom Eastep
8fc1a08766 Expand Split DNS Article 2010-03-22 19:57:23 -07:00
Tom Eastep
f9327d34e1 Add 'blacklst' to the documented unoptimized chains.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-22 06:58:29 -07:00
Tom Eastep
914d829a49 Don't optimize the 'blacklst' chain
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-22 06:47:39 -07:00
Tom Eastep
2e7a0297db More LOGBURST/LOGRATE clarification.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-21 07:35:38 -07:00
Tom Eastep
6ac549ef4e Add a comment explaining why avoiding creation of the blacklst chain
and branching to it is a bad idea.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-21 07:24:29 -07:00
Tom Eastep
925c61f6bd Additional advice re: LOGBURST and LOGRATE
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-20 07:08:10 -07:00
Tom Eastep
6fc347b9be Prepare 4.4.9-Beta1
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-20 07:06:47 -07:00
Tom Eastep
9a88156769 Back off on not jumping to the blacklist chain when there are no blacklist entries.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-19 11:32:22 -07:00
Tom Eastep
fae29bcf6f Change version to 4.4.8
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-19 10:17:32 -07:00
Tom Eastep
508475d80b Avoid panic among the user base by suppressing missing table error messages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-19 10:10:20 -07:00
Tom Eastep
b22b279bd1 Some additional idiot-proofing.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-19 10:01:02 -07:00
Tom Eastep
a71f5df64f Fix indentation and quoting in TC progress messages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-19 06:59:58 -07:00
Tom Eastep
f44dbcf20b More copyright updates
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-18 11:13:51 -07:00
Tom Eastep
91bc3b3293 Mark a restored configuration as 'Restored' rather than 'Started'.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-17 10:10:56 -07:00
Tom Eastep
1177540fd8 Update version to RC2
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-16 12:39:35 -07:00
Tom Eastep
66c883de2c Fix UDPLITE handling of source port when no dest port given.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-16 10:45:31 -07:00
Tom Eastep
b2a56cd542 Copyright update
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-16 09:53:51 -07:00
Tom Eastep
a01fa345b7 Add support for UDP Lite
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-16 09:42:50 -07:00
Tom Eastep
5ac2b16936 Correct typo in comment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-16 08:49:17 -07:00
Tom Eastep
16bbe780c7 Try to avoid printing import banners unnecessarily
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-16 07:23:02 -07:00
Tom Eastep
787cec4fe7 Fix 'uninitialized variable' bug in Config::copy2
Bug reported by Tuomo Soini

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-16 07:12:39 -07:00
Tom Eastep
472425cc62 Add FAQ 6c re: dmesg 2010-03-12 12:22:39 -08:00
Tom Eastep
a2ac726ce9 Add changelog entry
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-11 18:16:31 -08:00
Tom Eastep
196cd5417f Allow 'default' optimizations to be disabled by specifying optimization 4096.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-11 17:15:44 -08:00
Tom Eastep
57dc5731b2 Add change log entry
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-10 17:31:35 -08:00
Tom Eastep
249f9412f6 Add undocumented OPTIMIZE=-1
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-10 17:31:08 -08:00
Tom Eastep
4f32be03d7 Fix typo in comment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-08 15:34:38 -08:00
Tom Eastep
0fb9333346 Update release model doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-08 13:50:24 -08:00
Tom Eastep
93494c6ae3 Eliminate nested function declarations in generate_matrix()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-08 13:11:10 -08:00
Tom Eastep
fb4f7ebd67 Update release notes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-08 08:18:10 -08:00
Tom Eastep
07cba9e066 Bump version to RC1
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-08 08:11:00 -08:00
Tom Eastep
efed2286b0 Move qt1() to lib.common
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-07 11:50:54 -08:00
Tom Eastep
696f7d6b2b Update copyright on basics doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-07 09:34:27 -08:00
Tom Eastep
ce8d1cbc59 Change port range in release notes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-07 08:39:09 -08:00
Tom Eastep
f246f728e7 Flag '-' used as a port range separator
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-07 08:36:26 -08:00
Tom Eastep
7ee96c41e0 Tweak OpenVZ doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-07 07:26:12 -08:00
Tom Eastep
1c293d17dc Formatting improvements in OpenVZ doc.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-06 12:46:42 -08:00
Tom Eastep
9b1483d93e Update OpenBZ Doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-06 12:40:52 -08:00
Tom Eastep
4e18414fd7 Uninstall the logrotate scripts
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-06 09:24:51 -08:00
Tom Eastep
5671a7ae2f Add new options to online usage info.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-06 08:45:43 -08:00
Tom Eastep
88447bfc7d Avoid dropping first line of library source text
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-06 08:45:21 -08:00
Tom Eastep
2d458b46b4 Update help text in prog.header*
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-06 08:13:33 -08:00
Tom Eastep
928b162d3c Fix bug in handling of -p option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-06 08:12:04 -08:00
Tom Eastep
7557b4b5fb Update version to 4.4.8 Beta 3
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-06 07:41:29 -08:00
Tom Eastep
fe089ddc36 Don't copy headers in imported libraries
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-06 07:40:43 -08:00
Tom Eastep
e9dffbace2 Correct Type in Extension Script Doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-06 06:43:14 -08:00
Tom Eastep
bcfa98bf4d Remove extraneous comment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-05 11:36:22 -08:00
Tom Eastep
117d79ec02 Remove duplicate declaration
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-05 11:33:43 -08:00
Tom Eastep
c8d8d75cae Cosmetic change
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-05 10:40:18 -08:00
Tom Eastep
707ec67430 Corrections/additions to IPv6 shell libraries.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-05 07:59:03 -08:00
Tom Eastep
35974535b2 More removal/relocation of functions.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-05 07:29:27 -08:00
Tom Eastep
f8c7a284a5 Remove duplicate/unneeded functions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-05 07:02:00 -08:00
Tom Eastep
8e5114859c Only load lib.base and lib.cli (lib.base loads lib.common)
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-05 06:51:13 -08:00
Tom Eastep
b4d4cedef9 Fix silly bug in 'show dynamic <zone>'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-04 19:05:47 -08:00
Tom Eastep
a0ea84a8c6 Make the -lite command line tools compatible with lib.common
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-04 14:05:31 -08:00
Tom Eastep
f06bb65ffb Correct variable handling in shorecap
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-04 13:19:18 -08:00
Tom Eastep
abb943bfb7 Do library consolidation on IPv6 and load lib.cli into shorecap.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-04 13:11:33 -08:00
Tom Eastep
50330f71f6 Move many routines into lib.common.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-04 12:38:02 -08:00
Tom Eastep
3e4d9b3118 Rename lib.run -> lib.common 2010-03-04 12:13:41 -08:00
Tom Eastep
7757c0bc20 Rename lib.run to lib.common
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-04 09:54:56 -08:00
Tom Eastep
41d709b043 Allow 'get_script_version' to correctly handle point releases
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-04 09:40:48 -08:00
Tom Eastep
7b52d812ae Generate correct library path name
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-04 09:40:18 -08:00
Tom Eastep
24432a5f76 Back out dumb change to install.sh
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-04 09:17:57 -08:00
Tom Eastep
4c081e5998 Add lib.run
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-04 09:12:48 -08:00
Tom Eastep
5d87983803 Update change log. Remove anacronistic comment.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-03 16:14:15 -08:00
Tom Eastep
1d52683af8 Don't display 'Old' capabilities that are not enabled.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-03 15:28:49 -08:00
Tom Eastep
a963c8f955 Don't export CONFDIR or SHAREDIR
Document CONFDIR, SHAREDIR and VARDIR
Add FILEMODE to the old reserved variable names

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-03 11:46:23 -08:00
Tom Eastep
a4414a9695 Delete references to unimplemented functions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-03 10:53:40 -08:00
Tom Eastep
3f73b3c408 Export *DIR variables
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-03 10:39:18 -08:00
Tom Eastep
49c1350aa0 Documentation for final cleanup of variable names
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-03 10:28:09 -08:00
Tom Eastep
c6981de0e5 Complete elimination of globals that are not .conf options
Documentation to follow

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-03 09:50:07 -08:00
Tom Eastep
ee74696747 IPv6 work to only export when necessary
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-03 08:59:58 -08:00
Tom Eastep
234e4fa754 Update module versions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-03 08:51:55 -08:00
Tom Eastep
7457f643ee Don't export globals when the script is 4.4.8 or later
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-03 08:51:40 -08:00
Tom Eastep
70296b4bd6 Some fixes for -lite changes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 17:16:11 -08:00
Tom Eastep
78a39ccad5 Centralize exporting
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 16:03:44 -08:00
Tom Eastep
cce4bf277a Reduce export usage; Allow PURGE and RESTOREFILE to be specified on the run-line
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 14:49:31 -08:00
Tom Eastep
2656a9b0c7 Eliminate use of PRODUCT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 12:34:36 -08:00
Tom Eastep
5613d0105a Remove all reliance on HOSTNAME
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 11:59:38 -08:00
Tom Eastep
68f5215f07 Remove Reliance on HOSTNAME in generated programs
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 11:45:35 -08:00
Tom Eastep
82bb80cbba Put real fwlogwatch output in the FAQ
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 08:18:20 -08:00
Tom Eastep
55e1124bbe Update docs regarding VERSION
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 08:18:01 -08:00
Tom Eastep
3ea6f6792f Eliminate VERSION reserved variable name
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 08:02:10 -08:00
Tom Eastep
5fc6d58e19 Eliminate STOPPING variable
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 07:37:30 -08:00
Tom Eastep
d4936f4bad Tweak to an RE used in optimization
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-02 06:58:09 -08:00
Tom Eastep
9ec5f36549 Add fwlogwatch info 2010-03-01 12:17:09 -08:00
Tom Eastep
169f97d76b Fix typo
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-01 11:28:54 -08:00
Tom Eastep
8cfcacc862 Update release document with fix for multiple policy matches
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-01 08:40:20 -08:00
Tom Eastep
f11bfd3890 Eliminate redundate setting of PRODUCT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-01 08:32:59 -08:00
Tom Eastep
cfa09dce22 Avoid multiple policy matches with OPTIMIZE=7 and not KLUDGEFREE
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-01 08:32:37 -08:00
Tom Eastep
3ba797cb14 Correct several bugs in the VERBOSITY overhaul
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-03-01 06:57:04 -08:00
Tom Eastep
53c73bc8e9 Eliminate VERBOSE
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 17:58:01 -08:00
Tom Eastep
14f83759ae Propagate VERBOSITY even though we don't use it yet
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 17:39:35 -08:00
Tom Eastep
5d840e336a Rectify anachronistic README files
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 17:30:52 -08:00
Tom Eastep
546a48543d Propagate LOG_VERBOSITY
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 17:30:11 -08:00
Tom Eastep
f98e772c96 Implement verbose changes in the -lite products
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 17:13:49 -08:00
Tom Eastep
39883aa690 Eliminate LOG_VERBOSE
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 16:58:30 -08:00
Tom Eastep
fb55d63eaf Allow verbosity to be separate from -V
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 16:42:50 -08:00
Tom Eastep
333ac21c2f Prepare the footers for 4.6.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 15:25:25 -08:00
Tom Eastep
83ed0a401b I'll eventually get it the way I like it
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 13:45:33 -08:00
Tom Eastep
585711caa8 Even simpler RE for detecting builtins
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 13:29:26 -08:00
Tom Eastep
693d0e5d4c Make new test in add_jump() a bit safer.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 12:44:29 -08:00
Tom Eastep
91a14b4e82 Make -s the default on Debian; Issue message when installing in a distro-specific way
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 09:15:11 -08:00
Tom Eastep
d2992c21f4 Update version to Beta 2 2010-02-28 09:04:37 -08:00
Tom Eastep
c9c957c5b8 HKP Macro
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-28 07:37:16 -08:00
Tom Eastep
8fadaa8f2c Add FAQ 25a 2010-02-27 16:56:23 -08:00
Tom Eastep
f0dc720740 Document -s installer option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-27 12:09:48 -08:00
Tom Eastep
3c4b41fbe0 Implement -s option in the major installers
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-27 11:48:39 -08:00
Tom Eastep
643d4831ab More all-caps variable elimination
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-26 17:05:35 -08:00
Tom Eastep
061d850c16 Rename RESTOREPATH to g_restorepath
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-26 08:35:50 -08:00
Tom Eastep
c1ac19a81e Correct a couple of typos 2010-02-25 16:35:19 -08:00
Tom Eastep
8aaddf368b More reserved variable names documented
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-25 12:37:22 -08:00
Tom Eastep
e66b8759d6 Document variable name changes.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-25 12:18:41 -08:00
Tom Eastep
abbcf8eba4 Correct handling of NFQUEUE(queue-num) in policies 2010-02-25 08:53:31 -08:00
Tom Eastep
7fe7ebc891 Fix Handling of NFQUEUE(queue-num) in policies
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-25 08:44:28 -08:00
Tom Eastep
4059fe6956 Belatedly update some version numbers
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-25 08:43:32 -08:00
Tom Eastep
dd004bacb9 Belatedly update some version numbers
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-25 07:51:08 -08:00
Tom Eastep
4dedc26d9e Correct handling of NFQUEUE(queue-num) as a policy.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-25 07:50:17 -08:00
Tom Eastep
cd2056f0aa Apply the preceding change to Shorewall6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-23 17:01:44 -08:00
Tom Eastep
4415050fd2 Eliminate another reserved variable name
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-23 17:00:26 -08:00
Tom Eastep
bffb1793d7 More global variable renaming
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-23 07:52:35 -08:00
Tom Eastep
570497766b Add COMMAND to the list of reserved variable names
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-23 07:18:54 -08:00
Tom Eastep
70a246501e Update version of Tc.pm
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-23 07:08:48 -08:00
Tom Eastep
4320ebb8b0 Add SW_* to the list of reserved variable names
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-23 06:57:29 -08:00
Tom Eastep
b2350829b9 Rename 'debugging' to 'g_debugging'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-22 16:43:38 -08:00
Tom Eastep
3fc10cd94b Prepend 'SW_' to constructed shell variable names.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-22 10:27:59 -08:00
Tom Eastep
efa41d1801 Correct a typo 2010-02-22 08:36:31 -08:00
Tom Eastep
88d29d2e35 Eliminate a couple of more all-caps variable name restrictions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-22 08:24:29 -08:00
Tom Eastep
20ca22d437 Eliminate some of the all-caps variable name restrictions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-22 08:23:17 -08:00
Tom Eastep
55c9cf3e99 Eliminate some of the reserved all-caps variable names
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-22 08:05:23 -08:00
Tom Eastep
6165a50e49 Apply debian init script change to the other packages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-21 16:42:02 -08:00
Tom Eastep
56bcb5ebc4 Remove mention of variable name change from shorewall6-params
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-21 15:19:26 -08:00
Tom Eastep
8bc6f2144a Remove mention of variable name change in 4.4.8
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-21 15:14:40 -08:00
Tom Eastep
8c3bb22511 Additions to reserved shell variables 2010-02-21 08:34:21 -08:00
Tom Eastep
2a965d42b9 Add a comment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-21 07:57:34 -08:00
Tom Eastep
70242c0d00 Correct typo in Build document
separete -> separate

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-21 06:58:23 -08:00
Tom Eastep
3a9416fb87 Correct Build article:
- Change lists.shorewall.net to www1.shorewall.net
- Correct partial upload example

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-21 06:56:12 -08:00
Tom Eastep
e690303937 Modify Roberto's patch for 'show <chain>' error reporting
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-20 19:09:54 -08:00
Tom Eastep
8baa4e60c9 Merge branch 'master' of ssh://teastep@shorewall.git.sourceforge.net/gitroot/shorewall/shorewall 2010-02-20 18:59:17 -08:00
Roberto C. Sanchez
6a3b2b0dee Clarify error message when user asks shorewall to show a non-existent chain 2010-02-20 21:57:45 -05:00
Tom Eastep
6307653a01 Pick up one fix from 4.4.7.4 regarding CONTINUE rules.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-20 09:42:58 -08:00
Tom Eastep
5696742ef3 Update release Document with 4.4.7.5 changes and Debian Init Script Fix
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-20 08:34:47 -08:00
Tom Eastep
a83663bf25 Return failure status when a supported command fails.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-20 08:20:42 -08:00
Tom Eastep
edaf541850 Don't apply rate limiting twice in ACCEPT+ rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-19 14:01:45 -08:00
Tom Eastep
c030bc900c List variable names to be avoided in manpages and config file basics doc.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-19 08:12:56 -08:00
Tom Eastep
ceff8adc78 Restore duplicate interface detection in tcinterfaces.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-18 16:11:30 -08:00
Tom Eastep
3a2173ddb4 Some code cleanup in Tc.pm.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-18 15:56:59 -08:00
Tom Eastep
ea8be87720 Use Hex representation of device numbers > 9 in simple TC.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-18 12:53:01 -08:00
Tom Eastep
4e0225a4c3 Update Documentation for per-IP rate limiting fixes.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-18 07:12:36 -08:00
Tom Eastep
ea8a6c837f Document per-IP rate change
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-17 15:41:12 -08:00
Tom Eastep
00b0490cd7 Create a unique hashtable for each instance of a per-IP rate limit
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-17 15:39:21 -08:00
Tom Eastep
625963a4f0 Final (hopefully) fix for SFQ handle assignment
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-17 09:02:18 -08:00
Tom Eastep
41bb0782a3 Another tweak to SFQ handle assignment.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-17 08:06:27 -08:00
Tom Eastep
5649dbf9a8 Improve assignment of class ID for SFQ classses
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-17 07:41:30 -08:00
Tom Eastep
115ce7b87d Update release documents for bug fixes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-17 06:49:13 -08:00
Tom Eastep
eaafeb8c2b Add --hashlimit-htable-expire if the units are minutes or larger 2010-02-17 06:43:52 -08:00
Tom Eastep
375160d733 Avoid duplicate SFQ class numbers 2010-02-17 06:43:16 -08:00
Tom Eastep
167b29c2c5 Bump module version in Compiler.pm
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-15 14:24:52 -08:00
Tom Eastep
8aaf4aab3a Don't create log chain for 'RETURN' rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-15 14:24:00 -08:00
Tom Eastep
4546394531 Cosmetic changes to Compiler.pm
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-15 14:07:35 -08:00
Tom Eastep
5d08d51fe5 Add $remote_fs to Required-Start and Required-Stop for Debian
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-15 08:39:50 -08:00
Tom Eastep
12d3420a5d Detect FLOW_FILTER when LOAD_HELPERS_ONLY=No 2010-02-14 10:34:19 -08:00
Tom Eastep
ba01cecbcd Explain RATE and BURST in the basics doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-14 08:54:34 -08:00
Tom Eastep
0624451537 Fix for OLD_HL_MATCH.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-14 07:22:12 -08:00
Tom Eastep
5e9ecf1491 Update version of Config module 2010-02-13 11:00:34 -08:00
Tom Eastep
50d246c8be A little cleanup of compiler.pl
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-13 10:03:32 -08:00
Tom Eastep
ec95e5b32c Document fix for rate limiting of NAT rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-13 09:11:14 -08:00
Tom Eastep
1258149e0e Don't apply rate limiting twice in NAT rules
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-13 07:21:27 -08:00
Tom Eastep
ea5a6c79bc Bump CAPVERSION 2010-02-11 16:22:47 -08:00
Tom Eastep
5a96771e07 Start 4.4.8 Beta 1 2010-02-11 15:46:57 -08:00
Tom Eastep
757fea7467 Update documentation regarding FLOW_FILTER
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-11 14:35:12 -08:00
Tom Eastep
b35f20b403 Avoid CAPVERSION bump to implement FLOW_FILTER detection
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-11 07:29:41 -08:00
Tom Eastep
b8c195f570 Accurately detect 'flow' availability
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-10 14:50:26 -08:00
Tom Eastep
b1c64913b4 Reformat column header in tcinterfaces 2010-02-10 12:00:17 -08:00
Tom Eastep
433fc385bc 'bridge' implies 'routeback'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-09 14:04:36 -08:00
Tom Eastep
add302d02a Correct typo in manpages 2010-02-09 06:49:30 -08:00
Tom Eastep
76f053246a Add description of bandwidth specification to the tcinterfaces man pages 2010-02-09 06:42:31 -08:00
Tom Eastep
01521e4941 Correct typo in simple TC doc 2010-02-08 15:40:07 -08:00
Tom Eastep
21d4c8ba21 Document workaround for lack of 'flow'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-08 10:03:10 -08:00
Tom Eastep
1f86f54a8e Update simple TC doc with 4.4.7 workaround for lack of 'flow'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-08 08:44:40 -08:00
Tom Eastep
46e2afcf16 Ignore TYPE if old distro
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-08 07:13:20 -08:00
Tom Eastep
b45a70f98a Make 'nosmurfs' work correctly on IPv6 with Address Type Match
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-08 07:12:58 -08:00
Tom Eastep
6239218db5 Warn about absense of the 'flow' classifier.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-08 06:45:11 -08:00
Tom Eastep
18d03a61f5 Make 'nosmurfs' work with Address Type Match on IPv6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-07 08:43:31 -08:00
Tom Eastep
28b1139ef7 Add 'Tips and Hints' as an alias for the config file basics doc -- Take 2 2010-02-06 17:08:00 -08:00
Tom Eastep
b449d8168e Add 'Tips and Hints' as an alias for the config file basics doc 2010-02-06 17:03:22 -08:00
Tom Eastep
11a2ec9f7c Update version to 4.4.7 2010-02-05 16:40:48 -08:00
Tom Eastep
e64af57cae Give smurf logging chain a fixed name.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-03 16:04:59 -08:00
Tom Eastep
f4e175f149 Fix IPv6 'nosmurfs'. Make 'nosmurfs' logging more efficient.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-03 15:03:15 -08:00
Tom Eastep
97f3e5b8de Clear known problems.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-03 07:18:55 -08:00
Tom Eastep
52880a8822 Clean up generate_matrix() fix.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-03 06:57:51 -08:00
Tom Eastep
9d288241da Fix issues in generate_matrix().
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-02 19:42:54 -08:00
Tom Eastep
096fb29203 DEBUG and PURGE -- take 2.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-02 13:57:50 -08:00
Tom Eastep
1d8a7ad09f Clear DEBUG and PURGE shell variables
Delete a blank line

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-02 13:55:29 -08:00
Tom Eastep
e788b4c0f6 Mention DYNAMIC_BLACKLIST in the blacklisting doc.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-02 11:13:44 -08:00
Tom Eastep
753eb97667 Update version to 4.4.7 RC2
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-02 10:30:53 -08:00
Tom Eastep
ede17e2da0 Set ADD_IP_ALIASES=No in all shorewall.conf files.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-02 08:16:41 -08:00
Tom Eastep
dd60f04a9f Work around lack of MARK Target support 2010-02-01 16:22:57 -08:00
Tom Eastep
58f6e57286 Update known problems 2010-02-01 16:19:36 -08:00
Tom Eastep
d354560863 Finish last change.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-01 14:25:51 -08:00
Tom Eastep
f0d101605b Don't try to combine nat chains that include '-s'.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-02-01 14:24:07 -08:00
Tom Eastep
193fdc85f0 Add 'Make Install' to iptables installation instructions.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-31 12:12:55 -08:00
Tom Eastep
1981372c94 Make search for "-j ACCEPT" a little tighter
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-31 08:27:30 -08:00
Tom Eastep
f2709dd525 Correct release notes to match implementation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-30 20:31:39 -08:00
Tom Eastep
3d39a47582 Set $have_ipsec after completing parse of the hosts file.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-30 07:26:35 -08:00
Tom Eastep
659f774451 Sort %detect_capability for easier verification.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-29 13:09:53 -08:00
Tom Eastep
9d2decd26d Modify determine_capabilities to use detect_capability()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-29 10:38:22 -08:00
Tom Eastep
b8ec2be516 Clean up handling of %detect_capability
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-28 16:39:45 -08:00
Tom Eastep
ecc7861115 Validate LOAD_HELPERS_ONLY before detecting capabilities.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-28 08:05:24 -08:00
Tom Eastep
ebd847ef70 Don't display capabilties if they have not been determined
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-28 08:04:54 -08:00
Tom Eastep
05f2bb4b3a Correction to last patch.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-27 17:52:27 -08:00
Tom Eastep
103a1660bc Update release notes for RC 1
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-27 12:57:47 -08:00
Tom Eastep
9d25318d80 Fix detection of HASHLIMIT_MATCH on old kernels.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-27 12:53:31 -08:00
Tom Eastep
be117f6638 Remove traffic shaping modules from 'helpers'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-27 10:37:42 -08:00
Tom Eastep
2069855e44 Restore module loader to lib.base (it is needed by shorecap).
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-27 10:09:12 -08:00
Tom Eastep
846715b009 Remove module loading code from lib.base
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-27 09:58:14 -08:00
Tom Eastep
54456de888 Update module versions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-27 09:01:00 -08:00
Tom Eastep
c05c1a6f50 Update version to 4.4.7 RC1
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-27 06:58:44 -08:00
Tom Eastep
17fa381409 Update Build doc for revised Git layout 2010-01-25 16:27:50 -08:00
Tom Eastep
1556002b54 A couple of tweaks to the LOAD_HELPERS_ONLY optimization change.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-25 15:59:31 -08:00
Tom Eastep
fb007bc1c7 Bump version to Beta 4 2010-01-25 12:25:01 -08:00
Tom Eastep
9408a114c6 Don't load unused modules when LOAD_HELPERS_ONLY=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-25 10:50:49 -08:00
Tom Eastep
d933aa602b Eliminate 'ORIGINAL_POLICY_MATCH'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-25 08:13:22 -08:00
Tom Eastep
90b68a05de Don't export %capabilities
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-25 07:56:16 -08:00
Tom Eastep
c5f64848f6 Tweak bridge/firewall doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-24 15:28:37 -08:00
Tom Eastep
bb1f2993cc Tweaks to aliased interfaces doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-24 13:52:25 -08:00
Tom Eastep
bfdc6719c1 Fix DropBcasts()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-24 12:16:15 -08:00
Tom Eastep
83565f7a22 Updates to Actions doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-24 12:06:56 -08:00
Tom Eastep
e14d48c2cf Bump version to 4.4.7-Beta3
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-22 16:46:29 -08:00
Tom Eastep
0d63182ab4 Fix ambiguous syntax in Config.pm
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-22 16:44:45 -08:00
Tom Eastep
8dd835be2b Document LOAD_HELPERS_ONLY in the three basic HOWTOs.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-22 13:12:41 -08:00
Tom Eastep
5d5bdfc996 Remove -common from Shorewall6 installer.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-22 10:59:05 -08:00
Tom Eastep
f283c37b1c Add helpers file to shorewall6.spec
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-22 10:41:37 -08:00
Tom Eastep
199a50e1c7 Update version to 4.4.7 Beta 2
Add problems corrected to the release notes.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-22 10:35:27 -08:00
Tom Eastep
f74771a118 More LOAD_HELPERS_ONLY documentation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-21 20:30:35 -08:00
Tom Eastep
8def4d03c3 Document LOAD_HELPERS_ONLY=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-21 20:17:25 -08:00
Tom Eastep
8f85c75264 Implement LOAD_HELPERS_ONLY for IPv6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-21 15:49:44 -08:00
Tom Eastep
efc43b1b24 Add implementation of LOAD_HELPERS_ONLY
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-21 15:49:35 -08:00
Tom Eastep
a248acb4d4 Add LOAD_HELPERS_ONLY Option
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-21 15:49:23 -08:00
Tom Eastep
4303ad0a3e Add Module Helpers File
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-21 15:48:24 -08:00
Tom Eastep
10fe25050f Add TC_PRIOMAP fix to change log
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-21 10:39:40 -08:00
Tom Eastep
a7d4207bf5 Add TC_PRIOMAP to shorewall*.conf
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-21 10:38:32 -08:00
Tom Eastep
61a0e85410 Renumber FAQ 87
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-19 10:43:56 -08:00
Tom Eastep
8b50966f80 sip_direct_media was added in 2.6.26.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-19 10:36:13 -08:00
Tom Eastep
f731e04388 Mention sip_direct_media=0 in FAQ 77.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-19 10:32:34 -08:00
Tom Eastep
6b9afd6a82 Remove "-common" from installer messages
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-19 08:28:08 -08:00
Tom Eastep
188bd64242 Mention route_rules in masq manpage
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-19 07:59:00 -08:00
Tom Eastep
9788e057bf Correct filenames in install.sh -- Take 2
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-18 09:29:14 -08:00
Tom Eastep
1716995d75 Correct filenames in install.sh
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-18 09:20:09 -08:00
Tom Eastep
5cc2edf15a Add the new tc files to the repository
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-18 09:03:05 -08:00
Tom Eastep
8798d3cdb4 Install tcinterfaces and tcpri
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-18 07:39:36 -08:00
Tom Eastep
4453bb7dc8 More updates from 4.5 2010-01-17 16:18:44 -08:00
Tom Eastep
eb790c6d89 Add IPMARK and TPROXY modules to load list 2010-01-17 15:51:19 -08:00
Tom Eastep
e119037dea Make 'is_isable()' work with 'lo' 2010-01-17 15:38:20 -08:00
Tom Eastep
f072c10b18 Set version to 4.4.7 Beta1
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-17 09:10:48 -08:00
Tom Eastep
957de4b057 Add new options to shorewall[6].conf
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-17 08:50:32 -08:00
Tom Eastep
146a738e4c Document TPROXY
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-17 08:20:15 -08:00
Tom Eastep
f4102417ff Shorewall::Config changes for TPROXY from 4.5
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-17 08:15:14 -08:00
Tom Eastep
07cdb8ca82 Backport TPROXY from 4.5
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-17 08:12:44 -08:00
Tom Eastep
47007c5dbd Allow protocol to be expressed in octal or hex
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-16 14:20:47 -08:00
Tom Eastep
aad8ea837a Allow port numbers to be specified in Hex
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-16 14:00:47 -08:00
Tom Eastep
5ec7759d81 Don't pass an undefined value to fatal_error when numeric conversion fails.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-16 12:35:18 -08:00
Tom Eastep
5ae3e239e6 Update manpages for functionality backported from 4.5
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-16 11:51:32 -08:00
Tom Eastep
fddb85189e Update release documents for functionality backported from 4.5.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-16 11:32:50 -08:00
Tom Eastep
4bf0b8e1dd Add new configuration options and optimization changes from 4.5
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-16 09:53:53 -08:00
Tom Eastep
c39f3c12c9 Add FAQ about Snort
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-16 08:32:24 -08:00
Tom Eastep
d5cc302ad9 Start 4.4.7
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-16 08:11:13 -08:00
Tom Eastep
25d433b36f Update TRACK_PROVIDER description in the man pages.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-14 08:36:22 -08:00
Tom Eastep
45d975cb45 Final editing of release notes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-14 08:25:32 -08:00
Tom Eastep
81a5723009 Add appropriate 'use' statement to Limit code
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-14 08:04:08 -08:00
Tom Eastep
6e998edd48 Correct typo -- TC_EXPORT -> TC_EXPERT
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-14 07:48:19 -08:00
Tom Eastep
ce96bb003e Update manpages for TRACK_PROVIDERS
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-14 07:48:01 -08:00
Tom Eastep
ebf1e55609 Version to 4.4.6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 15:38:19 -08:00
Tom Eastep
1f1812b786 Document mDNS change in the release notes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 13:24:24 -08:00
Tom Eastep
bffe8ce4c6 Add multicast address to mDNS macro
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 13:20:07 -08:00
Tom Eastep
79f8031267 Add IGMP to the mDNS macro.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 13:03:34 -08:00
Tom Eastep
b8b7555ff9 Add "[ <device> ]" to "show tc" usage syntax
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 12:28:20 -08:00
Tom Eastep
880cd269c7 More mark geometry misses
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 12:16:40 -08:00
Tom Eastep
72de96760f One more 0xFF -> $globals{TC_MASK} fix
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 12:11:00 -08:00
Tom Eastep
890cbfbd5d Document TRACK_PROVIDERS change in the release notes.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 10:59:34 -08:00
Tom Eastep
10c5630786 A few more instances of TC_MASK
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 10:50:14 -08:00
Tom Eastep
555133fa3c Bump version to 4.4.6-Beta2
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 10:14:31 -08:00
Tom Eastep
505a2bac22 Make it clear that the variable expansion restriction applies to config files
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 08:38:16 -08:00
Tom Eastep
b4b6dce7c8 Add some comments
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 08:12:00 -08:00
Tom Eastep
4821d5e8b7 Change quantum to 1875 for simple TC SFQ.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 08:11:49 -08:00
Tom Eastep
ed3d3855f2 Correct typo in Shell Variable section
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-13 08:10:56 -08:00
Tom Eastep
55e41483de Update Release Documents
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 20:12:31 -08:00
Tom Eastep
38b8a8a7fd Allow Shorewall6 to display the tc config of one interface
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 19:09:46 -08:00
Tom Eastep
db2a1fe749 Add lib.cli changes to 4.4.6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 18:57:04 -08:00
Tom Eastep
2b39d7f522 Update version references for simplified TC
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 17:33:47 -08:00
Tom Eastep
416f600181 Update shorewall.conf(5) for Simplified TC
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 17:27:23 -08:00
Tom Eastep
f69a741691 Port Simplified TC to 4.4.6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 17:01:20 -08:00
Tom Eastep
7e183e8eb4 Change version to 4.4.6-Beta1
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 15:57:55 -08:00
Tom Eastep
57672d096c Don't invoke 4.5 optimization under 4.4.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 15:47:14 -08:00
Tom Eastep
ae31a09e8b Move code and add comments:
- Declare all of the 'preview' helpers together in Chains.pm
- Add some clarifying comments in the compiler.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 15:32:59 -08:00
Tom Eastep
4420eed8d7 Allow users to preview the generated ruleset.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 15:32:50 -08:00
Tom Eastep
271e472d3d Export empty RECOVERING from the -lite programs
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 13:54:14 -08:00
Tom Eastep
818dfb6295 Document 'show macro' in the release docs.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 13:46:14 -08:00
Tom Eastep
cab1f8548a Update manpage for correct version at introduction.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 13:43:52 -08:00
Tom Eastep
5bd050f8b6 Update manpage for 'show macro' command
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 13:40:54 -08:00
Tom Eastep
6c62f14749 Add 'show macro' command
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 13:40:25 -08:00
Tom Eastep
d164880381 Update Lenny->Squeeze doc to indicate that 4.4 is now in Sid
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 12:28:35 -08:00
Tom Eastep
3822fe98c2 Correct typo in Multi-ISP doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 11:20:56 -08:00
Tom Eastep
4be3cbe97b Expand DHCP relay instructions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 09:13:29 -08:00
Tom Eastep
341617b5b8 Update DHCP document for forwarding.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 07:55:58 -08:00
Tom Eastep
4464094773 Update release documents for DHCPfwd
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 07:51:20 -08:00
Tom Eastep
b6a7723c05 Add DHCPfwd macro
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 07:48:55 -08:00
Tom Eastep
baa893773d Apply Macro changes from Tuomo Soini
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-12 07:35:41 -08:00
Tom Eastep
6b085b7897 Update module versions
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-11 18:54:23 -08:00
Tom Eastep
5b4e9eb8e6 Revert change with migration issue
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-11 15:30:33 -08:00
Tom Eastep
0b549c7a15 Suppress mark geometry output
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-11 14:55:42 -08:00
Tom Eastep
fc8bfdcbf9 Update release documents
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-11 14:49:45 -08:00
Tom Eastep
1a74dbf93e Add mark geometry changes to Shorewall::Chains and Shorewall::Compiler
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-11 14:39:22 -08:00
Tom Eastep
01293427f5 Add Mark Geometry changes to Shorewall::Tc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-11 14:29:34 -08:00
Tom Eastep
4f5bb5e90b Add new mark geometry changes to Shorewall::Providers
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-11 14:22:01 -08:00
Tom Eastep
d2d2912534 Add New mark geometry variables to Shorewall::Config
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-11 14:16:03 -08:00
Tom Eastep
ab86994d68 Delete tc4shorewall link from the traffic shaping page
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-11 12:48:23 -08:00
Tom Eastep
4e50ea14ea Back out EXMARK detection since it is unused in 4.4.
Long overdue change to LIBVERSION

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-09 09:30:25 -08:00
Tom Eastep
b0feeb805d Fix typo in clear_firewall()
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-09 07:28:57 -08:00
Tom Eastep
a1e46b68f0 Add [...] to IPv6 doc.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-08 15:11:19 -08:00
Tom Eastep
54b21365c2 Update release documents for [...] change
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-08 13:58:15 -08:00
Tom Eastep
e6c0c8f6b7 Allow both <...> and [...] for IPv6 Addresses
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-08 13:55:13 -08:00
Tom Eastep
a2efc8e827 Correct log file for Debian and derivatives
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-07 11:41:27 -08:00
Tom Eastep
bbce309791 Bring 4.4.6 Lenny->Squeeze in sync with the 4.5.3 version
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-06 09:09:36 -08:00
Tom Eastep
83c2473d78 Correct typo in error message
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-06 08:26:13 -08:00
Tom Eastep
ca4eee3ae4 Correct handling of 'refresh' failures
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-06 08:01:46 -08:00
Tom Eastep
db819b1d3f Update release notes to qualify when ipsets are restored by 'restore'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-06 07:57:02 -08:00
Tom Eastep
314536dd74 Correct typo in shorewall6
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-06 07:45:53 -08:00
Tom Eastep
605da92eca Don't try to restore ipsets when 'restore' is being used to recover
from a start/restart failure.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-06 07:44:34 -08:00
Tom Eastep
d362af9fb6 Set CAPSVERSION to 4.4.7 just to be safe.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-05 10:00:29 -08:00
Tom Eastep
ab1dc03986 Implement EXMARK capability
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-05 09:35:11 -08:00
Tom Eastep
556170c990 Replace SVN by GIT in Documentation Index
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-05 07:48:47 -08:00
Tom Eastep
1f49d49464 Update Build Document
- Copyright
- Add additional options to build44
- Add warning about xmlto
- Correct a couple of typos

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-05 07:41:27 -08:00
Tom Eastep
4d3887c4f6 Recommend EXPORTPARAMS=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 16:31:49 -08:00
Tom Eastep
0c92e05509 Update the Shorewall-perl document regarding SAVE_IPSETS.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 14:45:27 -08:00
Tom Eastep
1175fa23b8 Update shorewall.conf (5) to indicate that SAVE_IPSETS was re-enabled in
shorewall 4.4.6.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 14:38:01 -08:00
Tom Eastep
d6123a8fbc Improve IPSET_SAVE restore logic:
- Call startup_error() rather than fatal_error()
- Call startup_error when restore-ipsets file exists but Shorewall is running

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 14:23:33 -08:00
Tom Eastep
84051ca19a Update the release notes regarding SAVE_IPSETS and save/restore
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 12:49:58 -08:00
Tom Eastep
559e22706b Correct manpage re save/restore
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 12:45:58 -08:00
Tom Eastep
4e0f9b2ef3 Make save/restore work with SAVE_IPSETS=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 12:43:12 -08:00
Tom Eastep
e3c75dcfcc Document the restoration of SAVE_IPSETS=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 11:54:59 -08:00
Tom Eastep
91b65125aa Update manpage for SAVE_IPSETS.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 11:50:33 -08:00
Tom Eastep
1aa55779e2 Re-enable SAVE_IPSETS=Yes
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 11:14:45 -08:00
Tom Eastep
b491eae3c0 Document Lenny/xtables-addons hack
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 10:20:40 -08:00
Tom Eastep
a1fd3aa7e3 Add a hack to work around a 'feature' of xtables-addons on Lenny
Be more careful about checking for the ipset utility before saving the ipsets

Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-04 10:15:27 -08:00
Tom Eastep
f306018159 Update all .conf files to specify 'MODULE_SUFFIX=ko'
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-02 09:33:27 -08:00
Tom Eastep
cf8239e1d9 Lite copyrights
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-01 13:27:48 -08:00
Tom Eastep
5ecf0e826a Shorewall6 copyrights
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-01 13:03:52 -08:00
Tom Eastep
55e874b23f Update copyrights
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2010-01-01 12:58:27 -08:00
Tom Eastep
65c282af8b Delete temporary nat chain used in capabilities detection.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
2009-12-31 10:42:21 -08:00
Tom Eastep
ea2ab6e4b6 A better solution to Marcus Limosani's issue 2009-12-29 08:22:15 -08:00
Tom Eastep
c19e7715c4 Display IPv6 Neighbors in dump 2009-12-28 16:57:55 -08:00
Tom Eastep
f568f3df9e Final fix for Marcus Limosani's problem 2009-12-28 15:05:54 -08:00
Tom Eastep
738a6de11b Make use of interface chains deterministic 2009-12-28 07:36:15 -08:00
Tom Eastep
167d86746c Correct typo in usage output 2009-12-27 11:56:38 -08:00
Tom Eastep
f933816735 Simplify handling of packet clearing 2009-12-26 15:04:41 -08:00
Tom Eastep
a7865e7e0e Fix simple TC typo 2009-12-26 12:44:42 -08:00
Tom Eastep
7e3675fb30 Move 4.5 manpage/doc updates to master 2009-12-26 12:40:16 -08:00
Tom Eastep
3bd3defd8e fix formatting in shorewall6-interfaces(5) 2009-12-24 08:16:29 -08:00
Tom Eastep
d62f3a4fed Set version to 4.4.6 2009-12-24 08:00:59 -08:00
Tom Eastep
d5c695258a Document 'forward' option in shorewall6-interfaces(5) 2009-12-24 07:58:59 -08:00
Tom Eastep
f233b86278 Fix 'forward' interface option in IPv6 2009-12-24 07:51:44 -08:00
Tom Eastep
58977a1905 Make Shorewall6 shut up about missing KERNELVERSION 2009-12-23 15:50:49 -08:00
Tom Eastep
e38df7efcb Fix another bug in ROUTE_FILTER Handling 2009-12-23 15:13:43 -08:00
Tom Eastep
e37cf0a370 Fix other issues with rp_filter fix 2009-12-20 15:54:41 -08:00
Tom Eastep
d87d0893d2 Fix typos in the release notes 2009-12-20 12:05:35 -08:00
Tom Eastep
8eb6d136ae Fix typo in release notes 2009-12-19 18:25:48 -08:00
Tom Eastep
d45dd5387a Fix type on release notes 2009-12-19 18:23:15 -08:00
Tom Eastep
61b2ed7b57 Fix bug that prevented routefilter=2 2009-12-19 16:57:16 -08:00
Tom Eastep
15a1b39822 Update change log 2009-12-19 16:40:13 -08:00
Tom Eastep
436169f0b2 Update documentation for rp_filter change 2009-12-19 16:09:20 -08:00
Tom Eastep
9cf75a4253 Revert "this is crap"
This reverts commit 7be7ef6685.
2009-12-19 16:05:28 -08:00
Tom Eastep
7be7ef6685 this is crap 2009-12-19 16:05:13 -08:00
Tom Eastep
d5914addd1 Disallow port 00 2009-12-19 14:59:03 -08:00
Tom Eastep
19af1a081c Handle kernel 2.6.31 and rp_filter 2009-12-19 13:47:12 -08:00
Tom Eastep
4f4d77be48 Add Kernel Version to the capabilities 2009-12-19 12:42:39 -08:00
Tom Eastep
24ddacb4a7 Adjust module versions 2009-12-19 07:35:30 -08:00
Tom Eastep
508e1123bb Revert change that allowed out of order policies 2009-12-19 07:24:17 -08:00
Tom Eastep
10ae98571b Revert change that allowed out of order policies 2009-12-19 07:20:00 -08:00
Tom Eastep
4bbbcc20dd Add additional advise about the routestopped file 2009-12-16 11:11:28 -08:00
Tom Eastep
182ed24b02 Add a comment to process_rule1() 2009-12-14 15:52:16 -08:00
Tom Eastep
576cd76842 Remove superfluous logic from process_rule1 2009-12-14 14:49:38 -08:00
Tom Eastep
e9d12cfc11 Remove superfluous line of code 2009-12-14 07:17:55 -08:00
Tom Eastep
c8e185554f Fix typo in MODULESDIR fix 2009-12-13 09:19:52 -08:00
Tom Eastep
c8c523622b Fix a couple of typos 2009-12-13 07:22:18 -08:00
Tom Eastep
0e19ad5ea0 Fix nonsensical combo of logmartians and routefilter 2009-12-13 07:14:13 -08:00
Tom Eastep
17802a4555 Fix typo 2009-12-13 07:08:05 -08:00
Tom Eastep
43c45a064c Add current and limit to conntrack table display 2009-12-12 09:10:24 -08:00
Tom Eastep
c56ff69c8f Another minor retitling 2009-12-11 14:25:45 -08:00
Tom Eastep
f938e9789e More release notes editing 2009-12-11 13:45:24 -08:00
Tom Eastep
beb7634ca6 Correct numerous typos in the release notes 2009-12-11 13:41:24 -08:00
Tom Eastep
c40f8e3742 Retitle the Lenny to Squeeze article 2009-12-11 13:36:33 -08:00
Tom Eastep
232423edf8 Fix typo in both 'notrack' manpages 2009-12-11 08:54:35 -08:00
Tom Eastep
6a62ced2c6 Add footnote and proviso regarding two links from the same ISP 2009-12-11 07:22:00 -08:00
Tom Eastep
9988cfb619 Remove silly logic in expand_rule() 2009-12-10 08:00:18 -08:00
Tom Eastep
a150ed1a72 Update change log 2009-12-08 13:30:55 -08:00
Tom Eastep
3214b14197 Fix macro handling of SOURCE and DEST columns 2009-12-08 13:29:06 -08:00
Tom Eastep
79ce532b69 Document fix for 'reload -c' 2009-12-08 08:30:37 -08:00
Tom Eastep
a321ec6225 Fix DONT_LOAD vs 'reload -c' 2009-12-07 14:44:46 -08:00
Tom Eastep
4076a6bca7 Fix ENHANCED_REJECT and MODULE_SUFFIX 2009-12-07 13:55:49 -08:00
Tom Eastep
5e1f550b69 Fix ENHANCED_REJECT and MODULE_SUFFIX 2009-12-07 13:51:54 -08:00
Tom Eastep
7a6ad80c8a Make kernel version detection work with non-standard version naming such as found on OpenWRT 2009-12-06 10:42:28 -08:00
Tom Eastep
c8616d4c67 Fix Shorewall6 capability detection 2009-12-05 21:35:05 -08:00
Tom Eastep
acaa9ccc55 Fix Shorewall6 capability detection 2009-12-05 21:34:03 -08:00
Tom Eastep
0e5293ffc5 Describe checking for cls_flow support 2009-12-05 09:34:39 -08:00
Tom Eastep
01ed97ad94 Describe checking for cls_flow support 2009-12-05 09:05:16 -08:00
Tom Eastep
acc985a290 Update 'flow=' description in the TC doc 2009-12-05 08:07:34 -08:00
Tom Eastep
e18238c665 Update 'flow=' description in the release notes 2009-12-05 08:05:20 -08:00
Tom Eastep
12279e57ed Add information about 'flow' to the release notes 2009-12-04 15:04:59 -08:00
Tom Eastep
083debb34e More add Debian logo to Debian-specific configuration steps 2009-12-04 09:15:15 -08:00
Tom Eastep
0e71ed18c0 Add Debian logo to Debian-specific configuration steps 2009-12-04 09:06:00 -08:00
Tom Eastep
ee2195e745 Allow LOGFILE=/dev/null 2009-12-03 16:30:06 -08:00
Tom Eastep
486f1a3493 Allow /dev/null for LOGFILE 2009-12-03 16:16:13 -08:00
Tom Eastep
a188fec942 Auto-load cls_flow and search .../sched for modules 2009-12-03 12:20:58 -08:00
Tom Eastep
4bf55883ee Auto-load cls_flow 2009-12-03 12:15:23 -08:00
Tom Eastep
4c7731fee6 Remove change log error for rejected change 2009-12-03 10:44:36 -08:00
Tom Eastep
768da64869 Remove incorrect migration consideration 2009-12-03 07:05:36 -08:00
Tom Eastep
117d4f9f2a Revert "Partial update to manpage"
This reverts commit 8d2408a8d6.
2009-11-30 11:26:33 -08:00
Tom Eastep
8d2408a8d6 Partial update to manpage 2009-11-30 11:26:00 -08:00
Tom Eastep
66d07955b0 Fix inconsistency in the Traffic Shaping Document 2009-11-30 07:39:01 -08:00
Cristian Rodríguez
add564e07a Update broken link 2009-11-29 15:27:30 -03:00
Tom Eastep
4494272dcd Improve error message 2009-11-29 09:55:32 -08:00
Tom Eastep
8c033de049 Fix limit check on TC mark values 2009-11-28 14:05:27 -08:00
Tom Eastep
8b2c6853f3 Remove description of reverted change from the release notes 2009-11-28 08:06:01 -08:00
Tom Eastep
e582f222ad Backout another Patch from the Virtual Zone Sequence and re-apply a couple of small optimizations 2009-11-28 07:25:31 -08:00
Tom Eastep
e5106f10bc Revert 8ff4d004c0 2009-11-28 07:23:23 -08:00
Tom Eastep
4e8d753682 Revert "Finish Virtual Zones"
This reverts commit 222c8cf88f.
2009-11-28 07:20:52 -08:00
Tom Eastep
d1812b4174 Revert "Fix a couple of bugs in virtual zones"
This reverts commit 22991ac9dd.
2009-11-28 07:20:28 -08:00
Tom Eastep
038b84e775 Revert "Small optimization in virtual zones"
This reverts commit 251d7116c8.
2009-11-28 07:20:01 -08:00
Tom Eastep
f21c71d7a6 Revert "Match section rules to the number of mark rules"
This reverts commit 1699d8e941.
2009-11-28 07:19:41 -08:00
Tom Eastep
0b1621027b Revert "Make 'virtual' a zone type rather than an option"
This reverts commit 18eedf7e34.
2009-11-28 07:19:10 -08:00
Tom Eastep
f5378e7652 Revert "More doc updates for virtual zones"
This reverts commit a37e56d823.
2009-11-28 07:18:46 -08:00
Tom Eastep
ea2c55a993 Revert "Fix off-by-one problem"
This reverts commit 543af8bccb.
2009-11-28 07:18:07 -08:00
Tom Eastep
f5bf3c9b43 Fix merge conflicts 2009-11-28 07:16:03 -08:00
Tom Eastep
7352771c5d Fix .spec history to omit false steps 2009-11-27 12:29:11 -08:00
Tom Eastep
8297db4c59 Fix .spec history to omit false steps 2009-11-27 11:41:14 -08:00
Tom Eastep
543af8bccb Fix off-by-one problem 2009-11-27 08:56:23 -08:00
Tom Eastep
7f16e96167 Set version to 4.4.5 Beta1 2009-11-27 08:52:37 -08:00
Tom Eastep
a37e56d823 More doc updates for virtual zones 2009-11-27 08:49:00 -08:00
Tom Eastep
18eedf7e34 Make 'virtual' a zone type rather than an option 2009-11-27 08:17:18 -08:00
Tom Eastep
1699d8e941 Match section rules to the number of mark rules 2009-11-26 17:12:11 -08:00
Tom Eastep
251d7116c8 Small optimization in virtual zones 2009-11-26 14:48:46 -08:00
Tom Eastep
22991ac9dd Fix a couple of bugs in virtual zones 2009-11-26 14:19:10 -08:00
Tom Eastep
222c8cf88f Finish Virtual Zones 2009-11-26 12:14:58 -08:00
Tom Eastep
8ff4d004c0 Better virtual zone implementation 2009-11-25 18:14:14 -08:00
Tom Eastep
8263ea1312 Limit providers to 15 2009-11-25 12:18:08 -08:00
Tom Eastep
d189c08533 Revert "Add 'virtual' zone support"
This reverts commit a2cd4bd1f4.
2009-11-25 11:51:13 -08:00
Tom Eastep
a2cd4bd1f4 Add 'virtual' zone support 2009-11-25 09:42:28 -08:00
Tom Eastep
4c40b205f8 Revert "Experimental explicit CONTINUE"
This reverts commit 10056a03d9.
2009-11-24 13:14:24 -08:00
Tom Eastep
10056a03d9 Experimental explicit CONTINUE 2009-11-24 12:50:53 -08:00
Tom Eastep
cd84efea94 Yet one more change to IPv6 address validation 2009-11-24 08:29:12 -08:00
Tom Eastep
deb45c5a27 Yet another IPv6 Address Normalization fix 2009-11-23 15:57:12 -08:00
Tom Eastep
bdb673a642 More IPv6 fixes 2009-11-23 15:21:25 -08:00
Tom Eastep
1710f9ce7c Several fixes to IPv6 Address Handling 2009-11-23 14:44:53 -08:00
Tom Eastep
9d85d0ff7a Allow IPv6 DNS names in net contexts 2009-11-23 13:51:46 -08:00
Tom Eastep
d3d21d4d18 Fix 'show policies' in Shorewall6[-lite] 2009-11-23 13:50:41 -08:00
Tom Eastep
f186c436d4 Improve wording of Problem Corrected #3 2009-11-23 11:48:08 -08:00
Tom Eastep
5610f78a48 Update version of Shorewall::Policy; improve 'expanded' description in Shorewall::Chains 2009-11-23 11:31:38 -08:00
Tom Eastep
cc809eaf78 Complete merge of 4.4 branch into master 2009-11-23 11:15:33 -08:00
Tom Eastep
c17ac8f23f commit crap for now 2009-11-23 11:13:57 -08:00
Tom Eastep
532105ec39 Allow specific policy to supersede a wildcard policy 2009-11-23 10:02:04 -08:00
Tom Eastep
b30cae89e3 Allow <zone>::<serverport> in the rules file DEST column 2009-11-23 09:56:15 -08:00
Tom Eastep
99a35c1bf0 Allow <zone>::<serverport> in the rules file DEST column 2009-11-23 09:33:16 -08:00
Tom Eastep
2eaf396f5a Revise Logging section of beginner HOWTOs 2009-11-22 10:14:40 -08:00
Tom Eastep
fedb26fe1e Revise Logging section of beginner HOWTOs 2009-11-22 10:11:50 -08:00
Tom Eastep
1150ef72d3 Move Logging section forward in the HOWTOs 2009-11-22 09:52:53 -08:00
Tom Eastep
ba4db1dd41 Move Logging section forward in the HOWTOs 2009-11-22 09:52:13 -08:00
Tom Eastep
c1001d7cc9 Add warning about default routes to multi-interface HOWTOs 2009-11-22 09:30:45 -08:00
Tom Eastep
617fddf1bd Add warning about default routes to multi-interface HOWTOs 2009-11-22 09:28:45 -08:00
Tom Eastep
d43ba935d1 Simplify port == 0 test 2009-11-22 09:03:01 -08:00
Tom Eastep
5b02ef68a5 Simplify port == 0 test 2009-11-22 09:00:03 -08:00
Tom Eastep
90170d6018 Update changelog 2009-11-22 08:58:06 -08:00
Tom Eastep
d4ff629fd8 Generate error on port == 0 2009-11-22 08:44:11 -08:00
Tom Eastep
720442b400 Fix merge screwup 2009-11-22 08:43:32 -08:00
Tom Eastep
bd9c0ac285 Generate error on port == 0 2009-11-22 08:39:03 -08:00
Tom Eastep
76e7dea858 Generate error on port == 0 2009-11-22 08:36:40 -08:00
Tom Eastep
6e9d9e239d Apply 4.4.4.1 changes to master 2009-11-22 08:20:07 -08:00
Tom Eastep
c8209f4ce2 Apply bridge fix to 4.4 2009-11-22 08:18:23 -08:00
Tom Eastep
4aeee6fd8b Make 'expanded' apply to all wildcard policies 2009-11-21 14:18:01 -08:00
Tom Eastep
c7de19cf39 Allow specific policy to supersede an expanded one 2009-11-21 13:56:40 -08:00
Tom Eastep
cbe944c354 Open the 4.5.0 Thread 2009-11-21 11:41:10 -08:00
Tom Eastep
ecf6a0ec4a Open 4.4.5 2009-11-21 11:08:50 -08:00
Tom Eastep
bce4d51a18 Allow wide MARK values in tcclasses when WIDE_TC_MARKS=Yes 2009-11-21 07:54:42 -08:00
Tom Eastep
c5bb493b29 Fix class number assignment when WIDE_TC_MARKS=Yes 2009-11-20 12:25:15 -08:00
Tom Eastep
0df84cf8b5 Remove superfluous line of code 2009-11-19 10:54:58 -08:00
Tom Eastep
a23632f45e Mostly cosmetic cleanup of Shorewall::Chains 2009-11-19 10:35:25 -08:00
Tom Eastep
de9c088972 Fix reported issues in the Macro article 2009-11-18 20:08:50 -08:00
Tom Eastep
c26fe6b15e Merge branch 'master' of ssh://teastep@shorewall.git.sourceforge.net/gitroot/shorewall/shorewall 2009-11-18 19:59:21 -08:00
Tom Eastep
c39a9fb5eb Fix typo in shorewall-rules(5) 2009-11-18 19:55:20 -08:00
Cristian Rodríguez
d7c084c9c6 comment out broken link until we find a suitable substitute 2009-11-18 16:22:17 -03:00
Tom Eastep
4579a71574 More massaging of redundant test suppression 2009-11-17 11:14:02 -08:00
Tom Eastep
831611e792 Update version of Shorewall::Policy 2009-11-16 20:24:01 -08:00
Tom Eastep
5f70b261b6 Update version of Shorewall::Compiler 2009-11-16 20:21:59 -08:00
Tom Eastep
c4bfab29a5 Clean up release notes 2009-11-16 15:21:11 -08:00
Tom Eastep
9d5dd2ad3a Implement an '-l' option to the 'show' command 2009-11-16 15:14:24 -08:00
Tom Eastep
5ec4f8d82c Unconditionally include route marking and sticky chains 2009-11-16 14:15:01 -08:00
Tom Eastep
2a910ebddf Suppress redundant tests for provider availability in route rules processing 2009-11-16 12:43:44 -08:00
Tom Eastep
31f01fe765 Document fixing route rule addition code 2009-11-16 11:20:02 -08:00
Tom Eastep
016537f631 Don't add route rules when interface is down 2009-11-16 10:58:38 -08:00
Tom Eastep
dd543a2934 Tweak policies display 2009-11-16 09:30:37 -08:00
Tom Eastep
f5a019becc Implement 'show policies' command 2009-11-15 09:24:56 -08:00
Tom Eastep
20ef4e584b Fix markup on tcrules manpage 2009-11-15 07:46:49 -08:00
Tom Eastep
1c1f16661f Tweak per-IP section 2009-11-14 11:56:37 -08:00
Tom Eastep
cb67513160 Document per-IP traffic shaping: 2009-11-14 08:52:47 -08:00
Tom Eastep
b662718eec Replace canonical_chain by rules_chain 2009-11-14 07:07:19 -08:00
Tom Eastep
10affb1cde Set version to 4.4.4 2009-11-13 13:52:49 -08:00
Tom Eastep
fa3bdde214 Set version to Beta2 2009-11-13 12:39:41 -08:00
Tom Eastep
9d57ff050a Remove obsolete documentation references 2009-11-13 08:16:04 -08:00
Tom Eastep
0e6c9abb5b A fix for COPY handling 2009-11-12 16:45:39 -08:00
Tom Eastep
f904866336 More minor cleanup of chain name change 2009-11-12 12:30:08 -08:00
Tom Eastep
2d53f8cb0c Delete unnecessary function 2009-11-11 16:35:46 -08:00
Tom Eastep
e748341afd Correct mis-statement in the release notes 2009-11-11 16:35:06 -08:00
Tom Eastep
b943f09e37 Fix indentation 2009-11-11 12:34:15 -08:00
Tom Eastep
8ddc2e804d Document Logical Interfaces some more 2009-11-11 11:29:21 -08:00
Tom Eastep
4e6b8f8f42 Set version to 4.4.4-Beta1 2009-11-11 10:58:22 -08:00
Tom Eastep
0f078e7440 Ignore empty port in INTERFACE column 2009-11-11 10:52:14 -08:00
Tom Eastep
a4eb581d44 Document full logical interface implementation 2009-11-11 10:45:01 -08:00
Tom Eastep
06d3b2c692 Allow wildcard logical names in COPY column 2009-11-11 10:17:53 -08:00
Tom Eastep
6987cd15c5 Avoid dereference of null variable 2009-11-11 10:10:45 -08:00
Tom Eastep
ba8ad6346a More use of logical chain name 2009-11-11 10:06:06 -08:00
Tom Eastep
893a847c87 Suppress extra COMMENT warnings 2009-11-10 17:17:55 -08:00
Tom Eastep
1735e168b1 Fix manpages 2009-11-10 15:48:49 -08:00
Tom Eastep
bd9c651961 Clarify physical naming rules and '+' 2009-11-10 15:25:25 -08:00
Tom Eastep
bf8c38e054 Add ZONE2ZONE option to shorewall.conf 2009-11-10 14:12:55 -08:00
Tom Eastep
7120a73f0e Minor efficiency improvement in move_rules() 2009-11-10 08:08:02 -08:00
Tom Eastep
c9e57c93a2 Insure uniqueness of physical names; use logical name when constructing the name of a chain 2009-11-10 07:24:14 -08:00
Tom Eastep
4e2f2923b6 Update ::Config::VERSION 2009-11-09 13:16:40 -08:00
Tom Eastep
79b5cb49df Fix over-zealous use of physical name; Correct syntax errors 2009-11-09 12:38:00 -08:00
Tom Eastep
893a0c9d42 Remove order dependency in interface OPTIONS processing 2009-11-09 11:15:08 -08:00
Tom Eastep
9b127e6e06 Improve performance of logical->physical mapping 2009-11-09 07:27:14 -08:00
Tom Eastep
92208251b7 Add undocumented LOGICAL_NAMES option 2009-11-09 07:01:25 -08:00
Tom Eastep
dda6f06883 Update module versions 2009-11-08 09:01:30 -08:00
Tom Eastep
4d977306f9 Make 'physical' work as a general logical name facility 2009-11-08 08:37:03 -08:00
Tom Eastep
83621ff416 Add logical->physical mapping to Shorewall::Chains 2009-11-08 07:11:38 -08:00
Tom Eastep
09f1b6501c Add logical->physical mapping to Shorewall::Providers 2009-11-08 07:00:43 -08:00
Tom Eastep
ca1dd1416d Add logical->physical mapping to Shorewall::Tc 2009-11-08 06:26:47 -08:00
Tom Eastep
1238b771a2 Apply logical->physical mapping to /proc settings 2009-11-07 18:59:10 -08:00
Tom Eastep
b1706e10e3 Correct typo 2009-11-07 07:58:15 -08:00
Tom Eastep
bcd4887d84 Correct capitalization in error message; remove unused variable 2009-11-07 07:39:28 -08:00
Tom Eastep
7f54a6fea9 Make non-wild physical work correctly 2009-11-07 07:19:52 -08:00
Tom Eastep
496cfc391e Make parsing of zone options tighter 2009-11-06 15:51:53 -08:00
Tom Eastep
b491745f1c More physical interface changes 2009-11-06 13:10:19 -08:00
Tom Eastep
4ef45ff665 Generate an error if a bridge port is configured as a provider interface 2009-11-06 09:22:16 -08:00
Tom Eastep
73eab1fa55 Report physical name in zone reports rather than logical name 2009-11-06 08:40:53 -08:00
Tom Eastep
d73ebb8a6a Add comment explaining the purpose of dump_zone_contents() 2009-11-06 08:11:18 -08:00
Tom Eastep
7014bd3ea0 Add 'physical' interface option for bridge ports 2009-11-06 08:07:13 -08:00
Tom Eastep
89bdcf9a3d Implement 'physical' option 2009-11-06 07:27:44 -08:00
Tom Eastep
a98195e156 Back out fix for multiple bridges with wildcard ports 2009-11-05 16:34:41 -08:00
Tom Eastep
fb3477b8b5 A couple of additional tweaks to the two-bridge fix 2009-11-05 13:40:03 -08:00
Tom Eastep
c1898d1c80 Remove anachronistic 'LAST LINE' from INtro 2009-11-05 13:30:18 -08:00
Tom Eastep
7e21488aec Document ICMP codes 2009-11-05 11:58:54 -08:00
Tom Eastep
b4199fd068 Document ICMP codes 2009-11-05 11:44:40 -08:00
Tom Eastep
28b660c853 Avoid reporting bogus duplicate interface with two bridges and wildcard ports 2009-11-05 11:04:14 -08:00
Tom Eastep
3cc9ee7be5 Fix typo in the install script 2009-11-04 06:58:49 -08:00
Tom Eastep
4548db58da Relax port list limitation in /etc/shorewall/routestopped 2009-11-03 11:36:32 -08:00
Tom Eastep
4f5c602d5f Fix .spec error and document logrotate files 2009-11-03 10:12:38 -08:00
Tom Eastep
25549b176c Update version to 4.4.4 2009-11-03 10:06:29 -08:00
Tom Eastep
306549119a Add logrotate files to packages 2009-11-03 10:06:10 -08:00
Tom Eastep
5a525134ea Be sure that startup log is secured 0600 2009-11-03 09:34:21 -08:00
Tom Eastep
f2f91ce7dd Some optimizations 2009-11-03 09:28:34 -08:00
Tom Eastep
c893ba6ffa Remove dependence of Shorewall::Rules on Scalar::Util 2009-11-03 07:40:06 -08:00
Tom Eastep
1892160ed5 Update copyright year list 2009-11-03 07:39:27 -08:00
Tom Eastep
45653ffe79 A couple of more move_rules() tweaks 2009-11-02 15:35:00 -08:00
Tom Eastep
f97e0c5989 Flesh out fix for Perl run-time errors 2009-11-02 07:15:20 -08:00
Tom Eastep
11ddfa92e9 Eliminate Perl run-time errors out of move_rules() 2009-11-01 17:14:42 -08:00
Tom Eastep
23d0806da2 Change Shorewall6 default STARTUP_LOG and LOG_VERBOSITY 2009-11-01 11:09:17 -08:00
Tom Eastep
99c77d2611 Fix typo in shorewall-rules(5) 2009-10-29 17:51:06 -07:00
Tom Eastep
4c3b0c7571 Re-word 'limit' description 2009-10-28 11:29:12 -07:00
Tom Eastep
59d01ccf97 A couple of tweaks to 'limit' class option 2009-10-27 12:33:14 -07:00
Tom Eastep
105754823a Raise max limit to 128 2009-10-26 13:03:26 -07:00
Tom Eastep
f0b4b1f42e Add limit option to tcclasses 2009-10-26 12:23:32 -07:00
Tom Eastep
cc0adc218f Update comments and release documentation 2009-10-26 10:03:51 -07:00
Tom Eastep
8251948d2a Add a comment 2009-10-24 15:55:56 -07:00
Tom Eastep
b3571261dd Fix optional providers 2009-10-24 12:05:44 -07:00
Tom Eastep
c922afaf23 Tweak release notes 2009-10-24 12:01:15 -07:00
Tom Eastep
3e2cf982a3 Correct messages issued when a provider is not added 2009-10-24 08:50:15 -07:00
Tom Eastep
86df82a29a Fix IPv6 address validation error 2009-10-23 13:41:51 -07:00
Tom Eastep
46896e7dce Fix for Ipv6 2009-10-23 11:34:13 -07:00
Tom Eastep
445527d27e Use /etc/debian_version to distinguish Debian-based systems 2009-10-21 16:12:02 -07:00
Tom Eastep
58ef1d3b63 Correct typo; elaborate on how PERL is processed 2009-10-21 09:39:50 -07:00
Tom Eastep
d0cda6b6ea Add TRACK_PROVIDERS option 2009-10-20 13:24:17 -07:00
Tom Eastep
49f361124e Make 'track' the default 2009-10-20 12:24:28 -07:00
Tom Eastep
c4af105ee4 Update display of capabilities in FAQ 2009-10-19 08:41:29 -07:00
Tom Eastep
7adb9b12bb Move all function declarations from prog.footer6 to prog.header6 2009-10-19 07:37:49 -07:00
Tom Eastep
a0482132c6 Move all function declarations from prog.footer6 to prog.header6 2009-10-19 07:28:30 -07:00
Tom Eastep
abc9ab061a Remove superfluous variables from generated script 2009-10-19 07:25:03 -07:00
Tom Eastep
65e4a5ff66 Move all functions from prog.footer to prog.header; minor tweaks elsewhere 2009-10-18 08:47:20 -07:00
Tom Eastep
0a74320bc2 Fix progress message 2009-10-17 14:23:11 -07:00
Tom Eastep
31bbec0fdd Make 'debug' work with the safe commands 2009-10-17 13:05:26 -07:00
Tom Eastep
30dbfdc949 Fix intentation problem introduces with config-detection fix 2009-10-17 11:08:34 -07:00
Tom Eastep
f3043f1453 Document nested zone fix 2009-10-17 11:06:36 -07:00
Tom Eastep
e6755b7172 Merge nested zone fix into master 2009-10-17 10:59:41 -07:00
Tom Eastep
f6913953fe Add Raw table to Netfilter Overview 2009-10-16 11:25:57 -07:00
Tom Eastep
a61c9a9e06 Fix typo 2009-10-16 10:45:46 -07:00
Tom Eastep
62c7ad7fbb Update Netfilter Overview 2009-10-16 10:29:36 -07:00
Tom Eastep
b38841798e Fix initialization 2009-10-15 13:43:46 -07:00
Tom Eastep
44c5ebcfa4 Fix initialization 2009-10-15 13:06:04 -07:00
Tom Eastep
6e6063f193 Don't wait for openvpn to start 2009-10-15 12:22:37 -07:00
Cristian Rodríguez
e2f64af187 if configured, openvpn should start before shorewall 2009-10-14 14:08:02 -03:00
Tom Eastep
19a90db09f Back out last unnecessary change 2009-10-14 07:13:52 -07:00
Tom Eastep
94d039bf56 Merge branch 'master' of ssh://teastep@shorewall.git.sourceforge.net/gitroot/shorewall/shorewall 2009-10-13 17:51:45 -07:00
Cristian Rodríguez
b24544306c fix some typos reported by Justin 2009-10-13 19:47:13 -03:00
Tom Eastep
990a9f0fdc Fix RETAIN_ALIASES 2009-10-13 14:36:47 -07:00
Tom Eastep
1b0a3e4417 Correct typos in release notes 2009-10-13 08:13:34 -07:00
Tom Eastep
80f41779f8 Replace keyword 'object' with 'script' 2009-10-12 08:24:47 -07:00
Tom Eastep
fe3b8be029 Expand the answer to FAQ 1h 2009-10-12 07:38:19 -07:00
Tom Eastep
f1d014dfe4 Fix test for null INITLOG 2009-10-08 15:57:25 -07:00
Tom Eastep
7064b8dd08 Update version of changed modules 2009-10-08 15:49:54 -07:00
Tom Eastep
7612c895e5 Attempt to clarify LSM some more 2009-10-08 14:05:46 -07:00
Tom Eastep
3f7a1f9574 Rename a variable 2009-10-08 09:48:15 -07:00
Tom Eastep
28b0e99492 Explain how to list the dynamic blacklist 2009-10-06 10:20:09 -07:00
Tom Eastep
83a9d8dd1b Rename 'object' to 'script' 2009-10-05 15:43:29 -07:00
Tom Eastep
dc643c67e9 Move declaration to inner block where it is used 2009-10-05 14:23:43 -07:00
Tom Eastep
ab4e7cffcf Document fix to routestopped 2009-10-03 10:53:53 -07:00
Tom Eastep
8089ef1599 Fix 'routeback' in routestopped file 2009-10-03 10:44:26 -07:00
Tom Eastep
8915145607 More INITLOG changes 2009-10-03 08:29:45 -07:00
Tom Eastep
beac09e45f STARTUP_LOG changes 2009-10-02 16:10:14 -07:00
Tom Eastep
de933ba912 Fix typo in comment 2009-10-02 13:10:49 -07:00
Tom Eastep
964cba79a9 Initialize 4.4.3 2009-10-02 11:31:08 -07:00
Tom Eastep
065808be16 Fix reference to README.Debian.gz 2009-10-02 11:13:44 -07:00
Tom Eastep
3171d3bfc2 Update FAQ regarding ACCEPT/DNAT 2009-10-02 10:45:56 -07:00
Tom Eastep
a87cb7b95d Generate list of builtins in initialize() 2009-10-01 15:02:14 -07:00
Tom Eastep
a8cc7d2a7e More clarification of masq file changes 2009-10-01 12:34:34 -07:00
Tom Eastep
dd70456430 Add '-p' to 'start' synopsis 2009-10-01 10:34:05 -07:00
Tom Eastep
ddb46931a0 Update version 2009-10-01 08:44:05 -07:00
Tom Eastep
327e170be5 Fix range-in-masq patch 2009-10-01 08:16:22 -07:00
Tom Eastep
5e49be219b Fix result from bad pull 2009-10-01 07:49:43 -07:00
Tom Eastep
d323c5b9c5 Delete shorewall-perl and shorewall-shell during upgrade 2009-10-01 07:37:30 -07:00
Tom Eastep
39ee3b2025 Tweak emitter 2009-09-29 14:28:50 -05:00
Tom Eastep
393673a884 Allow MARK in action body -- take 2 2009-09-25 16:15:56 -04:00
Tom Eastep
bfdc8db31a Allow MARK in action body 2009-09-25 16:01:24 -04:00
Tom Eastep
c1305eb059 Correct typo in error message 2009-09-25 13:36:45 -04:00
Tom Eastep
9f853d02d9 Make Tuomo Happy 2009-09-25 13:35:37 -04:00
Tom Eastep
111464ad95 Clarify 'loose' -- tweak wording 2009-09-25 06:17:49 -04:00
Tom Eastep
795ffb7212 Clarify 'loose' 2009-09-25 06:15:56 -04:00
Tom Eastep
d84458518e Add capability to detect old hashlimit syntax 2009-09-23 16:56:31 -04:00
Tom Eastep
428c3d1e4e Hack to make new LIMIT stuff work on ancient iptables releases 2009-09-20 09:12:35 -04:00
Tom Eastep
20250c9ce9 Hack to make new LIMIT stuff work on ancient iptables releases 2009-09-20 09:10:23 -04:00
Tom Eastep
96b19dd218 Fix accounting extension feature 2009-09-15 13:01:20 -07:00
Tom Eastep
120aade417 Allow Extension Scripts for Accounting Chains 2009-09-15 12:22:51 -07:00
Tom Eastep
4f4925002a Revert "Allow Extension Scripts for Accounting Chains"
This reverts commit 728ad2fecf.
2009-09-15 12:18:29 -07:00
Tom Eastep
728ad2fecf Allow Extension Scripts for Accounting Chains 2009-09-15 11:16:37 -07:00
Tom Eastep
0d651f093b Correct file name 2009-09-15 10:33:52 -07:00
Tom Eastep
326ac90596 Remove pre-4.4 cruft from article 2009-09-15 06:59:59 -07:00
Tom Eastep
d6b641b000 Add FAQ 86 2009-09-14 14:14:20 -07:00
Tom Eastep
a5f3a05341 Fix typo in the Introduction 2009-09-14 13:43:32 -07:00
Tom Eastep
0e8cb3b74d Improve wording of 'masq' section; add IDs to all sections 2009-09-14 09:01:02 -07:00
Tom Eastep
8180f45382 Add footnotes for non-Debian users 2009-09-14 08:29:49 -07:00
Tom Eastep
f25646d819 Add missing link to ipset section 2009-09-14 08:10:18 -07:00
Tom Eastep
b8e772a416 More Lenny->Squeeze additions (ipsets, extension scripts, more shorewall.conf options) 2009-09-14 07:49:47 -07:00
Tom Eastep
d5d4c451f9 Mention DYNAMIC_ZONES is Lenny->Squeeze article 2009-09-14 07:01:39 -07:00
Tom Eastep
9f102a1fba More tweaks to Lenny->Squeeze article 2009-09-14 06:53:25 -07:00
Tom Eastep
e814dc7b75 Make index entry for Lenny->Squeeze more generic 2009-09-13 09:32:06 -07:00
Tom Eastep
e1f7048107 More tweaks to the Lenny->Squeeze article 2009-09-13 09:28:58 -07:00
Tom Eastep
485ddd5e9f Note that the Lenny->Squeeze article is useful to non-Debian users 2009-09-13 09:25:45 -07:00
Tom Eastep
6afc43d200 Correct typo in comment 2009-09-13 09:20:32 -07:00
Tom Eastep
8fdbb6f252 Bump Nat.pm version; remove inadvertent paste 2009-09-13 09:13:50 -07:00
Tom Eastep
5793246d7c Make processing of original dest in Format-1 macros more obvious 2009-09-13 09:01:34 -07:00
Tom Eastep
57f4458ec9 Avoid repetative wording 2009-09-13 08:19:07 -07:00
Tom Eastep
8fdebf0c38 Add new columns to macros 2009-09-13 08:09:40 -07:00
Tom Eastep
904754c074 Correct syntax of TIME column 2009-09-13 07:03:25 -07:00
Tom Eastep
66765dcf75 Minor rewording 2009-09-12 15:03:19 -07:00
Tom Eastep
07d8872823 Indicate that Squeeze 'will' include 4.4 2009-09-12 09:20:38 -07:00
Tom Eastep
9b0a9e8ecd Add -<family> to 'ip route del default' command 2009-09-12 08:48:52 -07:00
Tom Eastep
0336a77120 Fix ID 2009-09-11 16:36:56 -07:00
Tom Eastep
95d422b15f Add Extension Scripts to Lenny->Squeeze Article 2009-09-11 16:33:06 -07:00
Tom Eastep
6f54b5ea2f Formatting in zones manpage 2009-09-11 10:49:49 -07:00
Tom Eastep
8c2a228a7d Apply Jesse Shrieve's SNAT patch 2009-09-11 07:47:31 -07:00
Tom Eastep
460428b21a More formatting fixes to shorewall-zones(5) 2009-09-10 19:43:52 -07:00
Tom Eastep
02d9888513 Document ipsec4/6 2009-09-10 14:56:39 -07:00
Tom Eastep
f33e842f1b Update module version 2009-09-10 14:56:23 -07:00
Tom Eastep
82eaf124ca Add section about SOURCE and DEST 2009-09-10 14:55:50 -07:00
Tom Eastep
74aff4f4ef Bump the version in a couple of modules modified for 4.4.2 2009-09-09 12:58:39 -07:00
Tom Eastep
212937a29d Make 'map_old_actions' a little cleaner 2009-09-09 12:37:49 -07:00
Tom Eastep
7c1dd35a00 Update release documents 2009-09-09 12:18:31 -07:00
Tom Eastep
0b03f52ad9 Don't look for extension script for built-in actions 2009-09-09 11:53:51 -07:00
Tom Eastep
5fc0137a2e Update Compiler module version 2009-09-08 17:05:01 -07:00
Tom Eastep
128edd4bba Slight optimization -- also makes code easier to read 2009-09-08 16:00:40 -07:00
Tom Eastep
b4712a93fa Don't call compile_stop_firewall() during 'check'; call process_routestopped() instead - comments 2009-09-08 13:04:34 -07:00
Tom Eastep
bb83db3eb9 Don't call compile_stop_firewall() during 'check'; call process_routestopped() instead - change log 2009-09-08 12:55:14 -07:00
Tom Eastep
5655dbb01b Don't call compile_stop_firewall() during 'check'; call process_routestopped() instead 2009-09-08 12:54:23 -07:00
Tom Eastep
fefff9fd83 Add MAPOLDACTIONS 2009-09-07 17:04:09 -07:00
Tom Eastep
9a1cb0c6b6 Admin that PKTTYPE is a no-op 2009-09-07 16:44:19 -07:00
Tom Eastep
b2c7b583f5 Add Lenny->Squeeze article to index 2009-09-07 16:26:32 -07:00
Tom Eastep
bc7e65732e Add upgrade warning 2009-09-07 14:13:32 -07:00
Tom Eastep
993bbe8a4e Fix broken links in Lenny->Squeeze doc 2009-09-07 09:43:53 -07:00
Tom Eastep
1ef90b4f0f Add means for handling 'norfc1918' warning in Lenny->Squeeze doc 2009-09-07 09:39:00 -07:00
Tom Eastep
8da5fd42d0 Yet more enhancements to Lenny->Squeeze doc 2009-09-07 09:35:15 -07:00
Tom Eastep
180024c1fc More enhancements to Lenny->Squeeze doc 2009-09-07 09:21:47 -07:00
Tom Eastep
06e85d6191 Add routestopped file to Lenny->Squeeze doc 2009-09-07 09:07:07 -07:00
Tom Eastep
c4eeb7b77e Link upgrade issues back to the home page 2009-09-06 17:25:39 -07:00
Tom Eastep
b03d502bbb Allow comments on continued lines 2009-09-06 16:17:22 -07:00
Tom Eastep
cf9bb616b8 Add example of nat-only fix 2009-09-06 14:03:36 -07:00
Tom Eastep
70ebe17cb3 Reimplement MAPOLDACTIONS=Yes 2009-09-06 13:37:24 -07:00
Tom Eastep
477c0ef9e8 Update Lenny->Squeeze doc 2009-09-06 12:46:22 -07:00
Tom Eastep
1a33596ada Update Lenny->Squeeze doc 2009-09-06 12:41:36 -07:00
Tom Eastep
efa952572c Update 4.4.2 2009-09-06 11:43:46 -07:00
Tom Eastep
7192b47289 Add a Lenny->Squeeze Howto 2009-09-06 09:51:32 -07:00
Tom Eastep
75eb186ea7 Split MASQ SOURCE warning into two separate warnings 2009-09-05 16:02:16 -07:00
Tom Eastep
f126755a96 Add notes about find_first_interface_address_if_any() 2009-09-05 08:59:45 -07:00
Tom Eastep
ec94ed638e Better modularization of Chains and Actions 2009-09-05 08:43:14 -07:00
Tom Eastep
496a9449f1 Add note to simple bridge doc 2009-09-05 08:23:35 -07:00
Tom Eastep
4368af9525 Add /etc/shorewall/masq to Simple Bridge article 2009-09-05 07:24:29 -07:00
Tom Eastep
b092ba5671 clarify IP_FORWARDING in IPv6 2009-09-04 19:04:03 -07:00
Tom Eastep
dd64ea2484 Update known_problems for 4.4.2 2009-09-04 11:41:23 -07:00
Tom Eastep
bb8ad187f1 Update version to 4.4.2 2009-09-04 11:40:34 -07:00
Tom Eastep
03821dc22c Process routestopped file during 'check' 2009-09-03 19:27:25 -07:00
Tom Eastep
76d9a80df3 A small optimization on the last restriction removal 2009-09-03 18:26:50 -07:00
Tom Eastep
84bff13e7f Apply 4.4.1.2 fix to trunk 2009-09-03 18:25:32 -07:00
Tom Eastep
4a809e14ab Documentation cleanup 2009-09-03 15:24:19 -07:00
Tom Eastep
f3455b107d 4.4.2 release doc initialization and update 2009-09-03 14:58:46 -07:00
Tom Eastep
df5291e119 Apply initialization fix to master branch 2009-09-03 14:54:47 -07:00
Tom Eastep
015d4f58ce Allow moving rules with commands 2009-09-03 14:11:44 -07:00
Tom Eastep
4412a05a70 Fix detection of PERSISTENT_SNAT 2009-09-03 13:56:00 -07:00
Tom Eastep
62b1dbcd7f Document portlist-splitting change 2009-09-02 15:30:26 -07:00
Tom Eastep
c9e9877f05 Combine port-list handling into a single function 2009-09-02 14:49:07 -07:00
Tom Eastep
9e09e61a1a Delete blank line 2009-09-01 11:18:14 -07:00
Tom Eastep
b778f04b1a Massage fix for multicast and nets= 2009-09-01 11:11:57 -07:00
Tom Eastep
b30da86cce Fix automatic multicast with nets= 2009-09-01 08:56:54 -07:00
Tom Eastep
0a39672b46 Add FAQ 85 2009-09-01 08:19:53 -07:00
Tom Eastep
3647b801dc Add another image file 2009-08-31 14:29:06 -07:00
Tom Eastep
fbfa4b4e49 Update release documents and make minor change to faq 2009-08-31 14:19:15 -07:00
Tom Eastep
1544c0b2b1 Add some comments concerning "$|" 2009-08-31 10:41:08 -07:00
Tom Eastep
d368d80a12 More robust checking of zone definitions 2009-08-31 09:09:15 -07:00
Tom Eastep
5297bb8b8d Fix undefined variable warning 2009-08-31 09:08:49 -07:00
Tom Eastep
9ef0dcb221 Remove extraineous label from graphic 2009-08-31 09:08:15 -07:00
Tom Eastep
2bb92a79f3 Fix silly hole in zones file parsing 2009-08-30 08:05:10 -07:00
Tom Eastep
57ca3591e5 Hopefully the last fix to 6to4 doc 2009-08-29 12:19:45 -07:00
Tom Eastep
75232c6f10 Fix 6to4 Article again 2009-08-29 11:56:32 -07:00
Tom Eastep
3f9e1ced7d Fix 6to4 Article 2009-08-29 11:55:00 -07:00
Tom Eastep
d31721a066 Fix rule generated by MULTICAST=Yes -- release documents 2009-08-29 09:34:16 -07:00
Tom Eastep
b4f7b85b3b Fix multicast network in Policy.pm 2009-08-29 09:26:46 -07:00
Tom Eastep
b7915991ba Add MULTICAST=Yes corrected problem description to release notes 2009-08-29 09:24:51 -07:00
Tom Eastep
a0a9e087de Fix typo in release notes 2009-08-29 09:07:27 -07:00
Tom Eastep
84fab0ebda Minor update to MultiISP doc 2009-08-29 09:05:14 -07:00
Tom Eastep
1ef00c547b Disallow 'nets=' in a multi-zone interface definition 2009-08-29 07:41:27 -07:00
Tom Eastep
f2c3d9cd79 Correct typo 2009-08-29 07:20:40 -07:00
Tom Eastep
4809314fc1 Allow extending a zone defined with nets= 2009-08-29 07:20:16 -07:00
Tom Eastep
acfdc7e481 nets= allows multicast 2009-08-28 15:17:10 -07:00
Tom Eastep
a62d86aca7 Update interfaces manpage 2009-08-28 13:45:00 -07:00
Tom Eastep
5db7e77462 Turn off IP forwarding in the standalone example -- update release docs 2009-08-28 08:31:48 -07:00
Tom Eastep
44803c1212 Turn off IP forwarding in the standalone example 2009-08-28 07:47:59 -07:00
Tom Eastep
b5bf7f5c47 Add link from shorewall.conf (5) to logging article 2009-08-27 13:35:44 -07:00
Tom Eastep
1ab2c5b2c0 Make the LOGFILE instructions in the support article even more explicit 2009-08-27 13:23:09 -07:00
Tom Eastep
8d447ebfba Move French language documents to the same directory as the English and Russian documents 2009-08-27 12:10:47 -07:00
Tom Eastep
f7772505e5 Remove redundant COMMENT information from shorewall-nat(5) 2009-08-27 11:33:02 -07:00
Tom Eastep
140b8ffc3a Remove contrib directory 2009-08-27 09:34:07 -07:00
Tom Eastep
a9c3e6f80a Remove tools and web 2009-08-27 07:09:07 -07:00
Tom Eastep
c680b5820b Copy .txt files to the build directory 2009-08-26 13:16:48 -07:00
Tom Eastep
383f3e8bcf Fix nested IPSEC zones 2009-08-26 12:44:10 -07:00
Tom Eastep
608d7b11da Add some qualifications and a link to the download page 2009-08-26 12:17:21 -07:00
Tom Eastep
f106613300 Update link on mirrors page 2009-08-26 10:41:09 -07:00
Tom Eastep
52dfd5b259 Make cleanup after error explicit 2009-08-26 10:34:04 -07:00
Tom Eastep
db803807a7 Add comment regarding tcclass.guarantee 2009-08-26 10:32:57 -07:00
Tom Eastep
b81f176680 Correct OpenVPN document 2009-08-26 07:11:51 -07:00
Tom Eastep
e6dc40f2f4 Fix typo 2009-08-25 12:59:25 -07:00
Tom Eastep
1b26c65cbc Fix logging in rules at the end of INPUT and OUTPUT 2009-08-25 09:22:26 -07:00
Tom Eastep
8932106394 Modify 'ping6' advice 2009-08-24 16:29:02 -07:00
Tom Eastep
53ab9427fc Create publish-4.2 from publish-4.4 2009-08-24 15:57:15 -07:00
Tom Eastep
088e164f18 Redefine 'full' when used in a sub-class definition 2009-08-24 11:56:16 -07:00
Tom Eastep
4eb9e5db3d Correct example in the docs and ensure that future idiots don't place 'default' in the PRIO column of tcclasses 2009-08-24 06:25:26 -07:00
Tom Eastep
679cff2779 Correct example in the docs and ensure that future idiots don't place 'default' in the PRIO column of tcclasses 2009-08-23 20:45:05 -07:00
Tom Eastep
6b5493b81c Add .*~ to files removed by "clean" 2009-08-23 12:55:29 -07:00
Tom Eastep
e24dbb9aea Add 'clean' target to Makefiles 2009-08-23 10:43:01 -07:00
Tom Eastep
267bc808f5 Use 'set_command()' in the 'compile' case as well as the 'check' case 2009-08-22 09:39:15 -07:00
Tom Eastep
5ac331a5a0 Rename verbosity-oriented variables/functions 2009-08-22 07:57:55 -07:00
Tom Eastep
65c59a36db Update Build document to reflect signing during upload rather than build 2009-08-22 07:31:52 -07:00
Tom Eastep
b72e8f6f4d Add warning to Git section of the download page 2009-08-21 22:06:39 -07:00
Tom Eastep
f71e6f87f1 Update Git URL 2009-08-20 14:41:57 -07:00
Tom Eastep
5dd41249c6 Remove trailing whitespace 2009-08-20 14:32:15 -07:00
Tom Eastep
8c16ac1d46 Update Module versions 2009-08-20 08:53:57 -07:00
Tom Eastep
ddf8bbe516 Remove some V4/V6 tests 2009-08-18 11:03:17 -07:00
Tom Eastep
dd1baf4beb Reorder release information in the Download file 2009-08-18 11:02:47 -07:00
Tom Eastep
f1d12d193b A little reorganization of the FAQ wrt IPv6 2009-08-18 09:22:05 -07:00
Tom Eastep
82cd525658 Fix another typo in FAQ 2009-08-18 09:10:49 -07:00
Tom Eastep
2d404fa998 Fix typos in FAQ 2009-08-18 09:09:33 -07:00
Tom Eastep
622db3655f More updates/corrections to change notes 2009-08-18 08:50:50 -07:00
Tom Eastep
4bc1fb145a Update change notes 2009-08-18 08:44:55 -07:00
Tom Eastep
897748aa83 Be silent about deleting temporary NAT chain 2009-08-18 08:43:37 -07:00
Tom Eastep
be574ea426 Fix typo and rewording 2009-08-18 07:58:56 -07:00
Tom Eastep
1cf22ead7f Correct allip() return value 2009-08-18 07:35:17 -07:00
Tom Eastep
bb6e9af43a Refine Migration Advice 2009-08-17 16:39:15 -07:00
Tom Eastep
90b0bedc43 More performance tweaks 2009-08-17 16:29:18 -07:00
Tom Eastep
787a1867a0 Another tiny performance enhancement 2009-08-17 12:58:50 -07:00
Tom Eastep
49a2ff05ce Remove IPv6 link from 4.4.0 2009-08-17 11:44:49 -07:00
Tom Eastep
e756689d0c Very minor performance tweak 2009-08-17 11:22:03 -07:00
Tom Eastep
89a6d7e5db Tweak initialization comments 2009-08-17 10:45:46 -07:00
Tom Eastep
bc1dbb3d4e Make build44 work without INIT globals initialization 2009-08-17 10:34:52 -07:00
Tom Eastep
d8cc9c5c92 Fix capabilities test for PERSISTENT_SNAT 2009-08-17 08:07:58 -07:00
Tom Eastep
6d2809f154 Note the inadaquacy of the Busybox version of the iproute2 utilities 2009-08-17 07:17:33 -07:00
Tom Eastep
400a1ed647 Explain how to combine the loc and fw zones 2009-08-16 10:17:48 -07:00
Tom Eastep
0557148bec Avoid double globals initialization for IPv6 2009-08-16 09:24:51 -07:00
Tom Eastep
cbc9fa6e4c Update README.txt 2009-08-15 17:43:26 -07:00
Tom Eastep
201145eed9 More Persistent SNAT tweaks 2009-08-15 08:56:05 -07:00
Tom Eastep
c908edab34 Add new capability for persistent SNAT 2009-08-15 08:35:54 -07:00
Tom Eastep
55f75604b3 Add support for 'persistent' 2009-08-15 08:15:38 -07:00
Tom Eastep
f042c641d6 Remove extraneous export 2009-08-15 07:01:06 -07:00
Tom Eastep
9b87812531 update version of Nat module 2009-08-14 15:03:59 -07:00
Tom Eastep
883f415e53 Start 4.4.1 2009-08-14 14:46:31 -07:00
Tom Eastep
e2bfcef5af Fix Introduction's description of Shorewall6-lite 2009-08-14 07:27:52 -07:00
Tom Eastep
45446bc754 Web site last-minute changes for 4.4 2009-08-14 07:08:16 -07:00
Tom Eastep
8161e54bea One more fix for partial uploads 2009-08-13 15:38:22 -07:00
Tom Eastep
09b9bfa914 More fixes for partial builds/uploads 2009-08-13 15:28:31 -07:00
Tom Eastep
7211569197 Fix upload for patch releases 2009-08-13 15:21:09 -07:00
Tom Eastep
0909bcc28f Don't step on known_problems.txt when setting version 2009-08-13 14:05:08 -07:00
Tom Eastep
302b6db831 Fix build44 for patch releases -- take 3 2009-08-13 13:19:49 -07:00
Tom Eastep
b05255e2e9 Fix build44 for patch releases -- take 2 2009-08-13 13:12:56 -07:00
Tom Eastep
336d4f29f9 Fix build44 for patch releases 2009-08-13 13:02:32 -07:00
Tom Eastep
f88de91dd9 Fix setversion for 4.4 dot releases 2009-08-13 12:46:34 -07:00
433 changed files with 25213 additions and 32288 deletions

View File

@@ -0,0 +1,12 @@
#
# Shorewall version 4 - Interfaces File
#
# For information about entries in this file, type "man shorewall-interfaces"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-interfaces.html
#
###############################################################################
#ZONE INTERFACE BROADCAST OPTIONS
- lo - ignore
net all - dhcp,physical=+,routeback,optional

13
Samples/Universal/policy Normal file
View File

@@ -0,0 +1,13 @@
#
# Shorewall version 4 - Policy File
#
# For information about entries in this file, type "man shorewall-policy"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-policy.html
#
###############################################################################
#SOURCE DEST POLICY LOG LIMIT: CONNLIMIT:
# LEVEL BURST MASK
$FW net ACCEPT
net all DROP

17
Samples/Universal/rules Normal file
View File

@@ -0,0 +1,17 @@
#
# Shorewall version 4 - Rules File
#
# For information on the settings in this file, type "man shorewall-rules"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-rules.html
#
####################################################################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME
# PORT PORT(S) DEST LIMIT GROUP
#SECTION ESTABLISHED
#SECTION RELATED
SECTION NEW
SSH(ACCEPT) net $FW
Ping(ACCEPT) net $FW

View File

@@ -0,0 +1,213 @@
###############################################################################
#
# Shorewall Version 4 -- /etc/shorewall/shorewall.conf
#
# For information about the settings in this file, type "man shorewall.conf"
#
# Manpage also online at http://www.shorewall.net/manpages/shorewall.conf.html
###############################################################################
# S T A R T U P E N A B L E D
###############################################################################
STARTUP_ENABLED=Yes
###############################################################################
# V E R B O S I T Y
###############################################################################
VERBOSITY=1
###############################################################################
# L O G G I N G
###############################################################################
LOGFILE=
STARTUP_LOG=/var/log/shorewall-init.log
LOG_VERBOSITY=2
LOGFORMAT="Shorewall:%s:%s:"
LOGTAGONLY=No
LOGLIMIT=
LOGALLNEW=
BLACKLIST_LOGLEVEL=
MACLIST_LOG_LEVEL=info
TCP_FLAGS_LOG_LEVEL=info
SMURF_LOG_LEVEL=info
LOG_MARTIANS=Yes
###############################################################################
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
###############################################################################
IPTABLES=
IP=
TC=
IPSET=
PERL=/usr/bin/perl
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
SHOREWALL_SHELL=/bin/sh
SUBSYSLOCK=
MODULESDIR=
CONFIG_PATH=/etc/shorewall:/usr/share/shorewall
RESTOREFILE=
IPSECFILE=zones
LOCKFILE=
###############################################################################
# D E F A U L T A C T I O N S / M A C R O S
###############################################################################
DROP_DEFAULT="Drop"
REJECT_DEFAULT="Reject"
ACCEPT_DEFAULT="none"
QUEUE_DEFAULT="none"
NFQUEUE_DEFAULT="none"
###############################################################################
# R S H / R C P C O M M A N D S
###############################################################################
RSH_COMMAND='ssh ${root}@${system} ${command}'
RCP_COMMAND='scp ${files} ${root}@${system}:${destination}'
###############################################################################
# F I R E W A L L O P T I O N S
###############################################################################
IP_FORWARDING=On
ADD_IP_ALIASES=No
ADD_SNAT_ALIASES=No
RETAIN_ALIASES=No
TC_ENABLED=Internal
TC_EXPERT=No
TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"
CLEAR_TC=Yes
MARK_IN_FORWARD_CHAIN=No
CLAMPMSS=No
ROUTE_FILTER=No
DETECT_DNAT_IPADDRS=No
MUTEX_TIMEOUT=60
ADMINISABSENTMINDED=Yes
BLACKLISTNEWONLY=Yes
DELAYBLACKLISTLOAD=No
MODULE_SUFFIX=ko
DISABLE_IPV6=No
BRIDGING=No
DYNAMIC_ZONES=No
PKTTYPE=Yes
NULL_ROUTE_RFC1918=No
MACLIST_TABLE=filter
MACLIST_TTL=
SAVE_IPSETS=No
MAPOLDACTIONS=No
FASTACCEPT=Yes
IMPLICIT_CONTINUE=No
HIGH_ROUTE_MARKS=No
USE_ACTIONS=Yes
OPTIMIZE=15
EXPORTPARAMS=Yes
EXPAND_POLICIES=Yes
KEEP_RT_TABLES=No
DELETE_THEN_ADD=Yes
MULTICAST=No
DONT_LOAD=
AUTO_COMMENT=Yes
MANGLE_ENABLED=Yes
USE_DEFAULT_RT=No
RESTORE_DEFAULT_ROUTE=Yes
AUTOMAKE=No
WIDE_TC_MARKS=Yes
TRACK_PROVIDERS=Yes
ZONE2ZONE=2
ACCOUNTING=Yes
DYNAMIC_BLACKLIST=Yes
OPTIMIZE_ACCOUNTING=No
LOAD_HELPERS_ONLY=Yes
REQUIRE_INTERFACE=Yes
FORWARD_CLEAR_MARK=Yes
COMPLETE=Yes
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################
BLACKLIST_DISPOSITION=DROP
MACLIST_DISPOSITION=REJECT
TCP_FLAGS_DISPOSITION=DROP
#LAST LINE -- DO NOT REMOVE

14
Samples/Universal/zones Normal file
View File

@@ -0,0 +1,14 @@
#
# Shorewall version 4 - Zones File
#
# For information about this file, type "man shorewall-zones"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-zones.html
#
###############################################################################
#ZONE TYPE OPTIONS IN OUT
# OPTIONS OPTIONS
fw firewall
net ip

View File

@@ -10,10 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-interfaces"
#
# For additional information, see
# http://shorewall.net/Documentation.htm#Interfaces
#
###############################################################################
#ZONE INTERFACE BROADCAST OPTIONS
net eth0 detect dhcp,tcpflags,logmartians,nosmurfs

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#-----------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-policy"
#
# See http://shorewall.net/Documentation.htm#Policy for additional information.
#
###############################################################################
#SOURCE DEST POLICY LOG LEVEL LIMIT:BURST
$FW net ACCEPT

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------------------------------------
# For information on entries in this file, type "man shorewall-rules"
#
# For more information, see http://www.shorewall.net/Documentation.htm#Zones
#
#############################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK
# PORT PORT(S) DEST LIMIT GROUP

View File

@@ -34,17 +34,15 @@ VERBOSITY=1
LOGFILE=/var/log/messages
STARTUP_LOG=
STARTUP_LOG=/var/log/shorewall-init.log
LOG_VERBOSITY=
LOG_VERBOSITY=2
LOGFORMAT="Shorewall:%s:%s:"
LOGTAGONLY=No
LOGRATE=
LOGBURST=
LOGLIMIT=
LOGALLNEW=
@@ -70,6 +68,8 @@ TC=
IPSET=
PERL=/usr/bin/perl
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
SHOREWALL_SHELL=/bin/sh
@@ -107,9 +107,9 @@ RCP_COMMAND='scp ${files} ${root}@${system}:${destination}'
# F I R E W A L L O P T I O N S
###############################################################################
IP_FORWARDING=On
IP_FORWARDING=Off
ADD_IP_ALIASES=Yes
ADD_IP_ALIASES=No
ADD_SNAT_ALIASES=No
@@ -119,6 +119,8 @@ TC_ENABLED=Internal
TC_EXPERT=No
TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"
CLEAR_TC=Yes
MARK_IN_FORWARD_CHAIN=No
@@ -137,7 +139,7 @@ BLACKLISTNEWONLY=Yes
DELAYBLACKLISTLOAD=No
MODULE_SUFFIX=
MODULE_SUFFIX=ko
DISABLE_IPV6=No
@@ -191,6 +193,24 @@ AUTOMAKE=No
WIDE_TC_MARKS=Yes
TRACK_PROVIDERS=Yes
ZONE2ZONE=2
ACCOUNTING=Yes
DYNAMIC_BLACKLIST=Yes
OPTIMIZE_ACCOUNTING=No
LOAD_HELPERS_ONLY=Yes
REQUIRE_INTERFACE=No
FORWARD_CLEAR_MARK=Yes
COMPLETE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#-----------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-zones"
#
# For more information, see http://www.shorewall.net/Documentation.htm#Zones
#
###############################################################################
#ZONE TYPE OPTIONS IN OUT
# OPTIONS OPTIONS

View File

@@ -10,10 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-interfaces"
#
# For additional information, see
# http://shorewall.net/Documentation.htm#Interfaces
#
###############################################################################
#ZONE INTERFACE BROADCAST OPTIONS
net eth0 detect tcpflags,dhcp,nosmurfs,routefilter,logmartians

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-masq"
#
# For additional information, see http://shorewall.net/Documentation.htm#Masq
#
##############################################################################
#INTERFACE SOURCE ADDRESS PROTO PORT(S) IPSEC MARK
eth0 10.0.0.0/8,\

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-policy"
#
# See http://shorewall.net/Documentation.htm#Policy for additional information.
#
###############################################################################
#SOURCE DEST POLICY LOG LEVEL LIMIT:BURST

View File

@@ -10,11 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-routestopped"
#
# See http://shorewall.net/Documentation.htm#Routestopped and
# http://shorewall.net/starting_and_stopping_shorewall.htm for additional
# information.
#
##############################################################################
#INTERFACE HOST(S)
eth1 -

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-rules"
#
# For additional information, see http://shorewall.net/Documentation.htm#Rules
#
#############################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK
# PORT PORT(S) DEST LIMIT GROUP

View File

@@ -34,17 +34,15 @@ VERBOSITY=1
LOGFILE=/var/log/messages
STARTUP_LOG=
STARTUP_LOG=/var/log/shorewall-init.log
LOG_VERBOSITY=
LOG_VERBOSITY=2
LOGFORMAT="Shorewall:%s:%s:"
LOGTAGONLY=No
LOGRATE=
LOGBURST=
LOGLIMIT=
LOGALLNEW=
@@ -70,6 +68,8 @@ TC=
IPSET=
PERL=/usr/bin/perl
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
SHOREWALL_SHELL=/bin/sh
@@ -109,7 +109,7 @@ RCP_COMMAND='scp ${files} ${root}@${system}:${destination}'
IP_FORWARDING=On
ADD_IP_ALIASES=Yes
ADD_IP_ALIASES=No
ADD_SNAT_ALIASES=No
@@ -119,6 +119,8 @@ TC_ENABLED=Internal
TC_EXPERT=No
TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"
CLEAR_TC=Yes
MARK_IN_FORWARD_CHAIN=No
@@ -137,7 +139,7 @@ BLACKLISTNEWONLY=Yes
DELAYBLACKLISTLOAD=No
MODULE_SUFFIX=
MODULE_SUFFIX=ko
DISABLE_IPV6=No
@@ -191,6 +193,24 @@ AUTOMAKE=No
WIDE_TC_MARKS=Yes
TRACK_PROVIDERS=Yes
ZONE2ZONE=2
ACCOUNTING=Yes
DYNAMIC_BLACKLIST=Yes
OPTIMIZE_ACCOUNTING=No
LOAD_HELPERS_ONLY=Yes
REQUIRE_INTERFACE=No
FORWARD_CLEAR_MARK=Yes
COMPLETE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-zones"
#
# For more information, see http://www.shorewall.net/Documentation.htm#Zones
#
###############################################################################
#ZONE TYPE OPTIONS IN OUT
# OPTIONS OPTIONS

View File

@@ -10,10 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-interfaces"
#
# For additional information, see
# http://shorewall.net/Documentation.htm#Interfaces
#
###############################################################################
#ZONE INTERFACE BROADCAST OPTIONS
net eth0 detect dhcp,tcpflags,nosmurfs,routefilter,logmartians

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-masq"
#
# For additional information, see http://shorewall.net/Documentation.htm#Masq
#
###############################################################################
#INTERFACE SOURCE ADDRESS PROTO PORT(S) IPSEC MARK
eth0 10.0.0.0/8,\

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-policy"
#
# See http://shorewall.net/Documentation.htm#Policy for additional information.
#
###############################################################################
#SOURCE DEST POLICY LOG LEVEL LIMIT:BURST

View File

@@ -10,11 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-routestopped"
#
# See http://shorewall.net/Documentation.htm#Routestopped and
# http://shorewall.net/starting_and_stopping_shorewall.htm for additional
# information.
#
##############################################################################
#INTERFACE HOST(S) OPTIONS
eth1 -

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-rules"
#
# For more information, see http://www.shorewall.net/Documentation.htm#Rules
#
#############################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK
# PORT PORT(S) DEST LIMIT GROUP

View File

@@ -41,17 +41,15 @@ SHOREWALL_COMPILER=
LOGFILE=/var/log/messages
STARTUP_LOG=
STARTUP_LOG=/var/log/shorewall-init.log
LOG_VERBOSITY=
LOG_VERBOSITY=2
LOGFORMAT="Shorewall:%s:%s:"
LOGTAGONLY=No
LOGRATE=
LOGBURST=
LOGLIMIT=
LOGALLNEW=
@@ -77,6 +75,8 @@ TC=
IPSET=
PERL=/usr/bin/perl
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
SHOREWALL_SHELL=/bin/sh
@@ -116,7 +116,7 @@ RCP_COMMAND='scp ${files} ${root}@${system}:${destination}'
IP_FORWARDING=On
ADD_IP_ALIASES=Yes
ADD_IP_ALIASES=No
ADD_SNAT_ALIASES=No
@@ -126,6 +126,8 @@ TC_ENABLED=Internal
TC_EXPERT=No
TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"
CLEAR_TC=Yes
MARK_IN_FORWARD_CHAIN=No
@@ -144,7 +146,7 @@ BLACKLISTNEWONLY=Yes
DELAYBLACKLISTLOAD=No
MODULE_SUFFIX=
MODULE_SUFFIX=ko
DISABLE_IPV6=No
@@ -198,6 +200,24 @@ AUTOMAKE=No
WIDE_TC_MARKS=Yes
TRACK_PROVIDERS=Yes
ZONE2ZONE=2
ACCOUNTING=Yes
DYNAMIC_BLACKLIST=Yes
OPTIMIZE_ACCOUNTING=No
LOAD_HELPERS_ONLY=Yes
REQUIRE_INTERFACE=No
FORWARD_CLEAR_MARK=Yes
COMPLETE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@@ -10,9 +10,6 @@
# See the file README.txt for further details.
#------------------------------------------------------------------------------
# For information about entries in this file, type "man shorewall-zones"
#
# For more information, see http://www.shorewall.net/Documentation.htm#Zones
#
###############################################################################
#ZONE TYPE OPTIONS IN OUT
# OPTIONS OPTIONS

View File

@@ -0,0 +1,13 @@
#
# Shorewall version 4 - Interfaces File
#
# For information about entries in this file, type "man shorewall-interfaces"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-interfaces.html
#
###############################################################################
#ZONE INTERFACE BROADCAST OPTIONS
- lo - ignore
net all - dhcp,physical=+,routeback

14
Samples6/Universal/policy Normal file
View File

@@ -0,0 +1,14 @@
#
# Shorewall version 4 - Policy File
#
# For information about entries in this file, type "man shorewall-policy"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-policy.html
#
###############################################################################
#SOURCE DEST POLICY LOG LIMIT: CONNLIMIT:
# LEVEL BURST MASK
fw net ACCEPT
net all DROP

17
Samples6/Universal/rules Normal file
View File

@@ -0,0 +1,17 @@
#
# Shorewall version 4 - Rules File
#
# For information on the settings in this file, type "man shorewall-rules"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-rules.html
#
####################################################################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ MARK CONNLIMIT TIME
# PORT PORT(S) DEST LIMIT GROUP
#SECTION ESTABLISHED
#SECTION RELATED
SECTION NEW
SSH(ACCEPT) net $FW
Ping(ACCEPT) net $FW

View File

@@ -0,0 +1,168 @@
###############################################################################
#
# Shorewall Version 4 -- /etc/shorewall6/shorewall6.conf
#
# For information about the settings in this file, type "man shorewall6.conf"
#
# Manpage also online at
# http://www.shorewall.net/manpages6/shorewall6.conf.html
###############################################################################
# S T A R T U P E N A B L E D
###############################################################################
STARTUP_ENABLED=Yes
###############################################################################
# V E R B O S I T Y
###############################################################################
VERBOSITY=1
###############################################################################
# L O G G I N G
###############################################################################
LOGFILE=
STARTUP_LOG=/var/log/shorewall6-init.log
LOG_VERBOSITY=2
LOGFORMAT="Shorewall:%s:%s:"
LOGTAGONLY=No
LOGLIMIT=
LOGALLNEW=
BLACKLIST_LOGLEVEL=
TCP_FLAGS_LOG_LEVEL=info
SMURF_LOG_LEVEL=info
###############################################################################
# L O C A T I O N O F F I L E S A N D D I R E C T O R I E S
###############################################################################
IP6TABLES=
IP=
TC=
IPSET=
PERL=/usr/bin/perl
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
SHOREWALL_SHELL=/bin/sh
SUBSYSLOCK=
MODULESDIR=
CONFIG_PATH=/usr/share/shorewall6:/usr/share/shorewall
RESTOREFILE=
LOCKFILE=
###############################################################################
# D E F A U L T A C T I O N S / M A C R O S
###############################################################################
DROP_DEFAULT="Drop"
REJECT_DEFAULT="Reject"
ACCEPT_DEFAULT="none"
QUEUE_DEFAULT="none"
NFQUEUE_DEFAULT="none"
###############################################################################
# R S H / R C P C O M M A N D S
###############################################################################
RSH_COMMAND='ssh ${root}@${system} ${command}'
RCP_COMMAND='scp ${files} ${root}@${system}:${destination}'
###############################################################################
# F I R E W A L L O P T I O N S
###############################################################################
IP_FORWARDING=Off
TC_ENABLED=No
TC_EXPERT=No
TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"
CLEAR_TC=Yes
MARK_IN_FORWARD_CHAIN=No
CLAMPMSS=No
MUTEX_TIMEOUT=60
ADMINISABSENTMINDED=Yes
BLACKLISTNEWONLY=Yes
MODULE_SUFFIX=ko
FASTACCEPT=Yes
IMPLICIT_CONTINUE=No
HIGH_ROUTE_MARKS=No
OPTIMIZE=15
EXPORTPARAMS=Yes
EXPAND_POLICIES=Yes
KEEP_RT_TABLES=Yes
DELETE_THEN_ADD=Yes
DONT_LOAD=
AUTO_COMMENT=Yes
MANGLE_ENABLED=Yes
AUTOMAKE=No
WIDE_TC_MARKS=Yes
TRACK_PROVIDERS=Yes
ZONE2ZONE=2
ACCOUNTING=Yes
OPTIMIZE_ACCOUNTING=No
DYNAMIC_BLACKLIST=Yes
LOAD_HELPERS_ONLY=Yes
REQUIRE_INTERFACE=Yes
FORWARD_CLEAR_MARK=Yes
COMPLETE=Yes
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################
BLACKLIST_DISPOSITION=DROP
TCP_FLAGS_DISPOSITION=DROP
#LAST LINE -- DO NOT REMOVE

14
Samples6/Universal/zones Normal file
View File

@@ -0,0 +1,14 @@
#
# Shorewall version 4 - Zones File
#
# For information about this file, type "man shorewall-zones"
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-zones.html
#
###############################################################################
#ZONE TYPE OPTIONS IN OUT
# OPTIONS OPTIONS
fw firewall
net ip

View File

@@ -32,17 +32,15 @@ VERBOSITY=1
LOGFILE=/var/log/messages
STARTUP_LOG=
STARTUP_LOG=/var/log/shorewall6-init.log
LOG_VERBOSITY=
LOG_VERBOSITY=2
LOGFORMAT="Shorewall:%s:%s:"
LOGTAGONLY=No
LOGRATE=
LOGBURST=
LOGLIMIT=
LOGALLNEW=
@@ -58,6 +56,8 @@ SMURF_LOG_LEVEL=info
IP6TABLES=
PERL=/usr/bin/perl
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
SHOREWALL_SHELL=/bin/sh
@@ -99,6 +99,8 @@ TC_ENABLED=No
TC_EXPERT=No
TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"
CLEAR_TC=Yes
MARK_IN_FORWARD_CHAIN=No
@@ -111,7 +113,7 @@ ADMINISABSENTMINDED=Yes
BLACKLISTNEWONLY=Yes
MODULE_SUFFIX=
MODULE_SUFFIX=ko
FASTACCEPT=No
@@ -139,7 +141,25 @@ AUTOMAKE=No
WIDE_TC_MARKS=Yes
###############################################################################
TRACK_PROVIDERS=Yes
ZONE2ZONE=2
ACCOUNTING=Yes
DYNAMIC_BLACKLIST=Yes
OPTIMIZE_ACCOUNTING=No
LOAD_HELPERS_ONLY=Yes
REQUIRE_INTERFACE=No
FORWARD_CLEAR_MARK=Yes
COMPLETE=No
##############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@@ -12,6 +12,6 @@
# For information about entries in this file, type "man shorewall6-interfaces"
###############################################################################
#ZONE INTERFACE BROADCAST OPTIONS
net eth0 detect tcpflags
loc eth1 detect tcpflags
dmz eth2 detect
net eth0 detect tcpflags,forward=1
loc eth1 detect tcpflags,forward=1
dmz eth2 detect tcpflags,forward=1

View File

@@ -32,17 +32,15 @@ VERBOSITY=1
LOGFILE=/var/log/messages
STARTUP_LOG=
STARTUP_LOG=/var/log/shorewall6-init.log
LOG_VERBOSITY=
LOG_VERBOSITY=2
LOGFORMAT="Shorewall:%s:%s:"
LOGTAGONLY=No
LOGRATE=
LOGBURST=
LOGLIMIT=
LOGALLNEW=
@@ -58,6 +56,8 @@ SMURF_LOG_LEVEL=info
IP6TABLES=
PERL=/usr/bin/perl
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
SHOREWALL_SHELL=/bin/sh
@@ -99,6 +99,8 @@ TC_ENABLED=No
TC_EXPERT=No
TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"
CLEAR_TC=Yes
MARK_IN_FORWARD_CHAIN=No
@@ -111,7 +113,7 @@ ADMINISABSENTMINDED=Yes
BLACKLISTNEWONLY=Yes
MODULE_SUFFIX=
MODULE_SUFFIX=ko
FASTACCEPT=No
@@ -139,6 +141,24 @@ AUTOMAKE=No
WIDE_TC_MARKS=Yes
TRACK_PROVIDERS=Yes
ZONE2ZONE=2
ACCOUNTING=Yes
DYNAMIC_BLACKLIST=Yes
OPTIMIZE_ACCOUNTING=No
LOAD_HELPERS_ONLY=Yes
REQUIRE_INTERFACE=No
FORWARD_CLEAR_MARK=Yes
COMPLETE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@@ -12,5 +12,5 @@
# For information about entries in this file, type "man shorewall6-interfaces"
###############################################################################
#ZONE INTERFACE BROADCAST OPTIONS
net eth0 detect tcpflags
loc eth1 detect tcpflags
net eth0 detect tcpflags,forward=1
loc eth1 detect tcpflags,forward=1

View File

@@ -1,6 +1,6 @@
###############################################################################
#
# Shorewall version 3.4 - Sample shorewall.conf for one-interface configuration.
# Shorewall version 4.4 - Sample shorewall.conf for one-interface configuration.
# Copyright (C) 2006 by the Shorewall Team
#
# This library is free software; you can redistribute it and/or
@@ -32,17 +32,15 @@ VERBOSITY=1
LOGFILE=/var/log/messages
STARTUP_LOG=
STARTUP_LOG=/var/log/shorewall6-init.log
LOG_VERBOSITY=
LOG_VERBOSITY=2
LOGFORMAT="Shorewall:%s:%s:"
LOGTAGONLY=No
LOGRATE=
LOGBURST=
LOGLIMIT=
LOGALLNEW=
@@ -58,6 +56,8 @@ SMURF_LOG_LEVEL=info
IP6TABLES=
PERL=/usr/bin/perl
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
SHOREWALL_SHELL=/bin/sh
@@ -99,6 +99,8 @@ TC_ENABLED=No
TC_EXPERT=No
TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"
CLEAR_TC=Yes
MARK_IN_FORWARD_CHAIN=No
@@ -111,7 +113,7 @@ ADMINISABSENTMINDED=Yes
BLACKLISTNEWONLY=Yes
MODULE_SUFFIX=
MODULE_SUFFIX=ko
FASTACCEPT=No
@@ -139,6 +141,24 @@ AUTOMAKE=No
WIDE_TC_MARKS=Yes
TRACK_PROVIDERS=Yes
ZONE2ZONE=2
ACCOUNTING=Yes
DYNAMIC_BLACKLIST=Yes
OPTIMIZE_ACCOUNTING=No
LOAD_HELPERS_ONLY=Yes
REQUIRE_INTERFACE=No
FORWARD_CLEAR_MARK=Yes
COMPLETE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@@ -55,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

View File

@@ -0,0 +1 @@
This is the Shorewall-init stable 4.4 branch of Git.

104
Shorewall-init/ifupdown.sh Normal file
View File

@@ -0,0 +1,104 @@
#!/bin/sh
#
# ifupdown script for Shorewall-based products
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2010 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
IFUPDOWN=0
PRODUCTS=
if [ -f /etc/default/shorewall-init ]; then
. /etc/default/shorewall-init
elif [ -f /etc/sysconfig/shorewall-init ]; then
. /etc/sysconfig/shorewall-init
fi
[ "$IFUPDOWN" = 1 -a -n "$PRODUCTS" ] || exit 0
if [ -f /etc/debian_version ]; then
#
# Debian ifupdown system
#
if [ "$MODE" = start ]; then
COMMAND=up
elif [ "$MODE" = stop ]; then
COMMAND=down
else
exit 0
fi
case "$PHASE" in
pre-*)
exit 0
;;
esac
elif [ -f /etc/SuSE-release ]; then
#
# SuSE ifupdown system
#
IFACE="$2"
case $0 in
*if-up.d*)
COMMAND=up
;;
*if-down.d*)
COMMAND=down
;;
*)
exit 0
;;
esac
else
#
# Assume RedHat/Fedora/CentOS/Foobar/...
#
IFACE="$1"
case $0 in
*ifup*)
COMMAND=up
;;
*ifdown*)
COMMAND=down
;;
*dispatcher.d*)
COMMAND="$2"
;;
*)
exit 0
;;
esac
fi
for PRODUCT in $PRODUCTS; do
VARDIR=/var/lib/$PRODUCT
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
if [ -x $VARDIR/firewall ]; then
( . /usr/share/$PRODUCT/lib.base
mutex_on
${VARDIR}/firewall -V0 $COMMAND $IFACE || echo_notdone
mutex_off
)
fi
done
exit 0

146
Shorewall-init/init.debian.sh Executable file
View File

@@ -0,0 +1,146 @@
#!/bin/sh
#
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.4
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2010 - Tom Eastep (teastep@shorewall.net)
#
# On most distributions, this file should be called /etc/init.d/shorewall.
#
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
### BEGIN INIT INFO
# Provides: shorewall-init
# Required-Start: $local_fs
# X-Start-Before: $network
# Required-Stop: $local_fs
# X-Stop-After: $network
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Initialize the firewall at boot time
# Description: Place the firewall in a safe state at boot time prior to
# bringing up the network
### END INIT INFO
export VERBOSITY=0
if [ "$(id -u)" != "0" ]
then
echo "You must be root to start, stop or restart \"Shorewall \"."
exit 1
fi
echo_notdone () {
echo "not done."
exit 1
}
not_configured () {
echo "#### WARNING ####"
echo "the firewall won't be initialized unless it is configured"
if [ "$1" != "stop" ]
then
echo ""
echo "Please read about Debian specific customization in"
echo "/usr/share/doc/shorewall-init/README.Debian.gz."
fi
echo "#################"
exit 0
}
# check if shorewall-init is configured or not
if [ -f "/etc/default/shorewall-init" ]
then
. /etc/default/shorewall-init
if [ -z "$PRODUCTS" ]
then
not_configured
fi
else
not_configured
fi
# Initialize the firewall
shorewall_start () {
local product
local VARDIR
echo -n "Initializing \"Shorewall-based firewalls\": "
for product in $PRODUCTS; do
VARDIR=/var/lib/$product
[ -f /etc/$product/vardir ] && . /etc/$product/vardir
if [ -x ${VARDIR}/firewall ]; then
#
# Run in a sub-shell to avoid name collisions
#
(
. /usr/share/$product/lib.base
#
# Get mutex so the firewall state is stable
#
mutex_on
if ! ${VARDIR}/firewall status > /dev/null 2>&1; then
${VARDIR}/firewall stop || echo_notdone
fi
mutex_off
)
fi
done
echo "done."
return 0
}
# Clear the firewall
shorewall_stop () {
local product
local VARDIR
echo -n "Clearing \"Shorewall-based firewalls\": "
for product in $PRODUCTS; do
VARDIR=/var/lib/$product
[ -f /etc/$product/vardir ] && . /etc/$product/vardir
if [ -x ${VARDIR}/firewall ]; then
( . /usr/share/$product/lib.base
mutex_on
${VARDIR}/firewall clear || echo_notdone
mutex_off
)
fi
done
echo "done."
return 0
}
case "$1" in
start)
shorewall_start
;;
stop)
shorewall_stop
;;
reload|force-reload)
;;
*)
echo "Usage: /etc/init.d/shorewall-init {start|stop|reload|force-reload}"
exit 1
esac
exit 0

104
Shorewall-init/init.sh Executable file
View File

@@ -0,0 +1,104 @@
#! /bin/bash
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.4
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2010 - Tom Eastep (teastep@shorewall.net)
#
# On most distributions, this file should be called /etc/init.d/shorewall.
#
# Complete documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# chkconfig: - 09 91
#
### BEGIN INIT INFO
# Provides: shorewall-init
# Required-start: $local_fs
# Required-stop: $local_fs
# Default-Start: 2 3 5
# Default-Stop:
# Short-Description: Initialize the firewall at boot time
# Description: Place the firewall in a safe state at boot time
# prior to bringing up the network.
### END INIT INFO
if [ "$(id -u)" != "0" ]
then
echo "You must be root to start, stop or restart \"Shorewall \"."
exit 1
fi
# check if shorewall-init is configured or not
if [ -f "/etc/sysconfig/shorewall-init" ]
then
. /etc/sysconfig/shorewall-init
if [ -z "$PRODUCTS" ]
then
exit 0
fi
else
exit 0
fi
# Initialize the firewall
shorewall_start () {
local PRODUCT
local VARDIR
echo -n "Initializing \"Shorewall-based firewalls\": "
for PRODUCT in $PRODUCTS; do
VARDIR=/var/lib/$PRODUCT
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
if [ -x ${VARDIR}/firewall ]; then
if ! /sbin/$PRODUCT status > /dev/null 2>&1; then
${VARDIR}/firewall stop || echo_notdone
fi
fi
done
return 0
}
# Clear the firewall
shorewall_stop () {
local PRODUCT
local VARDIR
echo -n "Clearing \"Shorewall-based firewalls\": "
for PRODUCT in $PRODUCTS; do
VARDIR=/var/lib/$PRODUCT
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
if [ -x ${VARDIR}/firewall ]; then
${VARDIR}/firewall clear || exit 1
fi
done
return 0
}
case "$1" in
start)
shorewall_start
;;
stop)
shorewall_stop
;;
*)
echo "Usage: /etc/init.d/shorewall-init {start|stop}"
exit 1
esac
exit 0

336
Shorewall-init/install.sh Executable file
View File

@@ -0,0 +1,336 @@
#!/bin/sh
#
# Script to install Shoreline Firewall Init
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
# (c) 2010 - Roberto C. Sanchez (roberto@connexer.com)
#
# Shorewall documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
VERSION=4.4.13-Beta3
usage() # $1 = exit status
{
ME=$(basename $0)
echo "usage: $ME"
echo " $ME -v"
echo " $ME -h"
exit $1
}
split() {
local ifs
ifs=$IFS
IFS=:
set -- $1
echo $*
IFS=$ifs
}
qt()
{
"$@" >/dev/null 2>&1
}
mywhich() {
local dir
for dir in $(split $PATH); do
if [ -x $dir/$1 ]; then
echo $dir/$1
return 0
fi
done
return 2
}
run_install()
{
if ! install $*; then
echo
echo "ERROR: Failed to install $*" >&2
exit 1
fi
}
cant_autostart()
{
echo
echo "WARNING: Unable to configure shorewall init to start automatically at boot" >&2
}
delete_file() # $1 = file to delete
{
rm -f $1
}
install_file() # $1 = source $2 = target $3 = mode
{
run_install $T $OWNERSHIP -m $3 $1 ${2}
}
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
#
# Parse the run line
#
# DEST is the SysVInit script directory
# INIT is the name of the script in the $DEST directory
# ARGS is "yes" if we've already parsed an argument
#
ARGS=""
if [ -z "$DEST" ] ; then
DEST="/etc/init.d"
fi
if [ -z "$INIT" ] ; then
INIT="shorewall-init"
fi
while [ $# -gt 0 ] ; do
case "$1" in
-h|help|?)
usage 0
;;
-v)
echo "Shorewall Init Installer Version $VERSION"
exit 0
;;
*)
usage 1
;;
esac
shift
ARGS="yes"
done
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
#
# Determine where to install the firewall script
#
case $(uname) in
Darwin)
[ -z "$OWNER" ] && OWNER=root
[ -z "$GROUP" ] && GROUP=wheel
T=
;;
*)
[ -z "$OWNER" ] && OWNER=root
[ -z "$GROUP" ] && GROUP=root
;;
esac
OWNERSHIP="-o $OWNER -g $GROUP"
if [ -n "$DESTDIR" ]; then
if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root."
OWNERSHIP=""
fi
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
elif [ -f /etc/debian_version ]; then
DEBIAN=yes
elif [ -f /etc/SuSE-release ]; then
SUSE=Yes
elif [ -f /etc/slackware-version ] ; then
echo "Shorewall-init is currently not supported on Slackware" >&2
exit 1
# DEST="/etc/rc.d"
# INIT="rc.firewall"
elif [ -f /etc/arch-release ] ; then
echo "Shorewall-init is currently not supported on Arch Linux" >&2
exit 1
# DEST="/etc/rc.d"
# INIT="shorewall-init"
# ARCHLINUX=yes
elif [ -d /etc/sysconfig/network-scripts/ ]; then
#
# Assume RedHat-based
#
REDHAT=Yes
else
echo "Unknown distribution: Shorewall-init support is not available" >&2
exit 1
fi
#
# Change to the directory containing this script
#
cd "$(dirname $0)"
echo "Installing Shorewall Init Version $VERSION"
#
# Check for /usr/share/shorewall-init/version
#
if [ -f ${DESTDIR}/usr/share/shorewall-init/version ]; then
first_install=""
else
first_install="Yes"
fi
#
# Install the Init Script
#
if [ -n "$DEBIAN" ]; then
install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall-init 0544
#elif [ -n "$ARCHLINUX" ]; then
# install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
else
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
fi
echo "Shorewall Init script installed in ${DESTDIR}${DEST}/$INIT"
#
# Create /usr/share/shorewall-init if needed
#
mkdir -p ${DESTDIR}/usr/share/shorewall-init
chmod 755 ${DESTDIR}/usr/share/shorewall-init
#
# Create the version file
#
echo "$VERSION" > ${DESTDIR}/usr/share/shorewall-init/version
chmod 644 ${DESTDIR}/usr/share/shorewall-init/version
#
# Remove and create the symbolic link to the init script
#
if [ -z "$DESTDIR" ]; then
rm -f /usr/share/shorewall-init/init
ln -s ${DEST}/${INIT} /usr/share/shorewall-init/init
fi
if [ -n "$DEBIAN" ]; then
if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/network/if-up.d/
mkdir -p ${DESTDIR}/etc/network/if-post-down.d/
fi
if [ ! -f ${DESTDIR}/etc/default/shorewall-init ]; then
if [ -n "${DESTDIR}" ]; then
mkdir ${DESTDIR}/etc/default
fi
install_file sysconfig ${DESTDIR}/etc/default/shorewall-init 0644
fi
else
if [ -n "$DESTDIR" ]; then
mkdir -p ${DESTDIR}/etc/sysconfig
if [ -z "$RPM" ]; then
if [ -n "$SUSE" ]; then
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-down.d
else
mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d
fi
fi
fi
if [ -d ${DESTDIR}/etc/sysconfig -a ! -f ${DESTDIR}/etc/sysconfig/shorewall-init ]; then
install_file sysconfig ${DESTDIR}/etc/sysconfig/shorewall-init 0644
fi
fi
#
# Install the ifupdown script
#
mkdir -p ${DESTDIR}/usr/share/shorewall-init
install_file ifupdown.sh ${DESTDIR}/usr/share/shorewall-init/ifupdown 0544
if [ -d ${DESTDIR}/etc/NetworkManager ]; then
install_file ifupdown.sh ${DESTDIR}/etc/NetworkManager/dispatcher.d/01-shorewall 0544
fi
if [ -n "$DEBIAN" ]; then
install_file ifupdown.sh ${DESTDIR}/etc/network/if-up.d/shorewall 0544
install_file ifupdown.sh ${DESTDIR}/etc/network/if-post-down.d/shorewall 0544
elif [ -n "$SUSE" ]; then
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-up.d/shorewall 0544
install_file ifupdown.sh ${DESTDIR}/etc/sysconfig/network/if-down.d/shorewall 0544
elif [ -n "$REDHAT" ]; then
if [ -f ${DESTDIR}/sbin/ifup-local -o -f ${DESTDIR}/sbin/ifdown-local ]; then
echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; up/down events will not be handled"
else
install_file ifupdown.sh ${DESTDIR}/sbin/ifup-local 0544
install_file ifupdown.sh ${DESTDIR}/sbin/ifdown-local 0544
fi
fi
if [ -z "$DESTDIR" ]; then
if [ -n "$first_install" ]; then
if [ -n "$DEBIAN" ]; then
if [ -x /sbin/insserv ]; then
insserv /etc/init.d/shorewall-init
else
ln -sf ../init.d/shorewall-init /etc/rcS.d/S38shorewall-init
fi
echo "Shorewall Init will start automatically at boot"
else
if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then
if insserv /etc/init.d/shorewall-init ; then
echo "Shorewall Init will start automatically at boot"
else
cant_autostart
fi
elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ]; then
if chkconfig --add shorewall-init ; then
echo "Shorewall Init will start automatically in run levels as follows:"
chkconfig --list shorewall-init
else
cant_autostart
fi
elif [ -x /sbin/rc-update ]; then
if rc-update add shorewall-init default; then
echo "Shorewall Init will start automatically at boot"
else
cant_autostart
fi
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
cant_autostart
fi
fi
fi
else
if [ -n "$first_install" ]; then
if [ -n "$DEBIAN" ]; then
if [ -n "${DESTDIR}" ]; then
mkdir -p ${DESTDIR}/etc/rcS.d
fi
ln -sf ../init.d/shorewall-init ${DESTDIR}/etc/rcS.d/S38shorewall-init
echo "Shorewall Init will start automatically at boot"
fi
fi
fi
#
# Report Success
#
echo "shorewall Init Version $VERSION Installed"

View File

@@ -0,0 +1,146 @@
%define name shorewall-init
%define version 4.4.13
%define release 0Beta3
Summary: Shorewall-init adds functionality to Shoreline Firewall (Shorewall).
Name: %{name}
Version: %{version}
Release: %{release}
License: GPLv2
Packager: Tom Eastep <teastep@shorewall.net>
Group: Networking/Utilities
Source: %{name}-%{version}.tgz
URL: http://www.shorewall.net/
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: shoreline_firewall >= 4.4.10
%description
The Shoreline Firewall, more commonly known as "Shorewall", is a Netfilter
(iptables) based firewall that can be used on a dedicated firewall system,
a multi-function gateway/ router/server or on a standalone GNU/Linux system.
Shorewall Init is a companion product to Shorewall that allows for tigher
control of connections during boot and that integrates Shorewall with
ifup/ifdown and NetworkManager.
%prep
%setup
%build
%install
export DESTDIR=$RPM_BUILD_ROOT ; \
export OWNER=`id -n -u` ; \
export GROUP=`id -n -g` ;\
./install.sh
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ $1 -eq 1 ]; then
if [ -x /sbin/insserv ]; then
/sbin/insserv /etc/rc.d/shorewall-init
elif [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --add shorewall-init;
fi
fi
if [ -f /etc/SuSE-release ]; then
cp -pf /usr/share/shorewall-init/ifupdown /etc/sysconfig/network/if-up.d/shorewall
cp -pf /usr/share/shorewall-init/ifupdown /etc/sysconfig/network/if-down.d/shorewall
else
if [ -f /sbin/ifup-local -o -f /sbin/ifdown-local ]; then
if ! grep -q Shorewall /sbin/ifup-local || ! grep -q Shorewall /sbin/ifdown-local; then
echo "WARNING: /sbin/ifup-local and/or /sbin/ifdown-local already exist; ifup/ifdown events will not be handled" >&2
else
cp -pf /usr/share/shorewall-init/ifupdown /sbin/ifup-local
cp -pf /usr/share/shorewall-init/ifupdown /sbin/ifdown-local
fi
else
cp -pf /usr/share/shorewall-init/ifupdown /sbin/ifup-local
cp -pf /usr/share/shorewall-init/ifupdown /sbin/ifdown-local
fi
if [ -d /etc/NetworkManager/dispatcher.d/ ]; then
cp -pf /usr/share/shorewall-init/ifupdown /etc/NetworkManager/dispatcher.d/01-shorewall
fi
fi
%preun
if [ $1 -eq 0 ]; then
if [ -x /sbin/insserv ]; then
/sbin/insserv -r /etc/init.d/shorewall-init
elif [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --del shorewall-init
fi
[ -f /sbin/ifup-local ] && grep -q Shorewall /sbin/ifup-local && rm -f /sbin/ifup-local
[ -f /sbin/ifdown-local ] && grep -q Shorewall /sbin/ifdown-local && rm -f /sbin/ifdown-local
rm -f /etc/NetworkManager/dispatcher.d/01-shorewall
fi
%files
%defattr(0644,root,root,0755)
%attr(0644,root,root) %config(noreplace) /etc/sysconfig/shorewall-init
%attr(0544,root,root) /etc/init.d/shorewall-init
%attr(0755,root,root) %dir /usr/share/shorewall-init
%attr(0644,root,root) /usr/share/shorewall-init/version
%attr(0544,root,root) /usr/share/shorewall-init/ifupdown
%doc COPYING changelog.txt releasenotes.txt
%changelog
* Mon Aug 30 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.13-0Beta3
* Wed Aug 25 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.13-0Beta2
* Wed Aug 18 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.13-0Beta1
* Sun Aug 15 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0base
* Fri Aug 06 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0RC1
* Sun Aug 01 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0Beta4
* Sat Jul 31 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0Beta3
* Sun Jul 25 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0Beta2
* Wed Jul 21 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0Beta1
* Fri Jul 09 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.11-0base
* Mon Jul 05 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.11-0RC1
* Sat Jul 03 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.11-0Beta3
* Thu Jul 01 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.11-0Beta2
* Sun Jun 06 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.11-0Beta1
* Sat Jun 05 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0base
* Fri Jun 04 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0RC2
* Thu May 27 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0RC1
* Wed May 26 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0Beta4
* Tue May 25 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0Beta3
* Thu May 20 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0Beta2
* Tue May 18 2010 Tom Eastep tom@shorewall.net
- Initial version

12
Shorewall-init/sysconfig Normal file
View File

@@ -0,0 +1,12 @@
# List the Shorewall products that Shorewall-init is to
# initialize (space-separated list).
#
# Sample: PRODUCTS="shorewall shorewall6"
#
PRODUCTS=""
#
# Set this to 1 if you want Shorewall-init to react to
# ifup/ifdown and NetworkManager events
#
IFUPDOWN=0

97
Shorewall-init/uninstall.sh Executable file
View File

@@ -0,0 +1,97 @@
#!/bin/sh
#
# Script to back uninstall Shoreline Firewall
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.sourceforge.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Usage:
#
# You may only use this script to uninstall the version
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=4.4.13-Beta3
usage() # $1 = exit status
{
ME=$(basename $0)
echo "usage: $ME"
exit $1
}
qt()
{
"$@" >/dev/null 2>&1
}
remove_file() # $1 = file to restore
{
if [ -f $1 -o -L $1 ] ; then
rm -f $1
echo "$1 Removed"
fi
}
if [ -f /usr/share/shorewall-init/version ]; then
INSTALLED_VERSION="$(cat /usr/share/shorewall-init/version)"
if [ "$INSTALLED_VERSION" != "$VERSION" ]; then
echo "WARNING: Shorewall Init Version $INSTALLED_VERSION is installed"
echo " and this is the $VERSION uninstaller."
VERSION="$INSTALLED_VERSION"
fi
else
echo "WARNING: Shorewall Init Version $VERSION is not installed"
VERSION=""
fi
echo "Uninstalling Shorewall Init $VERSION"
INITSCRIPT=/etc/init.d/shorewall-init
if [ -n "$INITSCRIPT" ]; then
if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then
insserv -r $INITSCRIPT
elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ]; then
chkconfig --del $(basename $INITSCRIPT)
else
rm -f /etc/rc*.d/*$(basename $INITSCRIPT)
fi
remove_file $INITSCRIPT
fi
[ "$(readlink -m -q /sbin/ifup-local)" = /usr/share/shorewall-init ] && remove_file /sbin/ifup-local
[ "$(readlink -m -q /sbin/ifdown-local)" = /usr/share/shorewall-init ] && remove_file /sbin/ifdown-local
remove_file /etc/default/shorewall-init
remove_file /etc/sysconfig/shorewall-init
remove_file /etc/NetworkManager/dispatcher.d/01-shorewall
remove_file /etc/network/if-up.d/shorewall
remove_file /etc/network/if-down.d/shorewall
remove_file /etc/sysconfig/network/if-up.d/shorewall
remove_file /etc/sysconfig/network/if-down.d/shorewall
rm -rf /usr/share/shorewall-init
echo "Shorewall Init Uninstalled"

View File

@@ -1 +1 @@
This is the Shorewall-lite development 4.3 branch of SVN.
This is the Shorewall-lite stable 4.4 branch of Git.

View File

@@ -21,4 +21,16 @@ startup=0
OPTIONS=""
#
# Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf
#
INITLOG=/dev/null
#
# Set this to 1 to cause '/etc/init.d/shorewall-lite stop' to place the firewall in
# a safe state rather than to open it
#
SAFESTOP=0
# EOF

View File

@@ -1,104 +0,0 @@
#!/bin/sh
#
# Script to back out the installation of Shorewall Lite and to restore the previous version of
# the program
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2006,2007 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.net
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of Version 2 of the GNU General Public License
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Usage:
#
# You may only use this script to back out the installation of the version
# shown below. Simply run this script to revert to your prior version of
# Shoreline Firewall.
VERSION=4.4.0.1
usage() # $1 = exit status
{
echo "usage: $(basename $0)"
exit $1
}
restore_directory() # $1 = directory to restore
{
if [ -d ${1}-${VERSION}.bkout ]; then
if mv -f $1 ${1}-${VERSION} && mv ${1}-${VERSION}.bkout $1; then
echo
echo "$1 restored"
rm -rf ${1}-${VERSION}
else
echo "ERROR: Could not restore $1"
exit 1
fi
fi
}
restore_file() # $1 = file to restore, $2 = (Optional) Directory to restore from
{
if [ -n "$2" ]; then
local file
file=$(basename $1)
if [ -f $2/$file ]; then
if mv -f $2/$file $1 ; then
echo
echo "$1 restored"
return
fi
echo "ERROR: Could not restore $1"
exit 1
fi
fi
if [ -f ${1}-${VERSION}.bkout -o -L ${1}-${VERSION}.bkout ]; then
if (mv -f ${1}-${VERSION}.bkout $1); then
echo
echo "$1 restored"
else
echo "ERROR: Could not restore $1"
exit 1
fi
fi
}
if [ ! -f /usr/share/shorewall-lite-${VERSION}.bkout/version ]; then
echo "Shorewall Version $VERSION is not installed"
exit 1
fi
echo "Backing Out Installation of Shorewall $VERSION"
if [ -L /usr/share/shorewall-lite/init ]; then
FIREWALL=$(ls -l /usr/share/shorewall-lite/init | sed 's/^.*> //')
restore_file $FIREWALL /usr/share/shorewall-lite-${VERSION}.bkout
else
restore_file /etc/init.d/shorewall /usr/share/shorewall-lite-${VERSION}.bkout
fi
restore_file /sbin/shorewall /var/lib/shorewall-lite-${VERSION}.bkout
restore_directory /etc/shorewall-lite
restore_directory /usr/share/shorewall-lite
restore_directory /var/lib/shorewall-lite
echo "Shorewall Lite Restored to Version $(cat /usr/share/shorewall-lite/version)"

View File

@@ -2,8 +2,8 @@
### BEGIN INIT INFO
# Provides: shorewall-lite
# Required-Start: $network
# Required-Stop: $network
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Configure the firewall at boot time
@@ -15,9 +15,7 @@
SRWL=/sbin/shorewall-lite
SRWL_OPTS="-tvv"
# Note, set INITLOG to /dev/null if you do not want to
# keep logs of the firewall (not recommended)
INITLOG=/var/log/shorewall-lite-init.log
test -n ${INITLOG:=/var/log/shorewall-lite-init.log}
[ "$INITLOG" eq "/dev/null" && SHOREWALL_INIT_SCRIPT=1 || SHOREWALL_INIT_SCRIPT=0
@@ -25,7 +23,7 @@ export SHOREWALL_INIT_SCRIPT
test -x $SRWL || exit 0
test -x $WAIT_FOR_IFUP || exit 0
test -n $INITLOG || {
test -n "$INITLOG" || {
echo "INITLOG cannot be empty, please configure $0" ;
exit 1;
}
@@ -44,6 +42,7 @@ echo_notdone () {
echo "not done (check $INITLOG)."
fi
exit 1
}
not_configured () {
@@ -89,7 +88,11 @@ shorewall_start () {
# stop the firewall
shorewall_stop () {
echo -n "Stopping \"Shorewall firewall\": "
if [ "$SAFESTOP" = 1 ]; then
$SRWL $SRWL_OPTS stop >> $INITLOG 2>&1 && echo "done." || echo_notdone
else
$SRWL $SRWL_OPTS clear >> $INITLOG 2>&1 && echo "done." || echo_notdone
fi
return 0
}

View File

@@ -4,7 +4,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2000,2001,2002,2003,2004,2005,2006,2007 - Tom Eastep (teastep@shorewall.net)
# (c) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.net
#
@@ -22,7 +22,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
VERSION=4.4.0.1
VERSION=4.4.13-Beta3
usage() # $1 = exit status
{
@@ -82,15 +82,16 @@ delete_file() # $1 = file to delete
install_file() # $1 = source $2 = target $3 = mode
{
run_install $OWNERSHIP -m $3 $1 ${2}
run_install $T $OWNERSHIP -m $3 $1 ${2}
}
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
#
# Parse the run line
#
# DEST is the SysVInit script directory
# INIT is the name of the script in the $DEST directory
# RUNLEVELS is the chkconfig parmeters for firewall
# ARGS is "yes" if we've already parsed an argument
#
ARGS=""
@@ -103,10 +104,6 @@ if [ -z "$INIT" ] ; then
INIT="shorewall-lite"
fi
if [ -z "$RUNLEVELS" ] ; then
RUNLEVELS=""
fi
while [ $# -gt 0 ] ; do
case "$1" in
-h|help|?)
@@ -131,10 +128,12 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
#
DEBIAN=
CYGWIN=
INSTALLD='-D'
T='-T'
case $(uname) in
CYGWIN*)
if [ -z "$PREFIX" ]; then
if [ -z "$DESTDIR" ]; then
DEST=
INIT=
fi
@@ -142,6 +141,10 @@ case $(uname) in
OWNER=$(id -un)
GROUP=$(id -gn)
;;
Darwin)
INSTALLD=
T=
;;
*)
[ -z "$OWNER" ] && OWNER=root
[ -z "$GROUP" ] && GROUP=root
@@ -150,14 +153,14 @@ esac
OWNERSHIP="-o $OWNER -g $GROUP"
if [ -n "$PREFIX" ]; then
if [ -n "$DESTDIR" ]; then
if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root."
OWNERSHIP=""
fi
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
DEBIAN=yes
elif [ -f /etc/slackware-version ] ; then
@@ -179,151 +182,186 @@ echo "Installing Shorewall Lite Version $VERSION"
#
# Check for /etc/shorewall-lite
#
if [ -z "$PREFIX" -a -d /etc/shorewall-lite ]; then
first_install=""
if [ -z "$DESTDIR" -a -d /etc/shorewall-lite ]; then
[ -f /etc/shorewall-lite/shorewall.conf ] && \
mv -f /etc/shorewall-lite/shorewall.conf /etc/shorewall-lite/shorewall-lite.conf
else
first_install="Yes"
rm -rf ${PREFIX}/etc/shorewall-lite
rm -rf ${PREFIX}/usr/share/shorewall-lite
rm -rf ${PREFIX}/var/lib/shorewall-lite
rm -rf ${DESTDIR}/etc/shorewall-lite
rm -rf ${DESTDIR}/usr/share/shorewall-lite
rm -rf ${DESTDIR}/var/lib/shorewall-lite
fi
delete_file ${PREFIX}/usr/share/shorewall-lite/xmodules
#
# Check for /sbin/shorewall-lite
#
if [ -f ${DESTDIR}/sbin/shorewall-lite ]; then
first_install=""
else
first_install="Yes"
fi
install_file shorewall-lite ${PREFIX}/sbin/shorewall-lite 0544 ${PREFIX}/var/lib/shorewall-lite-${VERSION}.bkout
delete_file ${DESTDIR}/usr/share/shorewall-lite/xmodules
echo "Shorewall Lite control program installed in ${PREFIX}/sbin/shorewall-lite"
install_file shorewall-lite ${DESTDIR}/sbin/shorewall-lite 0544
echo "Shorewall Lite control program installed in ${DESTDIR}/sbin/shorewall-lite"
#
# Install the Firewall Script
#
if [ -n "$DEBIAN" ]; then
install_file init.debian.sh /etc/init.d/shorewall-lite 0544 ${PREFIX}/usr/share/shorewall-lite-${VERSION}.bkout
install_file init.debian.sh /etc/init.d/shorewall-lite 0544
elif [ -n "$ARCHLINUX" ]; then
install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-lite-${VERSION}.bkout
install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
else
install_file init.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-lite-${VERSION}.bkout
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
fi
echo "Shorewall Lite script installed in ${PREFIX}${DEST}/$INIT"
echo "Shorewall Lite script installed in ${DESTDIR}${DEST}/$INIT"
#
# Create /etc/shorewall-lite, /usr/share/shorewall-lite and /var/lib/shorewall-lite if needed
#
mkdir -p ${PREFIX}/etc/shorewall-lite
mkdir -p ${PREFIX}/usr/share/shorewall-lite
mkdir -p ${PREFIX}/var/lib/shorewall-lite
mkdir -p ${DESTDIR}/etc/shorewall-lite
mkdir -p ${DESTDIR}/usr/share/shorewall-lite
mkdir -p ${DESTDIR}/var/lib/shorewall-lite
chmod 755 ${PREFIX}/etc/shorewall-lite
chmod 755 ${PREFIX}/usr/share/shorewall-lite
chmod 755 ${DESTDIR}/etc/shorewall-lite
chmod 755 ${DESTDIR}/usr/share/shorewall-lite
if [ -n "$DESTDIR" ]; then
mkdir -p ${DESTDIR}/etc/logrotate.d
chmod 755 ${DESTDIR}/etc/logrotate.d
fi
#
# Install the config file
#
if [ ! -f ${PREFIX}/etc/shorewall-lite/shorewall-lite.conf ]; then
run_install $OWNERSHIP -m 0744 shorewall-lite.conf ${PREFIX}/etc/shorewall-lite/shorewall-lite.conf
echo "Config file installed as ${PREFIX}/etc/shorewall-lite/shorewall-lite.conf"
if [ ! -f ${DESTDIR}/etc/shorewall-lite/shorewall-lite.conf ]; then
run_install $OWNERSHIP -m 0744 shorewall-lite.conf ${DESTDIR}/etc/shorewall-lite
echo "Config file installed as ${DESTDIR}/etc/shorewall-lite/shorewall-lite.conf"
fi
if [ -n "$ARCHLINUX" ] ; then
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${PREFIX}/etc/shorewall-lite/shorewall.conf
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/shorewall-lite/shorewall.conf
fi
#
# Install the Makefile
#
run_install $OWNERSHIP -m 0600 Makefile ${PREFIX}/etc/shorewall-lite/Makefile
echo "Makefile installed as ${PREFIX}/etc/shorewall-lite/Makefile"
run_install $OWNERSHIP -m 0600 Makefile ${DESTDIR}/etc/shorewall-lite
echo "Makefile installed as ${DESTDIR}/etc/shorewall-lite/Makefile"
#
# Install the default config path file
#
install_file configpath ${PREFIX}/usr/share/shorewall-lite/configpath 0644
echo "Default config path file installed as ${PREFIX}/usr/share/shorewall-lite/configpath"
install_file configpath ${DESTDIR}/usr/share/shorewall-lite/configpath 0644
echo "Default config path file installed as ${DESTDIR}/usr/share/shorewall-lite/configpath"
#
# Install the libraries
#
for f in lib.* ; do
if [ -f $f ]; then
install_file $f ${PREFIX}/usr/share/shorewall-lite/$f 0644
echo "Library ${f#*.} file installed as ${PREFIX}/usr/share/shorewall-lite/$f"
install_file $f ${DESTDIR}/usr/share/shorewall-lite/$f 0644
echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall-lite/$f"
fi
done
ln -sf lib.base ${PREFIX}/usr/share/shorewall-lite/functions
ln -sf lib.base ${DESTDIR}/usr/share/shorewall-lite/functions
echo "Common functions linked through ${PREFIX}/usr/share/shorewall-lite/functions"
echo "Common functions linked through ${DESTDIR}/usr/share/shorewall-lite/functions"
#
# Install Shorecap
#
install_file shorecap ${PREFIX}/usr/share/shorewall-lite/shorecap 0755
install_file shorecap ${DESTDIR}/usr/share/shorewall-lite/shorecap 0755
echo
echo "Capability file builder installed in ${PREFIX}/usr/share/shorewall-lite/shorecap"
echo "Capability file builder installed in ${DESTDIR}/usr/share/shorewall-lite/shorecap"
#
# Install wait4ifup
#
install_file wait4ifup ${PREFIX}/usr/share/shorewall-lite/wait4ifup 0755
if [ -f wait4ifup ]; then
install_file wait4ifup ${DESTDIR}/usr/share/shorewall-lite/wait4ifup 0755
echo
echo "wait4ifup installed in ${PREFIX}/usr/share/shorewall-lite/wait4ifup"
echo
echo "wait4ifup installed in ${DESTDIR}/usr/share/shorewall-lite/wait4ifup"
fi
#
# Install the Modules file
#
run_install $OWNERSHIP -m 0600 modules ${PREFIX}/usr/share/shorewall-lite/modules
echo "Modules file installed as ${PREFIX}/usr/share/shorewall-lite/modules"
if [ -f modules ]; then
run_install $OWNERSHIP -m 0600 modules ${DESTDIR}/usr/share/shorewall-lite
echo "Modules file installed as ${DESTDIR}/usr/share/shorewall-lite/modules"
fi
#
# Install the Man Pages
#
cd manpages
if [ -d manpages ]; then
cd manpages
for f in *.5; do
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}/usr/share/man/man5/ ${DESTDIR}/usr/share/man/man8/
for f in *.5; do
gzip -c $f > $f.gz
run_install -D -m 644 $f.gz ${PREFIX}/usr/share/man/man5/$f.gz
echo "Man page $f.gz installed to ${PREFIX}/usr/share/man/man5/$f.gz"
done
run_install $T $INSTALLD $OWNERSHIP -m 0644 $f.gz ${DESTDIR}/usr/share/man/man5/$f.gz
echo "Man page $f.gz installed to ${DESTDIR}/usr/share/man/man5/$f.gz"
done
for f in *.8; do
for f in *.8; do
gzip -c $f > $f.gz
run_install -D -m 644 $f.gz ${PREFIX}/usr/share/man/man8/$f.gz
echo "Man page $f.gz installed to ${PREFIX}/usr/share/man/man8/$f.gz"
done
run_install $T $INSTALLD $OWNERSHIP -m 0644 $f.gz ${DESTDIR}/usr/share/man/man8/$f.gz
echo "Man page $f.gz installed to ${DESTDIR}/usr/share/man/man8/$f.gz"
done
cd ..
cd ..
echo "Man Pages Installed"
fi
if [ -d ${DESTDIR}/etc/logrotate.d ]; then
run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}/etc/logrotate.d/shorewall-lite
echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/shorewall-lite"
fi
echo "Man Pages Installed"
#
# Create the version file
#
echo "$VERSION" > ${PREFIX}/usr/share/shorewall-lite/version
chmod 644 ${PREFIX}/usr/share/shorewall-lite/version
echo "$VERSION" > ${DESTDIR}/usr/share/shorewall-lite/version
chmod 644 ${DESTDIR}/usr/share/shorewall-lite/version
#
# Remove and create the symbolic link to the init script
#
if [ -z "$PREFIX" ]; then
if [ -z "$DESTDIR" ]; then
rm -f /usr/share/shorewall-lite/init
ln -s ${DEST}/${INIT} /usr/share/shorewall-lite/init
fi
if [ -z "$PREFIX" -a -n "$first_install" ]; then
if [ -z "$DESTDIR" ]; then
touch /var/log/shorewall-lite-init.log
if [ -n "$first_install" ]; then
if [ -n "$DEBIAN" ]; then
run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall-lite
if [ -x /sbin/insserv ]; then
insserv /etc/init.d/shorewall-lite
else
ln -s ../init.d/shorewall-lite /etc/rcS.d/S40shorewall-lite
fi
echo "Shorewall Lite will start automatically at boot"
touch /var/log/shorewall-init.log
else
if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then
if insserv /etc/init.d/shorewall-lite ; then
@@ -348,6 +386,7 @@ if [ -z "$PREFIX" -a -n "$first_install" ]; then
cant_autostart
fi
fi
fi
fi
#

5
Shorewall-lite/logrotate Normal file
View File

@@ -0,0 +1,5 @@
/var/log/shorewall-lite-init.log {
missingok
notifempty
create 0600 root root
}

View File

@@ -4,7 +4,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2006,2007 - Tom Eastep (teastep@shorewall.net)
# (c) 2006,2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# This file should be placed in /sbin/shorewall.
#
@@ -48,18 +48,19 @@
SHAREDIR=/usr/share/shorewall-lite
VARDIR=/var/lib/shorewall-lite
CONFDIR=/etc/shorewall-lite
PRODUCT="Shorewall Lite"
g_product="Shorewall Lite"
. /usr/share/shorewall-lite/lib.base
. /usr/share/shorewall-lite/lib.cli
. /usr/share/shorewall-lite/configpath
[ -n "$PATH" ] || PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
VERSION=$(cat /usr/share/shorewall-lite/version)
SHOREWALL_VERSION=$(cat /usr/share/shorewall-lite/version)
[ -n "$IPTABLES" ] || IPTABLES=$(mywhich iptables)
VERBOSE=0
VERBOSITY=0
load_kernel_modules No
determine_capabilities
report_capabilities1

View File

@@ -4,7 +4,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2006 - Tom Eastep (teastep@shorewall.net)
# (c) 2006,2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# This file should be placed in /sbin/shorewall-lite.
#
@@ -95,7 +95,7 @@ get_config() {
if ( ps ax 2> /dev/null | grep -v grep | qt grep 'syslogd.*-C' ) ; then
LOGREAD="logread | tac"
elif [ -f $LOGFILE ]; then
elif [ -r $LOGFILE ]; then
LOGREAD="tac $LOGFILE"
else
echo "LOGFILE ($LOGFILE) does not exist!" >&2
@@ -117,8 +117,6 @@ get_config() {
[ -n "$LOGFORMAT" ] || LOGFORMAT="Shorewall:"
export LOGFORMAT
if [ -n "$IPTABLES" ]; then
if [ ! -x "$IPTABLES" ]; then
echo " ERROR: The program specified in IPTABLES does not exist or is not executable" >&2
@@ -132,8 +130,6 @@ get_config() {
fi
fi
export IPTABLES
if [ -n "$SHOREWALL_SHELL" ]; then
if [ ! -x "$SHOREWALL_SHELL" ]; then
echo " WARNING: The program specified in SHOREWALL_SHELL does not exist or is not executable; falling back to /bin/sh" >&2
@@ -145,15 +141,20 @@ get_config() {
validate_restorefile RESTOREFILE
export RESTOREFILE
[ -n "${VERBOSITY:=2}" ]
[ -n "$USE_VERBOSITY" ] && VERBOSE=$USE_VERBOSITY || VERBOSE=$(($VERBOSE_OFFSET + $VERBOSITY))
[ -n "$g_use_verbosity" ] && VERBOSITY=$g_use_verbosity || VERBOSITY=$(($g_verbose_offset + $VERBOSITY))
export VERBOSE
g_hostname=$(hostname 2> /dev/null)
[ -n "${HOSTNAME:=$(hostname)}" ]
IP=$(mywhich ip 2> /dev/null)
if [ -z "$IP" ] ; then
echo " ERROR: Can't find ip executable" >&2
exit 2
fi
IPSET=ipset
TC=tc
}
@@ -161,13 +162,13 @@ get_config() {
# Verify that we have a compiled firewall script
#
verify_firewall_script() {
if [ ! -f $FIREWALL ]; then
if [ ! -f $g_firewall ]; then
echo " ERROR: Shorewall Lite is not properly installed" >&2
if [ -L $FIREWALL ]; then
echo " $FIREWALL is a symbolic link to a" >&2
if [ -L $g_firewall ]; then
echo " $g_firewall is a symbolic link to a" >&2
echo " non-existant file" >&2
else
echo " The file $FIREWALL does not exist" >&2
echo " The file $g_firewall does not exist" >&2
fi
exit 2
@@ -187,7 +188,7 @@ start_command() {
[ -n "$nolock" ] || mutex_on
if [ -x ${LITEDIR}/firewall ]; then
${LITEDIR}/firewall $debugging start
run_it ${LITEDIR}/firewall $debugging start
rc=$?
else
error_message "${LITEDIR}/firewall is missing or is not executable"
@@ -219,12 +220,12 @@ start_command() {
option=
;;
f*)
FAST=Yes
g_fast=Yes
option=${option#f}
;;
p*)
[ -n "$(which conntrack)" ] || fatal_error "The '-p' option requires the conntrack utility which does not appear to be installed on this system"
PURGE=Yes
g_purge=Yes
option=${option%p}
;;
*)
@@ -248,36 +249,21 @@ start_command() {
;;
esac
export NOROUTES
if [ -n "$FAST" ]; then
if [ -n "$g_fast" ]; then
if qt mywhich make; then
#
# RESTOREFILE is exported by get_config()
#
make -qf ${CONFDIR}/Makefile || FAST=
export RESTOREFILE
make -qf ${CONFDIR}/Makefile || g_fast=
fi
if [ -n "$FAST" ]; then
if [ -n "$g_fast" ]; then
RESTOREPATH=${VARDIR}/$RESTOREFILE
if [ -x $RESTOREPATH ]; then
if [ -x ${RESTOREPATH}-ipsets ]; then
echo Restoring Ipsets...
#
# We must purge iptables to be sure that there are no
# references to ipsets
#
iptables -F
iptables -X
$SHOREWALL_SHELL ${RESTOREPATH}-ipsets
fi
g_restorepath=${VARDIR}/$RESTOREFILE
if [ -x $g_restorepath ]; then
echo Restoring Shorewall Lite...
$SHOREWALL_SHELL $RESTOREPATH restore
run_it $g_restorepath restore
date > ${VARDIR}/restarted
progress_message3 Shorewall Lite restored from $RESTOREPATH
progress_message3 Shorewall Lite restored from $g_restorepath
else
do_it
fi
@@ -313,12 +299,12 @@ restart_command() {
option=
;;
n*)
NOROUTES=Yes
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"
PURGE=Yes
g_purge=Yes
option=${option%p}
;;
*)
@@ -342,12 +328,10 @@ restart_command() {
;;
esac
export NOROUTES
[ -n "$nolock" ] || mutex_on
if [ -x ${LITEDIR}/firewall ]; then
$SHOREWALL_SHELL ${LITEDIR}/firewall $debugging restart
run_it ${LITEDIR}/firewall $debugging restart
rc=$?
else
error_message "${LITEDIR}/firewall is missing or is not executable"
@@ -366,13 +350,14 @@ usage() # $1 = exit status
{
echo "Usage: $(basename $0) [debug|trace] [nolock] [ -q ] [ -v[-1|{0-2}] ] [ -t ] <command>"
echo "where <command> is one of:"
echo " add <interface>[:<host-list>] ... <zone>"
echo " allow <address> ..."
echo " clear"
echo " delete <interface>[:<host-list>] ... <zone>"
echo " drop <address> ..."
echo " dump [ -x ]"
echo " forget [ <file name> ]"
echo " help"
echo " hits [ -t ]"
echo " ipcalc { <address>/<vlsm> | <address> <netmask> }"
echo " ipdecimal { <address> | <integer> }"
echo " iprange <address>-<address>"
@@ -381,7 +366,7 @@ usage() # $1 = exit status
echo " logwatch [<refresh interval>]"
echo " reject <address> ..."
echo " reset [ <chain> ... ]"
echo " restart [ -n ] [ -p ]"
echo " restart [ -n ] [ -p ] [ -f ] [ <directory> ]"
echo " restore [ -n ] [ <file name> ]"
echo " save [ <file name> ]"
echo " show [ -x ] [ -t {filter|mangle|nat} ] [ {chain [<chain> [ <chain> ... ]"
@@ -389,23 +374,71 @@ usage() # $1 = exit status
echo " show classifiers"
echo " show config"
echo " show connections"
echo " show dynamic <zone>"
echo " show filter"
echo " show filters"
echo " show ip"
echo " show [ -m ] log"
echo " show [ -x ] mangle|nat|raw"
echo " show routing"
echo " show tc"
echo " show [ -m ] log [<regex>]"
echo " show [ -x ] mangle|nat|raw|routing"
echo " show policies"
echo " show tc [ device ]"
echo " show vardir"
echo " show zones"
echo " start [ -n ] [ -p ]"
echo " start [ -f ] [ -p ] [ <directory> ]"
echo " stop"
echo " status"
echo " version"
echo " version [ -a ]"
echo
exit $1
}
version_command() {
local finished
finished=0
local all
all=
local product
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=
;;
a*)
all=Yes
option=${option#a}
;;
*)
usage 1
;;
esac
done
shift
;;
*)
finished=1
;;
esac
done
[ $# -gt 0 ] && usage 1
echo $SHOREWALL_VERSION
if [ -n "$all" ]; then
for product in shorewall shorewall6 shorewall6-lite shorewall-init; do
if [ -f /usr/share/$product/version ]; then
echo "$product: $(cat /usr/share/$product/version)"
fi
done
fi
}
#
# Execution begins here
#
@@ -423,14 +456,13 @@ if [ $# -gt 0 ] && [ "$1" = "nolock" ]; then
shift
fi
IPT_OPTIONS="-nv"
FAST=
VERBOSE_OFFSET=0
USE_VERBOSITY=
NOROUTES=
EXPORT=
export TIMESTAMP=
noroutes=
g_ipt_options="-nv"
g_fast=
g_verbose_offset=0
g_use_verbosity=
g_noroutes=
g_timestamp=
g_recovering=
finished=0
@@ -449,48 +481,48 @@ while [ $finished -eq 0 ]; do
while [ -n "$option" ]; do
case $option in
x*)
IPT_OPTIONS="-xnv"
g_ipt_options="-xnv"
option=${option#x}
;;
q*)
VERBOSE_OFFSET=$(($VERBOSE_OFFSET - 1 ))
g_verbose_offset=$(($g_verbose_offset - 1 ))
option=${option#q}
;;
f*)
FAST=Yes
g_fast=Yes
option=${option#f}
;;
v*)
option=${option#v}
case $option in
-1*)
USE_VERBOSITY=-1
g_use_verbosity=-1
option=${option#-1}
;;
0*)
USE_VERBOSITY=0
g_use_verbosity=0
option=${option#0}
;;
1*)
USE_VERBOSITY=1
g_use_verbosity=1
option=${option#1}
;;
2*)
USE_VERBOSITY=2
g_use_verbosity=2
option=${option#2}
;;
*)
VERBOSE_OFFSET=$(($VERBOSE_OFFSET + 1 ))
USE_VERBOSITY=
g_verbose_offset=$(($g_verbose_offset + 1 ))
g_use_verbosity=
;;
esac
;;
n*)
NOROUTES=Yes
g_noroutes=Yes
option=${option#n}
;;
t*)
TIMESTAMP=Yes
g_timestamp=Yes
option=${option#t}
;;
-)
@@ -515,12 +547,11 @@ if [ $# -eq 0 ]; then
fi
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
export PATH
MUTEX_TIMEOUT=
SHAREDIR=/usr/share/shorewall-lite
CONFDIR=/etc/shorewall-lite
export PRODUCT="Shorewall Lite"
g_product="Shorewall Lite"
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir ]
@@ -528,17 +559,10 @@ export PRODUCT="Shorewall Lite"
[ -d $VARDIR ] || mkdir -p $VARDIR || fatal_error "Unable to create $VARDIR"
LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli"
VERSION_FILE=$SHAREDIR/version
HELP=$SHAREDIR/help
version_file=$SHAREDIR/version
for library in $LIBRARIES; do
if [ -f $library ]; then
. $library
else
echo "Installation error: $library does not exist!" >&2
exit 2
fi
for library in base cli; do
. ${SHAREDIR}/lib.$library
done
ensure_config_path
@@ -558,7 +582,6 @@ else
fi
ensure_config_path
export CONFIG_PATH
LITEDIR=${VARDIR}
@@ -566,17 +589,17 @@ LITEDIR=${VARDIR}
get_config
FIREWALL=$LITEDIR/firewall
g_firewall=$LITEDIR/firewall
if [ -f $VERSION_FILE ]; then
version=$(cat $VERSION_FILE)
if [ -f $version_file ]; then
SHOREWALL_VERSION=$(cat $version_file)
else
echo " ERROR: Shorewall Lite is not properly installed" >&2
echo " The file $VERSION_FILE does not exist" >&2
echo " The file $version_file does not exist" >&2
exit 1
fi
banner="Shorewall Lite $version Status at $HOSTNAME -"
banner="Shorewall Lite $SHOREWALL_VERSION Status at $g_hostname -"
case $(echo -e) in
-e*)
@@ -605,15 +628,12 @@ case "$COMMAND" in
shift
start_command $@
;;
stop|clear)
stop|reset|clear)
[ $# -ne 1 ] && usage 1
verify_firewall_script
export NOROUTES
exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $COMMAND
;;
reset)
verify_firewall_script
exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $@
[ -n "$nolock" ] || mutex_on
run_it $g_firewall $debugging $COMMAND
[ -n "$nolock" ] || mutex_off
;;
restart)
shift
@@ -626,7 +646,7 @@ case "$COMMAND" in
status)
[ $# -eq 1 ] || usage 1
[ "$(id -u)" != 0 ] && fatal_error "ERROR: The status command may only be run by root"
echo "Shorewall Lite $version Status at $HOSTNAME - $(date)"
echo "Shorewall Lite $SHOREWALL_VERSION Status at $g_hostname - $(date)"
echo
if shorewall_is_started ; then
echo "Shorewall Lite is running"
@@ -639,7 +659,7 @@ case "$COMMAND" in
if [ -f ${VARDIR}/state ]; then
state="$(cat ${VARDIR}/state)"
case $state in
Stopped*|Clear*)
Stopped*|Closed*|Clear*)
status=3
;;
esac
@@ -660,7 +680,8 @@ case "$COMMAND" in
hits_command $@
;;
version)
echo $version Lite
shift
version_command $@
;;
logwatch)
logwatch_command $@
@@ -729,7 +750,7 @@ case "$COMMAND" in
;;
esac
RESTOREPATH=${VARDIR}/$RESTOREFILE
g_restorepath=${VARDIR}/$RESTOREFILE
[ "$nolock" ] || mutex_on
@@ -751,20 +772,15 @@ case "$COMMAND" in
esac
RESTOREPATH=${VARDIR}/$RESTOREFILE
g_restorepath=${VARDIR}/$RESTOREFILE
if [ -x $RESTOREPATH ]; then
if [ -x ${RESTOREPATH}-ipsets ]; then
rm -f ${RESTOREPATH}-ipsets
echo " ${RESTOREPATH}-ipsets removed"
fi
rm -f $RESTOREPATH
rm -f ${RESTOREPATH}-iptables
echo " $RESTOREPATH removed"
elif [ -f $RESTOREPATH ]; then
echo " $RESTOREPATH exists and is not a saved Shorewall configuration"
if [ -x $g_restorepath ]; then
rm -f $g_restorepath
rm -f ${g_restorepath}-iptables
rm -f ${g_restorepath}-ipsets
echo " $g_restorepath removed"
elif [ -f $g_restorepath ]; then
echo " $g_restorepath exists and is not a saved Shorewall configuration"
fi
rm -f ${VARDIR}/save
;;

View File

@@ -4,12 +4,11 @@
# compile /var/lib/shorewall-lite/firewall. Those values may be found in
# /var/lib/shorewall-lite/firewall.conf.
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# This file should be placed in /etc/shorewall-lite
#
# (c) 2006,2007 - Tom Eastep (teastep@shorewall.net)
# For information about the settings in this file, type
# "man shorewall-lite.conf"
#
# Manpage also online at
# http://www.shorewall.net/manpages/shorewall-lite.conf.html
###############################################################################
# N 0 T E
###############################################################################

View File

@@ -1,6 +1,6 @@
%define name shorewall-lite
%define version 4.4.0
%define release 1
%define version 4.4.13
%define release 0Beta3
Summary: Shoreline Firewall Lite is an iptables-based firewall for Linux systems.
Name: %{name}
@@ -14,6 +14,7 @@ URL: http://www.shorewall.net/
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Requires: iptables iproute
Provides: shoreline_firewall = %{version}-%{release}
%description
@@ -31,7 +32,7 @@ administrators to centralize the configuration of Shorewall-based firewalls.
%build
%install
export PREFIX=$RPM_BUILD_ROOT ; \
export DESTDIR=$RPM_BUILD_ROOT ; \
export OWNER=`id -n -u` ; \
export GROUP=`id -n -g` ;\
./install.sh
@@ -79,6 +80,8 @@ fi
%attr(0755,root,root) %dir /usr/share/shorewall-lite
%attr(0700,root,root) %dir /var/lib/shorewall-lite
%attr(0644,root,root) /etc/logrotate.d/shorewall-lite
%attr(0755,root,root) /sbin/shorewall-lite
%attr(0644,root,root) /usr/share/shorewall-lite/version
@@ -86,6 +89,7 @@ fi
%attr(- ,root,root) /usr/share/shorewall-lite/functions
%attr(0644,root,root) /usr/share/shorewall-lite/lib.base
%attr(0644,root,root) /usr/share/shorewall-lite/lib.cli
%attr(0644,root,root) /usr/share/shorewall-lite/lib.common
%attr(0644,root,root) /usr/share/shorewall-lite/modules
%attr(0544,root,root) /usr/share/shorewall-lite/shorecap
%attr(0755,root,root) /usr/share/shorewall-lite/wait4ifup
@@ -98,8 +102,110 @@ fi
%doc COPYING changelog.txt releasenotes.txt
%changelog
* Thu Aug 13 2009 Tom Eastep tom@shorewall.net
- Updated to 4.4.0-1
* Mon Aug 30 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.13-0Beta3
* Wed Aug 25 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.13-0Beta2
* Wed Aug 18 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.13-0Beta1
* Sun Aug 15 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0base
* Fri Aug 06 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0RC1
* Sun Aug 01 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0Beta4
* Sat Jul 31 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0Beta3
* Sun Jul 25 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0Beta2
* Wed Jul 21 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.12-0Beta1
* Fri Jul 09 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.11-0base
* Mon Jul 05 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.11-0RC1
* Sat Jul 03 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.11-0Beta3
* Thu Jul 01 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.11-0Beta2
* Sun Jun 06 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.11-0Beta1
* Sat Jun 05 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0base
* Fri Jun 04 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0RC2
* Thu May 27 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0RC1
* Wed May 26 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0Beta4
* Tue May 25 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0Beta3
* Thu May 20 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0Beta2
* Thu May 20 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0Beta2
* Thu May 13 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.10-0Beta1
* Mon May 03 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.9-0base
* Sun May 02 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.9-0RC2
* Sun Apr 25 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.9-0RC1
* Sat Apr 24 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.9-0Beta5
* Fri Apr 16 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.9-0Beta4
* Fri Apr 09 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.9-0Beta3
* Thu Apr 08 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.9-0Beta2
* Sat Mar 20 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.9-0Beta1
* Fri Mar 19 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.8-0base
* Tue Mar 16 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.8-0RC2
* Mon Mar 08 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.8-0RC1
* Sun Feb 28 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.8-0Beta2
* Thu Feb 11 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.8-0Beta1
* Fri Feb 05 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.7-0base
* Tue Feb 02 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.7-0RC2
* Wed Jan 27 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.7-0RC1
* Mon Jan 25 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.7-0Beta4
* Fri Jan 22 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.7-0Beta3
* Fri Jan 22 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.7-0Beta2
* Sun Jan 17 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.7-0Beta1
* Wed Jan 13 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.6-0base
* Tue Jan 12 2010 Tom Eastep tom@shorewall.net
- Updated to 4.4.6-0Beta1
* Thu Dec 24 2009 Tom Eastep tom@shorewall.net
- Updated to 4.4.5-0base
* Sat Nov 21 2009 Tom Eastep tom@shorewall.net
- Updated to 4.4.4-0base
* Fri Nov 13 2009 Tom Eastep tom@shorewall.net
- Updated to 4.4.4-0Beta2
* Wed Nov 11 2009 Tom Eastep tom@shorewall.net
- Updated to 4.4.4-0Beta1
* Tue Nov 03 2009 Tom Eastep tom@shorewall.net
- Updated to 4.4.3-0base
* Sun Sep 06 2009 Tom Eastep tom@shorewall.net
- Updated to 4.4.2-0base
* Fri Sep 04 2009 Tom Eastep tom@shorewall.net
- Updated to 4.4.2-0base
* Fri Aug 14 2009 Tom Eastep tom@shorewall.net
- Updated to 4.4.1-0base
* Mon Aug 03 2009 Tom Eastep tom@shorewall.net
- Updated to 4.4.0-0base
* Tue Jul 28 2009 Tom Eastep tom@shorewall.net

View File

@@ -4,7 +4,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2000,2001,2002,2003,2004,2005,2006,2007 - Tom Eastep (teastep@shorewall.net)
# (c) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://shorewall.sourceforge.net
#
@@ -26,7 +26,7 @@
# You may only use this script to uninstall the version
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=4.4.0.1
VERSION=4.4.13-Beta3
usage() # $1 = exit status
{
@@ -79,7 +79,7 @@ if qt iptables -L shorewall -n && [ ! -f /sbin/shorewall ]; then
fi
if [ -L /usr/share/shorewall-lite/init ]; then
FIREWALL=$(ls -l /usr/share/shorewall-lite/init | sed 's/^.*> //')
FIREWALL=$(readlink -m -q /usr/share/shorewall-lite/init)
else
FIREWALL=/etc/init.d/shorewall-lite
fi
@@ -106,6 +106,7 @@ rm -rf /var/lib/shorewall-lite
rm -rf /var/lib/shorewall-lite-*.bkout
rm -rf /usr/share/shorewall-lite
rm -rf /usr/share/shorewall-lite-*.bkout
rm -f /etc/logrotate.d/shorewall-lite
echo "Shorewall Uninstalled"

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Shorewall WAN Interface monitor - V4.2
# Shorewall WAN Interface monitor - V4.4
#
# Inspired by Angsuman Chakraborty's gwping script.
#

View File

@@ -1,5 +1,5 @@
#!/bin/sh
# Shorewall WAN Interface monitor - V4.2
# Shorewall WAN Interface monitor - V4.4
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#

View File

@@ -3,7 +3,8 @@
#
# /usr/share/shorewall/macro.Citrix
#
# This macro handles Citrix/ICA traffic (ICA, ICA Browser, CGP a.k.a. ICA Session Reliability)
# This macro handles Citrix/ICA traffic (ICA, ICA Browser, CGP a.k.a.
# ICA Session Reliability)
#
####################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/

View File

@@ -0,0 +1,12 @@
#
# Shorewall version 4 - DHCPfwd Macro
#
# /usr/share/shorewall/macro.DHCPfwd
#
# This macro (bidirectional) handles forwarded DHCP traffic
#
###############################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
# PORT(S) PORT(S) LIMIT GROUP
PARAM - - udp 67:68 67:68 # DHCP
PARAM DEST SOURCE udp 67:68 67:68 # DHCP

View File

@@ -0,0 +1,11 @@
#
# Shorewall version 4 - HKP Macro
#
# /usr/share/shorewall/macro.HKP
#
# This macro handles OpenPGP HTTP keyserver protocol traffic.
#
###############################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
# PORT(S) PORT(S) LIMIT GROUP
PARAM - - tcp 11371

View File

@@ -5,7 +5,7 @@
#
# This macro handles OSPF multicast traffic
#
#######################################################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGINAL RATE USER/ ORIGINAL
# PORT(S) PORT(S) DEST LIMIT GROUP DEST
PARAM - - 89 - # OSPF
###############################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
# PORT(S) PORT(S) LIMIT GROUP
PARAM - - 89 # OSPF

View File

@@ -1,12 +1,15 @@
#
# Shorewall version 4 - Multicast DNS Macro
#
# /usr/share/shorewall/macro.DNS
# /usr/share/shorewall/macro.mDNS
#
# This macro handles multicast DNS traffic.
#
###############################################################################
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
# PORT(S) PORT(S) LIMIT GROUP
PARAM - - udp 5353
PARAM DEST SOURCE udp 5353
PARAM - 224.0.0.251 udp 5353
PARAM - - udp 32768: 5353
PARAM - 224.0.0.251 2
PARAM DEST SOURCE:224.0.0.251 udp 5353
PARAM DEST SOURCE:224.0.0.251 2

View File

@@ -269,7 +269,7 @@
# an action. See 'man shorewall-rules'.
#
# RATE LIMIT You may rate-limit the rule by placing a value in
# this colume:
# this column:
#
# <rate>/<interval>[:<burst>]
#
@@ -304,6 +304,100 @@
# #removed from Netfilter in kernel
# #version 2.6.14).
#
# MARK Specifies a MARK value to match. Must be empty or
# '-' if the macro is to be used within an action.
#
# [!]value[/mask][:C]
#
# Defines a test on the existing packet or connection
# mark. The rule will match only if the test returns
# true.
#
# If you don't want to define a test but need to
# specify anything in the following columns,
# place a "-" in this field.
#
# !
#
# Inverts the test (not equal)
#
# value
#
# Value of the packet or connection mark.
#
# mask
#
# A mask to be applied to the mark before
# testing.
#
# :C
#
# Designates a connection mark. If omitted, the
# packet mark's value is tested.
#
# CONNLIMIT Must be empty or '-' if the macro is to be used within
# an action.
#
# [!]limit[:mask]
#
# May be used to limit the number of simultaneous
# connections from each individual host to limit
# connections. Requires connlimit match in your kernel
# and iptables. While the limit is only checked on rules
# specifying CONNLIMIT, the number of current connections
# is calculated over all current connections from the
# SOURCE host. By default, the limit is applied to each
# host but can be made to apply to networks of hosts by
# specifying a mask. The mask specifies the width of a
# VLSM mask to be applied to the source address; the
# number of current connections is then taken over all
# hosts in the subnet source-address/mask. When ! is
# specified, the rule matches when the number of
# connection exceeds the limit.
#
# TIME Must be empty or '-' if the macro is to be used within
# an action.
#
#
# <timeelement>[&...]
#
# timeelement may be:
#
# timestart=hh:mm[:ss]
#
# Defines the starting time of day.
#
# timestop=hh:mm[:ss]
#
# Defines the ending time of day.
#
# utc
#
# Times are expressed in Greenwich Mean
# Time.
#
# localtz
#
# Times are expressed in Local Civil Time
# (default).
#
# weekdays=ddd[,ddd]...
#
# where ddd is one of Mon, Tue, Wed, Thu,
# Fri, Sat or Sun
#
# monthdays=dd[,dd],...
#
# where dd is an ordinal day of the month#
#
# datestart=yyyy[-mm[-dd[Thh[:mm[:ss]]]]]
#
# Defines the starting date and time.
#
# datestop=yyyy[-mm[-dd[Thh[:mm[:ss]]]]]
#
# Defines the ending date and time.
#
# A few examples should help show how Macros work.
#
# /etc/shorewall/macro.FwdFTP:

View File

@@ -14,4 +14,8 @@ $(VARDIR)/${RESTOREFILE}: $(CONFDIR)/*
/sbin/shorewall -q restart 2>&1 | tail >&2; \
fi
clean:
@rm -f $(CONFDIR)/*~ $(CONFDIR)/.*~
.PHONY: clean
# EOF

View File

@@ -3,7 +3,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
@@ -35,27 +35,16 @@ use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw( setup_accounting );
our @EXPORT_OK = qw( );
our $VERSION = '4.3_7';
our $VERSION = '4.4.13';
#
# Initialize globals -- we take this novel approach to globals initialization to allow
# the compiler to run multiple times in the same process. The
# initialize() function does globals initialization for this
# module and is called from an INIT block below. The function is
# also called by Shorewall::Compiler::compiler at the beginning of
# the second and subsequent calls to that function or when compiling
# for IPv6.
# Called by the compiler to [re-]initialize this module's state
#
sub initialize() {
our $jumpchainref;
$jumpchainref = undef;
}
INIT {
initialize;
}
#
# Accounting
#
@@ -63,7 +52,7 @@ sub process_accounting_rule( ) {
our $jumpchainref;
my ($action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark ) = split_line1 1, 9, 'Accounting File';
my ($action, $chain, $source, $dest, $proto, $ports, $sports, $user, $mark, $ipsec ) = split_line1 1, 10, 'Accounting File';
if ( $action eq 'COMMENT' ) {
process_comment;
@@ -72,6 +61,16 @@ sub process_accounting_rule( ) {
our $disposition = '';
sub reserved_chain_name($) {
$_[0] =~ /^acc(?:ount(?:ing|out)|ipsecin|ipsecout)$/;
}
sub ipsec_chain_name($) {
if ( $_[0] =~ /^accipsec(in|out)$/ ) {
$1;
}
}
sub check_chain( $ ) {
my $chainref = shift;
fatal_error "A non-accounting chain ($chainref->{name}) may not appear in the accounting file" if $chainref->{policy};
@@ -83,10 +82,11 @@ sub process_accounting_rule( ) {
sub jump_to_chain( $ ) {
my $jumpchain = $_[0];
$jumpchainref = ensure_accounting_chain( $jumpchain );
fatal_error "Jumps to the $jumpchain chain are not allowed" if reserved_chain_name( $jumpchain );
$jumpchainref = ensure_accounting_chain( $jumpchain, 0 );
check_chain( $jumpchainref );
$disposition = $jumpchain;
"-j $jumpchain";
$jumpchain;
}
my $target = '';
@@ -95,18 +95,21 @@ sub process_accounting_rule( ) {
$ports = '' if $ports eq 'any' || $ports eq 'all';
$sports = '' if $sports eq 'any' || $sports eq 'all';
my $rule = do_proto( $proto, $ports, $sports ) . do_user ( $user ) . do_test ( $mark, 0xFF );
my $rule = do_proto( $proto, $ports, $sports ) . do_user ( $user ) . do_test ( $mark, $globals{TC_MASK} );
my $rule2 = 0;
my $jump = 0;
unless ( $action eq 'COUNT' ) {
if ( $action eq 'DONE' ) {
$target = '-j RETURN';
$target = 'RETURN';
} else {
( $action, my $cmd ) = split /:/, $action;
if ( $cmd ) {
if ( $cmd eq 'COUNT' ) {
$rule2=1;
} elsif ( $cmd ne 'JUMP' ) {
$rule2 = 1;
} elsif ( $cmd eq 'JUMP' ) {
$jump = 1;
} else {
accounting_error;
}
}
@@ -148,7 +151,31 @@ sub process_accounting_rule( ) {
$dest = ALLIP if $dest eq 'any' || $dest eq 'all';
}
my $chainref = ensure_accounting_chain $chain;
my $chainref = $filter_table->{$chain};
my $dir;
if ( ! $chainref ) {
$chainref = ensure_accounting_chain $chain, 0;
$dir = ipsec_chain_name( $chain );
if ( $ipsec ne '-' ) {
if ( $dir ) {
$rule .= do_ipsec( $dir, $ipsec );
$chainref->{ipsec} = $dir;
} else {
fatal_error "Adding an IPSEC rule to an unreferenced accounting chain is not allowed";
}
} else {
warning_message "Adding rule to unreferenced accounting chain $chain" unless reserved_chain_name( $chain );
$chainref->{ipsec} = $dir;
}
} elsif ( $ipsec ne '-' ) {
$dir = $chainref->{ipsec};
fatal_error "Adding an IPSEC rule into a non-IPSEC chain is not allowed" unless $dir;
$rule .= do_ipsec( $dir , $ipsec );
}
$restriction = $dir eq 'in' ? INPUT_RESTRICT : OUTPUT_RESTRICT if $dir;
expand_rule
$chainref ,
@@ -162,6 +189,22 @@ sub process_accounting_rule( ) {
$disposition ,
'' ;
if ( $rule2 || $jump ) {
if ( $chainref->{ipsec} ) {
if ( $jumpchainref->{ipsec} ) {
fatal_error "IPSEC in/out mismatch on chains $chain and $jumpchainref->{name}";
} else {
fatal_error "$jumpchainref->{name} is not an IPSEC chain" if keys %{$jumpchainref->{references}} > 1;
$jumpchainref->{ipsec} = $chainref->{ipsec};
}
} elsif ( $jumpchainref->{ipsec} ) {
fatal_error "Jump from a non-IPSEC chain to an IPSEC chain not allowed";
} else {
$jumpchainref->{ipsec} = $chainref->{ipsec};
}
}
if ( $rule2 ) {
expand_rule
$jumpchainref ,
@@ -189,27 +232,40 @@ sub setup_accounting() {
$nonEmpty |= process_accounting_rule while read_a_line;
fatal_error "Accounring rules are isolated" if $nonEmpty && ! $filter_table->{accounting};
clear_comment;
if ( have_bridges ) {
if ( $filter_table->{accounting} ) {
for my $chain ( qw/INPUT FORWARD/ ) {
insert_rule1 $filter_table->{$chain}, 0, '-j accounting';
add_jump( $filter_table->{$chain}, 'accounting', 0, '', 0, 0 );
}
}
if ( $filter_table->{accountout} ) {
insert_rule1 $filter_table->{OUTPUT}, 0, '-j accountout';
add_jump( $filter_table->{OUTPUT}, 'accountout', 0, '', 0, 0 );
}
} else {
if ( $filter_table->{accounting} ) {
} elsif ( $filter_table->{accounting} ) {
for my $chain ( qw/INPUT FORWARD OUTPUT/ ) {
insert_rule1 $filter_table->{$chain}, 0, '-j accounting';
add_jump( $filter_table->{$chain}, 'accounting', 0, '', 0, 0 );
}
}
if ( $filter_table->{accipsecin} ) {
for my $chain ( qw/INPUT FORWARD/ ) {
add_jump( $filter_table->{$chain}, 'accipsecin', 0, '', 0, 0 );
}
}
if ( $filter_table->{accipsecout} ) {
for my $chain ( qw/FORWARD OUTPUT/ ) {
add_jump( $filter_table->{$chain}, 'accipsecout', 0, '', 0, 0 );
}
}
for ( accounting_chainrefs ) {
warning_message "Accounting chain $_->{name} has no references" unless keys %{$_->{references}};
}
}
1;

View File

@@ -3,7 +3,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
@@ -28,6 +28,7 @@ require Exporter;
use Shorewall::Config qw(:DEFAULT :internal);
use Shorewall::Zones;
use Shorewall::Chains qw(:DEFAULT :internal);
use Shorewall::IPAddrs;
use strict;
@@ -47,6 +48,7 @@ our @EXPORT = qw( merge_levels
substitute_param
merge_macro_source_dest
merge_macro_column
map_old_actions
%usedactions
%default_actions
@@ -56,7 +58,7 @@ our @EXPORT = qw( merge_levels
$macro_commands
);
our @EXPORT_OK = qw( initialize );
our $VERSION = '4.3_7';
our $VERSION = '4.4_13';
#
# Used Actions. Each action that is actually used has an entry with value 1.
@@ -85,21 +87,23 @@ our %macros;
our $family;
our @builtins;
#
# Commands that can be embedded in a macro file and how many total tokens on the line (0 => unlimited).
#
our $macro_commands = { COMMENT => 0, FORMAT => 2 };
#
# Initialize globals -- we take this novel approach to globals initialization to allow
# the compiler to run multiple times in the same process. The
# initialize() function does globals initialization for this
# module and is called from an INIT block below. The function is
# also called by Shorewall::Compiler::compiler at the beginning of
# the second and subsequent calls to that function or when compiling
# for IPv6.
# Rather than initializing globals in an INIT block or during declaration,
# we initialize them in a function. This is done for two reasons:
#
# 1. Proper initialization depends on the address family which isn't
# known until the compiler has started.
#
# 2. The compiler can run multiple times in the same process so it has to be
# able to re-initialize its dependent modules' state.
#
sub initialize( $ ) {
$family = shift;
@@ -111,10 +115,12 @@ sub initialize( $ ) {
%actions = ();
%logactionchains = ();
%macros = ();
}
INIT {
initialize( F_IPV4 );
if ( $family == F_IPV4 ) {
@builtins = qw/dropBcast allowBcast dropNotSyn rejNotSyn dropInvalid allowInvalid allowinUPnP forwardUPnP Limit/;
} else {
@builtins = qw/dropBcast allowBcast dropNotSyn rejNotSyn dropInvalid allowInvalid/;
}
}
#
@@ -173,9 +179,27 @@ sub find_macro( $ )
#
sub split_action ( $ ) {
my $action = $_[0];
my $target = '';
my $max = 3;
#
# The following rather grim RE, when matched, breaks the action into two parts:
#
# basicaction(param)
# logging part (may be empty)
#
# The param may contain one or more ':' characters
#
if ( $action =~ /^([^(:]+\(.*?\))(:(.*))?$/ ) {
$target = $1;
$action = $2 ? $3 : '';
$max = 2;
}
my @a = split( /:/ , $action, 4 );
fatal_error "Invalid ACTION ($action)" if ( $action =~ /::/ ) || ( @a > 3 );
( shift @a, join ":", @a );
fatal_error "Invalid ACTION ($action)" if ( $action =~ /::/ ) || ( @a > $max );
$target = shift @a unless $target;
( $target, join ":", @a );
}
#
@@ -208,7 +232,7 @@ sub merge_macro_source_dest( $$ ) {
if ( $invocation ) {
if ( $body ) {
return $body if $invocation eq '-';
return "$body:$invocation" if $invocation =~ /.*?\.*?\.|^\+|^~|^!~/;
return "$body:$invocation" if $invocation =~ /.*?\.*?\.|^\+|^!+|^~|^!~|~<|~\[/;
return "$invocation:$body";
}
@@ -268,14 +292,42 @@ sub add_requiredby ( $$ ) {
$actions{$requires}{requires}{$requiredby} = 1;
}
#
# Map pre-3.0 actions to the corresponding Macro invocation
#
sub find_old_action ( $$$ ) {
my ( $target, $macro, $param ) = @_;
if ( my $actiontype = find_macro( $macro ) ) {
( $macro, $actiontype , $param );
} else {
( $target, 0, '' );
}
}
sub map_old_actions( $ ) {
my $target = shift;
if ( $target =~ /^Allow(.*)$/ ) {
find_old_action( $target, $1, 'ACCEPT' );
} elsif ( $target =~ /^Drop(.*)$/ ) {
find_old_action( $target, $1, 'DROP' );
} elsif ( $target = /^Reject(.*)$/ ) {
find_old_action( $target, $1, 'REJECT' );
} else {
( $target, 0, '' );
}
}
#
# Create and record a log action chain -- Log action chains have names
# that are formed from the action name by prepending a "%" and appending
# a 1- or 2-digit sequence number. In the functions that follow,
# the CHAIN, LEVEL and TAG variable serves as arguments to the user's
# the $chain, $level and $tag variable serves as arguments to the user's
# exit. We call the exit corresponding to the name of the action but we
# set CHAIN to the name of the iptables chain where rules are to be added.
# Similarly, LEVEL and TAG contain the log level and log tag respectively.
# set $chain to the name of the iptables chain where rules are to be added.
# Similarly, $level and $tag contain the log level and log tag respectively.
#
# The maximum length of a chain name is 30 characters -- since the log
# action chain name is 2-3 characters longer than the base chain name,
@@ -306,7 +358,9 @@ sub createlogactionchain( $$ ) {
fatal_error "Too many invocations of Action $action" if $actionref->{actchain} > 99;
unless ( $targets{$action} & STANDARD ) {
unless ( $targets{$action} & BUILTIN ) {
dont_optimize $chainref;
my $file = find_file $chain;
@@ -332,7 +386,9 @@ sub createsimpleactionchain( $ ) {
$logactionchains{"$action:none"} = $chainref;
unless ( $targets{$action} & STANDARD ) {
unless ( $targets{$action} & BUILTIN ) {
dont_optimize $chainref;
my $file = find_file $action;
@@ -351,7 +407,7 @@ sub createsimpleactionchain( $ ) {
}
#
# Create an action chain and run it's associated user exit
# Create an action chain and run its associated user exit
#
sub createactionchain( $ ) {
my ( $action , $level ) = split_action $_[0];
@@ -417,8 +473,9 @@ sub process_macro1 ( $$ ) {
#
# The functions process_actions1-3() implement the three phases of action processing.
#
# The first phase (process_actions1) occurs before the rules file is processed. ${SHAREDIR}/actions.std
# and ${CONFDIR}/actions are scanned (in that order) and for each action:
# The first phase (process_actions1) occurs before the rules file is processed. The builtin-actions are added
# to the target table (%Shorewall::Chains::targets) and actions table, then ${SHAREDIR}/actions.std and
# ${CONFDIR}/actions are scanned (in that order). For each action:
#
# a) The related action definition file is located and scanned.
# b) Forward and unresolved action references are trapped as errors.
@@ -480,10 +537,10 @@ sub process_action1 ( $$ ) {
sub process_actions1() {
progress_message2 "Preprocessing Action Files...";
for my $act ( grep $targets{$_} & ACTION , keys %targets ) {
new_action $act;
}
#
# Add built-in actions to the target table and create those actions
#
$targets{$_} = ACTION + BUILTIN, new_action( $_ ) for @builtins;
for my $file ( qw/actions.std actions/ ) {
open_file $file;
@@ -519,7 +576,7 @@ sub process_actions1() {
while ( read_a_line ) {
my ($wholetarget, $source, $dest, $proto, $ports, $sports, $rate, $users ) = split_line 1, 8, 'action file';
my ($wholetarget, $source, $dest, $proto, $ports, $sports, $rate, $users, $mark ) = split_line 1, 9, 'action file';
process_action1( $action, $wholetarget );
@@ -540,7 +597,7 @@ sub process_actions2 () {
for my $target (keys %usedactions) {
my ($action, $level) = split_action $target;
my $actionref = $actions{$action};
fatal_error "Null Action Reference in process_actions2" unless $actionref;
assert( $actionref );
for my $action1 ( keys %{$actionref->{requires}} ) {
my $action2 = merge_levels $target, $action1;
unless ( $usedactions{ $action2 } ) {
@@ -556,8 +613,8 @@ sub process_actions2 () {
#
# This function is called to process each rule generated from an action file.
#
sub process_action( $$$$$$$$$$ ) {
my ($chainref, $actionname, $target, $source, $dest, $proto, $ports, $sports, $rate, $user ) = @_;
sub process_action( $$$$$$$$$$$ ) {
my ($chainref, $actionname, $target, $source, $dest, $proto, $ports, $sports, $rate, $user, $mark ) = @_;
my ( $action , $level ) = split_action $target;
@@ -575,11 +632,11 @@ sub process_action( $$$$$$$$$$ ) {
expand_rule ( $chainref ,
NO_RESTRICT ,
do_proto( $proto, $ports, $sports ) . do_ratelimit( $rate, $action ) . do_user $user ,
do_proto( $proto, $ports, $sports ) . do_ratelimit( $rate, $action ) . do_user $user . do_test( $mark, $globals{TC_MASK} ) ,
$source ,
$dest ,
'', #Original Dest
$action ? "-j $action" : '',
$action ,
$level ,
$action ,
'' );
@@ -588,8 +645,8 @@ sub process_action( $$$$$$$$$$ ) {
#
# Expand Macro in action files.
#
sub process_macro3( $$$$$$$$$$$ ) {
my ( $macro, $param, $chainref, $action, $source, $dest, $proto, $ports, $sports, $rate, $user ) = @_;
sub process_macro3( $$$$$$$$$$$$ ) {
my ( $macro, $param, $chainref, $action, $source, $dest, $proto, $ports, $sports, $rate, $user, $mark ) = @_;
my $nocomment = no_comment;
@@ -605,12 +662,14 @@ sub process_macro3( $$$$$$$$$$$ ) {
while ( read_a_line ) {
my ( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $morigdest, $mrate, $muser );
my ( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $morigdest, $mrate, $muser, $mmark );
if ( $format == 1 ) {
( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $mrate, $muser, $morigdest ) = split_line1 1, 9, 'macro file', $macro_commands;
( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $mrate, $muser ) = split_line1 1, 8, 'macro file', $macro_commands;
$morigdest = '-';
$mmark = '-';
} else {
( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $morigdest, $mrate, $muser ) = split_line1 1, 9, 'macro file', $macro_commands;
( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $morigdest, $mrate, $muser, $mmark ) = split_line1 1, 10, 'macro file', $macro_commands;
}
if ( $mtarget eq 'COMMENT' ) {
@@ -624,8 +683,6 @@ sub process_macro3( $$$$$$$$$$$ ) {
next;
}
fatal_error "Invalid macro file entry (too many columns)" if $morigdest ne '-' && $format == 1;
if ( $mtarget =~ /^PARAM:?/ ) {
fatal_error 'PARAM requires that a parameter be supplied in macro invocation' unless $param;
$mtarget = substitute_param $param, $mtarget;
@@ -666,8 +723,9 @@ sub process_macro3( $$$$$$$$$$$ ) {
$msports = merge_macro_column $msports, $sports;
$mrate = merge_macro_column $mrate, $rate;
$muser = merge_macro_column $muser, $user;
$mmark = merge_macro_column $mmark, $mark;
process_action $chainref, $action, $mtarget, $msource, $mdest, $mproto, $mports, $msports, $mrate, $muser;
process_action $chainref, $action, $mtarget, $msource, $mdest, $mproto, $mports, $msports, $mrate, $muser, $mark;
}
pop_open;
@@ -692,7 +750,7 @@ sub process_action3( $$$$$ ) {
while ( read_a_line ) {
my ($target, $source, $dest, $proto, $ports, $sports, $rate, $user ) = split_line1 1, 8, 'action file';
my ($target, $source, $dest, $proto, $ports, $sports, $rate, $user, $mark ) = split_line1 1, 9, 'action file';
if ( $target eq 'COMMENT' ) {
process_comment;
@@ -716,9 +774,9 @@ sub process_action3( $$$$$ ) {
}
if ( $action2type == MACRO ) {
process_macro3( $action2, $param, $chainref, $action, $source, $dest, $proto, $ports, $sports, $rate, $user );
process_macro3( $action2, $param, $chainref, $action, $source, $dest, $proto, $ports, $sports, $rate, $user, $mark );
} else {
process_action $chainref, $action, $target2, $source, $dest, $proto, $ports, $sports, $rate, $user;
process_action $chainref, $action, $target2, $source, $dest, $proto, $ports, $sports, $rate, $user, $mark;
}
}
@@ -731,10 +789,14 @@ sub process_action3( $$$$$ ) {
sub dropBcast( $$$ ) {
my ($chainref, $level, $tag) = @_;
if ( $capabilities{ADDRTYPE} ) {
if ( have_capability( 'ADDRTYPE' ) ) {
if ( $level ne '' ) {
log_rule_limit $level, $chainref, 'dropBcast' , 'DROP', '', $tag, 'add', ' -m addrtype --dst-type BROADCAST ';
if ( $family == F_IPV4 ) {
log_rule_limit $level, $chainref, 'dropBcast' , 'DROP', '', $tag, 'add', ' -d 224.0.0.0/4 ';
} else {
log_rule_limit $level, $chainref, 'dropBcast' , 'DROP', '', $tag, 'add', join( ' ', ' -d' , IPv6_MULTICAST , '-j DROP ' );
}
}
add_rule $chainref, '-m addrtype --dst-type BROADCAST -j DROP';
@@ -758,14 +820,14 @@ sub dropBcast( $$$ ) {
if ( $family == F_IPV4 ) {
add_rule $chainref, '-d 224.0.0.0/4 -j DROP';
} else {
add_rule $chainref, '-d ff00::/10 -j DROP';
add_rule $chainref, join( ' ', '-d', IPv6_MULTICAST, '-j DROP' );
}
}
sub allowBcast( $$$ ) {
my ($chainref, $level, $tag) = @_;
if ( $family == F_IPV4 && $capabilities{ADDRTYPE} ) {
if ( $family == F_IPV4 && have_capability( 'ADDRTYPE' ) ) {
if ( $level ne '' ) {
log_rule_limit $level, $chainref, 'allowBcast' , 'ACCEPT', '', $tag, 'add', ' -m addrtype --dst-type BROADCAST ';
log_rule_limit $level, $chainref, 'allowBcast' , 'ACCEPT', '', $tag, 'add', ' -d 224.0.0.0/4 ';
@@ -790,8 +852,8 @@ sub allowBcast( $$$ ) {
log_rule_limit $level, $chainref, 'allowBcast' , 'ACCEPT', '', $tag, 'add', ' -d 224.0.0.0/4 ' if $level ne '';
add_rule $chainref, '-d 224.0.0.0/4 -j ACCEPT';
} else {
log_rule_limit $level, $chainref, 'allowBcast' , 'ACCEPT', '', $tag, 'add', ' -d ff00::/10 ' if $level ne '';
add_rule $chainref, '-d ff00:/10 -j ACCEPT';
log_rule_limit $level, $chainref, 'allowBcast' , 'ACCEPT', '', $tag, 'add', ' -d ' . IPv6_MULTICAST . ' ' if $level ne '';
add_rule $chainref, join ( ' ', '-d', IPv6_MULTICAST, '-j ACCEPT' );
}
}
}
@@ -799,44 +861,46 @@ sub allowBcast( $$$ ) {
sub dropNotSyn ( $$$ ) {
my ($chainref, $level, $tag) = @_;
log_rule_limit $level, $chainref, 'dropNotSyn' , 'DROP', '', $tag, 'add', '-p tcp ! --syn ' if $level ne '';
add_rule $chainref , '-p tcp ! --syn -j DROP';
log_rule_limit $level, $chainref, 'dropNotSyn' , 'DROP', '', $tag, 'add', '-p 6 ! --syn ' if $level ne '';
add_rule $chainref , '-p 6 ! --syn -j DROP';
}
sub rejNotSyn ( $$$ ) {
my ($chainref, $level, $tag) = @_;
log_rule_limit $level, $chainref, 'rejNotSyn' , 'REJECT', '', $tag, 'add', '-p tcp ! --syn ' if $level ne '';
add_rule $chainref , '-p tcp ! --syn -j REJECT --reject-with tcp-reset';
log_rule_limit $level, $chainref, 'rejNotSyn' , 'REJECT', '', $tag, 'add', '-p 6 ! --syn ' if $level ne '';
add_rule $chainref , '-p 6 ! --syn -j REJECT --reject-with tcp-reset';
}
sub dropInvalid ( $$$ ) {
my ($chainref, $level, $tag) = @_;
log_rule_limit $level, $chainref, 'dropInvalid' , 'DROP', '', $tag, 'add', '-m state --state INVALID ' if $level ne '';
add_rule $chainref , '-m state --state INVALID -j DROP';
log_rule_limit $level, $chainref, 'dropInvalid' , 'DROP', '', $tag, 'add', "$globals{STATEMATCH} INVALID " if $level ne '';
add_rule $chainref , "$globals{STATEMATCH} INVALID -j DROP";
}
sub allowInvalid ( $$$ ) {
my ($chainref, $level, $tag) = @_;
log_rule_limit $level, $chainref, 'allowInvalid' , 'ACCEPT', '', $tag, 'add', '-m state --state INVALID ' if $level ne '';
add_rule $chainref , '-m state --state INVALID -j ACCEPT';
log_rule_limit $level, $chainref, 'allowInvalid' , 'ACCEPT', '', $tag, 'add', "$globals{STATEMATCH} INVALID " if $level ne '';
add_rule $chainref , "$globals{STATEMATCH} INVALID -j ACCEPT";
}
sub forwardUPnP ( $$$ ) {
my $chainref = dont_optimize 'forwardUPnP';
add_commands( $chainref , '[ -f ${VARDIR}/.forwardUPnP ] && cat ${VARDIR}/.forwardUPnP >&3' );
}
sub allowinUPnP ( $$$ ) {
my ($chainref, $level, $tag) = @_;
if ( $level ne '' ) {
log_rule_limit $level, $chainref, 'allowinUPnP' , 'ACCEPT', '', $tag, 'add', '-p udp --dport 1900 ';
log_rule_limit $level, $chainref, 'allowinUPnP' , 'ACCEPT', '', $tag, 'add', '-p tcp --dport 49152 ';
log_rule_limit $level, $chainref, 'allowinUPnP' , 'ACCEPT', '', $tag, 'add', '-p 17 --dport 1900 ';
log_rule_limit $level, $chainref, 'allowinUPnP' , 'ACCEPT', '', $tag, 'add', '-p 6 --dport 49152 ';
}
add_rule $chainref, '-p udp --dport 1900 -j ACCEPT';
add_rule $chainref, '-p tcp --dport 49152 -j ACCEPT';
add_rule $chainref, '-p 17 --dport 1900 -j ACCEPT';
add_rule $chainref, '-p 6 --dport 49152 -j ACCEPT';
}
sub Limit( $$$ ) {
@@ -862,7 +926,7 @@ sub Limit( $$$ ) {
my $xchainref = new_chain 'filter' , "$chainref->{name}%";
log_rule_limit $level, $xchainref, $tag[0], 'DROP', '', '', 'add', '';
add_rule $xchainref, '-j DROP';
add_rule $chainref, "-m recent --name $set --update --seconds $tag[2] --hitcount $count -j $xchainref->{name}";
add_jump $chainref, $xchainref, 0, "-m recent --name $set --update --seconds $tag[2] --hitcount $count ";
} else {
add_rule $chainref, "-m recent --update --name $set --seconds $tag[2] --hitcount $count -j DROP";
}

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008,2009 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
@@ -41,22 +41,20 @@ use Shorewall::IPAddrs;
use Shorewall::Raw;
our @ISA = qw(Exporter);
our @EXPORT = qw( compiler EXPORT TIMESTAMP DEBUG );
our @EXPORT = qw( compiler );
our @EXPORT_OK = qw( $export );
our $VERSION = '4.4_0';
our $VERSION = '4.4_12';
our $export;
our $test;
our $reused = 0;
our $family = F_IPV4;
our $family;
#
# Reinitilize the package-globals in the other modules
# Initilize the package-globals in the other modules
#
sub reinitialize() {
sub initialize_package_globals() {
Shorewall::Config::initialize($family);
Shorewall::Chains::initialize ($family);
Shorewall::Zones::initialize ($family);
@@ -74,32 +72,44 @@ sub reinitialize() {
#
# First stage of script generation.
#
# Copy prog.header to the generated script.
# Copy prog.header and lib.common to the generated script.
# Generate the various user-exit jacket functions.
#
sub generate_script_1() {
# Note: This function is not called when $command eq 'check'. So it must have no side effects other
# than those related to writing to the output script file.
#
sub generate_script_1( $ ) {
my $date = localtime;
my $script = shift;
if ( $script ) {
if ( $test ) {
emit "#!/bin/sh\n#\n# Compiled firewall script generated by Shorewall-perl\n#";
} else {
my $date = localtime;
emit "#!/bin/sh\n#\n# Compiled firewall script generated by Shorewall $globals{VERSION} - $date\n#";
if ( $family == F_IPV4 ) {
copy $globals{SHAREDIRPL} . 'prog.header';
} else {
copy $globals{SHAREDIRPL} . 'prog.header6';
}
copy2 $globals{SHAREDIR} . '/lib.common', 0;
}
}
my $lib = find_file 'lib.private';
copy2( $lib, $debug ) if -f $lib;
emit <<'EOF';
################################################################################
# Functions to execute the various user exits (extension scripts)
################################################################################
EOF
my $lib = find_file 'lib.private';
copy1 $lib, emit "\n" if -f $lib;
for my $exit qw/init start tcclear started stop stopped clear refresh refreshed restored/ {
emit "\nrun_${exit}_exit() {";
@@ -131,7 +141,7 @@ EOF
# Generate the 'initialize()' function.
#
# Note: This function is not called when $command eq 'check'. So it must have no side effects other
# than those related to writing to the object file.
# than those related to writing to the output script file.
sub generate_script_2() {
@@ -156,24 +166,24 @@ sub generate_script_2() {
if ( $export ) {
emit ( 'SHAREDIR=/usr/share/shorewall-lite',
'CONFDIR=/etc/shorewall-lite',
'PRODUCT="Shorewall Lite"'
'g_product="Shorewall Lite"'
);
} else {
emit ( 'SHAREDIR=/usr/share/shorewall',
'CONFDIR=/etc/shorewall',
'PRODUCT=\'Shorewall\'',
'g_product=\'Shorewall\'',
);
}
} else {
if ( $export ) {
emit ( 'SHAREDIR=/usr/share/shorewall6-lite',
'CONFDIR=/etc/shorewall6-lite',
'PRODUCT="Shorewall6 Lite"'
'g_product="Shorewall6 Lite"'
);
} else {
emit ( 'SHAREDIR=/usr/share/shorewall6',
'CONFDIR=/etc/shorewall6',
'PRODUCT=\'Shorewall6\'',
'g_product=\'Shorewall6\'',
);
}
}
@@ -205,17 +215,15 @@ sub generate_script_2() {
my @dont_load = split_list $config{DONT_LOAD}, 'module';
emit ( '[ -n "${COMMAND:=restart}" ]',
'[ -n "${VERBOSE:=0}" ]',
qq([ -n "\${RESTOREFILE:=$config{RESTOREFILE}}" ]),
'[ -n "$LOGFORMAT" ] || LOGFORMAT="Shorewall:%s:%s:"' );
'[ -n "${VERBOSITY:=0}" ]',
qq([ -n "\${RESTOREFILE:=$config{RESTOREFILE}}" ]) );
emit ( qq(VERSION="$globals{VERSION}") ) unless $test;
emit ( qq(SHOREWALL_VERSION="$globals{VERSION}") ) unless $test;
emit ( qq(PATH="$config{PATH}") ,
'TERMINATOR=fatal_error' ,
qq(DONT_LOAD="@dont_load") ,
qq(STARTUP_LOG="$config{STARTUP_LOG}") ,
"LOG_VERBOSE=$config{LOG_VERBOSITY}" ,
''
);
@@ -224,7 +232,7 @@ sub generate_script_2() {
append_file 'params' if $config{EXPORTPARAMS};
emit ( '',
"STOPPING=",
"g_stopping=",
'',
'#',
'# The library requires that ${VARDIR} exist',
@@ -232,14 +240,24 @@ sub generate_script_2() {
'[ -d ${VARDIR} ] || mkdir -p ${VARDIR}'
);
my $global_variables = have_global_variables;
pop_indent;
emit "\n}\n"; # End of initialize()
if ( $global_variables ) {
emit( '' ,
'#' ,
'# Set global variables holding detected IP information' ,
'#' ,
'case $COMMAND in' );
'detect_configuration()',
'{' );
my $global_variables = have_global_variables;
push_indent;
if ( $global_variables ) {
emit( 'case $COMMAND in' );
push_indent;
@@ -253,7 +271,7 @@ sub generate_script_2() {
set_global_variables(1);
handle_optional_interfaces;
handle_optional_interfaces(0);
emit ';;';
@@ -266,7 +284,7 @@ sub generate_script_2() {
set_global_variables(0);
handle_optional_interfaces;
handle_optional_interfaces(0);
emit ';;';
}
@@ -275,15 +293,16 @@ sub generate_script_2() {
pop_indent;
emit ( 'esac' ) ,
} else {
emit( 'true' ) unless handle_optional_interfaces(1);
}
pop_indent;
emit "\n}\n"; # End of initialize()
emit "\n}\n"; # End of detect_configuration()
}
#
# Final stage of script generation.
#
# Generate code for loading the various files in /var/lib/shorewall[6][-lite]
@@ -293,7 +312,7 @@ sub generate_script_2() {
# Generate the 'define_firewall()' function.
#
# Note: This function is not called when $command eq 'check'. So it must have no side effects other
# than those related to writing to the object file.
# than those related to writing to the output script file.
#
sub generate_script_3($) {
@@ -315,9 +334,9 @@ sub generate_script_3($) {
save_progress_message 'Initializing...';
if ( $export ) {
my $fn = find_file 'modules';
my $fn = find_file $config{LOAD_HELPERS_ONLY} ? 'helpers' : 'modules';
if ( $fn ne "$globals{SHAREDIR}/modules" && -f $fn ) {
if ( -f $fn && ! $fn =~ "^$globals{SHAREDIR}/" ) {
emit 'echo MODULESDIR="$MODULESDIR" > ${VARDIR}/.modulesdir';
emit 'cat > ${VARDIR}/.modules << EOF';
open_file $fn;
@@ -334,54 +353,17 @@ sub generate_script_3($) {
}
if ( $family == F_IPV4 ) {
my @ipsets = all_ipsets;
if ( @ipsets ) {
emit ( '',
'case $IPSET in',
' */*)',
' [ -x "$IPSET" ] || fatal_error "IPSET=$IPSET does not exist or is not executable"',
' ;;',
' *)',
' IPSET="$(mywhich $IPSET)"',
' [ -n "$IPSET" ] || fatal_error "The ipset utility cannot be located"' ,
' ;;',
'esac',
'',
'if [ "$COMMAND" = start ]; then' ,
' if [ -f ${VARDIR}/ipsets.save ]; then' ,
' $IPSET -F' ,
' $IPSET -X' ,
' $IPSET -R < ${VARDIR}/ipsets.save' ,
' fi' ,
'' );
emit ( " qt \$IPSET -L $_ -n || \$IPSET -N $_ iphash" ) for @ipsets;
emit ( '' ,
'elif [ "$COMMAND" = restart ]; then' ,
'' );
emit ( " qt \$IPSET -L $_ -n || \$IPSET -N $_ iphash" ) for @ipsets;
emit ( '' ,
' if $IPSET -S > ${VARDIR}/ipsets.tmp; then' ,
' grep -q "^-N" ${VARDIR}/ipsets.tmp && mv -f ${VARDIR}/ipsets.tmp ${VARDIR}/ipsets.save' ,
' fi' );
emit ( 'fi',
'' );
}
load_ipsets;
emit ( 'if [ "$COMMAND" = refresh ]; then' ,
' run_refresh_exit' );
emit ( " qt \$IPSET -L $_ -n || \$IPSET -N $_ iphash" ) for @ipsets;
emit ( 'else' ,
' run_refresh_exit' ,
'else' ,
' run_init_exit',
'fi',
'' );
save_dynamic_chains;
mark_firewall_not_started;
emit ('',
@@ -389,7 +371,7 @@ sub generate_script_3($) {
''
);
if ( $capabilities{NAT_ENABLED} ) {
if ( have_capability( 'NAT_ENABLED' ) ) {
emit( 'if [ -f ${VARDIR}/nat ]; then',
' while read external interface; do',
' del_ip_addr $external $interface',
@@ -402,23 +384,11 @@ sub generate_script_3($) {
emit "disable_ipv6\n" if $config{DISABLE_IPV6};
} else {
emit ( '#',
'# Recent kernels are difficult to configure -- we see state match omitted a lot so we check for it here',
'#',
'qt1 $IP6TABLES -N foox1234',
'qt1 $IP6TABLES -A foox1234 -m state --state ESTABLISHED,RELATED -j ACCEPT',
'result=$?',
'qt1 $IP6TABLES -F foox1234',
'qt1 $IP6TABLES -X foox1234',
'[ $result = 0 ] || startup_error "Your kernel/ip6tables do not include state match support. No version of Shorewall6 will run on this system"',
'' );
emit ( '[ "$COMMAND" = refresh ] && run_refresh_exit || run_init_exit',
'',
'qt1 $IP6TABLES -L shorewall -n && qt1 $IP6TABLES -F shorewall && qt1 $IP6TABLES -X shorewall',
''
);
'' );
save_dynamic_chains;
mark_firewall_not_started;
emit '';
}
emit qq(delete_tc1\n) if $config{CLEAR_TC};
@@ -440,6 +410,10 @@ sub generate_script_3($) {
dump_zone_contents;
emit_unindented '__EOF__';
emit 'cat > ${VARDIR}/policies << __EOF__';
save_policies;
emit_unindented '__EOF__';
pop_indent;
emit "fi\n";
@@ -467,31 +441,38 @@ EOF
pop_indent;
setup_forwarding( $family , 1 );
push_indent;
emit<<'EOF';
set_state "Started"
my $config_dir = $globals{CONFIGDIR};
emit<<"EOF";
set_state Started $config_dir
run_restored_exit
else
if [ $COMMAND = refresh ]; then
if [ \$COMMAND = refresh ]; then
chainlist_reload
EOF
setup_forwarding( $family , 0 );
emit<<'EOF';
emit<<"EOF";
run_refreshed_exit
do_iptables -N shorewall
set_state "Started"
set_state Started $config_dir
else
setup_netfilter
restore_dynamic_rules
conditionally_flush_conntrack
EOF
setup_forwarding( $family , 0 );
emit<<'EOF';
emit<<"EOF";
run_start_exit
do_iptables -N shorewall
set_state "Started"
set_state Started $config_dir
run_started_exit
fi
EOF
emit<<'EOF';
[ $0 = ${VARDIR}/firewall ] || cp -f $(my_pathname) ${VARDIR}/firewall
fi
@@ -499,16 +480,16 @@ date > ${VARDIR}/restarted
case $COMMAND in
start)
logger -p kern.info "$PRODUCT started"
logger -p kern.info "$g_product started"
;;
restart)
logger -p kern.info "$PRODUCT restarted"
logger -p kern.info "$g_product restarted"
;;
refresh)
logger -p kern.info "$PRODUCT refreshed"
logger -p kern.info "$g_product refreshed"
;;
restore)
logger -p kern.info "$PRODUCT restored"
logger -p kern.info "$g_product restored"
;;
esac
EOF
@@ -526,8 +507,8 @@ EOF
#
sub compiler {
my ( $objectfile, $directory, $verbosity, $timestamp , $debug, $chains , $log , $log_verbosity ) =
( '', '', -1, '', 0, '', '', -1 );
my ( $scriptfilename, $directory, $verbosity, $timestamp , $debug, $chains , $log , $log_verbosity, $preview ) =
( '', '', -1, '', 0, '', '', -1, 0 );
$export = 0;
$test = 0;
@@ -547,7 +528,8 @@ sub compiler {
defined($val) && ($val == F_IPV4 || $val == F_IPV6);
}
my %parms = ( object => { store => \$objectfile },
my %parms = ( object => { store => \$scriptfilename }, #Deprecated
script => { store => \$scriptfilename },
directory => { store => \$directory },
family => { store => \$family , validate => \&validate_family } ,
verbosity => { store => \$verbosity , validate => \&validate_verbosity } ,
@@ -558,6 +540,7 @@ sub compiler {
log => { store => \$log },
log_verbosity => { store => \$log_verbosity, validate => \&validate_verbosity } ,
test => { store => \$test },
preview => { store => \$preview },
);
#
# P A R A M E T E R P R O C E S S I N G
@@ -572,14 +555,19 @@ sub compiler {
${$ref->{store}} = $val;
}
reinitialize if $reused++ || $family == F_IPV6;
#
# Now that we know the address family (IPv4/IPv6), we can initialize the other modules' globals
#
initialize_package_globals;
if ( $directory ne '' ) {
fatal_error "$directory is not an existing directory" unless -d $directory;
set_shorewall_dir( $directory );
}
set_verbose( $verbosity );
$verbosity = 1 if $debug && $verbosity < 1;
set_verbosity( $verbosity );
set_log($log, $log_verbosity) if $log;
set_timestamp( $timestamp );
set_debug( $debug );
@@ -588,20 +576,24 @@ sub compiler {
#
get_configuration( $export );
report_capabilities;
report_capabilities unless $config{LOAD_HELPERS_ONLY};
require_capability( 'MULTIPORT' , "Shorewall $globals{VERSION}" , 's' );
require_capability( 'RECENT_MATCH' , 'MACLIST_TTL' , 's' ) if $config{MACLIST_TTL};
require_capability( 'XCONNMARK' , 'HIGH_ROUTE_MARKS=Yes' , 's' ) if $config{HIGH_ROUTE_MARKS};
require_capability( 'XCONNMARK' , 'HIGH_ROUTE_MARKS=Yes' , 's' ) if $config{PROVIDER_OFFSET} > 0;
require_capability( 'MANGLE_ENABLED' , 'Traffic Shaping' , 's' ) if $config{TC_ENABLED};
set_command( 'check', 'Checking', 'Checked' ) unless $objectfile;
initialize_chain_table;
unless ( $command eq 'check' ) {
create_temp_object( $objectfile , $export );
if ( $scriptfilename ) {
set_command( 'compile', 'Compiling', 'Compiled' );
create_temp_script( $scriptfilename , $export );
} else {
set_command( 'check', 'Checking', 'Checked' );
}
#
# Chain table initialization depends on shorewall.conf and capabilities. So it must be deferred until
# shorewall.conf has been processed and the capabilities have been determined.
#
initialize_chain_table;
#
# Allow user to load Perl modules
@@ -639,13 +631,13 @@ sub compiler {
#
setup_notrack;
enable_object;
enable_script;
unless ( $command eq 'check' ) {
if ( $scriptfilename || $debug ) {
#
# Place Header in the object
# Place Header in the script
#
generate_script_1;
generate_script_1( $scriptfilename );
#
# C O M M O N _ R U L E S
# (Writes the setup_common_rules() function to the compiled script)
@@ -659,11 +651,11 @@ sub compiler {
push_indent;
}
#
# Do all of the zone-independent stuff
# Do all of the zone-independent stuff (mostly /proc)
#
add_common_rules;
#
# /proc stuff
# More /proc
#
if ( $family == F_IPV4 ) {
setup_arp_filtering;
@@ -677,25 +669,24 @@ sub compiler {
#
setup_proxy_arp;
#
# Handle MSS setings in the zones file
# Handle MSS settings in the zones file
#
setup_zone_mss;
unless ( $command eq 'check' ) {
if ( $scriptfilename || $debug ) {
emit 'return 0';
pop_indent;
emit '}';
}
disable_object;
disable_script;
#
# R O U T I N G _ A N D _ T R A F F I C _ S H A P I N G
# (Writes the setup_routing_and_traffic_shaping() function to the compiled script)
#
enable_object;
unless ( $command eq 'check' ) {
enable_script;
if ( $scriptfilename || $debug ) {
emit( "\n#",
'# Setup routing and traffic shaping',
'#',
@@ -713,12 +704,12 @@ sub compiler {
#
setup_tc;
unless ( $command eq 'check' ) {
if ( $scriptfilename || $debug ) {
pop_indent;
emit "}\n";
}
disable_object;
disable_script;
#
# N E T F I L T E R
# (Produces no output to the compiled script -- rules are stored in the chain table)
@@ -729,7 +720,7 @@ sub compiler {
#
# ECN
#
setup_ecn if $capabilities{MANGLE_ENABLED} && $config{MANGLE_ENABLED};
setup_ecn if have_capability( 'MANGLE_ENABLED' ) && $config{MANGLE_ENABLED};
#
# Setup Masquerading/SNAT
#
@@ -772,21 +763,27 @@ sub compiler {
#
# Accounting.
#
setup_accounting;
setup_accounting if $config{ACCOUNTING};
if ( $command eq 'check' ) {
if ( $family == F_IPV4 ) {
progress_message3 "Shorewall configuration verified";
} else {
progress_message3 "Shorewall6 configuration verified";
}
} else {
if ( $scriptfilename ) {
#
# Generate the zone x zone matrix
# Compiling a script - generate the zone by zone matrix
#
generate_matrix;
enable_object;
if ( $config{OPTIMIZE} & 0xD ) {
progress_message2 'Optimizing Ruleset...';
#
# Optimize Policy Chains
#
optimize_policy_chains if $config{OPTIMIZE} & 2;
#
# More Optimization
#
optimize_ruleset if $config{OPTIMIZE} & 0xC;
}
enable_script;
#
# I N I T I A L I Z E
# (Writes the initialize() function to the compiled script)
@@ -797,17 +794,24 @@ sub compiler {
# (Produces setup_netfilter(), chainlist_reload() and define_firewall() )
#
generate_script_3( $chains );
# S T O P _ F I R E W A L L
# (Writes the stop_firewall() function to the compiled script)
#
# We must reinitialize Shorewall::Chains before generating the iptables-restore input
# for stopping the firewall
#
Shorewall::Chains::initialize( $family );
initialize_chain_table;
compile_stop_firewall( $test );
#
# Copy the footer to the object
# S T O P _ F I R E W A L L
# (Writes the stop_firewall() function to the compiled script)
#
compile_stop_firewall( $test, $export );
#
# U P D O W N
# (Writes the updown() function to the compiled script)
#
compile_updown;
#
# Copy the footer to the script
#
unless ( $test ) {
if ( $family == F_IPV4 ) {
@@ -817,15 +821,66 @@ sub compiler {
}
}
disable_object;
disable_script;
#
# Close, rename and secure the object
# Close, rename and secure the script
#
finalize_object ( $export );
finalize_script ( $export );
#
# And generate the auxilary config file
#
enable_object, generate_aux_config if $export;
enable_script, generate_aux_config if $export;
} else {
#
# Just checking the configuration
#
if ( $preview || $debug ) {
#
# User wishes to preview the ruleset or we are tracing -- generate the rule matrix
#
generate_matrix;
if ( $config{OPTIMIZE} & 6 ) {
progress_message2 'Optimizing Ruleset...';
#
# Optimize Policy Chains
#
optimize_policy_chains if $config{OPTIMIZE} & 2;
#
# Ruleset Optimization
#
optimize_ruleset if $config{OPTIMIZE} & 4;
}
enable_script if $debug;
generate_script_2 if $debug;
preview_netfilter_load if $preview;
}
#
# Re-initialize the chain table so that process_routestopped() has the same
# environment that it would when called by compile_stop_firewall().
#
Shorewall::Chains::initialize( $family );
initialize_chain_table;
if ( $debug ) {
compile_stop_firewall( $test, $export );
disable_script;
} else {
#
# 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;
}
if ( $family == F_IPV4 ) {
progress_message3 "Shorewall configuration verified";
} else {
progress_message3 "Shorewall6 configuration verified";
}
}
close_log if $log;

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008,2009 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
@@ -26,7 +26,7 @@
#
package Shorewall::IPAddrs;
require Exporter;
use Shorewall::Config qw( :DEFAULT split_list require_capability in_hex8 F_IPV4 F_IPV6 );
use Shorewall::Config qw( :DEFAULT split_list require_capability in_hex8 numeric_value F_IPV4 F_IPV6 );
use Socket;
use strict;
@@ -34,10 +34,10 @@ use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw( ALLIPv4
ALLIPv6
IPv4_MULTICAST
IPv6_MULTICAST
IPv6_LINKLOCAL
IPv6_SITELOCAL
IPv6_LINKLOCAL
IPv6_LOOPBACK
IPv6_LINK_ALLNODES
IPv6_LINK_ALLRTRS
@@ -47,6 +47,7 @@ our @EXPORT = qw( ALLIPv4
ALL
TCP
UDP
UDPLITE
ICMP
DCCP
IPv6_ICMP
@@ -72,52 +73,46 @@ our @EXPORT = qw( ALLIPv4
validate_icmp6
);
our @EXPORT_OK = qw( );
our $VERSION = '4.3_7';
our $VERSION = '4.4_12';
#
# Some IPv4/6 useful stuff
#
our @allipv4 = ( '0.0.0.0/0' );
our @allipv6 = ( '::/0' );
our $allip;
our @allip;
our $valid_address;
our $validate_address;
our $validate_net;
our $validate_range;
our $validate_host;
our $family;
use constant { ALLIPv4 => '0.0.0.0/0' ,
ALLIPv6 => '::/0' ,
IPv6_MULTICAST => 'FF00::/10' ,
IPv6_LINKLOCAL => 'FF80::/10' ,
IPv6_SITELOCAL => 'FFC0::/10' ,
IPv6_LINKLOCAL => 'FF80::/10' ,
IPv4_MULTICAST => '224.0.0.0/4' ,
IPv6_MULTICAST => 'ff00::/8' ,
IPv6_LINKLOCAL => 'fe80::/10' ,
IPv6_SITELOCAL => 'feC0::/10' ,
IPv6_LOOPBACK => '::1' ,
IPv6_LINK_ALLNODES => 'FF01::1' ,
IPv6_LINK_ALLRTRS => 'FF01::2' ,
IPv6_SITE_ALLNODES => 'FF02::1' ,
IPv6_SITE_ALLRTRS => 'FF02::2' ,
IPv6_LINK_ALLNODES => 'ff01::1' ,
IPv6_LINK_ALLRTRS => 'ff01::2' ,
IPv6_SITE_ALLNODES => 'ff02::1' ,
IPv6_SITE_ALLRTRS => 'ff02::2' ,
ICMP => 1,
TCP => 6,
UDP => 17,
DCCP => 33,
IPv6_ICMP => 58,
SCTP => 132 };
SCTP => 132,
UDPLITE => 136 };
our @rfc1918_networks = ( "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16" );
#
# Initialize globals -- we take this novel approach to globals initialization to allow
# the compiler to run multiple times in the same process. The
# initialize() function does globals initialization for this
# module and is called from an INIT block below. The function is
# also called by Shorewall::Compiler::compiler at the beginning of
# the second and subsequent calls to that function.
# Note: initialize() is declared at the bottom of the file
#
sub initialize( $ ) {
$family = shift;
}
INIT {
initialize( F_IPV4 );
}
sub vlsm_to_mask( $ ) {
my $vlsm = $_[0];
@@ -129,8 +124,8 @@ sub valid_4address( $ ) {
my @address = split /\./, $address;
return 0 unless @address == 4;
for my $a ( @address ) {
return 0 unless $a =~ /^\d+$/ && $a < 256;
for ( @address ) {
return 0 unless /^\d+$/ && $_ < 256;
}
1;
@@ -163,8 +158,8 @@ sub decodeaddr( $ ) {
my $result = shift @address;
for my $a ( @address ) {
$result = ( $result << 8 ) | $a;
for ( @address ) {
$result = ( $result << 8 ) | $_;
}
$result;
@@ -294,7 +289,17 @@ sub resolve_proto( $ ) {
my $proto = $_[0];
my $number;
$proto =~ /^(\d+)$/ ? $proto <= 65535 ? $proto : undef : defined( $number = $nametoproto{$proto} ) ? $number : scalar getprotobyname $proto;
if ( $proto =~ /^\d+$/ || $proto =~ /^0x/ ) {
$number = numeric_value ( $proto );
defined $number && $number <= 65535 ? $number : undef;
} else {
#
# Allow 'icmp' as a synonym for 'ipv6-icmp' in IPv6 compilations
#
$proto= 'ipv6-icmp' if $proto eq 'icmp' && $family == F_IPV6;
defined( $number = $nametoproto{$proto} ) ? $number : scalar getprotobyname $proto;
}
}
sub proto_name( $ ) {
@@ -308,16 +313,19 @@ sub validate_port( $$ ) {
my $value;
if ( $port =~ /^(\d+)$/ ) {
return $port if $port <= 65535;
if ( $port =~ /^(\d+)$/ || $port =~ /^0x/ ) {
$port = numeric_value $port;
return $port if defined $port && $port && $port <= 65535;
} else {
$proto = proto_name $proto if $proto =~ /^(\d+)$/;
$value = getservbyname( $port, $proto );
}
fatal_error "Invalid/Unknown $proto port/service ($port)" unless defined $value;
return $value if defined $value;
$value;
fatal_error "The separator for a port range is ':', not '-' ($port)" if $port =~ /^\d+-\d+$/;
fatal_error "Invalid/Unknown $proto port/service ($_[1])" unless defined $value;
}
sub validate_portpair( $$ ) {
@@ -330,7 +338,7 @@ sub validate_portpair( $$ ) {
my @ports = split /:/, $portpair, 2;
$_ = validate_port( $proto, $_) for ( @ports );
$_ = validate_port( $proto, $_) for ( grep $_, @ports );
if ( @ports == 2 ) {
fatal_error "Invalid port range ($portpair)" unless $ports[0] < $ports[1];
@@ -398,7 +406,6 @@ my %icmp_types = ( any => 'any',
'address-mask-reply' => 18 );
sub validate_icmp( $ ) {
fatal_error "IPv4 ICMP not allowed in an IPv6 Rule" unless $family == F_IPV4;
my $type = $_[0];
@@ -484,6 +491,7 @@ sub valid_6address( $ ) {
return 0 unless valid_4address pop @address;
$max = 6;
$address = join ':', @address;
return 1 if @address eq ':';
} else {
$max = 8;
}
@@ -492,16 +500,16 @@ sub valid_6address( $ ) {
return 0 unless ( @address == $max ) || $address =~ /::/;
return 0 if $address =~ /:::/ || $address =~ /::.*::/;
if ( $address =~ /^:/ ) {
unless ( $address eq '::' ) {
return 0 if $address =~ /:$/ || $address =~ /^:.*::/;
unless ( $address =~ /^::/ ) {
return 0 if $address =~ /^:/;
}
} elsif ( $address =~ /:$/ ) {
return 0 if $address =~ /::.*:$/;
unless ( $address =~ /::$/ ) {
return 0 if $address =~ /:$/;
}
for my $a ( @address ) {
return 0 unless $a eq '' || ( $a =~ /^[a-fA-f\d]+$/ && oct "0x$a" < 65536 );
return 0 unless $a eq '' || ( $a =~ /^[a-fA-f\d]+$/ && length $a < 5 );
}
1;
@@ -550,13 +558,27 @@ sub validate_6net( $$ ) {
sub normalize_6addr( $ ) {
my $addr = shift;
while ( $addr =~ tr/:/:/ < 6 ) {
$addr =~ s/::/:0::/;
}
if ( $addr eq '::' ) {
'0:0:0:0:0:0:0:0';
} else {
#
# Suppress leading zeros
#
$addr =~ s/^0+//;
$addr =~ s/:0+/:/g;
$addr =~ s/^:/0:/;
$addr =~ s/:$/:0/;
$addr =~ s/::/:0:/;
$addr =~ s/::/:0::/ while $addr =~ tr/:/:/ < 7;
#
# Note: "s/::/:0:/g" doesn't work here
#
1 while $addr =~ s/::/:0:/;
$addr =~ s/^0+:/0:/;
$addr;
}
}
sub validate_6range( $$ ) {
@@ -580,7 +602,7 @@ sub validate_6range( $$ ) {
}
sub validate_6host( $$ ) {
my ( $host, $allow_name ) = $_[0];
my ( $host, $allow_name ) = @_;
if ( $host =~ /^(.*:.*)-(.*:.*)$/ ) {
validate_6range $1, $2;
@@ -614,7 +636,6 @@ my %ipv6_icmp_types = ( any => 'any',
sub validate_icmp6( $ ) {
fatal_error "IPv6 ICMP not allowed in an IPv4 Rule" unless $family == F_IPV6;
my $type = $_[0];
my $value = $ipv6_icmp_types{$type};
@@ -629,31 +650,63 @@ sub validate_icmp6( $ ) {
}
sub ALLIP() {
$family == F_IPV4 ? ALLIPv4 : ALLIPv6;
$allip;
}
sub allip() {
$family == F_IPV4 ? ALLIPv4 : ALLIPv6;
@allip;
}
sub valid_address ( $ ) {
$family == F_IPV4 ? valid_4address( $_[0] ) : valid_6address( $_[0] );
$valid_address->(@_);
}
sub validate_address ( $$ ) {
$family == F_IPV4 ? validate_4address( $_[0], $_[1] ) : validate_6address( $_[0], $_[1] );
$validate_address->(@_);
}
sub validate_net ( $$ ) {
$family == F_IPV4 ? validate_4net( $_[0], $_[1] ) : validate_6net( $_[0], $_[1] );
$validate_net->(@_);
}
sub validate_range ($$ ) {
$family == F_IPV4 ? validate_4range( $_[0], $_[1] ) : validate_6range( $_[0], $_[1] );
$validate_range->(@_);
}
sub validate_host ($$ ) {
$family == F_IPV4 ? validate_4host( $_[0], $_[1] ) : validate_6host( $_[0], $_[1] );
$validate_host->(@_);
}
#
# Rather than initializing globals in an INIT block or during declaration,
# we initialize them in a function. This is done for two reasons:
#
# 1. Proper initialization depends on the address family which isn't
# known until the compiler has started.
#
# 2. The compiler can run multiple times in the same process so it has to be
# able to re-initialize its dependent modules' state.
#
sub initialize( $ ) {
$family = shift;
if ( $family == F_IPV4 ) {
$allip = ALLIPv4;
@allip = @allipv4;
$valid_address = \&valid_4address;
$validate_address = \&validate_4address;
$validate_net = \&validate_4net;
$validate_range = \&validate_4range;
$validate_host = \&validate_4host;
} else {
$allip = ALLIPv6;
@allip = @allipv6;
$valid_address = \&valid_6address;
$validate_address = \&validate_6address;
$validate_net = \&validate_6net;
$validate_range = \&validate_6range;
$validate_host = \&validate_6host;
}
}
1;

View File

@@ -3,7 +3,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008,2009 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
@@ -29,7 +29,6 @@ use Shorewall::Config qw(:DEFAULT :internal);
use Shorewall::IPAddrs;
use Shorewall::Zones;
use Shorewall::Chains qw(:DEFAULT :internal);
use Shorewall::IPAddrs;
use Shorewall::Providers qw( lookup_provider );
use strict;
@@ -37,79 +36,19 @@ use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw( setup_masq setup_nat setup_netmap add_addresses );
our @EXPORT_OK = ();
our $VERSION = '4.3_7';
our $VERSION = '4.4_13';
our @addresses_to_add;
our %addresses_to_add;
#
# Initialize globals -- we take this novel approach to globals initialization to allow
# the compiler to run multiple times in the same process. The
# initialize() function does globals initialization for this
# module and is called from an INIT block below. The function is
# also called by Shorewall::Compiler::compiler at the beginning of
# the second and subsequent calls to that function.
# Called by the compiler
#
sub initialize() {
@addresses_to_add = ();
%addresses_to_add = ();
}
INIT {
initialize;
}
#
# Handle IPSEC Options in a masq record
#
sub do_ipsec_options($)
{
my %validoptions = ( strict => NOTHING,
next => NOTHING,
reqid => NUMERIC,
spi => NUMERIC,
proto => IPSECPROTO,
mode => IPSECMODE,
"tunnel-src" => NETWORK,
"tunnel-dst" => NETWORK,
);
my $list=$_[0];
my $options = '-m policy --pol ipsec --dir out ';
my $fmt;
for my $e ( split_list $list, 'option' ) {
my $val = undef;
my $invert = '';
if ( $e =~ /([\w-]+)!=(.+)/ ) {
$val = $2;
$e = $1;
$invert = '! ';
} elsif ( $e =~ /([\w-]+)=(.+)/ ) {
$val = $2;
$e = $1;
}
$fmt = $validoptions{$e};
fatal_error "Invalid Option ($e)" unless $fmt;
if ( $fmt eq NOTHING ) {
fatal_error "Option \"$e\" does not take a value" if defined $val;
} else {
fatal_error "Missing value for option \"$e\"" unless defined $val;
fatal_error "Invalid value ($val) for option \"$e\"" unless $val =~ /^($fmt)$/;
}
$options .= $invert;
$options .= "--$e ";
$options .= "$val " if defined $val;
}
$options;
}
#
# Process a single rule from the the masq file
#
@@ -161,16 +100,16 @@ sub process_one_masq( )
# Handle IPSEC options, if any
#
if ( $ipsec ne '-' ) {
fatal_error "Non-empty IPSEC column requires policy match support in your kernel and iptables" unless $globals{ORIGINAL_POLICY_MATCH};
fatal_error "Non-empty IPSEC column requires policy match support in your kernel and iptables" unless have_capability( 'POLICY_MATCH' );
if ( $ipsec =~ /^yes$/i ) {
$baserule .= '-m policy --pol ipsec --dir out ';
$baserule .= do_ipsec_options 'out', 'ipsec', '';
} elsif ( $ipsec =~ /^no$/i ) {
$baserule .= '-m policy --pol none --dir out ';
$baserule .= do_ipsec_options 'out', 'none', '';
} else {
$baserule .= do_ipsec_options $ipsec;
$baserule .= do_ipsec_options 'out', 'ipsec', $ipsec;
}
} elsif ( $capabilities{POLICY_MATCH} ) {
} elsif ( have_ipsec ) {
$baserule .= '-m policy --pol none --dir out ';
}
@@ -178,16 +117,15 @@ sub process_one_masq( )
# Handle Protocol and Ports
#
$baserule .= do_proto $proto, $ports, '';
#
# Handle Mark
#
$baserule .= do_test( $mark, 0xFF) if $mark ne '-';
$baserule .= do_test( $mark, $globals{TC_MASK} ) if $mark ne '-';
$baserule .= do_user( $user ) if $user ne '-';
for my $fullinterface (split_list $interfacelist, 'interface' ) {
my $rule = '';
my $target = '-j MASQUERADE ';
my $target = 'MASQUERADE ';
#
# Isolate and verify the interface part
#
@@ -207,7 +145,7 @@ sub process_one_masq( )
fatal_error "Unknown interface ($interface)" unless my $interfaceref = known_interface( $interface );
unless ( $interfaceref->{root} ) {
$rule .= "-o $interface ";
$rule .= match_dest_dev( $interface );
$interface = $interfaceref->{name};
}
@@ -216,6 +154,7 @@ sub process_one_masq( )
my $detectaddress = 0;
my $exceptionrule = '';
my $randomize = '';
my $persistent = '';
#
# Parse the ADDRESSES column
#
@@ -223,13 +162,16 @@ sub process_one_masq( )
if ( $addresses eq 'random' ) {
$randomize = '--random ';
} else {
$addresses =~ s/:persistent$// and $persistent = '--persistent ';
$addresses =~ s/:random$// and $randomize = '--random ';
require_capability 'PERSISTENT_SNAT', ':persistent', 's' if $persistent;
if ( $addresses =~ /^SAME/ ) {
fatal_error "The SAME target is no longer supported";
} elsif ( $addresses eq 'detect' ) {
my $variable = get_interface_address $interface;
$target = "-j SNAT --to-source $variable";
$target = "SNAT --to-source $variable";
if ( interface_is_optional $interface ) {
add_commands( $chainref,
@@ -239,15 +181,19 @@ sub process_one_masq( )
$detectaddress = 1;
}
} elsif ( $addresses eq 'NONAT' ) {
$target = '-j RETURN';
$target = 'RETURN';
$add_snat_aliases = 0;
} else {
my $addrlist = '';
for my $addr ( split_list $addresses , 'address' ) {
if ( $addr =~ /^.*\..*\..*\./ ) {
$target = '-j SNAT ';
$target = 'SNAT ';
my ($ipaddr, $rest) = split ':', $addr;
if ( $ipaddr =~ /^(.+)-(.+)$/ ) {
validate_range( $1, $2 );
} else {
validate_address $ipaddr, 0;
}
$addrlist .= "--to-source $addr ";
$exceptionrule = do_proto( $proto, '', '' ) if $addr =~ /:/;
} else {
@@ -262,6 +208,7 @@ sub process_one_masq( )
}
$target .= $randomize;
$target .= $persistent;
} else {
$add_snat_aliases = 0;
}
@@ -293,7 +240,6 @@ sub process_one_masq( )
next if $addrs eq 'detect';
for my $addr ( ip_range_explicit $addrs ) {
unless ( $addresses_to_add{$addr} ) {
emit "del_ip_addr $addr $interface" unless $config{RETAIN_ALIASES};
$addresses_to_add{$addr} = 1;
if ( defined $alias ) {
push @addresses_to_add, $addr, "$interface:$alias";
@@ -371,12 +317,12 @@ sub do_one_nat( $$$$$ )
fatal_error "Unknown interface ($interface)" unless my $interfaceref = known_interface( $interface );
unless ( $interfaceref->{root} ) {
$rulein = "-i $interface ";
$ruleout = "-o $interface ";
$rulein = match_source_dev $interface;
$ruleout = match_dest_dev $interface;
$interface = $interfaceref->{name};
}
if ( $capabilities{POLICY_MATCH} ) {
if ( have_ipsec ) {
$policyin = ' -m policy --pol none --dir in';
$policyout = '-m policy --pol none --dir out';
}
@@ -406,7 +352,6 @@ sub do_one_nat( $$$$$ )
push @addresses_to_add, ( $external , $fullinterface );
}
}
}
#
@@ -453,7 +398,9 @@ sub setup_netmap() {
while ( read_a_line ) {
my ( $type, $net1, $interfacelist, $net2 ) = split_line 4, 4, 'netmap file';
my ( $type, $net1, $interfacelist, $net2, $net3 ) = split_line 4, 5, 'netmap file';
$net3 = ALLIP if $net3 eq '-';
for my $interface ( split_list $interfacelist, 'interface' ) {
@@ -461,18 +408,18 @@ sub setup_netmap() {
my $ruleout = '';
my $iface = $interface;
fatal_error "Unknown interface ($interface)" unless my $interfaceref = find_interface( $interface );
fatal_error "Unknown interface ($interface)" unless my $interfaceref = known_interface( $interface );
unless ( $interfaceref->{root} ) {
$rulein = "-i $interface ";
$ruleout = "-o $interface ";
$rulein = match_source_dev( $interface );
$ruleout = match_dest_dev( $interface );
$interface = $interfaceref->{name};
}
if ( $type eq 'DNAT' ) {
add_rule ensure_chain( 'nat' , input_chain $interface ) , $rulein . "-d $net1 -j NETMAP --to $net2";
add_rule ensure_chain( 'nat' , input_chain $interface ) , $rulein . match_source_net( $net3 ) . "-d $net1 -j NETMAP --to $net2";
} elsif ( $type eq 'SNAT' ) {
add_rule ensure_chain( 'nat' , output_chain $interface ) , $ruleout . "-s $net1 -j NETMAP --to $net2";
add_rule ensure_chain( 'nat' , output_chain $interface ) , $ruleout . match_dest_net( $net3 ) . "-s $net1 -j NETMAP --to $net2";
} else {
fatal_error "Invalid type ($type)";
}
@@ -485,12 +432,13 @@ sub setup_netmap() {
sub add_addresses () {
if ( @addresses_to_add ) {
my @addrs = @addresses_to_add;
my $arg = '';
my $addresses = 0;
while ( @addresses_to_add ) {
my $addr = shift @addresses_to_add;
my $interface = shift @addresses_to_add;
while ( @addrs ) {
my $addr = shift @addrs;
my $interface = shift @addrs;
$arg = "$arg $addr $interface";
unless ( $config{RETAIN_ALIASES} ) {
emit '' unless $addresses++;

View File

@@ -3,7 +3,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008,2009 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
@@ -32,31 +32,21 @@ use Shorewall::Actions;
use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw( validate_policy apply_policy_rules complete_standard_chain setup_syn_flood_chains );
our @EXPORT = qw( validate_policy apply_policy_rules complete_standard_chain setup_syn_flood_chains save_policies optimize_policy_chains);
our @EXPORT_OK = qw( );
our $VERSION = '4.3_7';
our $VERSION = '4.4_12';
# @policy_chains is a list of references to policy chains in the filter table
our @policy_chains;
#
# Initialize globals -- we take this novel approach to globals initialization to allow
# the compiler to run multiple times in the same process. The
# initialize() function does globals initialization for this
# module and is called from an INIT block below. The function is
# also called by Shorewall::Compiler::compiler at the beginning of
# the second and subsequent calls to that function.
# Called by the compiler
#
sub initialize() {
@policy_chains = ();
}
INIT {
initialize;
}
#
# Convert a chain into a policy chain.
#
@@ -76,11 +66,11 @@ sub convert_to_policy_chain($$$$$)
#
sub new_policy_chain($$$$)
{
my ($source, $dest, $policy, $optional) = @_;
my ($source, $dest, $policy, $provisional) = @_;
my $chainref = new_chain( 'filter', "${source}2${dest}" );
my $chainref = new_chain( 'filter', rules_chain( ${source}, ${dest} ) );
convert_to_policy_chain( $chainref, $source, $dest, $policy, $optional );
convert_to_policy_chain( $chainref, $source, $dest, $policy, $provisional );
$chainref;
}
@@ -125,20 +115,20 @@ sub set_policy_chain($$$$$)
#
# Process the policy file
#
use constant { OPTIONAL => 1 };
use constant { PROVISIONAL => 1 };
sub add_or_modify_policy_chain( $$ ) {
my ( $zone, $zone1 ) = @_;
my $chain = "${zone}2${zone1}";
my $chain = rules_chain( ${zone}, ${zone1} );
my $chainref = $filter_table->{$chain};
if ( $chainref ) {
unless( $chainref->{is_policy} ) {
convert_to_policy_chain( $chainref, $zone, $zone1, 'CONTINUE', OPTIONAL );
convert_to_policy_chain( $chainref, $zone, $zone1, 'CONTINUE', PROVISIONAL );
push @policy_chains, $chainref;
}
} else {
push @policy_chains, ( new_policy_chain $zone, $zone1, 'CONTINUE', OPTIONAL );
push @policy_chains, ( new_policy_chain $zone, $zone1, 'CONTINUE', PROVISIONAL );
}
}
@@ -221,7 +211,7 @@ sub process_a_policy() {
}
}
my $chain = "${client}2${server}";
my $chain = rules_chain( ${client}, ${server} );
my $chainref;
if ( defined $filter_table->{$chain} ) {
@@ -262,19 +252,19 @@ sub process_a_policy() {
if ( $serverwild ) {
for my $zone ( @zonelist ) {
for my $zone1 ( @zonelist ) {
set_policy_chain $client, $server, "${zone}2${zone1}", $chainref, $policy;
set_policy_chain $client, $server, rules_chain( ${zone}, ${zone1} ), $chainref, $policy;
print_policy $zone, $zone1, $policy, $chain;
}
}
} else {
for my $zone ( all_zones ) {
set_policy_chain $client, $server, "${zone}2${server}", $chainref, $policy;
set_policy_chain $client, $server, rules_chain( ${zone}, ${server} ), $chainref, $policy;
print_policy $zone, $server, $policy, $chain;
}
}
} elsif ( $serverwild ) {
for my $zone ( @zonelist ) {
set_policy_chain $client, $server, "${client}2${zone}", $chainref, $policy;
set_policy_chain $client, $server, rules_chain( ${client}, ${zone} ), $chainref, $policy;
print_policy $client, $zone, $policy, $chain;
}
@@ -283,6 +273,21 @@ sub process_a_policy() {
}
}
sub save_policies() {
for my $zone1 ( all_zones ) {
for my $zone2 ( all_zones ) {
my $chainref = $filter_table->{ rules_chain( $zone1, $zone2 ) };
my $policyref = $filter_table->{ $chainref->{policychain} };
if ( $policyref->{referenced} ) {
emit_unindented "$zone1 \t=>\t$zone2\t" . $policyref->{policy} . ' using chain ' . $policyref->{name};
} elsif ( $zone1 ne $zone2 ) {
emit_unindented "$zone1 \t=>\t$zone2\t" . $policyref->{policy};
}
}
}
}
sub validate_policy()
{
our %validpolicies = (
@@ -302,6 +307,7 @@ sub validate_policy()
NFQUEUE_DEFAULT => 'NFQUEUE' );
my $zone;
my $firewall = firewall_zone;
our @zonelist = $config{EXPAND_POLICIES} ? all_zones : ( all_zones, 'all' );
for my $option qw/DROP_DEFAULT REJECT_DEFAULT ACCEPT_DEFAULT QUEUE_DEFAULT NFQUEUE_DEFAULT/ {
@@ -324,9 +330,12 @@ sub validate_policy()
}
for $zone ( all_zones ) {
push @policy_chains, ( new_policy_chain $zone, $zone, 'ACCEPT', OPTIONAL );
push @policy_chains, ( new_policy_chain $zone, $zone, 'ACCEPT', PROVISIONAL );
push @policy_chains, ( new_policy_chain firewall_zone, $zone, 'NONE', PROVISIONAL ) if zone_type( $zone ) == BPORT;
if ( $config{IMPLICIT_CONTINUE} && ( @{find_zone( $zone )->{parents}} ) ) {
my $zoneref = find_zone( $zone );
if ( $config{IMPLICIT_CONTINUE} && ( @{$zoneref->{parents}} || $zoneref->{type} == VSERVER ) ) {
for my $zone1 ( all_zones ) {
unless( $zone eq $zone1 ) {
add_or_modify_policy_chain( $zone, $zone1 );
@@ -344,7 +353,7 @@ sub validate_policy()
for $zone ( all_zones ) {
for my $zone1 ( all_zones ) {
fatal_error "No policy defined from zone $zone to zone $zone1" unless $filter_table->{"${zone}2${zone1}"}{policy};
fatal_error "No policy defined from zone $zone to zone $zone1" unless $filter_table->{rules_chain( ${zone}, ${zone1} )}{policy};
}
}
}
@@ -356,8 +365,8 @@ sub policy_rules( $$$$$ ) {
my ( $chainref , $target, $loglevel, $default, $dropmulticast ) = @_;
unless ( $target eq 'NONE' ) {
add_rule $chainref, "-d 224.0.0.0/24 -j RETURN" if $dropmulticast && $target ne 'CONTINUE';
add_rule $chainref, "-j $default" if $default && $default ne 'none';
add_rule $chainref, "-d 224.0.0.0/4 -j RETURN" if $dropmulticast && $target ne 'CONTINUE' && $target ne 'ACCEPT';
add_jump $chainref, $default, 0 if $default && $default ne 'none';
log_rule $loglevel , $chainref , $target , '' if $loglevel ne '';
fatal_error "Null target in policy_rules()" unless $target;
@@ -409,17 +418,29 @@ sub apply_policy_rules() {
for my $chainref ( @policy_chains ) {
my $policy = $chainref->{policy};
unless ( $policy eq 'NONE' ) {
my $loglevel = $chainref->{loglevel};
my $provisional = $chainref->{provisional};
my $default = $chainref->{default};
my $name = $chainref->{name};
my $synparms = $chainref->{synparms};
if ( $policy ne 'NONE' ) {
if ( ! $chainref->{referenced} && ( ! $provisional && $policy ne 'CONTINUE' ) ) {
unless ( $chainref->{referenced} || $provisional || $policy eq 'CONTINUE' ) {
if ( $config{OPTIMIZE} & 2 ) {
#
# This policy chain is empty and the only thing that we would put in it is
# the policy-related stuff. Don't create it if all we are going to put in it
# is a single jump. Generate_matrix() will just use the policy target when
# needed.
#
ensure_filter_chain $name, 1 if $default ne 'none' || $loglevel || $synparms || $config{MULTICAST} || ! ( $policy eq 'ACCEPT' || $config{FASTACCEPT} );
} else {
ensure_filter_chain $name, 1;
}
}
if ( $name =~ /^all2|2all$/ ) {
if ( $name =~ /^all[-2]|[-2]all$/ ) {
run_user_exit $chainref;
policy_rules $chainref , $policy, $loglevel , $default, $config{MULTICAST};
}
@@ -428,7 +449,7 @@ sub apply_policy_rules() {
for my $zone ( all_zones ) {
for my $zone1 ( all_zones ) {
my $chainref = $filter_table->{"${zone}2${zone1}"};
my $chainref = $filter_table->{rules_chain( ${zone}, ${zone1} )};
if ( $chainref->{referenced} ) {
run_user_exit $chainref;
@@ -450,11 +471,11 @@ sub apply_policy_rules() {
sub complete_standard_chain ( $$$$ ) {
my ( $stdchainref, $zone, $zone2, $default ) = @_;
add_rule $stdchainref, '-m state --state ESTABLISHED,RELATED -j ACCEPT' unless $config{FASTACCEPT};
add_rule $stdchainref, "$globals{STATEMATCH} ESTABLISHED,RELATED -j ACCEPT" unless $config{FASTACCEPT};
run_user_exit $stdchainref;
my $ruleschainref = $filter_table->{"${zone}2${zone2}"} || $filter_table->{all2all};
my $ruleschainref = $filter_table->{rules_chain( ${zone}, ${zone2} ) } || $filter_table->{rules_chain( 'all', 'all' ) };
my ( $policy, $loglevel, $defaultaction ) = ( $default , 6, $config{$default . '_DEFAULT'} );
my $policychainref;
@@ -475,11 +496,38 @@ sub setup_syn_flood_chains() {
my $level = $chainref->{loglevel};
my $synchainref = new_chain 'filter' , syn_flood_chain $chainref;
add_rule $synchainref , "${limit}-j RETURN";
log_rule_limit $level , $synchainref , $chainref->{name} , 'DROP', '-m limit --limit 5/min --limit-burst 5 ' , '' , 'add' , ''
log_rule_limit( $level ,
$synchainref ,
$chainref->{name} ,
'DROP',
$globals{LOGLIMIT} || '-m limit --limit 5/min --limit-burst 5 ' ,
'' ,
'add' ,
'' )
if $level ne '';
add_rule $synchainref, '-j DROP';
}
}
}
#
# Optimize Policy chains with ACCEPT policy
#
sub optimize_policy_chains() {
for my $chainref ( grep $_->{policy} eq 'ACCEPT', @policy_chains ) {
optimize_chain ( $chainref );
}
#
# Often, fw->all has an ACCEPT policy. This code allows optimization in that case
#
my $outputrules = $filter_table->{OUTPUT}{rules};
if ( @{$outputrules} && $outputrules->[-1] =~ /-j ACCEPT/ ) {
optimize_chain( $filter_table->{OUTPUT} );
}
progress_message ' Policy chains optimized';
progress_message '';
}
1;

View File

@@ -3,7 +3,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008,2009 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
@@ -41,7 +41,7 @@ our @EXPORT = qw(
setup_forwarding
);
our @EXPORT_OK = qw( );
our $VERSION = '4.3_12';
our $VERSION = '4.4_7';
#
# ARP Filtering
@@ -56,27 +56,35 @@ sub setup_arp_filtering() {
save_progress_message "Setting up ARP filtering...";
for my $interface ( @$interfaces ) {
my $file = "/proc/sys/net/ipv4/conf/$interface/arp_filter";
my $value = get_interface_option $interface, 'arp_filter';
my $optional = interface_is_optional $interface;
$interface = get_physical $interface;
my $file = "/proc/sys/net/ipv4/conf/$interface/arp_filter";
emit ( '',
"if [ -f $file ]; then",
" echo $value > $file");
emit ( 'else',
" error_message \"WARNING: Cannot set ARP filtering on $interface\"" ) unless interface_is_optional( $interface );
" error_message \"WARNING: Cannot set ARP filtering on $interface\"" ) unless $optional;
emit "fi\n";
}
for my $interface ( @$interfaces1 ) {
my $file = "/proc/sys/net/ipv4/conf/$interface/arp_ignore";
my $value = get_interface_option $interface, 'arp_ignore';
my $optional = interface_is_optional $interface;
$interface = get_physical $interface;
my $file = "/proc/sys/net/ipv4/conf/$interface/arp_ignore";
assert( defined $value );
emit ( "if [ -f $file ]; then",
" echo $value > $file");
emit ( 'else',
" error_message \"WARNING: Cannot set ARP filtering on $interface\"" ) unless interface_is_optional( $interface );
" error_message \"WARNING: Cannot set ARP filtering on $interface\"" ) unless $optional;
emit "fi\n";
}
}
@@ -88,16 +96,18 @@ sub setup_arp_filtering() {
sub setup_route_filtering() {
my $interfaces = find_interfaces_by_option 'routefilter';
my $config = $config{ROUTE_FILTER};
if ( @$interfaces || $config{ROUTE_FILTER} ) {
if ( @$interfaces || $config ) {
progress_message2 "$doing Kernel Route Filtering...";
save_progress_message "Setting up Route Filtering...";
my $val = '';
if ( $config{ROUTE_FILTER} ) {
my $val = $config{ROUTE_FILTER} eq 'on' ? 1 : 0;
if ( $config{ROUTE_FILTER} ne '' ) {
$val = $config eq 'on' ? 1 : $config eq 'off' ? 0 : $config;
emit ( 'for file in /proc/sys/net/ipv4/conf/*; do',
" [ -f \$file/rp_filter ] && echo $val > \$file/rp_filter",
@@ -106,25 +116,29 @@ sub setup_route_filtering() {
}
for my $interface ( @$interfaces ) {
my $file = "/proc/sys/net/ipv4/conf/$interface/rp_filter";
my $value = get_interface_option $interface, 'routefilter';
my $optional = interface_is_optional $interface;
$interface = get_physical $interface;
my $file = "/proc/sys/net/ipv4/conf/$interface/rp_filter";
emit ( "if [ -f $file ]; then" ,
" echo $value > $file" );
emit ( 'else' ,
" error_message \"WARNING: Cannot set route filtering on $interface\"" ) unless interface_is_optional( $interface);
" error_message \"WARNING: Cannot set route filtering on $interface\"" ) unless $optional;
emit "fi\n";
}
if ( have_capability( 'KERNELVERSION' ) < 20631 ) {
emit 'echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter';
if ( $config{ROUTE_FILTER} eq 'on' ) {
emit 'echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter';
} elsif ( $config{ROUTE_FILTER} eq 'off' ) {
emit 'echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter';
} elsif ( $val ne '' ) {
emit "echo $val > /proc/sys/net/ipv4/conf/all/rp_filter";
}
emit "[ -n \"\$NOROUTES\" ] || \$IP -4 route flush cache";
emit "echo $val > /proc/sys/net/ipv4/conf/default/rp_filter" if $val ne '';
emit "[ -n \"\$g_noroutes\" ] || \$IP -4 route flush cache";
}
}
@@ -153,14 +167,18 @@ sub setup_martian_logging() {
}
for my $interface ( @$interfaces ) {
my $file = "/proc/sys/net/ipv4/conf/$interface/log_martians";
my $value = get_interface_option $interface, 'logmartians';
my $optional = interface_is_optional $interface;
$interface = get_physical $interface;
my $file = "/proc/sys/net/ipv4/conf/$interface/log_martians";
emit ( "if [ -f $file ]; then" ,
" echo $value > $file" );
emit ( 'else' ,
" error_message \"WARNING: Cannot set Martian logging on $interface\"") unless interface_is_optional( $interface);
" error_message \"WARNING: Cannot set Martian logging on $interface\"") unless $optional;
emit "fi\n";
}
}
@@ -180,13 +198,17 @@ sub setup_source_routing( $ ) {
save_progress_message 'Setting up Accept Source Routing...';
for my $interface ( @$interfaces ) {
my $file = "/proc/sys/net/ipv$family/conf/$interface/accept_source_route";
my $value = get_interface_option $interface, 'sourceroute';
my $optional = interface_is_optional $interface;
$interface = get_physical $interface;
my $file = "/proc/sys/net/ipv$family/conf/$interface/accept_source_route";
emit ( "if [ -f $file ]; then" ,
" echo $value > $file" );
emit ( 'else' ,
" error_message \"WARNING: Cannot set Accept Source Routing on $interface\"" ) unless interface_is_optional( $interface);
" error_message \"WARNING: Cannot set Accept Source Routing on $interface\"" ) unless $optional;
emit "fi\n";
}
}
@@ -227,13 +249,17 @@ sub setup_forwarding( $$ ) {
save_progress_message 'Setting up IPv6 Interface Forwarding...';
for my $interface ( @$interfaces ) {
my $file = "/proc/sys/net/ipv6/conf/$interface/forwarding";
my $value = get_interface_option $interface, 'forward';
my $optional = interface_is_optional $interface;
$interface = get_physical $interface;
my $file = "/proc/sys/net/ipv6/conf/$interface/forwarding";
emit ( "if [ -f $file ]; then" ,
" echo $value > $file" );
emit ( 'else' ,
" error_message \"WARNING: Cannot set IPv6 forwarding on $interface\"" ) unless interface_is_optional( $interface);
" error_message \"WARNING: Cannot set IPv6 forwarding on $interface\"" ) unless $optional;
emit "fi\n";
}

View File

@@ -3,7 +3,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008,2009 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
@@ -35,7 +35,7 @@ use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw( setup_providers @routemarked_interfaces handle_stickiness handle_optional_interfaces );
our @EXPORT_OK = qw( initialize lookup_provider );
our $VERSION = '4.4_0';
our $VERSION = '4.4_13';
use constant { LOCAL_TABLE => 255,
MAIN_TABLE => 254,
@@ -59,17 +59,20 @@ our @providers;
our $family;
our $lastmark;
use constant { ROUTEMARKED_SHARED => 1, ROUTEMARKED_UNSHARED => 2 };
#
# Initialize globals -- we take this novel approach to globals initialization to allow
# the compiler to run multiple times in the same process. The
# initialize() function does globals initialization for this
# module and is called from an INIT block below. The function is
# also called by Shorewall::Compiler::compiler at the beginning of
# the second and subsequent calls to that function.
# Rather than initializing globals in an INIT block or during declaration,
# we initialize them in a function. This is done for two reasons:
#
# 1. Proper initialization depends on the address family which isn't
# known until the compiler has started.
#
# 2. The compiler can run multiple times in the same process so it has to be
# able to re-initialize its dependent modules' state.
#
sub initialize( $ ) {
$family = shift;
@@ -89,17 +92,13 @@ sub initialize( $ ) {
@providers = ();
}
INIT {
initialize( F_IPV4 );
}
#
# Set up marking for 'tracked' interfaces.
#
sub setup_route_marking() {
my $mask = $config{HIGH_ROUTE_MARKS} ? $config{WIDE_TC_MARKS} ? '0xFF0000' : '0xFF00' : '0xFF';
my $mask = in_hex( $globals{PROVIDER_MASK} );
require_capability( $_ , 'the provider \'track\' option' , 's' ) for qw/CONNMARK_MATCH CONNMARK/;
require_capability( $_ , q(The provider 'track' option) , 's' ) for qw/CONNMARK_MATCH CONNMARK/;
add_rule $mangle_table->{$_} , "-m connmark ! --mark 0/$mask -j CONNMARK --restore-mark --mask $mask" for qw/PREROUTING OUTPUT/;
@@ -111,33 +110,21 @@ sub setup_route_marking() {
for my $providerref ( @routemarked_providers ) {
my $interface = $providerref->{interface};
my $physical = $providerref->{physical};
my $mark = $providerref->{mark};
my $base = uc chain_base $interface;
if ( $providerref->{optional} ) {
if ( $providerref->{shared} ) {
add_commands( $chainref, qq(if [ interface_is_usable $interface -a -n "$providerref->{mac}" ]; then) );
} else {
add_commands( $chainref, qq(if [ -n "\$${base}_IS_USABLE" ]; then) );
}
incr_cmd_level( $chainref );
}
unless ( $marked_interfaces{$interface} ) {
add_rule $mangle_table->{PREROUTING} , "-i $interface -m mark --mark 0/$mask -j routemark";
add_jump $mangle_table->{PREROUTING} , $chainref1, 0, "! -i $interface -m mark --mark $mark/$mask ";
add_jump $mangle_table->{PREROUTING} , $chainref, 0, "-i $physical -m mark --mark 0/$mask ";
add_jump $mangle_table->{PREROUTING} , $chainref1, 0, "! -i $physical -m mark --mark $mark/$mask ";
add_jump $mangle_table->{OUTPUT} , $chainref2, 0, "-m mark --mark $mark/$mask ";
$marked_interfaces{$interface} = 1;
}
if ( $providerref->{shared} ) {
add_rule $chainref, " -i $interface -m mac --mac-source $providerref->{mac} -j MARK --set-mark $providerref->{mark}";
add_rule $chainref, match_source_dev( $interface ) . "-m mac --mac-source $providerref->{mac} -j MARK --set-mark $providerref->{mark}";
} else {
add_rule $chainref, " -i $interface -j MARK --set-mark $providerref->{mark}";
add_rule $chainref, match_source_dev( $interface ) . "-j MARK --set-mark $providerref->{mark}";
}
decr_cmd_level( $chainref), add_commands( $chainref, "fi" ) if $providerref->{optional};
}
add_rule $chainref, "-m mark ! --mark 0/$mask -j CONNMARK --save-mark --mask $mask";
@@ -145,11 +132,15 @@ sub setup_route_marking() {
sub copy_table( $$$ ) {
my ( $duplicate, $number, $realm ) = @_;
#
# Hack to work around problem in iproute
#
my $filter = $family == F_IPV6 ? q(sed 's/ via :: / /' | ) : '';
if ( $realm ) {
emit ( "\$IP -$family route show table $duplicate | sed -r 's/ realm [[:alnum:]_]+//' | while read net route; do" )
} else {
emit ( "\$IP -$family route show table $duplicate | while read net route; do" )
emit ( "\$IP -$family route show table $duplicate | ${filter}while read net route; do" )
}
emit ( ' case $net in',
@@ -165,11 +156,23 @@ sub copy_table( $$$ ) {
sub copy_and_edit_table( $$$$ ) {
my ( $duplicate, $number, $copy, $realm) = @_;
#
# Hack to work around problem in iproute
#
my $filter = $family == F_IPV6 ? q(sed 's/ via :: / /' | ) : '';
#
# Map physical names in $copy to logical names
#
$copy = join( '|' , map( physical_name($_) , split( ',' , $copy ) ) );
#
# Shell and iptables use a different wildcard character
#
$copy =~ s/\+/*/;
if ( $realm ) {
emit ( "\$IP -$family route show table $duplicate | sed -r 's/ realm [[:alnum:]_]+//' | while read net route; do" )
emit ( "\$IP -$family route show table $duplicate | sed -r 's/ realm [[:alnum:]]+//' | while read net route; do" )
} else {
emit ( "\$IP -$family route show table $duplicate | while read net route; do" )
emit ( "\$IP -$family route show table $duplicate | ${filter}while read net route; do" )
}
emit ( ' case $net in',
@@ -272,10 +275,11 @@ sub add_a_provider( ) {
require_capability 'REALM_MATCH', "Configuring multiple providers through one interface", "s";
}
fatal_error "Unknown Interface ($interface)" unless known_interface $interface;
fatal_error "Unknown Interface ($interface)" unless known_interface( $interface, 1 );
fatal_error "A bridge port ($interface) may not be configured as a provider interface" if port_to_bridge $interface;
my $provider = chain_base $table;
my $base = uc chain_base $interface;
my $physical = get_physical $interface;
my $base = uc chain_base $physical;
my $gatewaycase = '';
if ( $gateway eq 'detect' ) {
@@ -291,40 +295,15 @@ sub add_a_provider( ) {
$gateway = '';
}
my $val = 0;
my $pref;
if ( $mark ne '-' ) {
$val = numeric_value $mark;
fatal_error "Invalid Mark Value ($mark)" unless defined $val;
verify_mark $mark;
if ( $val < 65535 ) {
if ( $config{HIGH_ROUTE_MARKS} ) {
fatal_error "Invalid Mark Value ($mark) with HIGH_ROUTE_MARKS=Yes and WIDE_TC_MARKS=Yes" if $config{WIDE_TC_MARKS};
fatal_error "Invalid Mark Value ($mark) with HIGH_ROUTE_MARKS=Yes" if $val < 256;
}
} else {
fatal_error "Invalid Mark Value ($mark)" unless $config{HIGH_ROUTE_MARKS} && $config{WIDE_TC_MARKS};
}
for my $providerref ( values %providers ) {
fatal_error "Duplicate mark value ($mark)" if numeric_value( $providerref->{mark} ) == $val;
}
$pref = 10000 + $number - 1;
}
my ( $loose, $track, $balance , $default, $default_balance, $optional, $mtu ) = (0,0,0,0,$config{USE_DEFAULT_RT} ? 1 : 0,interface_is_optional( $interface ), '' );
my ( $loose, $track, $balance , $default, $default_balance, $optional, $mtu, $local ) =
(0, $config{TRACK_PROVIDERS}, 0 , 0, $config{USE_DEFAULT_RT} ? 1 : 0, interface_is_optional( $interface ), '' , 0 );
unless ( $options eq '-' ) {
for my $option ( split_list $options, 'option' ) {
if ( $option eq 'track' ) {
$track = 1;
} elsif ( $option eq 'notrack' ) {
$track = 0;
} elsif ( $option =~ /^balance=(\d+)$/ ) {
fatal_error q('balance' is not available in IPv6) if $family == F_IPV6;
$balance = $1;
@@ -358,12 +337,43 @@ sub add_a_provider( ) {
} else {
$default = -1;
}
} elsif ( $option eq 'local' ) {
$local = 1;
$track = 0 if $config{TRACK_PROVIDERS};
$default_balance = 0 if$config{USE_DEFAULT_RT};
} else {
fatal_error "Invalid option ($option)";
}
}
}
my $val = 0;
my $pref;
$mark = ( $lastmark += ( 1 << $config{PROVIDER_OFFSET} ) ) if $mark eq '-' && $track;
if ( $mark ne '-' ) {
$val = numeric_value $mark;
fatal_error "Invalid Mark Value ($mark)" unless defined $val && $val;
verify_mark $mark;
fatal_error "Invalid Mark Value ($mark)" unless ( $val & $globals{PROVIDER_MASK} ) == $val;
fatal_error "Provider MARK may not be specified when PROVIDER_BITS=0" unless $config{PROVIDER_BITS};
for my $providerref ( values %providers ) {
fatal_error "Duplicate mark value ($mark)" if numeric_value( $providerref->{mark} ) == $val;
}
$pref = 10000 + $number - 1;
$lastmark = $val;
}
unless ( $loose ) {
warning_message q(The 'proxyarp' option is dangerous when specified on a Provider interface) if get_interface_option( $interface, 'proxyarp' );
warning_message q(The 'proxyndp' option is dangerous when specified on a Provider interface) if get_interface_option( $interface, 'proxyndp' );
@@ -375,6 +385,7 @@ sub add_a_provider( ) {
number => $number ,
mark => $val ? in_hex($val) : $val ,
interface => $interface ,
physical => $physical ,
optional => $optional ,
gateway => $gateway ,
gatewaycase => $gatewaycase ,
@@ -402,26 +413,34 @@ sub add_a_provider( ) {
if ( $shared ) {
my $variable = $providers{$table}{mac} = get_interface_mac( $gateway, $interface , $table );
$realm = "realm $number";
start_provider( $table, $number, qq(if interface_is_usable $interface && [ -n "$variable" ]; then) );
start_provider( $table, $number, qq(if interface_is_usable $physical && [ -n "$variable" ]; then) );
} else {
if ( $optional ) {
start_provider( $table, $number, qq(if [ -n "\$${base}_IS_USABLE" ]; then) );
start_provider( $table, $number, qq(if [ -n "\$SW_${base}_IS_USABLE" ]; then) );
} elsif ( $gatewaycase eq 'detect' ) {
start_provider( $table, $number, qq(if interface_is_usable $interface && [ -n "$gateway" ]; then) );
start_provider( $table, $number, qq(if interface_is_usable $physical && [ -n "$gateway" ]; then) );
} else {
start_provider( $table, $number, "if interface_is_usable $interface; then" );
start_provider( $table, $number, "if interface_is_usable $physical; then" );
}
$provider_interfaces{$interface} = $table;
emit "run_ip route add default dev $interface table $number" if $gatewaycase eq 'none';
if ( $gatewaycase eq 'none' ) {
if ( $local ) {
emit "run_ip route add local 0.0.0.0/0 dev $physical table $number";
} else {
emit "run_ip route add default dev $physical table $number";
}
}
}
if ( $mark ne '-' ) {
emit ( "qt \$IP -$family rule del fwmark $mark" ) if $config{DELETE_THEN_ADD};
my $mask = have_capability 'FWMARK_RT_MASK' ? '/' . in_hex $globals{PROVIDER_MASK} : '';
emit ( "run_ip rule add fwmark $mark pref $pref table $number",
"echo \"qt \$IP -$family rule del fwmark $mark\" >> \${VARDIR}/undo_routing"
emit ( "qt \$IP -$family rule del fwmark ${mark}${mask}" ) if $config{DELETE_THEN_ADD};
emit ( "run_ip rule add fwmark ${mark}${mask} pref $pref table $number",
"echo \"qt \$IP -$family rule del fwmark ${mark}${mask}\" >> \${VARDIR}/undo_routing"
);
}
@@ -433,8 +452,7 @@ sub add_a_provider( ) {
if ( $copy eq 'none' ) {
$copy = $interface;
} else {
$copy =~ tr/,/|/;
$copy = "$interface|$copy";
$copy = "$interface,$copy";
}
copy_and_edit_table( $duplicate, $number ,$copy , $realm);
@@ -446,28 +464,33 @@ sub add_a_provider( ) {
if ( $gateway ) {
$address = get_interface_address $interface unless $address;
emit "run_ip route replace $gateway src $address dev $interface ${mtu}table $number $realm";
emit "run_ip route add default via $gateway src $address dev $interface ${mtu}table $number $realm";
emit "run_ip route replace $gateway src $address dev $physical ${mtu}table $number $realm";
emit "run_ip route add default via $gateway src $address dev $physical ${mtu}table $number $realm";
}
balance_default_route $balance , $gateway, $interface, $realm if $balance;
balance_default_route $balance , $gateway, $physical, $realm if $balance;
if ( $default > 0 ) {
balance_fallback_route $default , $gateway, $interface, $realm;
balance_fallback_route $default , $gateway, $physical, $realm;
} elsif ( $default ) {
emit '';
if ( $gateway ) {
emit qq(run_ip route replace default via $gateway src $address dev $interface table ) . DEFAULT_TABLE . qq( dev $interface metric $number);
emit qq(echo "qt \$IP route del default via $gateway table ) . DEFAULT_TABLE . qq(" >> \${VARDIR}/undo_routing);
emit qq(run_ip route replace default via $gateway src $address dev $physical table ) . DEFAULT_TABLE . qq( metric $number);
emit qq(echo "qt \$IP -$family route del default via $gateway table ) . DEFAULT_TABLE . qq(" >> \${VARDIR}/undo_routing);
} else {
emit qq(run_ip route add default table ) . DEFAULT_TABLE . qq( dev $interface metric $number);
emit qq(echo "qt \$IP route del default dev $interface table ) . DEFAULT_TABLE . qq(" >> \${VARDIR}/undo_routing);
emit qq(run_ip route add default table ) . DEFAULT_TABLE . qq( dev $physical metric $number);
emit qq(echo "qt \$IP -$family route del default dev $physical table ) . DEFAULT_TABLE . qq(" >> \${VARDIR}/undo_routing);
}
}
if ( $loose ) {
if ( $local ) {
fatal_error "GATEWAY not valid with 'local' provider" unless $gatewaycase eq 'none';
fatal_error "'track' not valid with 'local'" if $track;
fatal_error "DUPLICATE not valid with 'local'" if $duplicate ne '-';
fatal_error "MARK required with 'local'" unless $mark;
} elsif ( $loose ) {
if ( $config{DELETE_THEN_ADD} ) {
emit ( "\nfind_interface_addresses $interface | while read address; do",
emit ( "\nfind_interface_addresses $physical | while read address; do",
" qt \$IP -$family rule del from \$address",
'done'
);
@@ -481,7 +504,7 @@ sub add_a_provider( ) {
emit "\nrulenum=0\n";
emit ( "find_interface_addresses $interface | while read address; do" );
emit ( "find_interface_addresses $physical | while read address; do" );
emit ( " qt \$IP -$family rule del from \$address" ) if $config{DELETE_THEN_ADD};
emit ( " run_ip rule add from \$address pref \$(( $rulebase + \$rulenum )) table $number",
" echo \"qt \$IP -$family rule del from \$address\" >> \${VARDIR}/undo_routing",
@@ -497,15 +520,15 @@ sub add_a_provider( ) {
if ( $optional ) {
if ( $shared ) {
emit ( " error_message \"WARNING: Interface $interface is not usable -- Provider $table ($number) not Added\"" );
} else {
emit ( " error_message \"WARNING: Gateway $gateway is not reachable -- Provider $table ($number) not Added\"" );
} else {
emit ( " error_message \"WARNING: Interface $physical is not usable -- Provider $table ($number) not Added\"" );
}
} else {
if ( $shared ) {
emit( " fatal_error \"Gateway $gateway is not reachable -- Provider $table ($number) Cannot be Added\"" );
} else {
emit( " fatal_error \"Interface $interface is not usable -- Provider $table ($number) Cannot be Added\"" );
emit( " fatal_error \"Interface $physical is not usable -- Provider $table ($number) Cannot be Added\"" );
}
}
@@ -516,9 +539,32 @@ sub add_a_provider( ) {
progress_message " Provider \"$currentline\" $done";
}
#
# Begin an 'if' statement testing whether the passed interface is available
#
sub start_new_if( $ ) {
our $current_if = shift;
emit ( '', qq(if [ -n "\$SW_${current_if}_IS_USABLE" ]; then) );
push_indent;
}
#
# Complete any current 'if' statement in the output script
#
sub finish_current_if() {
if ( our $current_if ) {
pop_indent;
emit ( "fi\n" );
$current_if = '';
}
}
sub add_an_rtrule( ) {
my ( $source, $dest, $provider, $priority ) = split_line 4, 4, 'route_rules file';
our $current_if;
unless ( $providers{$provider} ) {
my $found = 0;
@@ -553,6 +599,7 @@ sub add_an_rtrule( ) {
( my $interface, $source , my $remainder ) = split( /:/, $source, 3 );
fatal_error "Invalid SOURCE" if defined $remainder;
validate_net ( $source, 0 );
$interface = physical_name $interface;
$source = "iif $interface from $source";
} elsif ( $source =~ /\..*\..*/ ) {
validate_net ( $source, 0 );
@@ -560,9 +607,10 @@ sub add_an_rtrule( ) {
} else {
$source = "iif $source";
}
} elsif ( $source =~ /^(.+?):<(.+)>\s*$/ ) {
} elsif ( $source =~ /^(.+?):<(.+)>\s*$/ || $source =~ /^(.+?):\[(.+)\]\s*$/ ) {
my ($interface, $source ) = ($1, $2);
validate_net ($source, 0);
$interface = physical_name $interface;
$source = "iif $interface from $source";
} elsif ( $source =~ /:.*:/ || $source =~ /\..*\..*/ ) {
validate_net ( $source, 0 );
@@ -575,21 +623,21 @@ sub add_an_rtrule( ) {
$priority = "priority $priority";
emit ( "qt \$IP -$family rule del $source $dest $priority" ) if $config{DELETE_THEN_ADD};
finish_current_if, emit ( "qt \$IP -$family rule del $source $dest $priority" ) if $config{DELETE_THEN_ADD};
my ( $optional, $number ) = ( $providers{$provider}{optional} , $providers{$provider}{number} );
if ( $optional ) {
my $base = uc chain_base( $providers{$provider}{interface} );
emit ( '', "if [ -n \$${base}_IS_USABLE ]; then" );
push_indent;
my $base = uc chain_base( $providers{$provider}{physical} );
finish_current_if if $base ne $current_if;
start_new_if( $base ) unless $current_if;
} else {
finish_current_if;
}
emit ( "run_ip rule add $source $dest $priority table $number",
"echo \"qt \$IP -$family rule del $source $dest $priority\" >> \${VARDIR}/undo_routing" );
pop_indent, emit ( "fi\n" ) if $optional;
progress_message " Routing rule \"$currentline\" $done";
}
@@ -707,12 +755,14 @@ sub finish_providers() {
sub setup_providers() {
my $providers = 0;
$lastmark = 0;
my $fn = open_file 'providers';
first_entry sub() {
emit "\nif [ -z \"\$NOROUTES\" ]; then";
push_indent;
progress_message2 "$doing $fn...";
emit "\nif [ -z \"\$g_noroutes\" ]; then";
push_indent;
start_providers; };
add_a_provider, $providers++ while read_a_line;
@@ -723,25 +773,28 @@ sub setup_providers() {
my $fn = open_file 'route_rules';
if ( $fn ) {
our $current_if = '';
first_entry "$doing $fn...";
emit '';
add_an_rtrule while read_a_line;
finish_current_if;
}
setup_null_routing if $config{NULL_ROUTE_RFC1918};
emit "\nrun_ip route flush cache";
#
# This completes the if block begun in the first_entry closure
# This completes the if-block begun in the first_entry closure above
#
pop_indent;
emit "fi\n";
setup_route_marking if @routemarked_interfaces;
} else {
emit "\nif [ -z \"\$NOROUTES\" ]; then";
emit "\nif [ -z \"\$g_noroutes\" ]; then";
push_indent;
@@ -784,45 +837,133 @@ sub lookup_provider( $ ) {
}
#
# This function is called by the compiler when it is generating the initialize() function.
# The function emits code to set the ..._IS_USABLE interface variables appropriately for the
# optional interfaces
# This function is called by the compiler when it is generating the detect_configuration() function.
# The function calls Shorewall::Zones::verify_required_interfaces then emits code to set the
# ..._IS_USABLE interface variables appropriately for the optional interfaces
#
sub handle_optional_interfaces() {
# Returns true if there were required or optional interfaces
#
sub handle_optional_interfaces( $ ) {
my $interfaces = find_interfaces_by_option 'optional';
my ( $interfaces, $wildcards ) = find_interfaces_by_option1 'optional';
if ( @$interfaces ) {
for my $interface ( @$interfaces ) {
my $base = uc chain_base( $interface );
my $provider = $provider_interfaces{$interface};
my $require = $config{REQUIRE_INTERFACE};
verify_required_interfaces( shift );
emit( 'HAVE_INTERFACE=', '' ) if $require;
#
# Clear the '_IS_USABLE' variables
#
emit( join( '_', 'SW', uc chain_base( get_physical( $_ ) ) , 'IS_USABLE=' ) ) for @$interfaces;
if ( $wildcards ) {
#
# We must consider all interfaces with an address in $family -- generate a list of such addresses.
#
emit( '',
'for interface in $(find_all_interfaces1); do',
);
push_indent;
emit ( 'case "$interface" in' );
push_indent;
} else {
emit '';
}
if ( $provider ) {
#
# This interface is associated with a non-shared provider -- get the provider table entry
#
for my $interface ( grep $provider_interfaces{$_}, @$interfaces ) {
my $provider = $provider_interfaces{$interface};
my $physical = get_physical $interface;
my $base = uc chain_base( $physical );
my $providerref = $providers{$provider};
emit( "$physical)" ), push_indent if $wildcards;
if ( $providerref->{gatewaycase} eq 'detect' ) {
emit qq(if interface_is_usable $interface && [ -n "$providerref->{gateway}" ]; then);
emit qq(if interface_is_usable $physical && [ -n "$providerref->{gateway}" ]; then);
} else {
emit qq(if interface_is_usable $interface; then);
}
} else {
#
# Not a provider interface
#
emit qq(if interface_is_usable $interface; then);
emit qq(if interface_is_usable $physical; then);
}
emit( " ${base}_IS_USABLE=Yes" ,
'else' ,
" ${base}_IS_USABLE=" ,
emit( ' HAVE_INTERFACE=Yes' ) if $require;
emit( " SW_${base}_IS_USABLE=Yes" ,
'fi' );
emit( ';;' ), pop_indent if $wildcards;
}
for my $interface ( grep ! $provider_interfaces{$_}, @$interfaces ) {
my $physical = get_physical $interface;
my $base = uc chain_base( $physical );
my $case = $physical;
my $wild = $case =~ s/\+$/*/;
if ( $wildcards ) {
emit( "$case)" );
push_indent;
if ( $wild ) {
emit( qq(if [ -z "\$SW_${base}_IS_USABLE" ]; then) );
push_indent;
emit ( 'if interface_is_usable $interface; then' );
} else {
emit ( "if interface_is_usable $physical; then" );
}
} else {
emit ( "if interface_is_usable $physical; then" );
}
emit ( ' HAVE_INTERFACE=Yes' ) if $require;
emit ( " SW_${base}_IS_USABLE=Yes" ,
'fi' );
if ( $wildcards ) {
pop_indent, emit( 'fi' ) if $wild;
emit( ';;' );
pop_indent;
}
}
if ( $wildcards ) {
emit( '*)' ,
' ;;'
);
pop_indent;
emit( 'esac' );
pop_indent;
emit('done' );
}
if ( $require ) {
emit( '',
'if [ -z "$HAVE_INTERFACE" ]; then' ,
' case "$COMMAND" in',
' start|restart|restore|refresh)'
);
if ( $family == F_IPV4 ) {
emit( ' if shorewall_is_started; then' );
} else {
emit( ' if shorewall6_is_started; then' );
}
emit( ' fatal_error "No network interface available"',
' else',
' startup_error "No network interface available"',
' fi',
' ;;',
' esac',
'fi'
);
}
return 1;
}
verify_required_interfaces( shift );
}
#
@@ -831,7 +972,7 @@ sub handle_optional_interfaces() {
#
sub handle_stickiness( $ ) {
my $havesticky = shift;
my $mask = $config{HIGH_ROUTE_MARKS} ? $config{WIDE_TC_MARKS} ? '0xFF0000' : '0xFF00' : '0xFF';
my $mask = in_hex( $globals{PROVIDER_MASK} );
my $setstickyref = $mangle_table->{setsticky};
my $setstickoref = $mangle_table->{setsticko};
my $tcpreref = $mangle_table->{tcpre};
@@ -842,9 +983,8 @@ sub handle_stickiness( $ ) {
if ( $havesticky ) {
fatal_error "There are SAME tcrules but no 'track' providers" unless @routemarked_providers;
for my $providerref ( @routemarked_providers ) {
my $interface = $providerref->{interface};
my $interface = $providerref->{physical};
my $base = uc chain_base $interface;
my $mark = $providerref->{mark};
@@ -854,9 +994,6 @@ sub handle_stickiness( $ ) {
my $list = sprintf "sticky%03d" , $sticky++;
for my $chainref ( $stickyref, $setstickyref ) {
add_commands( $chainref, qq(if [ -n "\$${base}_IS_USABLE" ]; then) ), incr_cmd_level( $chainref ) if $providerref->{optional};
if ( $chainref->{name} eq 'sticky' ) {
$rule1 = $_;
$rule1 =~ s/-j sticky/-m recent --name $list --update --seconds 300 -j MARK --set-mark $mark/;
@@ -867,17 +1004,14 @@ sub handle_stickiness( $ ) {
$rule1 =~ s/-j sticky/-m mark --mark $mark\/$mask -m recent --name $list --set/;
}
$rule1 =~ s/-A //;
$rule1 =~ s/-A tcpre //;
add_rule $chainref, $rule1;
if ( $rule2 ) {
$rule2 =~ s/-A //;
$rule2 =~ s/-A tcpre //;
add_rule $chainref, $rule2;
}
decr_cmd_level( $chainref), add_commands( $chainref, "fi" ) if $providerref->{optional};
}
}
@@ -887,8 +1021,6 @@ sub handle_stickiness( $ ) {
my $stickoref = ensure_mangle_chain 'sticko';
for my $chainref ( $stickoref, $setstickoref ) {
add_commands( $chainref, qq(if [ -n "\$${base}_IS_USABLE" ]; then) ), incr_cmd_level( $chainref ) if $providerref->{optional};
if ( $chainref->{name} eq 'sticko' ) {
$rule1 = $_;
$rule1 =~ s/-j sticko/-m recent --name $list --rdest --update --seconds 300 -j MARK --set-mark $mark/;
@@ -899,24 +1031,23 @@ sub handle_stickiness( $ ) {
$rule1 =~ s/-j sticko/-m mark --mark $mark -m recent --name $list --rdest --set/;
}
$rule1 =~ s/-A //;
$rule1 =~ s/-A tcout //;
add_rule $chainref, $rule1;
if ( $rule2 ) {
$rule2 =~ s/-A //;
$rule2 =~ s/-A tcout //;
add_rule $chainref, $rule2;
}
decr_cmd_level( $chainref), add_commands( $chainref, "fi" ) if $providerref->{optional};
}
}
}
}
if ( @routemarked_providers ) {
purge_jump $mangle_table->{PREROUTING}, $setstickyref unless @{$setstickyref->{rules}};
purge_jump $mangle_table->{OUTPUT}, $setstickoref unless @{$setstickoref->{rules}};
delete_jumps $mangle_table->{PREROUTING}, $setstickyref unless @{$setstickyref->{rules}};
delete_jumps $mangle_table->{OUTPUT}, $setstickoref unless @{$setstickoref->{rules}};
}
}
1;

View File

@@ -35,30 +35,27 @@ our @EXPORT = qw(
);
our @EXPORT_OK = qw( initialize );
our $VERSION = '4.3_7';
our $VERSION = '4.4_9';
our @proxyarp;
our $family;
#
# Initialize globals -- we take this novel approach to globals initialization to allow
# the compiler to run multiple times in the same process. The
# initialize() function does globals initialization for this
# module and is called from an INIT block below. The function is
# also called by Shorewall::Compiler::compiler at the beginning of
# the second and subsequent calls to that function.
# Rather than initializing globals in an INIT block or during declaration,
# we initialize them in a function. This is done for two reasons:
#
# 1. Proper initialization depends on the address family which isn't
# known until the compiler has started.
#
# 2. The compiler can run multiple times in the same process so it has to be
# able to re-initialize its dependent modules' state.
#
sub initialize( $ ) {
$family = shift;
@proxyarp = ();
}
INIT {
initialize( F_IPV4 );
}
sub setup_one_proxy_arp( $$$$$ ) {
my ( $address, $interface, $external, $haveroute, $persistent) = @_;
@@ -79,7 +76,7 @@ sub setup_one_proxy_arp( $$$$$ ) {
}
unless ( $haveroute ) {
emit "[ -n \"\$NOROUTES\" ] || run_ip route replace $address dev $interface";
emit "[ -n \"\$g_noroutes\" ] || run_ip route replace $address dev $interface";
$haveroute = 1 if $persistent;
}
@@ -120,6 +117,9 @@ sub setup_proxy_arp() {
$first_entry = 0;
}
$interface = get_physical $interface;
$external = get_physical $external;
$set{$interface} = 1;
$reset{$external} = 1 unless $set{$external};
@@ -146,10 +146,14 @@ sub setup_proxy_arp() {
for my $interface ( @$interfaces ) {
my $value = get_interface_option $interface, 'proxyarp';
my $optional = interface_is_optional $interface;
$interface = get_physical $interface;
emit ( "if [ -f /proc/sys/net/ipv4/conf/$interface/proxy_arp ] ; then" ,
" echo $value > /proc/sys/net/ipv4/conf/$interface/proxy_arp" );
emit ( 'else' ,
" error_message \"WARNING: Unable to set/reset proxy ARP on $interface\"" ) unless interface_is_optional( $interface );
" error_message \"WARNING: Unable to set/reset proxy ARP on $interface\"" ) unless $optional;
emit "fi\n";
}
}
@@ -161,10 +165,14 @@ sub setup_proxy_arp() {
for my $interface ( @$interfaces ) {
my $value = get_interface_option $interface, 'proxyndp';
my $optional = interface_is_optional $interface;
$interface = get_physical $interface;
emit ( "if [ -f /proc/sys/net/ipv6/conf/$interface/proxy_ndp ] ; then" ,
" echo $value > /proc/sys/net/ipv6/conf/$interface/proxy_ndp" );
emit ( 'else' ,
" error_message \"WARNING: Unable to set/reset Proxy NDP on $interface\"" ) unless interface_is_optional( $interface );
" error_message \"WARNING: Unable to set/reset Proxy NDP on $interface\"" ) unless $optional;
emit "fi\n";
}
}

View File

@@ -34,7 +34,7 @@ use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw( setup_notrack );
our @EXPORT_OK = qw( );
our $VERSION = '4.3_7';
our $VERSION = '4.4_13';
#
# Notrack
@@ -50,9 +50,9 @@ sub process_notrack_rule( $$$$$$ ) {
( my $zone, $source) = split /:/, $source, 2;
my $zoneref = find_zone $zone;
my $chainref = ensure_raw_chain( notrack_chain $zone );
my $restriction = $zone eq firewall_zone ? OUTPUT_RESTRICT : PREROUTE_RESTRICT;
my $restriction = $zoneref->{type} == FIREWALL || $zoneref->{type} == VSERVER ? OUTPUT_RESTRICT : PREROUTE_RESTRICT;
fatal_error 'USER/GROUP is not allowed unless the SOURCE zone is $FW' if $user ne '-' && $restriction != OUTPUT_RESTRICT;
fatal_error 'USER/GROUP is not allowed unless the SOURCE zone is $FW or a Vserver zone' if $user ne '-' && $restriction != OUTPUT_RESTRICT;
require_capability 'RAW_TABLE', 'Notrack rules', '';
my $rule = do_proto( $proto, $ports, $sports ) . do_user ( $user );
@@ -64,7 +64,7 @@ sub process_notrack_rule( $$$$$$ ) {
$source ,
$dest ,
'' ,
'-j NOTRACK' ,
'NOTRACK' ,
'' ,
'NOTRACK' ,
'' ;

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008,2009 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Traffic Control is from tc4shorewall Version 0.5
# (c) 2005 Arne Bernin <arne@ucbering.de>
@@ -40,7 +40,7 @@ use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw( setup_tc );
our @EXPORT_OK = qw( process_tc_rule initialize );
our $VERSION = '4.3_12';
our $VERSION = '4.4_13';
our %tcs = ( T => { chain => 'tcpost',
connmark => 0,
@@ -79,48 +79,6 @@ use constant { NOMARK => 0 ,
HIGHMARK => 2
};
our @tccmd = ( { match => sub ( $ ) { $_[0] eq 'SAVE' } ,
target => 'CONNMARK --save-mark --mask' ,
mark => SMALLMARK ,
mask => '0xFF' ,
connmark => 1
} ,
{ match => sub ( $ ) { $_[0] eq 'RESTORE' },
target => 'CONNMARK --restore-mark --mask' ,
mark => SMALLMARK ,
mask => '0xFF' ,
connmark => 1
} ,
{ match => sub ( $ ) { $_[0] eq 'CONTINUE' },
target => 'RETURN' ,
mark => NOMARK ,
mask => '' ,
connmark => 0
} ,
{ match => sub ( $ ) { $_[0] eq 'SAME' },
target => 'sticky' ,
mark => NOMARK ,
mask => '' ,
connmark => 0
} ,
{ match => sub ( $ ) { $_[0] =~ /^IPMARK/ },
target => 'IPMARK' ,
mark => NOMARK,
mask => '',
connmark => 0
} ,
{ match => sub ( $ ) { $_[0] =~ '\|.*'} ,
target => 'MARK --or-mark' ,
mark => HIGHMARK ,
mask => '' } ,
{ match => sub ( $ ) { $_[0] =~ '&.*' },
target => 'MARK --and-mark ' ,
mark => HIGHMARK ,
mask => '' ,
connmark => 0
}
);
our %flow_keys = ( 'src' => 1,
'dst' => 1,
'proto' => 1,
@@ -153,7 +111,7 @@ our @deferred_rules;
#
# TCDevices Table
#
# %tcdevices { <interface> -> {in_bandwidth => <value> ,
# %tcdevices { <interface> => {in_bandwidth => <value> ,
# out_bandwidth => <value> ,
# number => <number>,
# classify => 0|1
@@ -163,6 +121,8 @@ our @deferred_rules;
# nextclass => <number>
# occurs => Has one or more occurring classes
# qdisc => htb|hfsc
# guarantee => <total RATE of classes seen so far>
# name => <interface>
# }
#
our @tcdevices;
@@ -170,7 +130,7 @@ our %tcdevices;
our @devnums;
our $devnum;
our $sticky;
our $ipp2p;
#
# TCClasses Table
@@ -186,6 +146,7 @@ our $sticky;
# occurs => <number> # 0 means that this is a class generated by another class with occurs > 1
# parent => <class number>
# leaf => 0|1
# guarantee => <sum of rates of sub-classes>
# options => { tos => [ <value1> , <value2> , ... ];
# tcp_ack => 1 ,
# ...
@@ -202,14 +163,15 @@ our %restrictions = ( tcpre => PREROUTE_RESTRICT ,
our $family;
#
# Initialize globals -- we take this novel approach to globals initialization to allow
# the compiler to run multiple times in the same process. The
# initialize() function does globals initialization for this
# module and is called from an INIT block below. The function is
# also called by Shorewall::Compiler::compiler at the beginning of
# the second and subsequent calls to that function.
# Rather than initializing globals in an INIT block or during declaration,
# we initialize them in a function. This is done for two reasons:
#
# 1. Proper initialization depends on the address family which isn't
# known until the compiler has started.
#
# 2. The compiler can run multiple times in the same process so it has to be
# able to re-initialize its dependent modules' state.
#
sub initialize( $ ) {
$family = shift;
%classids = ();
@@ -221,15 +183,14 @@ sub initialize( $ ) {
@devnums = ();
$devnum = 0;
$sticky = 0;
}
INIT {
initialize( F_IPV4 );
$ipp2p = 0;
}
sub process_tc_rule( ) {
my ( $originalmark, $source, $dest, $proto, $ports, $sports, $user, $testval, $length, $tos , $connbytes, $helper ) = split_line1 2, 12, 'tcrules file';
our @tccmd;
if ( $originalmark eq 'COMMENT' ) {
process_comment;
return;
@@ -267,7 +228,7 @@ sub process_tc_rule( ) {
$chain = $tcsref->{chain} if $tcsref->{chain};
$target = $tcsref->{target} if $tcsref->{target};
$mark = "$mark/0xFF" if $connmark = $tcsref->{connmark};
$mark = "$mark/" . in_hex( $globals{TC_MASK} ) if $connmark = $tcsref->{connmark};
require_capability ('CONNMARK' , "CONNMARK Rules", '' ) if $connmark;
@@ -285,8 +246,6 @@ sub process_tc_rule( ) {
}
}
my $mask = 0xffff;
my ($cmd, $rest) = split( '/', $mark, 2 );
$list = '';
@@ -354,8 +313,40 @@ sub process_tc_rule( ) {
}
$target = "IPMARK --addr $srcdst --and-mask $mask1 --or-mask $mask2 --shift $shift";
} elsif ( $target eq 'TPROXY ' ) {
require_capability( 'TPROXY_TARGET', 'Use of TPROXY', 's');
fatal_error "Invalid TPROXY specification( $cmd/$rest )" if $rest;
$chain = 'tcpre';
$cmd =~ /TPROXY\((.+?)\)$/;
my $params = $1;
fatal_error "Invalid TPROXY specification( $cmd )" unless defined $params;
( $mark, my $port, my $ip, my $bad ) = split ',', $params;
fatal_error "Invalid TPROXY specification( $cmd )" if defined $bad;
if ( $port ) {
$port = validate_port( 'tcp', $port );
} else {
$port = 0;
}
$target .= "--on-port $port";
if ( defined $ip && $ip ne '' ) {
validate_address $ip, 1;
$target .= " --on-ip $ip";
}
$target .= ' --tproxy-mark';
}
if ( $rest ) {
fatal_error "Invalid MARK ($originalmark)" if $marktype == NOMARK;
@@ -376,21 +367,23 @@ sub process_tc_rule( ) {
validate_mark $mark;
if ( $config{HIGH_ROUTE_MARKS} ) {
if ( $config{PROVIDER_OFFSET} ) {
my $val = numeric_value( $cmd );
fatal_error "Invalid MARK/CLASSIFY ($cmd)" unless defined $val;
my $limit = $config{WIDE_TC_MARKS} ? 65535 : 255;
my $limit = $globals{TC_MASK};
unless ( have_capability 'FWMARK_RT_MASK' ) {
fatal_error "Marks <= $limit may not be set in the PREROUTING or OUTPUT chains when HIGH_ROUTE_MARKS=Yes"
if $cmd && ( $chain eq 'tcpre' || $chain eq 'tcout' ) && $val <= $limit;
}
}
}
}
if ( ( my $result = expand_rule( ensure_chain( 'mangle' , $chain ) ,
$restrictions{$chain} ,
do_proto( $proto, $ports, $sports) .
do_user( $user ) .
do_test( $testval, $mask ) .
do_test( $testval, $globals{TC_MASK} ) .
do_length( $length ) .
do_tos( $tos ) .
do_connbytes( $connbytes ) .
@@ -398,9 +391,9 @@ sub process_tc_rule( ) {
$source ,
$dest ,
'' ,
"-j $target $mark" ,
'' ,
"$target $mark" ,
'' ,
$target ,
'' ) )
&& $device ) {
#
@@ -440,8 +433,6 @@ sub calculate_quantum( $$ ) {
sub process_flow($) {
my $flow = shift;
$flow =~ s/^\(// if $flow =~ s/\)$//;
my @flow = split /,/, $flow;
for ( @flow ) {
@@ -451,6 +442,65 @@ sub process_flow($) {
$flow;
}
sub process_simple_device() {
my ( $device , $type , $in_bandwidth ) = split_line 1, 3, 'tcinterfaces';
fatal_error "Duplicate INTERFACE ($device)" if $tcdevices{$device};
fatal_error "Invalid INTERFACE name ($device)" if $device =~ /[:+]/;
my $number = in_hexp( $tcdevices{$device} = ++$devnum );
my $physical = physical_name $device;
my $dev = chain_base( $physical );
if ( $type ne '-' ) {
if ( lc $type eq 'external' ) {
$type = 'nfct-src';
} elsif ( lc $type eq 'internal' ) {
$type = 'dst';
} else {
fatal_error "Invalid TYPE ($type)";
}
}
$in_bandwidth = rate_to_kbit( $in_bandwidth );
emit "if interface_is_up $physical; then";
push_indent;
emit ( "${dev}_exists=Yes",
"qt \$TC qdisc del dev $physical root",
"qt \$TC qdisc del dev $physical ingress\n"
);
emit ( "run_tc qdisc add dev $physical handle ffff: ingress",
"run_tc filter add dev $physical parent ffff: protocol all prio 10 u32 match ip src 0.0.0.0/0 police rate ${in_bandwidth}kbit burst 10k drop flowid :1\n"
) if $in_bandwidth;
emit "run_tc qdisc add dev $physical root handle $number: prio bands 3 priomap $config{TC_PRIOMAP}";
for ( my $i = 1; $i <= 3; $i++ ) {
emit "run_tc qdisc add dev $physical parent $number:$i handle ${number}${i}: sfq quantum 1875 limit 127 perturb 10";
emit "run_tc filter add dev $physical protocol all parent $number: handle $i fw classid $number:$i";
emit "run_tc filter add dev $physical protocol all prio 1 parent ${number}$i: handle ${number}${i} flow hash keys $type divisor 1024" if $type ne '-' && have_capability 'FLOW_FILTER';
emit '';
}
save_progress_message_short qq(" TC Device $physical defined.");
pop_indent;
emit 'else';
push_indent;
emit qq(error_message "WARNING: Device $physical is not in the UP state -- traffic-shaping configuration skipped");
emit "${dev}_exists=";
pop_indent;
emit "fi\n";
progress_message " Simple tcdevice \"$currentline\" $done.";
}
sub validate_tc_device( ) {
my ( $device, $inband, $outband , $options , $redirected ) = split_line 3, 5, 'tcdevices';
@@ -509,7 +559,6 @@ sub validate_tc_device( ) {
if ( @redirected ) {
fatal_error "IFB devices may not have IN-BANDWIDTH" if $inband ne '-' && $inband;
$classify = 1;
}
for my $rdevice ( @redirected ) {
fatal_error "Invalid device name ($rdevice)" if $rdevice =~ /[:+]/;
@@ -517,6 +566,7 @@ sub validate_tc_device( ) {
fatal_error "REDIRECTED device ($rdevice) has not been defined in this file" unless $rdevref;
fatal_error "IN-BANDWIDTH must be zero for REDIRECTED devices" if $rdevref->{in_bandwidth} ne '0kbit';
}
}
$tcdevices{$device} = { in_bandwidth => rate_to_kbit( $inband ) . 'kbit',
out_bandwidth => rate_to_kbit( $outband ) . 'kbit',
@@ -529,6 +579,9 @@ sub validate_tc_device( ) {
default => 0,
nextclass => 2,
qdisc => $qdisc,
guarantee => 0,
name => $device,
physical => physical_name $device
} ,
push @tcdevices, $device;
@@ -538,8 +591,8 @@ sub validate_tc_device( ) {
progress_message " Tcdevice \"$currentline\" $done.";
}
sub convert_rate( $$$ ) {
my ($full, $rate, $column) = @_;
sub convert_rate( $$$$ ) {
my ($full, $rate, $column, $max) = @_;
if ( $rate =~ /\bfull\b/ ) {
$rate =~ s/\bfull\b/$full/g;
@@ -553,7 +606,7 @@ sub convert_rate( $$$ ) {
}
fatal_error "$column may not be zero" unless $rate;
fatal_error "$column ($_[1]) exceeds OUT-BANDWIDTH" if $rate > $full;
fatal_error "$column ($_[1]) exceeds $max (${full}kbit)" if $rate > $full;
$rate;
}
@@ -599,6 +652,7 @@ sub validate_tc_class( ) {
my $device = $devclass;
my $occurs = 1;
my $parentclass = 1;
my $parentref;
if ( $devclass =~ /:/ ) {
( $device, my ($number, $subnumber, $rest ) ) = split /:/, $device, 4;
@@ -631,6 +685,10 @@ sub validate_tc_class( ) {
}
my $full = rate_to_kbit $devref->{out_bandwidth};
my $ratemax = $full;
my $ceilmax = $full;
my $ratename = 'OUT-BANDWIDTH';
my $ceilname = 'OUT-BANDWIDTH';
my $tcref = $tcclasses{$device};
@@ -640,15 +698,17 @@ sub validate_tc_class( ) {
if ( $devref->{classify} ) {
warning_message "INTERFACE $device has the 'classify' option - MARK value ($mark) ignored";
} else {
fatal_error "Invalid Mark ($mark)" unless $mark =~ /^([0-9]+|0x[0-9a-fA-F]+)$/ && numeric_value( $mark ) <= 0xff;
fatal_error "MARK may not be specified when TC_BITS=0" unless $config{TC_BITS};
$markval = numeric_value( $mark );
fatal_error "Invalid MARK ($markval)" unless defined $markval;
fatal_error "Invalid Mark ($mark)" unless $markval <= $globals{TC_MAX};
if ( $classnumber ) {
fatal_error "Duplicate Class NUMBER ($classnumber)" if $tcref->{$classnumber};
} else {
$classnumber = $config{WIDE_TC_MARKS} ? $tcref->{nextclass}++ : hex_value( $devnum . $markval );
$classnumber = $config{WIDE_TC_MARKS} ? $devref->{nextclass}++ : hex_value( $devnum . $markval );
fatal_error "Duplicate MARK ($mark)" if $tcref->{$classnumber};
}
}
@@ -660,10 +720,14 @@ sub validate_tc_class( ) {
#
# Nested Class
#
my $parentref = $tcref->{$parentclass};
$parentref = $tcref->{$parentclass};
fatal_error "Unknown Parent class ($parentclass)" unless $parentref && $parentref->{occurs} == 1;
fatal_error "The parent class ($parentclass) specifies UMAX and/or DMAX; it cannot serve as a parent" if $parentref->{dmax};
$parentref->{leaf} = 0;
$ratemax = $parentref->{rate};
$ratename = q(the parent class's RATE);
$ceilmax = $parentref->{ceiling};
$ceilname = q(the parent class's CEIL);
}
my ( $umax, $dmax ) = ( '', '' );
@@ -673,19 +737,27 @@ sub validate_tc_class( ) {
fatal_error "Invalid RATE ($rate)" if defined $rest;
$rate = convert_rate ( $full, $trate, 'RATE' );
$rate = convert_rate ( $ratemax, $trate, 'RATE', $ratename );
$dmax = convert_delay( $dmax );
$umax = convert_size( $umax );
fatal_error "DMAX must be specified when UMAX is specified" if $umax && ! $dmax;
} else {
$rate = convert_rate ( $full, $rate, 'RATE' );
$rate = convert_rate ( $ratemax, $rate, 'RATE' , $ratename );
}
if ( $parentref ) {
warning_message "Total RATE of sub classes ($parentref->{guarantee}kbits) exceeds RATE of parent class ($parentref->{rate}kbits)" if ( $parentref->{guarantee} += $rate ) > $parentref->{rate};
} else {
warning_message "Total RATE of classes ($devref->{guarantee}kbits) exceeds OUT-BANDWIDTH (${full}kbits)" if ( $devref->{guarantee} += $rate ) > $full;
}
fatal_error "Invalid PRIO ($prio)" unless defined numeric_value $prio;
$tcref->{$classnumber} = { tos => [] ,
rate => $rate ,
umax => $umax ,
dmax => $dmax ,
ceiling => convert_rate( $full, $ceil, 'CEIL' ) ,
ceiling => convert_rate( $ceilmax, $ceil, 'CEIL' , $ceilname ) ,
priority => $prio eq '-' ? 1 : $prio ,
mark => $markval ,
flow => '' ,
@@ -693,6 +765,8 @@ sub validate_tc_class( ) {
occurs => 1,
parent => $parentclass,
leaf => 1,
guarantee => 0,
limit => 127,
};
$tcref = $tcref->{$classnumber};
@@ -733,7 +807,7 @@ sub validate_tc_class( ) {
fatal_error q(The 'occurs' option is only valid for IPv4) if $family == F_IPV6;
fatal_error q(The 'occurs' option may not be used with 'classify') if $devref->{classify};
fatal_error "Invalid 'occurs' ($val)" unless defined $occurs && $occurs > 1 && $occurs <= 256;
fatal_error "Invalid 'occurs' ($val)" if $occurs > ( $config{WIDE_TC_MARKS} ? 8191 : 255 );
fatal_error "Invalid 'occurs' ($val)" if $occurs > $globals{TC_MAX};
fatal_error q(Duplicate 'occurs') if $tcref->{occurs} > 1;
fatal_error q(The 'occurs' option is not valid with 'default') if $devref->{default} == $classnumber;
fatal_error q(The 'occurs' option is not valid with 'tos') if @{$tcref->{tos}};
@@ -741,6 +815,10 @@ sub validate_tc_class( ) {
$tcref->{occurs} = $occurs;
$devref->{occurs} = 1;
} elsif ( $option =~ /^limit=(\d+)$/ ) {
warning_message "limit ignored with pfifo queuing" if $tcref->{pfifo};
fatal_error "Invalid limit ($1)" if $1 < 3 || $1 > 128;
$tcref->{limit} = $1;
} else {
fatal_error "Unknown option ($option)";
}
@@ -769,6 +847,7 @@ sub validate_tc_class( ) {
pfifo => $tcref->{pfifo},
occurs => 0,
parent => $parentclass,
limit => $tcref->{limit},
};
push @tcclasses, "$device:$classnumber";
};
@@ -805,7 +884,7 @@ sub process_tc_filter( ) {
fatal_error "Unknown CLASS ($devclass)" unless $tcref && $tcref->{occurs};
fatal_error "Filters may not specify an occurring CLASS" if $tcref->{occurs} > 1;
my $rule = "filter add dev $device protocol ip parent $devnum:0 prio 10 u32";
my $rule = "filter add dev $devref->{physical} protocol ip parent $devnum:0 prio 10 u32";
if ( $source ne '-' ) {
my ( $net , $mask ) = decompose_net( $source );
@@ -876,7 +955,7 @@ sub process_tc_filter( ) {
$lasttnum = $tnum;
$lastrule = $rule;
emit( "\nrun_tc filter add dev $device parent $devnum:0 protocol ip prio 10 handle $tnum: u32 divisor 1" );
emit( "\nrun_tc filter add dev $devref->{physical} parent $devnum:0 protocol ip prio 10 handle $tnum: u32 divisor 1" );
}
#
# And link to it using the current contents of $rule
@@ -886,7 +965,7 @@ sub process_tc_filter( ) {
#
# The rule to match the port(s) will be inserted into the new table
#
$rule = "filter add dev $device protocol ip parent $devnum:0 prio 10 u32 ht $tnum:0";
$rule = "filter add dev $devref->{physical} protocol ip parent $devnum:0 prio 10 u32 ht $tnum:0";
if ( $portlist eq '-' ) {
fatal_error "Only TCP, UDP and SCTP may specify SOURCE PORT"
@@ -983,16 +1062,104 @@ sub process_tc_filter( ) {
$currentline =~ s/\s+/ /g;
save_progress_message_short qq(" TC Filter \"$currentline\" defined.");
save_progress_message_short qq(' TC Filter \"$currentline\" defined.');
emit '';
}
sub process_tc_priority() {
my ( $band, $proto, $ports , $address, $interface, $helper ) = split_line1 1, 6, 'tcpri';
if ( $band eq 'COMMENT' ) {
process_comment;
return;
}
my $val = numeric_value $band;
fatal_error "Invalid PRIORITY ($band)" unless $val && $val <= 3;
my $rule = do_helper( $helper ) . "-j MARK --set-mark $band";
$rule .= join('', '/', in_hex( $globals{TC_MASK} ) ) if have_capability( 'EXMARK' );
if ( $interface ne '-' ) {
fatal_error "Invalid combination of columns" unless $address eq '-' && $proto eq '-' && $ports eq '-';
my $forwardref = $mangle_table->{tcfor};
add_rule( $forwardref ,
join( '', match_source_dev( $interface) , $rule ) ,
1 );
} else {
my $postref = $mangle_table->{tcpost};
if ( $address ne '-' ) {
fatal_error "Invalid combination of columns" unless $proto eq '-' && $ports eq '-';
add_rule( $postref ,
join( '', match_source_net( $address) , $rule ) ,
1 );
} else {
add_rule( $postref ,
join( '', do_proto( $proto, $ports, '-' , 0 ) , $rule ) ,
1 );
if ( $ports ne '-' ) {
my $protocol = resolve_proto $proto;
if ( $proto =~ /^ipp2p/ ) {
fatal_error "ipp2p may not be used when there are tracked providers and PROVIDER_OFFSET=0" if @routemarked_interfaces && $config{PROVIDER_OFFSET} == 0;
$ipp2p = 1;
}
add_rule( $postref ,
join( '' , do_proto( $proto, '-', $ports, 0 ) , $rule ) ,
1 )
unless $proto =~ /^ipp2p/ || $protocol == ICMP || $protocol == IPv6_ICMP;
}
}
}
}
sub setup_simple_traffic_shaping() {
my $interfaces;
save_progress_message q("Setting up Traffic Control...");
my $fn = open_file 'tcinterfaces';
if ( $fn ) {
first_entry "$doing $fn...";
process_simple_device, $interfaces++ while read_a_line;
} else {
$fn = find_file 'tcinterfaces';
}
my $fn1 = open_file 'tcpri';
if ( $fn1 ) {
first_entry
sub {
progress_message2 "$doing $fn1...";
warning_message "There are entries in $fn1 but $fn was empty" unless $interfaces;
};
process_tc_priority while read_a_line;
clear_comment;
if ( $ipp2p ) {
insert_rule1 $mangle_table->{tcpost} , 0 , '-m mark --mark 0/' . in_hex( $globals{TC_MASK} ) . ' -j CONNMARK --restore-mark --ctmask ' . in_hex( $globals{TC_MASK} );
add_rule $mangle_table->{tcpost} , '-m mark ! --mark 0/' . in_hex( $globals{TC_MASK} ) . ' -j CONNMARK --save-mark --ctmask ' . in_hex( $globals{TC_MASK} );
}
}
}
sub setup_traffic_shaping() {
our $lastrule = '';
save_progress_message "Setting up Traffic Control...";
save_progress_message q("Setting up Traffic Control...");
my $fn = open_file 'tcdevices';
@@ -1002,6 +1169,9 @@ sub setup_traffic_shaping() {
validate_tc_device while read_a_line;
}
my $sfq = $devnum;
my $sfqinhex;
$devnum = $devnum > 10 ? 10 : 1;
$fn = open_file 'tcclasses';
@@ -1013,12 +1183,15 @@ sub setup_traffic_shaping() {
}
for my $device ( @tcdevices ) {
my $dev = chain_base( $device );
my $devref = $tcdevices{$device};
my $defmark = in_hexp ( $devref->{default} || 0 );
my $devnum = in_hexp $devref->{number};
my $r2q = int calculate_r2q $devref->{out_bandwidth};
$device = physical_name $device;
my $dev = chain_base( $device );
emit "if interface_is_up $device; then";
push_indent;
@@ -1068,7 +1241,7 @@ sub setup_traffic_shaping() {
emit( "run_tc filter add dev $rdev parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev $device > /dev/null" );
}
save_progress_message_short " TC Device $device defined.";
save_progress_message_short qq(" TC Device $device defined.");
pop_indent;
emit 'else';
@@ -1101,12 +1274,14 @@ sub setup_traffic_shaping() {
my $classid = join( ':', in_hexp $devicenumber, $classnum);
my $rate = "$tcref->{rate}kbit";
my $quantum = calculate_quantum $rate, calculate_r2q( $devref->{out_bandwidth} );
$classids{$classid}=$device;
$device = physical_name $device;
my $dev = chain_base $device;
my $priority = $tcref->{priority} << 8;
my $parent = in_hexp $tcref->{parent};
$classids{$classid}=$device;
if ( $lastdevice ne $device ) {
if ( $lastdevice ) {
pop_indent;
@@ -1133,17 +1308,18 @@ sub setup_traffic_shaping() {
}
}
emit( "run_tc qdisc add dev $device parent $classid handle ${classnum}: sfq quantum \$quantum limit 127 perturb 10" ) if $tcref->{leaf} && ! $tcref->{pfifo};
if ( $tcref->{leaf} && ! $tcref->{pfifo} ) {
$sfqinhex = in_hexp( ++$sfq);
emit( "run_tc qdisc add dev $device parent $classid handle $sfqinhex: sfq quantum \$quantum limit $tcref->{limit} perturb 10" );
}
#
# add filters
#
unless ( $devref->{classify} ) {
if ( $tcref->{occurs} == 1 ) {
emit "run_tc filter add dev $device protocol all parent $devicenumber:0 prio " . ( $priority | 20 ) . " handle $mark fw classid $classid";
}
emit "run_tc filter add dev $device protocol all parent $devicenumber:0 prio " . ( $priority | 20 ) . " handle $mark fw classid $classid" if $tcref->{occurs} == 1;
}
emit "run_tc filter add dev $device protocol all prio 1 parent $classnum: handle $classnum flow hash keys $tcref->{flow} divisor 1024" if $tcref->{flow};
emit "run_tc filter add dev $device protocol all prio 1 parent $sfqinhex: handle $classnum flow hash keys $tcref->{flow} divisor 1024" if $tcref->{flow};
#
# options
#
@@ -1167,7 +1343,7 @@ sub setup_traffic_shaping() {
$fn = open_file 'tcfilters';
if ( $fn ) {
first_entry( sub { progress_message2 "$doing $fn..."; save_progress_message "Adding TC Filters"; } );
first_entry( sub { progress_message2 "$doing $fn..."; save_progress_message q("Adding TC Filters"); } );
process_tc_filter while read_a_line;
}
@@ -1179,11 +1355,11 @@ sub setup_traffic_shaping() {
#
sub setup_tc() {
if ( $capabilities{MANGLE_ENABLED} && $config{MANGLE_ENABLED} ) {
if ( $config{MANGLE_ENABLED} ) {
ensure_mangle_chain 'tcpre';
ensure_mangle_chain 'tcout';
if ( $capabilities{MANGLE_FORWARD} ) {
if ( have_capability( 'MANGLE_FORWARD' ) ) {
ensure_mangle_chain 'tcfor';
ensure_mangle_chain 'tcpost';
}
@@ -1191,43 +1367,90 @@ sub setup_tc() {
my $mark_part = '';
if ( @routemarked_interfaces && ! $config{TC_EXPERT} ) {
$mark_part = $config{HIGH_ROUTE_MARKS} ? $config{WIDE_TC_MARKS} ? '-m mark --mark 0/0xFF0000' : '-m mark --mark 0/0xFF00' : '-m mark --mark 0/0xFF';
$mark_part = '-m mark --mark 0/' . in_hex( $globals{PROVIDER_MASK} ) . ' ';
unless ( $config{TRACK_PROVIDERS} ) {
#
# This is overloading TRACK_PROVIDERS a bit but sending tracked packets through PREROUTING is a PITA for users
#
for my $interface ( @routemarked_interfaces ) {
add_rule $mangle_table->{PREROUTING} , "-i $interface -j tcpre";
add_jump $mangle_table->{PREROUTING} , 'tcpre', 0, match_source_dev( $interface );
}
}
}
add_rule $mangle_table->{PREROUTING} , "$mark_part -j tcpre";
add_rule $mangle_table->{OUTPUT} , "$mark_part -j tcout";
add_jump $mangle_table->{PREROUTING} , 'tcpre', 0, $mark_part;
add_jump $mangle_table->{OUTPUT} , 'tcout', 0, $mark_part;
if ( $capabilities{MANGLE_FORWARD} ) {
add_rule $mangle_table->{FORWARD} , '-j tcfor';
add_rule $mangle_table->{POSTROUTING} , '-j tcpost';
}
if ( have_capability( 'MANGLE_FORWARD' ) ) {
my $mask = have_capability 'EXMARK' ? have_capability 'FWMARK_RT_MASK' ? '/' . in_hex $globals{PROVIDER_MASK} : '' : '';
if ( $config{HIGH_ROUTE_MARKS} ) {
for my $chain qw(INPUT FORWARD) {
insert_rule1 $mangle_table->{$chain}, 0, $config{WIDE_TC_MARKS} ? '-j MARK --and-mark 0xFFFF' : '-j MARK --and-mark 0xFF';
}
#
# In POSTROUTING, we only want to clear routing mark and not IPMARK.
#
insert_rule1 $mangle_table->{POSTROUTING}, 0, $config{WIDE_TC_MARKS} ? '-m mark --mark 0/0xFFFF -j MARK --and-mark 0' : '-m mark --mark 0/0xFF -j MARK --and-mark 0';
add_rule( $mangle_table->{FORWARD}, "-j MARK --set-mark 0${mask}" ) if $config{FORWARD_CLEAR_MARK};
add_jump $mangle_table->{FORWARD} , 'tcfor', 0;
add_jump $mangle_table->{POSTROUTING} , 'tcpost', 0;
}
}
if ( $globals{TC_SCRIPT} ) {
save_progress_message 'Setting up Traffic Control...';
save_progress_message q('Setting up Traffic Control...');
append_file $globals{TC_SCRIPT};
} elsif ( $config{TC_ENABLED} eq 'Internal' ) {
setup_traffic_shaping;
} elsif ( $config{TC_ENABLED} eq 'Simple' ) {
setup_simple_traffic_shaping;
}
if ( $config{TC_ENABLED} ) {
our @tccmd = ( { match => sub ( $ ) { $_[0] eq 'SAVE' } ,
target => 'CONNMARK --save-mark --mask' ,
mark => SMALLMARK ,
mask => in_hex( $globals{TC_MASK} ) ,
connmark => 1
} ,
{ match => sub ( $ ) { $_[0] eq 'RESTORE' },
target => 'CONNMARK --restore-mark --mask' ,
mark => SMALLMARK ,
mask => in_hex( $globals{TC_MASK} ) ,
connmark => 1
} ,
{ match => sub ( $ ) { $_[0] eq 'CONTINUE' },
target => 'RETURN' ,
mark => NOMARK ,
mask => '' ,
connmark => 0
} ,
{ match => sub ( $ ) { $_[0] eq 'SAME' },
target => 'sticky' ,
mark => NOMARK ,
mask => '' ,
connmark => 0
} ,
{ match => sub ( $ ) { $_[0] =~ /^IPMARK/ },
target => 'IPMARK' ,
mark => NOMARK,
mask => '',
connmark => 0
} ,
{ match => sub ( $ ) { $_[0] =~ '\|.*'} ,
target => 'MARK --or-mark' ,
mark => HIGHMARK ,
mask => '' } ,
{ match => sub ( $ ) { $_[0] =~ '&.*' },
target => 'MARK --and-mark ' ,
mark => HIGHMARK ,
mask => '' ,
connmark => 0
} ,
{ match => sub ( $ ) { $_[0] =~ /^TPROXY/ },
target => 'TPROXY',
mark => HIGHMARK,
mask => '',
connmark => '' },
);
if ( my $fn = open_file 'tcrules' ) {
first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'MANGLE_ENABLED' , 'a non-empty tcrules file' , 's'; } );
first_entry "$doing $fn...";
process_tc_rule while read_a_line;

View File

@@ -3,7 +3,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008,2009 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
@@ -34,7 +34,7 @@ use strict;
our @ISA = qw(Exporter);
our @EXPORT = qw( setup_tunnels );
our @EXPORT_OK = ( );
our $VERSION = '4.3_7';
our $VERSION = '4.4_9';
#
# Here starts the tunnel stuff -- we really should get rid of this crap...
@@ -61,7 +61,7 @@ sub setup_tunnels() {
}
}
my $options = $globals{UNTRACKED} ? '-m state --state NEW,UNTRACKED -j ACCEPT' : '-m state --state NEW -j ACCEPT';
my $options = $globals{UNTRACKED} ? "$globals{STATEMATCH} NEW,UNTRACKED -j ACCEPT" : "$globals{STATEMATCH} NEW -j ACCEPT";
add_tunnel_rule $inchainref, "-p 50 $source -j ACCEPT";
add_tunnel_rule $outchainref, "-p 50 $dest -j ACCEPT";
@@ -83,10 +83,10 @@ sub setup_tunnels() {
for my $zone ( split_list $gatewayzones, 'zone' ) {
my $type = zone_type( $zone );
fatal_error "Invalid zone ($zone) for GATEWAY ZONE" if $type == FIREWALL || $type == BPORT;
$inchainref = ensure_filter_chain "${zone}2${fw}", 1;
$outchainref = ensure_filter_chain "${fw}2${zone}", 1;
$inchainref = ensure_filter_chain rules_chain( ${zone}, ${fw} ), 1;
$outchainref = ensure_filter_chain rules_chain( ${fw}, ${zone} ), 1;
unless ( $capabilities{POLICY_MATCH} ) {
unless ( have_ipsec ) {
add_tunnel_rule $inchainref, "-p 50 $source -j ACCEPT";
add_tunnel_rule $outchainref, "-p 50 $dest -j ACCEPT";
@@ -239,8 +239,8 @@ sub setup_tunnels() {
fatal_error "Invalid tunnel ZONE ($zone)" if $zonetype == FIREWALL || $zonetype == BPORT;
my $inchainref = ensure_filter_chain "${zone}2${fw}", 1;
my $outchainref = ensure_filter_chain "${fw}2${zone}", 1;
my $inchainref = ensure_filter_chain rules_chain( ${zone}, ${fw} ), 1;
my $outchainref = ensure_filter_chain rules_chain( ${fw}, ${zone} ), 1;
$gateway = ALLIP if $gateway eq '-';

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 2007,2008,2009 - Tom Eastep (teastep@shorewall.net)
# (c) 2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
#
# Complete documentation is available at http://shorewall.net
#
@@ -36,6 +36,7 @@
# --log=<filename> # Log file
# --log_verbosity=<number> # Log Verbosity range -1 to 2
# --family=<number> # IP family; 4 = IPv4 (default), 6 = IPv6
# --preview # Preview the ruleset.
#
use strict;
use FindBin;
@@ -44,7 +45,6 @@ use Shorewall::Compiler;
use Getopt::Long;
sub usage( $ ) {
my $returnval = shift @_;
print STDERR 'usage: compiler.pl [ <option> ... ] [ <filename> ]
@@ -58,10 +58,11 @@ sub usage( $ ) {
[ --log=<filename> ]
[ --log-verbose={-1|0-2} ]
[ --test ]
[ --preview ]
[ --family={4|6} ]
';
$returnval;
exit shift @_;
}
#
@@ -78,6 +79,7 @@ my $log_verbose = 0;
my $help = 0;
my $test = 0;
my $family = 4; # F_IPV4
my $preview = 0;
Getopt::Long::Configure ('bundling');
@@ -98,6 +100,7 @@ my $result = GetOptions('h' => \$help,
'l=s' => \$log,
'log_verbosity=i' => \$log_verbose,
'test' => \$test,
'preview' => \$preview,
'f=i' => \$family,
'family=i' => \$family,
);
@@ -105,7 +108,7 @@ my $result = GetOptions('h' => \$help,
usage(1) unless $result && @ARGV < 2;
usage(0) if $help;
compiler( object => defined $ARGV[0] ? $ARGV[0] : '',
compiler( script => $ARGV[0] || '',
directory => $shorewall_dir,
verbosity => $verbose,
timestamp => $timestamp,
@@ -115,4 +118,5 @@ compiler( object => defined $ARGV[0] ? $ARGV[0] : '',
log => $log,
log_verbosity => $log_verbose,
test => $test,
preview => $preview,
family => $family );

View File

@@ -1,288 +1,20 @@
###############################################################################
# Code imported from /usr/share/shorewall/prog.footer
###############################################################################
#
# Clear Proxy Arp
#
delete_proxyarp() {
if [ -f ${VARDIR}/proxyarp ]; then
while read address interface external haveroute; do
qt arp -i $external -d $address pub
[ -z "${haveroute}${NOROUTES}" ] && qt $IP -4 route del $address dev $interface
f=/proc/sys/net/ipv4/conf/$interface/proxy_arp
[ -f $f ] && echo 0 > $f
done < ${VARDIR}/proxyarp
fi
rm -f ${VARDIR}/proxyarp
}
#
# Remove all Shorewall-added rules
#
clear_firewall() {
stop_firewall
setpolicy INPUT ACCEPT
setpolicy FORWARD ACCEPT
setpolicy OUTPUT ACCEPT
run_iptables -F
echo 1 > /proc/sys/net/ipv4/ip_forward
if [ -n "$DISABLE_IPV6" ]; then
if [ -x $IPTABLES ]; then
$IP6TABLES -P INPUT ACCEPT 2> /dev/null
$IP6TABLES -P OUTPUT ACCEPT 2> /dev/null
$IP6TABLES -P FORWARD ACCEPT 2> /dev/null
fi
fi
run_clear_exit
set_state "Cleared"
logger -p kern.info "$PRODUCT Cleared"
}
#
# Issue a message and stop/restore the firewall
#
fatal_error()
{
echo " ERROR: $@" >&2
if [ $LOG_VERBOSE -gt 1 ]; then
timestamp="$(date +'%_b %d %T') "
echo "${timestamp} ERROR: $@" >> $STARTUP_LOG
fi
stop_firewall
[ -n "$TEMPFILE" ] && rm -f $TEMPFILE
exit 2
}
#
# Issue a message and stop
#
startup_error() # $* = Error Message
{
echo " ERROR: $@: Firewall state not changed" >&2
case $COMMAND in
start)
logger -p kern.err "ERROR:$PRODUCT start failed:Firewall state not changed"
;;
restart)
logger -p kern.err "ERROR:$PRODUCT restart failed:Firewall state not changed"
;;
restore)
logger -p kern.err "ERROR:$PRODUCT restore failed:Firewall state not changed"
;;
esac
if [ $LOG_VERBOSE -gt 1 ]; then
timestamp="$(date +'%_b %d %T') "
case $COMMAND in
start)
echo "${timestamp} ERROR:$PRODUCT start failed:Firewall state not changed" >> $STARTUP_LOG
;;
restart)
echo "${timestamp} ERROR:$PRODUCT restart failed:Firewall state not changed" >> $STARTUP_LOG
;;
restore)
echo "${timestamp} ERROR:$PRODUCT restore failed:Firewall state not changed" >> $STARTUP_LOG
;;
esac
fi
kill $$
exit 2
}
#
# Run iptables and if an error occurs, stop/restore the firewall
#
run_iptables()
{
local status
while [ 1 ]; do
$IPTABLES $@
status=$?
[ $status -ne 4 ] && break
done
if [ $status -ne 0 ]; then
error_message "ERROR: Command \"$IPTABLES $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Run iptables retrying exit status 4
#
do_iptables()
{
local status
while [ 1 ]; do
$IPTABLES $@
status=$?
[ $status -ne 4 ] && return $status;
done
}
#
# Run iptables and if an error occurs, stop/restore the firewall
#
run_ip()
{
if ! $IP -4 $@; then
error_message "ERROR: Command \"$IP -4 $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Run tc and if an error occurs, stop/restore the firewall
#
run_tc() {
if ! $TC $@ ; then
error_message "ERROR: Command \"$TC $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Restore the rules generated by 'drop','reject','logdrop', etc.
#
restore_dynamic_rules() {
if [ -f ${VARDIR}/save ]; then
progress_message2 "Setting up dynamic rules..."
rangematch='source IP range'
while read target ignore1 ignore2 address ignore3 rest; do
case $target in
DROP|reject|logdrop|logreject)
case $rest in
$rangematch*)
run_iptables -A dynamic -m iprange --src-range ${rest#source IP range} -j $target
;;
*)
if [ -z "$rest" ]; then
run_iptables -A dynamic -s $address -j $target
else
error_message "WARNING: Unable to restore dynamic rule \"$target $ignore1 $ignore2 $address $ignore3 $rest\""
fi
;;
esac
;;
esac
done < ${VARDIR}/save
fi
}
#
# Get a list of all configured broadcast addresses on the system
#
get_all_bcasts()
{
$IP -f inet addr show 2> /dev/null | grep 'inet.*brd' | grep -v '/32 ' | sed 's/inet.*brd //; s/scope.*//;' | sort -u
}
#
# Run the .iptables_restore_input as a set of discrete iptables commands
#
debug_restore_input() {
local first second rest table chain
#
# Clear the ruleset
#
qt1 $IPTABLES -t mangle -F
qt1 $IPTABLES -t mangle -X
for chain in PREROUTING INPUT FORWARD POSTROUTING; do
qt1 $IPTABLES -t mangle -P $chain ACCEPT
done
qt1 $IPTABLES -t raw -F
qt1 $IPTABLES -t raw -X
for chain in PREROUTING OUTPUT; do
qt1 $IPTABLES -t raw -P $chain ACCEPT
done
run_iptables -t nat -F
run_iptables -t nat -X
for chain in PREROUTING POSTROUTING OUTPUT; do
qt1 $IPTABLES -t nat -P $chain ACCEPT
done
qt1 $IPTABLES -t filter -F
qt1 $IPTABLES -t filter -X
for chain in INPUT FORWARD OUTPUT; do
qt1 $IPTABLES -t filter -P $chain -P ACCEPT
done
while read first second rest; do
case $first in
-*)
#
# We can't call run_iptables() here because the rules may contain quoted strings
#
eval $IPTABLES -t $table $first $second $rest
if [ $? -ne 0 ]; then
error_message "ERROR: Command \"$IPTABLES $first $second $rest\" Failed"
stop_firewall
exit 2
fi
;;
:*)
chain=${first#:}
if [ "x$second" = x- ]; then
do_iptables -t $table -N $chain
else
do_iptables -t $table -P $chain $second
fi
if [ $? -ne 0 ]; then
error_message "ERROR: Command \"$IPTABLES $first $second $rest\" Failed"
stop_firewall
exit 2
fi
;;
#
# This grotesque hack with the table names works around a bug/feature with ash
#
'*'raw)
table=raw
;;
'*'mangle)
table=mangle
;;
'*'nat)
table=nat
;;
'*'filter)
table=filter
;;
esac
done
}
#
# Give Usage Information
#
usage() {
echo "Usage: $0 [ -q ] [ -v ] [ -n ] [ start|stop|clear|reset|refresh|restart|status|version ]"
echo "Usage: $0 [ options ] [ start|stop|clear|down|reset|refresh|restart|status|up|version ]"
echo
echo "Options are:"
echo
echo " -v and -q Standard Shorewall verbosity controls"
echo " -n Don't unpdate routing configuration"
echo " -p Purge Conntrack Table"
echo " -t Timestamp progress Messages"
echo " -V <verbosity> Set verbosity explicitly"
echo " -R <file> Override RESTOREFILE setting"
exit $1
}
################################################################################
@@ -300,10 +32,23 @@ if [ $# -gt 1 ]; then
shift
fi
fi
#
# Map VERBOSE to VERBOSITY for compatibility with old Shorewall-lite installations
#
[ -z "$VERBOSITY" ] && [ -n "$VERBOSE" ] && VERBOSITY=$VERBOSE
#
# Map other old exported variables
#
g_purge=$PURGE
g_noroutes=$NOROUTES
g_timestamp=$TIMESTAMP
g_recovering=$RECOVERING
initialize
if [ -n "$STARTUP_LOG" ]; then
touch $STARTUP_LOG
chmod 0600 $STARTUP_LOG
if [ ${SHOREWALL_INIT_SCRIPT:-0} -eq 1 ]; then
#
# We're being run by a startup script that isn't redirecting STDOUT
@@ -326,17 +71,78 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
while [ -n "$option" ]; do
case $option in
v*)
VERBOSE=$(($VERBOSE + 1 ))
[ $VERBOSITY -lt 2 ] && VERBOSITY=$(($VERBOSITY + 1 ))
option=${option#v}
;;
q*)
VERBOSE=$(($VERBOSE - 1 ))
[ $VERBOSITY -gt -1 ] && VERBOSITY=$(($VERBOSITY - 1 ))
option=${option#q}
;;
n*)
NOROUTES=Yes
g_noroutes=Yes
option=${option#n}
;;
t*)
g_timestamp=Yes
option=${option#t}
;;
p*)
g_purge=Yes
option=${option#p}
;;
r*)
g_recovering=Yes
option=${option#r}
;;
V*)
option=${option#V}
if [ -z "$option" -a $# -gt 0 ]; then
shift
option=$1
fi
if [ -n "$option" ]; then
case $option in
-1|0|1|2)
VERBOSITY=$option
option=
;;
*)
startup_error "Invalid -V option value ($option)"
;;
esac
else
startup_error "Missing -V option value"
fi
;;
R*)
option=${option#R}
if [ -z "$option" -a $# -gt 0 ]; then
shift
option=$1
fi
if [ -n "$option" ]; then
case $option in
*/*)
startup_error "-R must specify a simple file name: $option"
;;
.safe|.try|NONE)
;;
.*)
error_message "ERROR: Reserved File Name: $RESTOREFILE"
exit 2
;;
esac
else
startup_error "Missing -R option value"
fi
RESTOREFILE=$option
option=
;;
*)
usage 1
;;
@@ -352,16 +158,15 @@ done
COMMAND="$1"
[ -n "${PRODUCT:=Shorewall}" ]
case "$COMMAND" in
start)
[ $# -ne 1 ] && usage 2
if shorewall_is_started; then
error_message "$PRODUCT is already Running"
error_message "$g_product is already Running"
status=0
else
progress_message3 "Starting $PRODUCT...."
progress_message3 "Starting $g_product...."
detect_configuration
define_firewall
status=$?
[ -n "$SUBSYSLOCK" -a $status -eq 0 ] && touch $SUBSYSLOCK
@@ -370,7 +175,8 @@ case "$COMMAND" in
;;
stop)
[ $# -ne 1 ] && usage 2
progress_message3 "Stopping $PRODUCT...."
progress_message3 "Stopping $g_product...."
detect_configuration
stop_firewall
status=0
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
@@ -378,7 +184,7 @@ case "$COMMAND" in
;;
reset)
if ! shorewall_is_started ; then
error_message "$PRODUCT is not running"
error_message "$g_product is not running"
status=2
elif [ $# -eq 1 ]; then
$IPTABLES -Z
@@ -386,7 +192,7 @@ case "$COMMAND" in
$IPTABLES -t mangle -Z
date > ${VARDIR}/restarted
status=0
progress_message3 "$PRODUCT Counters Reset"
progress_message3 "$g_product Counters Reset"
else
shift
status=0
@@ -408,12 +214,14 @@ case "$COMMAND" in
restart)
[ $# -ne 1 ] && usage 2
if shorewall_is_started; then
progress_message3 "Restarting $PRODUCT...."
progress_message3 "Restarting $g_product...."
else
error_message "$PRODUCT is not running"
progress_message3 "Starting $PRODUCT...."
error_message "$g_product is not running"
progress_message3 "Starting $g_product...."
COMMAND=start
fi
detect_configuration
define_firewall
status=$?
if [ -n "$SUBSYSLOCK" ]; then
@@ -424,17 +232,19 @@ case "$COMMAND" in
refresh)
[ $# -ne 1 ] && usage 2
if shorewall_is_started; then
progress_message3 "Refreshing $PRODUCT...."
progress_message3 "Refreshing $g_product...."
detect_configuration
define_firewall
status=$?
progress_message3 "done."
else
echo "$PRODUCT is not running" >&2
echo "$g_product is not running" >&2
status=2
fi
;;
restore)
[ $# -ne 1 ] && usage 2
detect_configuration
define_firewall
status=$?
if [ -n "$SUBSYSLOCK" ]; then
@@ -443,28 +253,30 @@ case "$COMMAND" in
;;
clear)
[ $# -ne 1 ] && usage 2
progress_message3 "Clearing $PRODUCT...."
progress_message3 "Clearing $g_product...."
clear_firewall
status=0
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
if [ -n "$SUBSYSLOCK" ]; then
rm -f $SUBSYSLOCK
fi
progress_message3 "done."
;;
status)
[ $# -ne 1 ] && usage 2
echo "$PRODUCT-$VERSION Status at $HOSTNAME - $(date)"
echo "$g_product-$SHOREWALL_VERSION Status at $(hostname) - $(date)"
echo
if shorewall_is_started; then
echo "$PRODUCT is running"
echo "$g_product is running"
status=0
else
echo "$PRODUCT is stopped"
echo "$g_product is stopped"
status=4
fi
if [ -f ${VARDIR}/state ]; then
state="$(cat ${VARDIR}/state)"
case $state in
Stopped*|Clear*)
Stopped*|lClear*)
status=3
;;
esac
@@ -474,9 +286,16 @@ case "$COMMAND" in
echo "State:$state"
echo
;;
up|down)
[ $# -eq 1 ] && exit 0
shift
[ $# -ne 1 ] && usage 2
updown $@
status=0;
;;
version)
[ $# -ne 1 ] && usage 2
echo $VERSION
echo $SHOREWALL_VERSION
status=0
;;
help)

View File

@@ -1,249 +1,20 @@
###############################################################################
# Code imported from /usr/share/shorewall/prog.footer6
###############################################################################
#
# Remove all Shorewall-added rules
#
clear_firewall() {
stop_firewall
setpolicy INPUT ACCEPT
setpolicy FORWARD ACCEPT
setpolicy OUTPUT ACCEPT
run_iptables -F
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
run_clear_exit
set_state "Cleared"
logger -p kern.info "$PRODUCT Cleared"
}
#
# Issue a message and stop/restore the firewall
#
fatal_error()
{
echo " ERROR: $@" >&2
if [ $LOG_VERBOSE -gt 1 ]; then
timestamp="$(date +'%_b %d %T') "
echo "${timestamp} ERROR: $@" >> $STARTUP_LOG
fi
stop_firewall
[ -n "$TEMPFILE" ] && rm -f $TEMPFILE
exit 2
}
#
# Issue a message and stop
#
startup_error() # $* = Error Message
{
echo " ERROR: $@: Firewall state not changed" >&2
case $COMMAND in
start)
logger -p kern.err "ERROR:$PRODUCT start failed:Firewall state not changed"
;;
restart)
logger -p kern.err "ERROR:$PRODUCT restart failed:Firewall state not changed"
;;
restore)
logger -p kern.err "ERROR:$PRODUCT restore failed:Firewall state not changed"
;;
esac
if [ $LOG_VERBOSE -gt 1 ]; then
timestamp="$(date +'%_b %d %T') "
case $COMMAND in
start)
echo "${timestamp} ERROR:$PRODUCT start failed:Firewall state not changed" >> $STARTUP_LOG
;;
restart)
echo "${timestamp} ERROR:$PRODUCT restart failed:Firewall state not changed" >> $STARTUP_LOG
;;
restore)
echo "${timestamp} ERROR:$PRODUCT restore failed:Firewall state not changed" >> $STARTUP_LOG
;;
esac
fi
kill $$
exit 2
}
#
# Run iptables and if an error occurs, stop/restore the firewall
#
run_iptables()
{
local status
while [ 1 ]; do
$IP6TABLES $@
status=$?
[ $status -ne 4 ] && break
done
if [ $status -ne 0 ]; then
error_message "ERROR: Command \"$IP6TABLES $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Run iptables retrying exit status 4
#
do_iptables()
{
local status
while [ 1 ]; do
$IP6TABLES $@
status=$?
[ $status -ne 4 ] && return $status;
done
}
#
# Run iptables and if an error occurs, stop/restore the firewall
#
run_ip()
{
if ! $IP -6 $@; then
error_message "ERROR: Command \"$IP -6 $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Run tc and if an error occurs, stop/restore the firewall
#
run_tc() {
if ! $TC $@ ; then
error_message "ERROR: Command \"$TC $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Restore the rules generated by 'drop','reject','logdrop', etc.
#
restore_dynamic_rules() {
if [ -f ${VARDIR}/save ]; then
progress_message2 "Setting up dynamic rules..."
rangematch='source IP range'
while read target ignore1 ignore2 address ignore3 rest; do
case $target in
DROP|reject|logdrop|logreject)
case $rest in
$rangematch*)
run_iptables -A dynamic -m iprange --src-range ${rest#source IP range} -j $target
;;
*)
if [ -z "$rest" ]; then
run_iptables -A dynamic -s $address -j $target
else
error_message "WARNING: Unable to restore dynamic rule \"$target $ignore1 $ignore2 $address $ignore3 $rest\""
fi
;;
esac
;;
esac
done < ${VARDIR}/save
fi
}
#
# Run the .iptables_restore_input as a set of discrete iptables commands
#
debug_restore_input() {
local first second rest table chain
#
# Clear the ruleset
#
qt1 $IP6TABLES -t mangle -F
qt1 $IP6TABLES -t mangle -X
for chain in PREROUTING INPUT FORWARD POSTROUTING; do
qt1 $IP6TABLES -t mangle -P $chain ACCEPT
done
qt1 $IP6TABLES -t raw -F
qt1 $IP6TABLES -t raw -X
for chain in PREROUTING OUTPUT; do
qt1 $IP6TABLES -t raw -P $chain ACCEPT
done
qt1 $IP6TABLES -t filter -F
qt1 $IP6TABLES -t filter -X
for chain in INPUT FORWARD OUTPUT; do
qt1 $IP6TABLES -t filter -P $chain -P ACCEPT
done
while read first second rest; do
case $first in
-*)
#
# We can't call run_iptables() here because the rules may contain quoted strings
#
eval $IP6TABLES -t $table $first $second $rest
if [ $? -ne 0 ]; then
error_message "ERROR: Command \"$IP6TABLES $first $second $rest\" Failed"
stop_firewall
exit 2
fi
;;
:*)
chain=${first#:}
if [ "x$second" = x- ]; then
do_iptables -t $table -N $chain
else
do_iptables -t $table -P $chain $second
fi
if [ $? -ne 0 ]; then
error_message "ERROR: Command \"$IP6TABLES $first $second $rest\" Failed"
stop_firewall
exit 2
fi
;;
#
# This grotesque hack with the table names works around a bug/feature with ash
#
'*'raw)
table=raw
;;
'*'mangle)
table=mangle
;;
'*'nat)
table=nat
;;
'*'filter)
table=filter
;;
esac
done
}
#
# Give Usage Information
#
usage() {
echo "Usage: $0 [ -q ] [ -v ] [ -n ] [ start|stop|clear|reset|refresh|restart|status|version ]"
echo "Usage: $0 [ options ] [ start|stop|clear|down|reset|refresh|restart|status|up|version ]"
echo
echo "Options are:"
echo
echo " -v and -q Standard Shorewall verbosity controls"
echo " -n Don't unpdate routing configuration"
echo " -p Purge Conntrack Table"
echo " -t Timestamp progress Messages"
echo " -V <verbosity> Set verbosity explicitly"
echo " -R <file> Override RESTOREFILE setting"
exit $1
}
################################################################################
@@ -261,10 +32,23 @@ if [ $# -gt 1 ]; then
shift
fi
fi
#
# Map VERBOSE to VERBOSITY for compatibility with old Shorewall6-lite installations
#
[ -z "$VERBOSITY" ] && [ -n "$VERBOSE" ] && VERBOSITY=$VERBOSE
#
# Map other old exported variables
#
g_purge=$PURGE
g_noroutes=$NOROUTES
g_timestamp=$TIMESTAMP
g_recovering=$RECOVERING
initialize
if [ -n "$STARTUP_LOG" ]; then
touch $STARTUP_LOG
chmod 0600 $STARTUP_LOG
if [ ${SHOREWALL_INIT_SCRIPT:-0} -eq 1 ]; then
#
# We're being run by a startup script that isn't redirecting STDOUT
@@ -287,19 +71,77 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
while [ -n "$option" ]; do
case $option in
v*)
VERBOSE=$(($VERBOSE + 1 ))
[ $VERBOSITY -lt 2 ] && VERBOSITY=$(($VERBOSITY + 1 ))
option=${option#v}
;;
q*)
VERBOSE=$(($VERBOSE - 1 ))
[ $VERBOSITY -gt -1 ] && VERBOSITY=$(($VERBOSITY - 1 ))
option=${option#q}
;;
n*)
NOROUTES=Yes
g_noroutes=Yes
option=${option#n}
;;
t*)
g_timestamp=Yes
option=${option#t}
;;
p*)
g_purge=Yes
option=${option#p}
;;
r*)
g_recovering=Yes
option=${option#r}
;;
V*)
option=${option#V}
if [ -z "$option" -a $# -gt 0 ]; then
shift
option=$1
fi
if [ -n "$option" ]; then
case $option in
-1|0|1|2)
VERBOSITY=$option
option=
;;
*)
usage 1
startup_error "Invalid -V option value ($option)"
;;
esac
else
startup_error "Missing -V option value"
fi
;;
R*)
option=${option#R}
if [ -z "$option" -a $# -gt 0 ]; then
shift
option=$1
fi
if [ -n "$option" ]; then
case $option in
*/*)
startup_error "-R must specify a simple file name: $option"
;;
.safe|.try|NONE)
;;
.*)
error_message "ERROR: Reserved File Name: $RESTOREFILE"
exit 2
;;
esac
else
startup_error "Missing -R option value"
fi
RESTOREFILE=$option
option=
;;
esac
done
@@ -313,21 +155,20 @@ done
COMMAND="$1"
[ -n "${PRODUCT:=Shorewall6}" ]
kernel=$(printf "%2d%02d%02d\n" $(echo $(uname -r) 2> /dev/null | sed 's/-.*//' | tr '.' ' ' ) | head -n1)
kernel=$(printf "%2d%02d%02d" $(uname -r 2> /dev/null | sed -e 's/-.*//' -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/\1 \2 \3/g'))
if [ $kernel -lt 20624 ]; then
error_message "ERROR: $PRODUCT requires Linux kernel 2.6.24 or later"
error_message "ERROR: $g_product requires Linux kernel 2.6.24 or later"
status=2
else
case "$COMMAND" in
start)
[ $# -ne 1 ] && usage 2
if shorewall6_is_started; then
error_message "$PRODUCT is already Running"
error_message "$g_product is already Running"
status=0
else
progress_message3 "Starting $PRODUCT...."
progress_message3 "Starting $g_product...."
detect_configuration
define_firewall
status=$?
[ -n "$SUBSYSLOCK" -a $status -eq 0 ] && touch $SUBSYSLOCK
@@ -336,7 +177,8 @@ else
;;
stop)
[ $# -ne 1 ] && usage 2
progress_message3 "Stopping $PRODUCT...."
progress_message3 "Stopping $g_product...."
detect_configuration
stop_firewall
status=0
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
@@ -344,14 +186,14 @@ else
;;
reset)
if ! shorewall6_is_started ; then
error_message "$PRODUCT is not running"
error_message "$g_product is not running"
status=2
elif [ $# -eq 1 ]; then
$IP6TABLES -Z
$IP6TABLES -t mangle -Z
date > ${VARDIR}/restarted
status=0
progress_message3 "$PRODUCT Counters Reset"
progress_message3 "$g_product Counters Reset"
else
shift
status=0
@@ -373,12 +215,14 @@ else
restart)
[ $# -ne 1 ] && usage 2
if shorewall6_is_started; then
progress_message3 "Restarting $PRODUCT...."
progress_message3 "Restarting $g_product...."
else
error_message "$PRODUCT is not running"
progress_message3 "Starting $PRODUCT...."
error_message "$g_product is not running"
progress_message3 "Starting $g_product...."
COMMAND=start
fi
detect_configuration
define_firewall
status=$?
if [ -n "$SUBSYSLOCK" ]; then
@@ -389,17 +233,19 @@ else
refresh)
[ $# -ne 1 ] && usage 2
if shorewall6_is_started; then
progress_message3 "Refreshing $PRODUCT...."
progress_message3 "Refreshing $g_product...."
detect_configuration
define_firewall
status=$?
progress_message3 "done."
else
echo "$PRODUCT is not running" >&2
echo "$g_product is not running" >&2
status=2
fi
;;
restore)
[ $# -ne 1 ] && usage 2
detect_configuration
define_firewall
status=$?
if [ -n "$SUBSYSLOCK" ]; then
@@ -408,21 +254,23 @@ else
;;
clear)
[ $# -ne 1 ] && usage 2
progress_message3 "Clearing $PRODUCT...."
progress_message3 "Clearing $g_product...."
clear_firewall
status=0
[ -n "$SUBSYSLOCK" ] && rm -f $SUBSYSLOCK
if [ -n "$SUBSYSLOCK" ]; then
rm -f $SUBSYSLOCK
fi
progress_message3 "done."
;;
status)
[ $# -ne 1 ] && usage 2
echo "$PRODUCT-$VERSION Status at $HOSTNAME - $(date)"
echo "$g_product-$SHOREWALL_VERSION Status at $(hostname) - $(date)"
echo
if shorewall6_is_started; then
echo "$PRODUCT is running"
echo "$g_product is running"
status=0
else
echo "$PRODUCT is stopped"
echo "$g_product is stopped"
status=4
fi
@@ -439,9 +287,16 @@ else
echo "State:$state"
echo
;;
up|down)
[ $# -eq 1 ] && exit 0
shift
[ $# -ne 1 ] && usage 2
updown $1
status=0
;;
version)
[ $# -ne 1 ] && usage 2
echo $VERSION
echo $SHOREWALL_VERSION
status=0
;;
help)

View File

@@ -1,11 +1,18 @@
#!/bin/sh
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 1999-2009 - Tom Eastep (teastep@shorewall.net)
# (c) 1999-2010 - Tom Eastep (teastep@shorewall.net)
#
# Options are:
#
# -n Don't alter Routing
# -v and -q Standard Shorewall Verbosity control
# -t Timestamp progress messages
# -p Purge conntrack table
# -r Recover from failed start/restart
# -V <verbosity> Set verbosity level explicitly
# -R <restore> Overrides RESTOREFILE setting
#
# Commands are:
#
@@ -22,14 +29,6 @@
################################################################################
# Functions imported from /usr/share/shorewall/prog.header
################################################################################
#
# Message to stderr
#
error_message() # $* = Error Message
{
echo " $@" >&2
}
#
# Conditionally produce message
#
@@ -38,12 +37,12 @@ progress_message() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 1 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
if [ $VERBOSITY -gt 1 ]; then
[ -n "$g_timestamp" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
if [ $LOG_VERBOSE -gt 1 ]; then
if [ $LOG_VERBOSITY -gt 1 ]; then
timestamp="$(date +'%b %_d %T') "
echo "${timestamp}$@" >> $STARTUP_LOG
fi
@@ -54,12 +53,12 @@ progress_message2() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
if [ $VERBOSITY -gt 0 ]; then
[ -n "$g_timestamp" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
if [ $LOG_VERBOSE -gt 0 ]; then
if [ $LOG_VERBOSITY -gt 0 ]; then
timestamp="$(date +'%b %_d %T') "
echo "${timestamp}$@" >> $STARTUP_LOG
fi
@@ -70,93 +69,17 @@ progress_message3() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -ge 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
if [ $VERBOSITY -ge 0 ]; then
[ -n "$g_timestamp" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
if [ $LOG_VERBOSE -ge 0 ]; then
if [ $LOG_VERBOSITY -ge 0 ]; then
timestamp="$(date +'%b %_d %T') "
echo "${timestamp}$@" >> $STARTUP_LOG
fi
}
#
# Split a colon-separated list into a space-separated list
#
split() {
local ifs
ifs=$IFS
IFS=:
echo $*
IFS=$ifs
}
#
# Search a list looking for a match -- returns zero if a match found
# 1 otherwise
#
list_search() # $1 = element to search for , $2-$n = list
{
local e
e=$1
while [ $# -gt 1 ]; do
shift
[ "x$e" = "x$1" ] && return 0
done
return 1
}
#
# Suppress all output for a command
#
qt()
{
"$@" >/dev/null 2>&1
}
qt1()
{
local status
while [ 1 ]; do
"$@" >/dev/null 2>&1
status=$?
[ $status -ne 4 ] && return $status
done
}
#
# Determine if Shorewall is "running"
#
shorewall_is_started() {
qt1 $IPTABLES -L shorewall -n
}
#
# Echos the fully-qualified name of the calling shell program
#
my_pathname() {
cd $(dirname $0)
echo $PWD/$(basename $0)
}
#
# Source a user exit file if it exists
#
run_user_exit() # $1 = file name
{
local user_exit
user_exit=$(find_file $1)
if [ -f $user_exit ]; then
progress_message "Processing $user_exit ..."
. $user_exit
fi
}
#
# Set a standard chain's policy
#
@@ -198,240 +121,17 @@ deleteallchains() {
}
#
# Load a Kernel Module -- assumes that the variable 'moduledirectories' contains
# a space-separated list of directories to search for
# the module and that 'moduleloader' contains the
# module loader command.
# Generate a list of all network interfaces on the system
#
loadmodule() # $1 = module name, $2 - * arguments
{
local modulename
modulename=$1
local modulefile
local suffix
if ! list_search $modulename $DONT_LOAD $MODULES; then
shift
for suffix in $MODULE_SUFFIX ; do
for directory in $moduledirectories; do
modulefile=$directory/${modulename}.${suffix}
if [ -f $modulefile ]; then
case $moduleloader in
insmod)
insmod $modulefile $*
;;
*)
modprobe $modulename $*
;;
esac
break 2
fi
done
done
fi
find_all_interfaces() {
${IP:-ip} link list | egrep '^[[:digit:]]+:' | cut -d ' ' -f2 | sed -r 's/(@.*)?:$//'
}
#
# Reload the Modules
# Generate a list of all network interfaces on the system that have an ipv4 address
#
reload_kernel_modules() {
local save_modules_dir
save_modules_dir=$MODULESDIR
local directory
local moduledirectories
moduledirectories=
local moduleloader
moduleloader=modprobe
local uname
if ! qt mywhich modprobe; then
moduleloader=insmod
fi
[ -n "${MODULE_SUFFIX:=o gz ko o.gz ko.gz}" ]
[ -z "$MODULESDIR" ] && \
uname=$(uname -r) && \
MODULESDIR=/lib/modules/$uname/kernel/net/ipv4/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset
MODULES=$(lsmod | cut -d ' ' -f1)
for directory in $(split $MODULESDIR); do
[ -d $directory ] && moduledirectories="$moduledirectories $directory"
done
[ -n "$moduledirectories" ] && while read command; do
eval $command
done
MODULESDIR=$save_modules_dir
}
#
# Load kernel modules required for Shorewall
#
load_kernel_modules() # $1 = Yes, if we are to save moduleinfo in $VARDIR
{
local save_modules_dir
save_modules_dir=$MODULESDIR
local directory
local moduledirectories
moduledirectories=
local moduleloader
moduleloader=modprobe
local savemoduleinfo
savemoduleinfo=${1:-Yes} # So old compiled scripts still work
local uname
if ! qt mywhich modprobe; then
moduleloader=insmod
fi
[ -n "${MODULE_SUFFIX:=o gz ko o.gz ko.gz}" ]
[ -z "$MODULESDIR" ] && \
uname=$(uname -r) && \
MODULESDIR=/lib/modules/$uname/kernel/net/ipv4/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset
for directory in $(split $MODULESDIR); do
[ -d $directory ] && moduledirectories="$moduledirectories $directory"
done
modules=$(find_file modules)
if [ -f $modules -a -n "$moduledirectories" ]; then
MODULES=$(lsmod | cut -d ' ' -f1)
progress_message "Loading Modules..."
. $modules
if [ $savemoduleinfo = Yes ]; then
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
echo MODULESDIR="$MODULESDIR" > ${VARDIR}/.modulesdir
cp -f $modules ${VARDIR}/.modules
fi
elif [ $savemoduleinfo = Yes ]; then
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
> ${VARDIR}/.modulesdir
> ${VARDIR}/.modules
fi
MODULESDIR=$save_modules_dir
}
#
# Note: The following set of IP address manipulation functions have anomalous
# behavior when the shell only supports 32-bit signed arithmetic and
# the IP address is 128.0.0.0 or 128.0.0.1.
#
LEFTSHIFT='<<'
#
# Convert an IP address in dot quad format to an integer
#
decodeaddr() {
local x
local temp
temp=0
local ifs
ifs=$IFS
IFS=.
for x in $1; do
temp=$(( $(( $temp $LEFTSHIFT 8 )) | $x ))
done
echo $temp
IFS=$ifs
}
#
# convert an integer to dot quad format
#
encodeaddr() {
addr=$1
local x
local y
y=$(($addr & 255))
for x in 1 2 3 ; do
addr=$(($addr >> 8))
y=$(($addr & 255)).$y
done
echo $y
}
#
# Netmask from CIDR
#
ip_netmask() {
local vlsm
vlsm=${1#*/}
[ $vlsm -eq 0 ] && echo 0 || echo $(( -1 $LEFTSHIFT $(( 32 - $vlsm )) ))
}
#
# Network address from CIDR
#
ip_network() {
local decodedaddr
decodedaddr=$(decodeaddr ${1%/*})
local netmask
netmask=$(ip_netmask $1)
echo $(encodeaddr $(($decodedaddr & $netmask)))
}
#
# The following hack is supplied to compensate for the fact that many of
# the popular light-weight Bourne shell derivatives don't support XOR ("^").
#
ip_broadcast() {
local x
x=$(( 32 - ${1#*/} ))
[ $x -eq 32 ] && echo -1 || echo $(( $(( 1 $LEFTSHIFT $x )) - 1 ))
}
#
# Calculate broadcast address from CIDR
#
broadcastaddress() {
local decodedaddr
decodedaddr=$(decodeaddr ${1%/*})
local netmask
netmask=$(ip_netmask $1)
local broadcast
broadcast=$(ip_broadcast $1)
echo $(encodeaddr $(( $(($decodedaddr & $netmask)) | $broadcast )))
}
#
# Test for network membership
#
in_network() # $1 = IP address, $2 = CIDR network
{
local netmask
netmask=$(ip_netmask $2)
#
# Use string comparison to work around a broken BusyBox ash in OpenWRT
#
test $(( $(decodeaddr $1) & $netmask)) = $(( $(decodeaddr ${2%/*}) & $netmask ))
}
#
# Query NetFilter about the existence of a filter chain
#
chain_exists() # $1 = chain name
{
qt1 $IPTABLES -L $1 -n
find_all_interfaces1() {
${IP:-ip} -4 addr list | egrep '^[[:digit:]]+:' | cut -d ' ' -f2 | sed -r 's/(@.*)?:$//'
}
#
@@ -534,32 +234,6 @@ find_interface_by_address() {
[ -n "$dev" ] && echo $dev
}
#
# Find the interface with the passed MAC address
#
find_interface_by_mac() {
local mac
mac=$1
local first
local second
local rest
local dev
$IP link list | while read first second rest; do
case $first in
*:)
dev=$second
;;
*)
if [ "$second" = $mac ]; then
echo ${dev%:}
return
fi
esac
done
}
#
# Determine if Interface is up
#
@@ -567,45 +241,12 @@ interface_is_up() {
[ -n "$($IP link list dev $1 2> /dev/null | grep -e '[<,]UP[,>]')" ]
}
#
# Find interface address--returns the first IP address assigned to the passed
# device
#
find_first_interface_address() # $1 = interface
{
#
# get the line of output containing the first IP address
#
addr=$($IP -f inet addr show $1 2> /dev/null | grep 'inet .* global' | head -n1)
#
# If there wasn't one, bail out now
#
[ -n "$addr" ] || startup_error "Can't determine the IP address of $1"
#
# Strip off the trailing VLSM mask (or the peer IP in case of a P-t-P link)
# along with everything else on the line
#
echo $addr | sed 's/\s*inet //;s/\/.*//;s/ peer.*//'
}
find_first_interface_address_if_any() # $1 = interface
{
#
# get the line of output containing the first IP address
#
addr=$($IP -f inet addr show $1 2> /dev/null | grep 'inet .* global' | head -n1)
#
# Strip off the trailing VLSM mask (or the peer IP in case of a P-t-P link)
# along with everything else on the line
#
[ -n "$addr" ] && echo $addr | sed 's/\s*inet //;s/\/.*//;s/ peer.*//' || echo 0.0.0.0
}
#
# Determine if interface is usable from a Netfilter prespective
#
interface_is_usable() # $1 = interface
{
[ "$1" = lo ] && return 0
interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != 0.0.0.0 ] && run_isusable_exit $1
}
@@ -658,71 +299,6 @@ get_interface_bcasts() # $1 = interface
$IP -f inet addr show dev $1 2> /dev/null | grep 'inet.*brd' | sed 's/inet.*brd //; s/scope.*//;' | sort -u
}
#
# Internal version of 'which'
#
mywhich() {
local dir
for dir in $(split $PATH); do
if [ -x $dir/$1 ]; then
echo $dir/$1
return 0
fi
done
return 2
}
#
# Find a File -- For relative file name, look in each ${CONFIG_PATH} then ${CONFDIR}
#
find_file()
{
local saveifs
saveifs=
local directory
case $1 in
/*)
echo $1
;;
*)
for directory in $(split $CONFIG_PATH); do
if [ -f $directory/$1 ]; then
echo $directory/$1
return
fi
done
echo ${CONFDIR}/$1
;;
esac
}
#
# Set the Shorewall state
#
set_state () # $1 = state
{
echo "$1 ($(date))" > ${VARDIR}/state
}
#
# Perform variable substitution on the passed argument and echo the result
#
expand() # $@ = contents of variable which may be the name of another variable
{
eval echo \"$@\"
}
#
# Function for including one file into another
#
INCLUDE() {
. $(find_file $(expand $@))
}
#
# Delete IP address
#
@@ -875,16 +451,6 @@ disable_ipv6() {
fi
}
# Function to truncate a string -- It uses 'cut -b -<n>'
# rather than ${v:first:last} because light-weight shells like ash and
# dash do not support that form of expansion.
#
truncate() # $1 = length
{
cut -b -${1}
}
#
# Clear the current traffic shaping configuration
#
@@ -950,7 +516,7 @@ get_device_mtu1() # $1 = device
#
undo_routing() {
if [ -z "$NOROUTES" ]; then
if [ -z "$g_noroutes" ]; then
#
# Restore rt_tables database
#
@@ -974,7 +540,7 @@ undo_routing() {
# Restore the default route that was in place before the initial 'shorewall start'
#
restore_default_route() {
if [ -z "$NOROUTES" -a -f ${VARDIR}/default_route ]; then
if [ -z "$g_noroutes" -a -f ${VARDIR}/default_route ]; then
local default_route
default_route=
local route
@@ -1017,25 +583,6 @@ restore_default_route() {
return $result
}
#
# Determine how to do "echo -e"
#
find_echo() {
local result
result=$(echo "a\tb")
[ ${#result} -eq 3 ] && { echo echo; return; }
result=$(echo -e "a\tb")
[ ${#result} -eq 3 ] && { echo "echo -e"; return; }
result=$(mywhich echo)
[ -n "$result" ] && { echo "$result -e"; return; }
echo echo
}
#
# Determine the MAC address of the passed IP through the passed interface
#
@@ -1058,11 +605,11 @@ find_mac() # $1 = IP address, $2 = interface
}
#
# Flush the conntrack table if $PURGE is non-empty
# Flush the conntrack table if $g_purge is non-empty
#
conditionally_flush_conntrack() {
if [ -n "$PURGE" ]; then
if [ -n "$g_purge" ]; then
if [ -n $(mywhich conntrack) ]; then
conntrack -F
else
@@ -1071,6 +618,261 @@ conditionally_flush_conntrack() {
fi
}
#
# Clear Proxy Arp
#
delete_proxyarp() {
if [ -f ${VARDIR}/proxyarp ]; then
while read address interface external haveroute; do
qt arp -i $external -d $address pub
[ -z "${haveroute}${g_noroutes}" ] && qt $IP -4 route del $address dev $interface
f=/proc/sys/net/ipv4/conf/$interface/proxy_arp
[ -f $f ] && echo 0 > $f
done < ${VARDIR}/proxyarp
fi
rm -f ${VARDIR}/proxyarp
}
#
# Remove all Shorewall-added rules
#
clear_firewall() {
stop_firewall
setpolicy INPUT ACCEPT
setpolicy FORWARD ACCEPT
setpolicy OUTPUT ACCEPT
run_iptables -F
echo 1 > /proc/sys/net/ipv4/ip_forward
if [ -n "$DISABLE_IPV6" ]; then
if [ -x $IP6TABLES ]; then
$IP6TABLES -P INPUT ACCEPT 2> /dev/null
$IP6TABLES -P OUTPUT ACCEPT 2> /dev/null
$IP6TABLES -P FORWARD ACCEPT 2> /dev/null
fi
fi
run_clear_exit
set_state "Cleared"
logger -p kern.info "$g_product Cleared"
}
#
# Issue a message and stop/restore the firewall
#
fatal_error()
{
echo " ERROR: $@" >&2
if [ $LOG_VERBOSITY -ge 0 ]; then
timestamp="$(date +'%_b %d %T') "
echo "${timestamp} ERROR: $@" >> $STARTUP_LOG
fi
stop_firewall
[ -n "$TEMPFILE" ] && rm -f $TEMPFILE
exit 2
}
#
# Issue a message and stop
#
startup_error() # $* = Error Message
{
echo " ERROR: $@: Firewall state not changed" >&2
if [ $LOG_VERBOSITY -ge 0 ]; then
timestamp="$(date +'%_b %d %T') "
echo "${timestamp} ERROR: $@" >> $STARTUP_LOG
fi
case $COMMAND in
start)
logger -p kern.err "ERROR:$g_product start failed:Firewall state not changed"
;;
restart)
logger -p kern.err "ERROR:$g_product restart failed:Firewall state not changed"
;;
restore)
logger -p kern.err "ERROR:$g_product restore failed:Firewall state not changed"
;;
esac
if [ $LOG_VERBOSITY -ge 0 ]; then
timestamp="$(date +'%_b %d %T') "
case $COMMAND in
start)
echo "${timestamp} ERROR:$g_product start failed:Firewall state not changed" >> $STARTUP_LOG
;;
restart)
echo "${timestamp} ERROR:$g_product restart failed:Firewall state not changed" >> $STARTUP_LOG
;;
restore)
echo "${timestamp} ERROR:$g_product restore failed:Firewall state not changed" >> $STARTUP_LOG
;;
esac
fi
kill $$
exit 2
}
#
# Run iptables and if an error occurs, stop/restore the firewall
#
run_iptables()
{
local status
while [ 1 ]; do
$IPTABLES $@
status=$?
[ $status -ne 4 ] && break
done
if [ $status -ne 0 ]; then
error_message "ERROR: Command \"$IPTABLES $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Run iptables retrying exit status 4
#
do_iptables()
{
local status
while [ 1 ]; do
$IPTABLES $@
status=$?
[ $status -ne 4 ] && return $status;
done
}
#
# Run iptables and if an error occurs, stop/restore the firewall
#
run_ip()
{
if ! $IP -4 $@; then
error_message "ERROR: Command \"$IP -4 $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Run tc and if an error occurs, stop/restore the firewall
#
run_tc() {
if ! $TC $@ ; then
error_message "ERROR: Command \"$TC $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Get a list of all configured broadcast addresses on the system
#
get_all_bcasts()
{
$IP -f inet addr show 2> /dev/null | grep 'inet.*brd' | grep -v '/32 ' | sed 's/inet.*brd //; s/scope.*//;' | sort -u
}
#
# Run the .iptables_restore_input as a set of discrete iptables commands
#
debug_restore_input() {
local first second rest table chain
#
# Clear the ruleset
#
qt1 $IPTABLES -t mangle -F
qt1 $IPTABLES -t mangle -X
for chain in PREROUTING INPUT FORWARD POSTROUTING; do
qt1 $IPTABLES -t mangle -P $chain ACCEPT
done
qt1 $IPTABLES -t raw -F
qt1 $IPTABLES -t raw -X
for chain in PREROUTING OUTPUT; do
qt1 $IPTABLES -t raw -P $chain ACCEPT
done
run_iptables -t nat -F
run_iptables -t nat -X
for chain in PREROUTING POSTROUTING OUTPUT; do
qt1 $IPTABLES -t nat -P $chain ACCEPT
done
qt1 $IPTABLES -t filter -F
qt1 $IPTABLES -t filter -X
for chain in INPUT FORWARD OUTPUT; do
qt1 $IPTABLES -t filter -P $chain -P ACCEPT
done
while read first second rest; do
case $first in
-*)
#
# We can't call run_iptables() here because the rules may contain quoted strings
#
eval $IPTABLES -t $table $first $second $rest
if [ $? -ne 0 ]; then
error_message "ERROR: Command \"$IPTABLES $first $second $rest\" Failed"
stop_firewall
exit 2
fi
;;
:*)
chain=${first#:}
if [ "x$second" = x- ]; then
do_iptables -t $table -N $chain
else
do_iptables -t $table -P $chain $second
fi
if [ $? -ne 0 ]; then
error_message "ERROR: Command \"$IPTABLES $first $second $rest\" Failed"
stop_firewall
exit 2
fi
;;
#
# This grotesque hack with the table names works around a bug/feature with ash
#
'*'raw)
table=raw
;;
'*'mangle)
table=mangle
;;
'*'nat)
table=nat
;;
'*'filter)
table=filter
;;
esac
done
}
################################################################################
# End of functions in /usr/share/shorewall/prog.header
################################################################################

View File

@@ -1,11 +1,18 @@
#!/bin/sh
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# (c) 1999-2009 - Tom Eastep (teastep@shorewall.net)
# (c) 1999-2010- Tom Eastep (teastep@shorewall.net)
#
# Options are:
#
# -n Don't alter Routing
# -v and -q Standard Shorewall Verbosity control
# -t Timestamp progress messages
# -p Purge conntrack table
# -r Recover from failed start/restart
# -V <verbosity> Set verbosity level explicitly
# -R <restore> Overrides RESTOREFILE setting
#
# Commands are:
#
@@ -22,14 +29,6 @@
################################################################################
# Functions imported from /usr/share/shorewall/prog.header6
################################################################################
#
# Message to stderr
#
error_message() # $* = Error Message
{
echo " $@" >&2
}
#
# Conditionally produce message
#
@@ -38,12 +37,12 @@ progress_message() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 1 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
if [ $VERBOSITY -gt 1 ]; then
[ -n "$g_timestamp" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
if [ $LOG_VERBOSE -gt 1 ]; then
if [ $LOG_VERBOSITY -gt 1 ]; then
timestamp="$(date +'%b %_d %T') "
echo "${timestamp}$@" >> $STARTUP_LOG
fi
@@ -54,12 +53,12 @@ progress_message2() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
if [ $VERBOSITY -gt 0 ]; then
[ -n "$g_timestamp" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
if [ $LOG_VERBOSE -gt 0 ]; then
if [ $LOG_VERBOSITY -gt 0 ]; then
timestamp="$(date +'%b %_d %T') "
echo "${timestamp}$@" >> $STARTUP_LOG
fi
@@ -70,117 +69,17 @@ progress_message3() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -ge 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
if [ $VERBOSITY -ge 0 ]; then
[ -n "$g_timestamp" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
if [ $LOG_VERBOSE -ge 0 ]; then
if [ $LOG_VERBOSITY -ge 0 ]; then
timestamp="$(date +'%b %_d %T') "
echo "${timestamp}$@" >> $STARTUP_LOG
fi
}
#
# Split a colon-separated list into a space-separated list
#
split() {
local ifs
ifs=$IFS
IFS=:
echo $*
IFS=$ifs
}
#
# Undo the effect of 'split()'
#
join()
{
local f
local o
o=
for f in $* ; do
o="${o:+$o:}$f"
done
echo $o
}
#
# Return the number of elements in a list
#
list_count() # $* = list
{
return $#
}
#
# Search a list looking for a match -- returns zero if a match found
# 1 otherwise
#
list_search() # $1 = element to search for , $2-$n = list
{
local e
e=$1
while [ $# -gt 1 ]; do
shift
[ "x$e" = "x$1" ] && return 0
done
return 1
}
#
# Suppress all output for a command
#
qt()
{
"$@" >/dev/null 2>&1
}
qt1()
{
local status
while [ 1 ]; do
"$@" >/dev/null 2>&1
status=$?
[ $status -ne 4 ] && return $status
done
}
#
# Determine if Shorewall is "running"
#
shorewall6_is_started() {
qt1 $IP6TABLES -L shorewall -n
}
#
# Echos the fully-qualified name of the calling shell program
#
my_pathname() {
cd $(dirname $0)
echo $PWD/$(basename $0)
}
#
# Source a user exit file if it exists
#
run_user_exit() # $1 = file name
{
local user_exit
user_exit=$(find_file $1)
if [ -f $user_exit ]; then
progress_message "Processing $user_exit ..."
. $user_exit
fi
}
#
# Set a standard chain's policy
#
@@ -214,128 +113,17 @@ deleteallchains() {
}
#
# Load a Kernel Module -- assumes that the variable 'moduledirectories' contains
# a space-separated list of directories to search for
# the module and that 'moduleloader' contains the
# module loader command.
# Generate a list of all network interfaces on the system
#
loadmodule() # $1 = module name, $2 - * arguments
{
local modulename
modulename=$1
local modulefile
local suffix
if ! list_search $modulename $DONT_LOAD $MODULES; then
shift
for suffix in $MODULE_SUFFIX ; do
for directory in $moduledirectories; do
modulefile=$directory/${modulename}.${suffix}
if [ -f $modulefile ]; then
case $moduleloader in
insmod)
insmod $modulefile $*
;;
*)
modprobe $modulename $*
;;
esac
break 2
fi
done
done
fi
find_all_interfaces() {
${IP:-ip} link list | egrep '^[[:digit:]]+:' | cut -d ' ' -f2 | sed -r 's/(@.*)?:$//'
}
#
# Reload the Modules
# Generate a list of all network interfaces on the system that have an ipv6 address
#
reload_kernel_modules() {
local save_modules_dir
save_modules_dir=$MODULESDIR
local directory
local moduledirectories
moduledirectories=
local moduleloader
moduleloader=modprobe
if ! qt mywhich modprobe; then
moduleloader=insmod
fi
[ -n "${MODULE_SUFFIX:=o gz ko o.gz ko.gz}" ]
[ -z "$MODULESDIR" ] && MODULESDIR=/lib/modules/$(uname -r)/kernel/net/ipv6/netfilter:/lib/modules/$(uname -r)/kernel/net/netfilter
MODULES=$(lsmod | cut -d ' ' -f1)
for directory in $(split $MODULESDIR); do
[ -d $directory ] && moduledirectories="$moduledirectories $directory"
done
[ -n "$moduledirectories" ] && while read command; do
eval $command
done
MODULESDIR=$save_modules_dir
}
#
# Load kernel modules required for Shorewall6
#
load_kernel_modules() # $1 = Yes, if we are to save moduleinfo in $VARDIR
{
local save_modules_dir
save_modules_dir=$MODULESDIR
local directory
local moduledirectories
moduledirectories=
local moduleloader
moduleloader=modprobe
local savemoduleinfo
savemoduleinfo=${1:-Yes} # So old compiled scripts still work
if ! qt mywhich modprobe; then
moduleloader=insmod
fi
[ -n "${MODULE_SUFFIX:=o gz ko o.gz ko.gz}" ]
[ -z "$MODULESDIR" ] && \
MODULESDIR=/lib/modules/$(uname -r)/kernel/net/ipv6/netfilter:/lib/modules/$(uname -r)/kernel/net/netfilter
for directory in $(split $MODULESDIR); do
[ -d $directory ] && moduledirectories="$moduledirectories $directory"
done
modules=$(find_file modules)
if [ -f $modules -a -n "$moduledirectories" ]; then
MODULES=$(lsmod | cut -d ' ' -f1)
progress_message "Loading Modules..."
. $modules
if [ $savemoduleinfo = Yes ]; then
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
echo MODULESDIR="$MODULESDIR" > ${VARDIR}/.modulesdir
cp -f $modules ${VARDIR}/.modules
fi
elif [ $savemoduleinfo = Yes ]; then
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
> ${VARDIR}/.modulesdir
> ${VARDIR}/.modules
fi
MODULESDIR=$save_modules_dir
}
#
# Query NetFilter about the existence of a filter chain
#
chain_exists() # $1 = chain name
{
qt1 $IP6TABLES -L $1 -n
find_all_interfaces1() {
${IP:-ip} -6 addr list | egrep '^[[:digit:]]+:' | cut -d ' ' -f2 | sed -r 's/(@.*)?:$//'
}
#
@@ -400,71 +188,11 @@ find_default_interface() {
done
}
#
# Find the interface with the passed MAC address
#
find_interface_by_mac() {
local mac
mac=$1
local first
local second
local rest
local dev
$IP link list | while read first second rest; do
case $first in
*:)
dev=$second
;;
*)
if [ "$second" = $mac ]; then
echo ${dev%:}
return
fi
esac
done
}
#
# Determine if Interface is up
#
interface_is_up() {
[ -n "$($IP link list dev $1 2> /dev/null | grep -e '[<,]UP[,>]')" ]
}
#
# Find interface address--returns the first IP address assigned to the passed
# device
#
find_first_interface_address() # $1 = interface
{
#
# get the line of output containing the first IP address
#
addr=$($IP -f inet6 addr show $1 2> /dev/null | grep 'inet6 .* global' | head -n1)
#
# If there wasn't one, bail out now
#
[ -n "$addr" ] || startup_error "Can't determine the IPv6 address of $1"
#
# Strip off the trailing VLSM mask (or the peer IP in case of a P-t-P link)
# along with everything else on the line
#
echo $addr | sed 's/\s*inet6 //;s/\/.*//;s/ peer.*//'
}
find_first_interface_address_if_any() # $1 = interface
{
#
# get the line of output containing the first IP address
#
addr=$($IP -f inet6 addr show $1 2> /dev/null | grep 'inet6 2.* global' | head -n1)
#
# Strip off the trailing VLSM mask (or the peer IP in case of a P-t-P link)
# along with everything else on the line
#
[ -n "$addr" ] && echo $addr | sed 's/\s*inet6 //;s/\/.*//;s/ peer.*//' || echo ::
[ -n "$($IP -6 link list dev $1 2> /dev/null | grep -e '[<,]UP[,>]')" ]
}
#
@@ -472,6 +200,7 @@ find_first_interface_address_if_any() # $1 = interface
#
interface_is_usable() # $1 = interface
{
[ "$1" = lo ] && return 0
interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != :: ] && run_isusable_exit $1
}
@@ -681,71 +410,6 @@ get_all_acasts()
find_interface_full_addresses | convert_to_anycast | sort -u
}
#
# Internal version of 'which'
#
mywhich() {
local dir
for dir in $(split $PATH); do
if [ -x $dir/$1 ]; then
echo $dir/$1
return 0
fi
done
return 2
}
#
# Find a File -- For relative file name, look in each ${CONFIG_PATH} then ${CONFDIR}
#
find_file()
{
local saveifs
saveifs=
local directory
case $1 in
/*)
echo $1
;;
*)
for directory in $(split $CONFIG_PATH); do
if [ -f $directory/$1 ]; then
echo $directory/$1
return
fi
done
echo ${CONFDIR}/$1
;;
esac
}
#
# Set the Shorewall state
#
set_state () # $1 = state
{
echo "$1 ($(date))" > ${VARDIR}/state
}
#
# Perform variable substitution on the passed argument and echo the result
#
expand() # $@ = contents of variable which may be the name of another variable
{
eval echo \"$@\"
}
#
# Function for including one file into another
#
INCLUDE() {
. $(find_file $(expand $@))
}
#
# Detect the gateway through an interface
#
@@ -771,20 +435,6 @@ detect_gateway() # $1 = interface
[ -n "$gateway" ] && echo $gateway
}
# Function to truncate a string -- It uses 'cut -b -<n>'
# rather than ${v:first:last} because light-weight shells like ash and
# dash do not support that form of expansion.
#
truncate() # $1 = length
{
cut -b -${1}
}
#
# Clear the current traffic shaping configuration
#
delete_tc1()
{
clear_one_tc() {
@@ -846,7 +496,7 @@ get_device_mtu1() # $1 = device
#
undo_routing() {
if [ -z "$NOROUTES" ]; then
if [ -z "$g_noroutes" ]; then
#
# Restore rt_tables database
#
@@ -870,7 +520,7 @@ undo_routing() {
# Restore the default route that was in place before the initial 'shorewall start'
#
restore_default_route() {
if [ -z "$NOROUTES" -a -f ${VARDIR}/default_route ]; then
if [ -z "$g_noroutes" -a -f ${VARDIR}/default_route ]; then
local default_route
default_route=
local route
@@ -933,11 +583,11 @@ find_echo() {
}
#
# Flush the conntrack table if $PURGE is non-empty
# Flush the conntrack table if $g_purge is non-empty
#
conditionally_flush_conntrack() {
if [ -n "$PURGE" ]; then
if [ -n "$g_purge" ]; then
if [ -n $(which conntrack) ]; then
conntrack -F
else
@@ -946,6 +596,222 @@ conditionally_flush_conntrack() {
fi
}
#
# Remove all Shorewall-added rules
#
clear_firewall() {
stop_firewall
setpolicy INPUT ACCEPT
setpolicy FORWARD ACCEPT
setpolicy OUTPUT ACCEPT
run_iptables -F
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
run_clear_exit
set_state "Cleared"
logger -p kern.info "$g_product Cleared"
}
#
# Issue a message and stop/restore the firewall
#
fatal_error()
{
echo " ERROR: $@" >&2
if [ $LOG_VERBOSITY -gt 1 ]; then
timestamp="$(date +'%_b %d %T') "
echo "${timestamp} ERROR: $@" >> $STARTUP_LOG
fi
stop_firewall
[ -n "$TEMPFILE" ] && rm -f $TEMPFILE
exit 2
}
#
# Issue a message and stop
#
startup_error() # $* = Error Message
{
echo " ERROR: $@: Firewall state not changed" >&2
if [ $LOG_VERBOSITY -ge 0 ]; then
timestamp="$(date +'%_b %d %T') "
echo "${timestamp} ERROR: $@" >> $STARTUP_LOG
fi
case $COMMAND in
start)
logger -p kern.err "ERROR:$g_product start failed:Firewall state not changed"
;;
restart)
logger -p kern.err "ERROR:$g_product restart failed:Firewall state not changed"
;;
restore)
logger -p kern.err "ERROR:$g_product restore failed:Firewall state not changed"
;;
esac
if [ $LOG_VERBOSITY -gt 1 ]; then
timestamp="$(date +'%_b %d %T') "
case $COMMAND in
start)
echo "${timestamp} ERROR:$g_product start failed:Firewall state not changed" >> $STARTUP_LOG
;;
restart)
echo "${timestamp} ERROR:$g_product restart failed:Firewall state not changed" >> $STARTUP_LOG
;;
restore)
echo "${timestamp} ERROR:$g_product restore failed:Firewall state not changed" >> $STARTUP_LOG
;;
esac
fi
kill $$
exit 2
}
#
# Run iptables and if an error occurs, stop/restore the firewall
#
run_iptables()
{
local status
while [ 1 ]; do
$IP6TABLES $@
status=$?
[ $status -ne 4 ] && break
done
if [ $status -ne 0 ]; then
error_message "ERROR: Command \"$IP6TABLES $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Run iptables retrying exit status 4
#
do_iptables()
{
local status
while [ 1 ]; do
$IP6TABLES $@
status=$?
[ $status -ne 4 ] && return $status;
done
}
#
# Run iptables and if an error occurs, stop/restore the firewall
#
run_ip()
{
if ! $IP -6 $@; then
error_message "ERROR: Command \"$IP -6 $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Run tc and if an error occurs, stop/restore the firewall
#
run_tc() {
if ! $TC $@ ; then
error_message "ERROR: Command \"$TC $@\" Failed"
stop_firewall
exit 2
fi
}
#
# Run the .iptables_restore_input as a set of discrete iptables commands
#
debug_restore_input() {
local first second rest table chain
#
# Clear the ruleset
#
qt1 $IP6TABLES -t mangle -F
qt1 $IP6TABLES -t mangle -X
for chain in PREROUTING INPUT FORWARD POSTROUTING; do
qt1 $IP6TABLES -t mangle -P $chain ACCEPT
done
qt1 $IP6TABLES -t raw -F
qt1 $IP6TABLES -t raw -X
for chain in PREROUTING OUTPUT; do
qt1 $IP6TABLES -t raw -P $chain ACCEPT
done
qt1 $IP6TABLES -t filter -F
qt1 $IP6TABLES -t filter -X
for chain in INPUT FORWARD OUTPUT; do
qt1 $IP6TABLES -t filter -P $chain -P ACCEPT
done
while read first second rest; do
case $first in
-*)
#
# We can't call run_iptables() here because the rules may contain quoted strings
#
eval $IP6TABLES -t $table $first $second $rest
if [ $? -ne 0 ]; then
error_message "ERROR: Command \"$IP6TABLES $first $second $rest\" Failed"
stop_firewall
exit 2
fi
;;
:*)
chain=${first#:}
if [ "x$second" = x- ]; then
do_iptables -t $table -N $chain
else
do_iptables -t $table -P $chain $second
fi
if [ $? -ne 0 ]; then
error_message "ERROR: Command \"$IP6TABLES $first $second $rest\" Failed"
stop_firewall
exit 2
fi
;;
#
# This grotesque hack with the table names works around a bug/feature with ash
#
'*'raw)
table=raw
;;
'*'mangle)
table=mangle
;;
'*'nat)
table=nat
;;
'*'filter)
table=filter
;;
esac
done
}
################################################################################
# End of functions imported from /usr/share/shorewall/prog.header6
################################################################################

View File

@@ -1,11 +1,384 @@
Changes in Shorewall 4.4.13
Changes in Shorewall 4.4.0.1
1) Allow zone lists in rules SOURCE and DEST.
1) Updated release versions.
2) Fix exclusion in the blacklist file.
2) Fix log level in rules at the end of INPUT and OUTPUT
3) Correct several old exclusion bugs.
3) Correct handling of nested IPSEC chains.
4) Fix exclusion with CONTINUE/NONAT/ACCEPT+
5) Re-implement optional interface handling.
Changes in Shorewall 4.4.12
1) Fix IPv6 shorecap program.
2) Eradicate incorrect IPv6 Multicast Network
3) Add ADD/DEL support.
4) Allow :random to work with REDIRECT
5) Add per-ip log rate limiting.
6) Use new hashlimit match syntax if available.
7) Add Universal sample.
8) Add COMPLETE option.
9) Make ICMP a synonym for IPV6-ICMP in ipv6 configs.
10) Support new set match syntax.
11) Blacklisting by DEST IP.
12) Fix duplicate rule generation with 'any'.
13) Fix port range editing problem.
14) Display the .conf file directory in response to the status command.
15) Correct AUTOMAKE
Changes in Shorewall 4.4.11
1) Apply patch from Gabriel.
2) Fix IPSET match detection when a pathname is specified for IPSET.
3) Fix start priority of shorewall-init on Debian
4) Make IPv6 log and connections output readable.
5) Add REQUIRE_INTERFACE to shorewall*.conf
6) Avoid run-time warnings when options are not listed in
shorewall.conf.
7) Implement Vserver zones.
8) Make find_hosts_by_option() work correctly where ALL_IP appears in
hosts file.
9) Add CLEAR_FORWARD_MARK option.
10) Avoid missing closing quote when REQUIRE_INTERFACE=Yes.
11) Add PERL option.
12) Fix nets= in Shorewall6
Changes in Shorewall 4.4.10
1) Fix regression with scripts.
2) Log startup errors.
3) Implement Shorewall-init.
4) Add SAFESTOP option to /etc/default/shorewall*
5) Restore -a functionality to the version command.
6) Correct Optimization issue
7) Rename PREFIX to DESTDIR in install scripts
8) Correct handling of optional/required interfaces with wildcard names.
Changes in Shorewall 4.4.9
1) Auto-detection of bridges.
2) Correct handling of a logical interface name in the EXTERNAL column
of proxyarp.
3) More robust 'trace'.
4) Added IPv6 mDNS macro.
5) Fix find_first_interface_address() error reporting.
6) Fix propagation of zero-valued config variables.
7) Fix OPTIMIZE 4 bug.
8) Deallocate unused rules.
9) Keep rule arrays compressed during optimization.
10) Remove remaining fallback scripts.
11) Rationalize startup logs.
12) Optimize 8.
13) Don't create output chains for BPORT zones.
14) Implement 'show log ip-addr' in /sbin/shorewall and
/sbin/shorewall-lite/
15) Restore lone ACCEPT rule to the OUTPUT chain under OPTIMIZE 2.
16) Change chain policy on OUTPUT chain with lone ACCEPT rule.
17) Set IP before sourcing the params file.
18) Fix rare optimization bug.
19) Allow definition of an addressless bridge without a zone.
20) In the routestopped file, assume 'routeback' if the interface has
'routeback'.
21) Make Shorewall and Shorewall6 installable on OS X.
Changes in Shorewall 4.4.8
1) Correct handling of RATE LIMIT on NAT rules.
2) Don't create a logging chain for rules with '-j RETURN'.
3) Avoid duplicate SFQ class numbers.
4) Fix low per-IP rate limits.
5) Fix Debian init script exit status
6) Fix NFQUEUE(queue-num) in policy
7) Implement -s option in install.sh
8) Add HKP Macro
9) Fix multiple policy matches with OPTIMIZE 4 and not KLUDGEFREE
10) Eliminate up-cased variable names that aren't documented options.
11) Don't show 'OLD' capabilities if they are not available.
12) Attempt to flag use of '-' as a port-range separator.
13) Add undocumented OPTIMIZE=-1 setting.
14) Replace OPTIMIZE=-1 with undocumented optimize 4096 which DISABLES
default optimizations.
15) Add support for UDPLITE
16) Distinguish between 'Started' and 'Restored' in ${VARDIR}/state
17) Issue warnings when 'blacklist' but no blacklist file entries.
18) Don't optimize 'blacklst'.
Changes in Shorewall 4.4.7
1) Backport optimization changes from 4.5.
2) Backport two new options from 4.5.
3) Backport TPROXY from 4.5
4) Add TC_PRIOMAP to shorewall*.conf
5) Implement LOAD_HELPERS_ONLY
6) Avoid excessive module loading with LOAD_HELPERS_ONLY=Yes
7) Fix case where MARK target is unavailable.
8) Change default to ADD_IP_ALIASES=No
9) Correct defects in generate_matrix().
10) Fix and optimize 'nosmurfs'.
11) Use 'OLD_HL_MATCH' to suppress use of 'flow' in Simple TC.
Changes in Shorewall 4.4.6
1) Fix for rp_filter and kernel 2.6.31.
2) Add a hack to work around a bug in Lenny + xtables-addons
3) Re-enable SAVE_IPSETS
4) Allow both <...> and [...] for IPv6 Addresses.
5) Port mark geometry change from 4.5.
6) Add Macro patch from Tuomo Soini
7) Add 'show macro' command.
8) Add -r option to check.
9) Port simplified TC from 4.5.
Changes in Shorewall 4.4.5
1) Fix 15-port limit removal change.
2) Fix handling of interfaces with the 'bridge' option.
3) Generate error for port number 0
4) Allow zone::serverport in rules DEST column.
5) Fix 'show policies' in Shorewall6.
6) Auto-load tc modules.
7) Allow LOGFILE=/dev/null
8) Fix shorewall6-lite/shorecap
9) Fix MODULE_SUFFIX.
10) Fix ENHANCED_REJECT detection for IPv4.
11) Fix DONT_LOAD vs 'reload -c'
12) Fix handling of SOURCE and DEST vs macros.
13) Remove silly logic in expand_rule().
14) Add current and limit to Conntrack Table Heading.
Changes in Shorewall 4.4.4
1) Change STARTUP_LOG and LOG_VERBOSITY in default shorewall6.conf.
2) Fix access to uninitialized variable.
3) Add logrotate scripts.
4) Allow long port lists in /etc/shorewall/routestopped.
5) Implement 'physical' interface option.
6) Implement ZONE2ZONE option.
7) Suppress duplicate COMMENT warnings.
8) Implement 'show policies' command.
9) Fix route_rule suppression for down provider.
10) Suppress redundant tests for provider availability in route rules
processing.
11) Implement the '-l' option to the 'show' command.
12) Fix class number assignment when WIDE_TC_MARKS=Yes
13) Allow wide marks in tcclasses when WIDE_TC_MARKS=Yes
Changes in Shorewall 4.4.3
1) Move Debian INITLOG initialization to /etc/default/shorewall
2) Fix 'routeback' in /etc/shorewall/routestopped.
3) Rename 'object' to 'script' in compiler and config modules.
4) Correct RETAIN_ALIASES=No.
5) Fix detection of IP config.
6) Fix nested zones.
7) Move all function declarations from prog.footer to prog.header
8) Remove superfluous variables from generated script
9) Make 'track' the default.
10) Add TRACK_PROVIDERS option.
11) Fix IPv6 address parsing bug.
12) Add hack to work around iproute IPv6 bug in route handling
13) Correct messages issued when an optional provider is not usable.
14) Fix optional interfaces.
15) Add 'limit' option to tcclasses.
Changes in Shorewall 4.4.2
1) BUGFIX: Correct detection of Persistent SNAT support
2) BUGFIX: Fix chain table initialization
3) BUGFIX: Validate routestopped file on 'check'
4) Let the Actions module add the builtin actions to
%Shorewall::Chains::targets. Much better modularization that way.
5) Some changes to make Lenny->Squeeze less painful.
6) Allow comments at the end of continued lines.
7) Call process_routestopped() during 'check' rather than
'compile_stop_firewall()'.
8) Don't look for an extension script for built-in actions.
9) Apply Jesse Shrieve's patch for SNAT range.
10) Add -<family> to 'ip route del default' command.
11) Add three new columns to macro body.
12) Change 'wait4ifup' so that it requires no PATH
13) Allow extension scripts for accounting chains.
14) Allow per-ip LIMIT to work on ancient iptables releases.
15) Add 'MARK' column to action body.
Changes in Shorewall 4.4.1
1) Deleted extra 'use ...IPAddrs.pm' from Nat.pm.
2) Deleted superfluous export from Chains.pm.
3) Added support for --persistent.
4) Don't do module initialization in an INIT block.
5) Minor performance improvements.
6) Add 'clean' target to Makefile.
7) Redefine 'full' for sub-classes.
8) Fix log level in rules at the end of INPUT and OUTPUT chains.
9) Fix nested ipsec zones.
10) Change one-interface sample to IP_FORWARDING=Off.
11) Allow multicast to non-dynamic zones defined with nets=.
12) Allow zones with nets= to be extended by /etc/shorewall/hosts
entries.
13) Don't allow nets= in a multi-zone interface definition.
14) Fix rule generated by MULTICAST=Yes
15) Fix silly hole in zones file parsing.
16) Tighen up zone membership checking.
17) Combine portlist-spitting routines into a single function.
Changes in Shorewall 4.4.0
@@ -19,7 +392,7 @@ Changes in Shorewall 4.4.0
5) Fix 'upnpclient' with required interfaces.
5) Fix provider number in
6) Fix provider number in masq file.
Changes in Shorewall 4.4.0-RC2
@@ -225,10 +598,8 @@ Changes in Shorewall 4.3.5
1) Remove support for shorewall-shell.
2) Combine shorewall-common and shorewall-perl to product shorewall.
2) Combine shorewall-common and shorewall-perl to produce shorewall.
3) Add nets= OPTION in interfaces file.
4) Add SAME MARK/CLASSIFY target

View File

@@ -6,6 +6,6 @@
# Please see http://shorewall.net/Accounting.html for examples and
# additional information about how to use this file.
#
#####################################################################################
#ACTION CHAIN SOURCE DESTINATION PROTO DEST SOURCE USER/ MARK
#####################################################################################################
#ACTION CHAIN SOURCE DESTINATION PROTO DEST SOURCE USER/ MARK IPSEC
# PORT(S) PORT(S) GROUP

View File

@@ -7,4 +7,5 @@
# information.
#
###############################################################################
#ADDRESS/SUBNET PROTOCOL PORT
#ADDRESS/SUBNET PROTOCOL PORT OPTIONS

View File

@@ -1,5 +1,5 @@
#
# Shorewall version 4 - Filegw File
# Shorewall version 4 - Findgw File
#
# /etc/shorewall/findgw
#

View File

@@ -7,5 +7,5 @@
# http://www.shorewall.net/manpages/shorewall-masq.html
#
###############################################################################
#INTERFACE SOURCE ADDRESS PROTO PORT(S) IPSEC MARK USER/
#INTERFACE:DEST SOURCE ADDRESS PROTO PORT(S) IPSEC MARK USER/
# GROUP

View File

@@ -7,4 +7,4 @@
# information.
#
###############################################################################
#TYPE NET1 INTERFACE NET2
#TYPE NET1 INTERFACE NET2 NET3

View File

@@ -1,19 +1,10 @@
###############################################################################
# /etc/shorewall/shorewall.conf Version 4 - Change the following variables to
# match your setup
#
# This program is under GPL
# [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
# This file should be placed in /etc/shorewall
#
# (c) 1999,2000,2001,2002,2003,2004,2005,
# 2006,2007,2008 - Tom Eastep (teastep@shorewall.net)
# Shorewall Version 4 -- /etc/shorewall/shorewall.conf
#
# For information about the settings in this file, type "man shorewall.conf"
#
# Additional information is available at
# http://www.shorewall.net/Documentation.htm#Conf
# Manpage also online at http://www.shorewall.net/manpages/shorewall.conf.html
###############################################################################
# S T A R T U P E N A B L E D
###############################################################################
@@ -32,17 +23,15 @@ VERBOSITY=1
LOGFILE=/var/log/messages
STARTUP_LOG=
STARTUP_LOG=/var/log/shorewall-init.log
LOG_VERBOSITY=
LOG_VERBOSITY=2
LOGFORMAT="Shorewall:%s:%s:"
LOGTAGONLY=No
LOGRATE=
LOGBURST=
LOGLIMIT=
LOGALLNEW=
@@ -68,6 +57,8 @@ TC=
IPSET=
PERL=/usr/bin/perl
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
SHOREWALL_SHELL=/bin/sh
@@ -107,7 +98,7 @@ RCP_COMMAND='scp ${files} ${root}@${system}:${destination}'
IP_FORWARDING=On
ADD_IP_ALIASES=Yes
ADD_IP_ALIASES=No
ADD_SNAT_ALIASES=No
@@ -117,6 +108,8 @@ TC_ENABLED=Internal
TC_EXPERT=No
TC_PRIOMAP="2 3 3 3 2 3 1 1 2 2 2 2 2 2 2 2"
CLEAR_TC=Yes
MARK_IN_FORWARD_CHAIN=No
@@ -135,7 +128,7 @@ BLACKLISTNEWONLY=Yes
DELAYBLACKLISTLOAD=No
MODULE_SUFFIX=
MODULE_SUFFIX=ko
DISABLE_IPV6=No
@@ -189,6 +182,24 @@ AUTOMAKE=No
WIDE_TC_MARKS=No
TRACK_PROVIDERS=No
ZONE2ZONE=2
ACCOUNTING=Yes
DYNAMIC_BLACKLIST=Yes
OPTIMIZE_ACCOUNTING=No
LOAD_HELPERS_ONLY=No
REQUIRE_INTERFACE=No
FORWARD_CLEAR_MARK=Yes
COMPLETE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@@ -0,0 +1,11 @@
#
# Shorewall version 4 - Tcinterfaces File
#
# For information about entries in this file, type "man shorewall-tcinterfaces"
#
# See http://shorewall.net/simple_traffic_shaping.htm for additional
# information.
#
###############################################################################
#INTERFACE TYPE IN-BANDWIDTH

View File

@@ -0,0 +1,13 @@
#
# Shorewall version 4 - Tcpri File
#
# For information about entries in this file, type "man shorewall-tcpri"
#
# See http://shorewall.net/simple_traffic_shaping.htm for additional
# information.
#
###############################################################################
#BAND PROTO PORT(S) ADDRESS IN-INTERFACE HELPER

View File

@@ -21,4 +21,16 @@ startup=0
OPTIONS=""
#
# Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf
#
INITLOG=/dev/null
#
# Set this to 1 to cause '/etc/init.d/shorewall stop' to place the firewall in
# a safe state rather than to open it
#
SAFESTOP=0
# EOF

63
Shorewall/helpers Normal file
View File

@@ -0,0 +1,63 @@
#
# Shorewall version 4 - Helpers File
#
# /usr/share/shorewall/helpers
#
# This file loads the kernel helper modules.
#
# THE ORDER OF THE COMMANDS BELOW IS IMPORTANT!!!!!! You MUST load in
# dependency order. i.e., if M2 depends on M1 then you must load M1
# before you load M2.
#
# If you need to modify this file, copy it to /etc/shorewall and modify the
# copy.
#
###############################################################################
# Helpers
#
loadmodule ip_conntrack_amanda
loadmodule ip_conntrack_ftp
loadmodule ip_conntrack_h323
loadmodule ip_conntrack_irc
loadmodule ip_conntrack_netbios_ns
loadmodule ip_conntrack_pptp
loadmodule ip_conntrack_sip
loadmodule ip_conntrack_tftp
loadmodule ip_nat_amanda
loadmodule ip_nat_ftp
loadmodule ip_nat_h323
loadmodule ip_nat_irc
loadmodule ip_nat_pptp
loadmodule ip_nat_sip
loadmodule ip_nat_snmp_basic
loadmodule ip_nat_tftp
loadmodule ip_set
loadmodule ip_set_iphash
loadmodule ip_set_ipmap
loadmodule ip_set_macipmap
loadmodule ip_set_portmap
#
# 2.6.20+ helpers
#
loadmodule nf_conntrack_ftp
loadmodule nf_conntrack_h323
loadmodule nf_conntrack_irc
loadmodule nf_conntrack_netbios_ns
loadmodule nf_conntrack_netlink
loadmodule nf_conntrack_pptp
loadmodule nf_conntrack_proto_gre
loadmodule nf_conntrack_proto_sctp
loadmodule nf_conntrack_sip sip_direct_media=0
loadmodule nf_conntrack_tftp
loadmodule nf_conntrack_sane
loadmodule nf_nat_amanda
loadmodule nf_nat_ftp
loadmodule nf_nat_h323
loadmodule nf_nat_irc
loadmodule nf_nat
loadmodule nf_nat_pptp
loadmodule nf_nat_proto_gre
loadmodule nf_nat_sip
loadmodule nf_nat_snmp_basic
loadmodule nf_nat_tftp

View File

@@ -1,8 +1,8 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: shorewall
# Required-Start: $network
# Required-Stop: $network
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Configure the firewall at boot time
@@ -15,13 +15,11 @@
SRWL=/sbin/shorewall
SRWL_OPTS="-tvv"
WAIT_FOR_IFUP=/usr/share/shorewall/wait4ifup
# Note, set INITLOG to /dev/null if you want to
# use Shorewall's STARTUP_LOG feature.
INITLOG=/var/log/shorewall-init.log
test -n ${INITLOG:=/var/log/shorewall-init.log}
test -x $SRWL || exit 0
test -x $WAIT_FOR_IFUP || exit 0
test -n $INITLOG || {
test -n "$INITLOG" || {
echo "INITLOG cannot be empty, please configure $0" ;
exit 1;
}
@@ -40,6 +38,7 @@ echo_notdone () {
echo "not done (check $INITLOG)."
fi
exit 1
}
not_configured () {
@@ -49,7 +48,7 @@ not_configured () {
then
echo ""
echo "Please read about Debian specific customization in"
echo "/usr/share/doc/shorewall-common/README.Debian.gz."
echo "/usr/share/doc/shorewall/README.Debian.gz."
fi
echo "#################"
exit 0
@@ -94,7 +93,11 @@ shorewall_start () {
# stop the firewall
shorewall_stop () {
echo -n "Stopping \"Shorewall firewall\": "
if [ "$SAFESTOP" = 1 ]; then
$SRWL $SRWL_OPTS stop >> $INITLOG 2>&1 && echo "done." || echo_notdone
else
$SRWL $SRWL_OPTS clear >> $INITLOG 2>&1 && echo "done." || echo_notdone
fi
return 0
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1 @@
1) If ULOG is specified as the LOG LEVEL in the all->all policy, the
rules at the end of the INPUT and OUTPUT chains still use the
LOG target rather than ULOG.
You can work around this problem by adding two additional policies
before the all->all one:
all $FW DROP ULOG
$FW all REJECT ULOG
This problem was corrected in Shorewall 4.4.0.1.
2) Use of CONTINUE policies with a nested IPSEC zone was broken in
some cases.
This problem was corrected in Shorewall 4.4.0.1.
There are no known problems in Shorewall 4.4.13-Beta3

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# Shorewall 4.2 -- /usr/share/shorewall/lib.base
# Shorewall 4.4 -- /usr/share/shorewall/lib.base
#
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
#
@@ -24,26 +24,17 @@
# This library contains the code common to all Shorewall components.
#
# - It is loaded by /sbin/shorewall.
# - It is loaded by /usr/share/shorewall/firewall.
# - It is released as part of Shorewall Lite where it is used by /sbin/shorewall-lite
# and /usr/share/shorewall-lite/shorecap.
#
SHOREWALL_LIBVERSION=40000
SHOREWALL_CAPVERSION=40310
SHOREWALL_LIBVERSION=40407
SHOREWALL_CAPVERSION=40413
[ -n "${VARDIR:=/var/lib/shorewall}" ]
[ -n "${SHAREDIR:=/usr/share/shorewall}" ]
[ -n "${CONFDIR:=/etc/shorewall}" ]
#
# Message to stderr
#
error_message() # $* = Error Message
{
echo " $@" >&2
}
#
# Conditionally produce message
#
@@ -52,8 +43,8 @@ progress_message() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 1 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
if [ $VERBOSITY -gt 1 ]; then
[ -n "$g_timestamp" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
}
@@ -63,8 +54,8 @@ progress_message2() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -gt 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
if [ $VERBOSITY -gt 0 ]; then
[ -n "$g_timestamp" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
}
@@ -74,40 +65,12 @@ progress_message3() # $* = Message
local timestamp
timestamp=
if [ $VERBOSE -ge 0 ]; then
[ -n "$TIMESTAMP" ] && timestamp="$(date +%H:%M:%S) "
if [ $VERBOSITY -ge 0 ]; then
[ -n "$g_timestamp" ] && timestamp="$(date +%H:%M:%S) "
echo "${timestamp}$@"
fi
}
#
# Split a colon-separated list into a space-separated list
#
split() {
local ifs
ifs=$IFS
IFS=:
echo $*
IFS=$ifs
}
#
# Search a list looking for a match -- returns zero if a match found
# 1 otherwise
#
list_search() # $1 = element to search for , $2-$n = list
{
local e
e=$1
while [ $# -gt 1 ]; do
shift
[ "x$e" = "x$1" ] && return 0
done
return 1
}
#
# Undo the effect of 'separate_list()'
#
@@ -124,167 +87,6 @@ combine_list()
echo $o
}
#
# Suppress all output for a command
#
qt()
{
"$@" >/dev/null 2>&1
}
#
# Determine if Shorewall is "running"
#
shorewall_is_started() {
qt $IPTABLES -L shorewall -n
}
#
# Echos the fully-qualified name of the calling shell program
#
my_pathname() {
cd $(dirname $0)
echo $PWD/$(basename $0)
}
#
# Source a user exit file if it exists
#
run_user_exit() # $1 = file name
{
local user_exit
user_exit=$(find_file $1)
if [ -f $user_exit ]; then
progress_message "Processing $user_exit ..."
. $user_exit
fi
}
#
# Load a Kernel Module -- assumes that the variable 'moduledirectories' contains
# a space-separated list of directories to search for
# the module and that 'moduleloader' contains the
# module loader command.
#
loadmodule() # $1 = module name, $2 - * arguments
{
local modulename
modulename=$1
local modulefile
local suffix
if ! list_search $modulename $MODULES $DONT_LOAD ; then
shift
for suffix in $MODULE_SUFFIX ; do
for directory in $moduledirectories; do
modulefile=$directory/${modulename}.${suffix}
if [ -f $modulefile ]; then
case $moduleloader in
insmod)
insmod $modulefile $*
;;
*)
modprobe $modulename $*
;;
esac
break 2
fi
done
done
fi
}
#
# Reload the Modules
#
reload_kernel_modules() {
local save_modules_dir
save_modules_dir=$MODULESDIR
local directory
local moduledirectories
moduledirectories=
local moduleloader
moduleloader=modprobe
local uname
if ! qt mywhich modprobe; then
moduleloader=insmod
fi
[ -n "${MODULE_SUFFIX:=o gz ko o.gz ko.gz}" ]
[ -z "$MODULESDIR" ] && \
uname=$(uname -r) && \
MODULESDIR=/lib/modules/$uname/kernel/net/ipv4/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset
MODULES=$(lsmod | cut -d ' ' -f1)
for directory in $(split $MODULESDIR); do
[ -d $directory ] && moduledirectories="$moduledirectories $directory"
done
[ -n "$moduledirectories" ] && while read command; do
eval $command
done
MODULESDIR=$save_modules_dir
}
#
# Load kernel modules required for Shorewall
#
load_kernel_modules() # $1 = Yes, if we are to save moduleinfo in $VARDIR
{
local save_modules_dir
save_modules_dir=$MODULESDIR
local directory
local moduledirectories
moduledirectories=
local moduleloader
moduleloader=modprobe
local savemoduleinfo
savemoduleinfo=${1:-Yes} # So old compiled scripts still work
local uname
if ! qt mywhich modprobe; then
moduleloader=insmod
fi
[ -n "${MODULE_SUFFIX:=o gz ko o.gz ko.gz}" ]
[ -z "$MODULESDIR" ] && \
uname=$(uname -r) && \
MODULESDIR=/lib/modules/$uname/kernel/net/ipv4/netfilter:/lib/modules/$uname/kernel/net/netfilter:/lib/modules/$uname/extra:/lib/modules/$uname/extra/ipset
for directory in $(split $MODULESDIR); do
[ -d $directory ] && moduledirectories="$moduledirectories $directory"
done
modules=$(find_file modules)
if [ -f $modules -a -n "$moduledirectories" ]; then
MODULES=$(lsmod | cut -d ' ' -f1)
progress_message "Loading Modules..."
. $modules
if [ $savemoduleinfo = Yes ]; then
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
echo MODULESDIR="$MODULESDIR" > ${VARDIR}/.modulesdir
cp -f $modules ${VARDIR}/.modules
fi
elif [ $savemoduleinfo = Yes ]; then
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
> ${VARDIR}/.modulesdir
> ${VARDIR}/.modules
fi
MODULESDIR=$save_modules_dir
}
#
# Call this function to assert mutual exclusion with Shorewall. If you invoke the
# /sbin/shorewall program while holding mutual exclusion, you should pass "nolock" as
@@ -334,12 +136,32 @@ mutex_off()
}
#
# Note: The following set of IP address manipulation functions have anomalous
# behavior when the shell only supports 32-bit signed arithmetic and
# the IP address is 128.0.0.0 or 128.0.0.1.
# Find the interface with the passed MAC address
#
LEFTSHIFT='<<'
find_interface_by_mac() {
local mac
mac=$1
local first
local second
local rest
local dev
$IP link list | while read first second rest; do
case $first in
*:)
dev=$second
;;
*)
if [ "$second" = $mac ]; then
echo ${dev%:}
return
fi
esac
done
}
[ -z "$LEFTSHIFT" ] && . ${SHAREDIR}/lib.common
#
# Validate an IP address
@@ -369,44 +191,6 @@ valid_address() {
return 0
}
#
# Convert an IP address in dot quad format to an integer
#
decodeaddr() {
local x
local temp
temp=0
local ifs
ifs=$IFS
IFS=.
for x in $1; do
temp=$(( $(( $temp $LEFTSHIFT 8 )) | $x ))
done
echo $temp
IFS=$ifs
}
#
# convert an integer to dot quad format
#
encodeaddr() {
addr=$1
local x
local y
y=$(($addr & 255))
for x in 1 2 3 ; do
addr=$(($addr >> 8))
y=$(($addr & 255)).$y
done
echo $y
}
#
# Miserable Hack to work around broken BusyBox ash in OpenWRT
#
@@ -507,66 +291,6 @@ ip_range_explicit() {
done
}
#
# Netmask from CIDR
#
ip_netmask() {
local vlsm
vlsm=${1#*/}
[ $vlsm -eq 0 ] && echo 0 || echo $(( -1 $LEFTSHIFT $(( 32 - $vlsm )) ))
}
#
# Network address from CIDR
#
ip_network() {
local decodedaddr
decodedaddr=$(decodeaddr ${1%/*})
local netmask
netmask=$(ip_netmask $1)
echo $(encodeaddr $(($decodedaddr & $netmask)))
}
#
# The following hack is supplied to compensate for the fact that many of
# the popular light-weight Bourne shell derivatives don't support XOR ("^").
#
ip_broadcast() {
local x
x=$(( 32 - ${1#*/} ))
[ $x -eq 32 ] && echo -1 || echo $(( $(( 1 $LEFTSHIFT $x )) - 1 ))
}
#
# Calculate broadcast address from CIDR
#
broadcastaddress() {
local decodedaddr
decodedaddr=$(decodeaddr ${1%/*})
local netmask
netmask=$(ip_netmask $1)
local broadcast
broadcast=$(ip_broadcast $1)
echo $(encodeaddr $(( $(($decodedaddr & $netmask)) | $broadcast )))
}
#
# Test for network membership
#
in_network() # $1 = IP address, $2 = CIDR network
{
local netmask
netmask=$(ip_netmask $2)
#
# We compare the values as strings rather than integers to work around broken BusyBox ash on OpenWRT
#
test $(( $(decodeaddr $1) & $netmask)) = $(( $(decodeaddr ${2%/*}) & $netmask ))
}
#
# Netmask to VLSM
#
@@ -590,90 +314,6 @@ ip_vlsm() {
fi
}
#
# Query NetFilter about the existence of a filter chain
#
chain_exists() # $1 = chain name
{
qt $IPTABLES -L $1 -n
}
#
# Find the interface with the passed MAC address
#
find_interface_by_mac() {
local mac
mac=$1
local first
local second
local rest
local dev
ip link list | while read first second rest; do
case $first in
*:)
dev=$second
;;
*)
if [ "$second" = $mac ]; then
echo ${dev%:}
return
fi
esac
done
}
#
# Find interface address--returns the first IP address assigned to the passed
# device
#
find_first_interface_address() # $1 = interface
{
#
# get the line of output containing the first IP address
#
addr=$(ip -f inet addr show $1 2> /dev/null | grep 'inet .* global' | head -n1)
#
# If there wasn't one, bail out now
#
[ -n "$addr" ] || fatal_error "Can't determine the IP address of $1"
#
# Strip off the trailing VLSM mask (or the peer IP in case of a P-t-P link)
# along with everything else on the line
#
echo $addr | sed 's/\s*inet //;s/\/.*//;s/ peer.*//'
}
find_first_interface_address_if_any() # $1 = interface
{
#
# get the line of output containing the first IP address
#
addr=$(ip -f inet addr show $1 2> /dev/null | grep 'inet .* global' | head -n1)
#
# Strip off the trailing VLSM mask (or the peer IP in case of a P-t-P link)
# along with everything else on the line
#
[ -n "$addr" ] && echo $addr | sed 's/\s*inet //;s/\/.*//;s/ peer.*//' || echo 0.0.0.0
}
#
# Internal version of 'which'
#
mywhich() {
local dir
for dir in $(split $PATH); do
if [ -x $dir/$1 ]; then
echo $dir/$1
return 0
fi
done
return 2
}
#
# Set default config path
#
@@ -690,32 +330,6 @@ ensure_config_path() {
fi
}
#
# Find a File -- For relative file name, look in each ${CONFIG_PATH} then ${CONFDIR}
#
find_file()
{
local saveifs
saveifs=
local directory
case $1 in
/*)
echo $1
;;
*)
for directory in $(split $CONFIG_PATH); do
if [ -f $directory/$1 ]; then
echo $directory/$1
return
fi
done
echo ${CONFDIR}/$1
;;
esac
}
#
# Get fully-qualified name of file
#
@@ -750,342 +364,11 @@ resolve_file() # $1 = file name
esac
}
#
# Perform variable substitution on the passed argument and echo the result
#
expand() # $@ = contents of variable which may be the name of another variable
{
eval echo \"$@\"
}
#
# Function for including one file into another
#
INCLUDE() {
. $(find_file $(expand $@))
}
#
# Set the Shorewall state
#
set_state () # $1 = state
{
echo "$1 ($(date))" > ${VARDIR}/state
}
#
# Determine which optional facilities are supported by iptables/netfilter
#
determine_capabilities() {
qt $IPTABLES -t nat -L -n && NAT_ENABLED=Yes || NAT_ENABLED=
qt $IPTABLES -t mangle -L -n && MANGLE_ENABLED=Yes || MANGLE_ENABLED=
CONNTRACK_MATCH=
NEW_CONNTRACK_MATCH=
OLD_CONNTRACK_MATCH=
MULTIPORT=
XMULTIPORT=
POLICY_MATCH=
PHYSDEV_MATCH=
PHYSDEV_BRIDGE=
IPRANGE_MATCH=
RECENT_MATCH=
OWNER_MATCH=
IPSET_MATCH=
CONNMARK=
XCONNMARK=
CONNMARK_MATCH=
XCONNMARK_MATCH=
RAW_TABLE=
IPP2P_MATCH=
OLD_IPP2P_MATCH=
LENGTH_MATCH=
CLASSIFY_TARGET=
ENHANCED_REJECT=
USEPKTTYPE=
KLUDGEFREE=
MARK=
XMARK=
MANGLE_FORWARD=
COMMENTS=
ADDRTYPE=
TCPMSS_MATCH=
HASHLIMIT_MATCH=
NFQUEUE_TARGET=
REALM_MATCH=
HELPER_MATCH=
CONNLIMIT_MATCH=
TIME_MATCH=
GOTO_TARGET=
LOGMARK_TARGET=
IPMARK_TARGET=
LOG_TARGET=Yes
chain=fooX$$
[ -n "$IPTABLES" ] || IPTABLES=$(mywhich iptables)
if [ -z "$IPTABLES" ]; then
echo " ERROR: No executable iptables binary can be found on your PATH" >&2
exit 1
fi
qt $IPTABLES -F $chain
qt $IPTABLES -X $chain
if ! $IPTABLES -N $chain; then
echo " ERROR: The command \"$IPTABLES -N $chain\" failed" >&2
exit 1
fi
chain1=${chain}1
qt $IPTABLES -F $chain1
qt $IPTABLES -X $chain1
if ! $IPTABLES -N $chain1; then
echo " ERROR: The command \"$IPTABLES -N $chain1\" failed" >&2
exit 1
fi
if ! qt $IPTABLES -A $chain -m state --state ESTABLISHED,RELATED -j ACCEPT; then
echo " ERROR: Your kernel lacks connection tracking and/or state matching -- Shorewall will not run on this system" >&2
exit 1
fi
qt $IPTABLES -A $chain -m conntrack --ctorigdst 192.168.1.1 -j ACCEPT && CONNTRACK_MATCH=Yes
if [ -n "$CONNTRACK_MATCH" ]; then
qt $IPTABLES -A $chain -m conntrack -p tcp --ctorigdstport 22 -j ACCEPT && NEW_CONNTRACK_MATCH=Yes
qt $IPTABLES -A $chain -m conntrack ! --ctorigdst 1.2.3.4 || OLD_CONNTRACK_MATCH=Yes
fi
if qt $IPTABLES -A $chain -p tcp -m multiport --dports 21,22 -j ACCEPT; then
MULTIPORT=Yes
qt $IPTABLES -A $chain -p tcp -m multiport --sports 60 -m multiport --dports 99 -j ACCEPT && KLUDEFREE=Yes
fi
qt $IPTABLES -A $chain -p tcp -m multiport --dports 21:22 -j ACCEPT && XMULTIPORT=Yes
qt $IPTABLES -A $chain -m policy --pol ipsec --mode tunnel --dir in -j ACCEPT && POLICY_MATCH=Yes
if qt $IPTABLES -A $chain -m physdev --physdev-out eth0 -j ACCEPT; then
PHYSDEV_MATCH=Yes
qt $IPTABLES -A $chain -m physdev --physdev-is-bridged --physdev-in eth0 --physdev-out eth0 -j ACCEPT && PHYSDEV_BRIDGE=Yes
if [ -z "${KLUDGEFREE}" ]; then
qt $IPTABLES -A $chain -m physdev --physdev-in eth0 -m physdev --physdev-out eth0 -j ACCEPT && KLUDGEFREE=Yes
fi
fi
if qt $IPTABLES -A $chain -m iprange --src-range 192.168.1.5-192.168.1.124 -j ACCEPT; then
IPRANGE_MATCH=Yes
if [ -z "${KLUDGEFREE}" ]; then
qt $IPTABLES -A $chain -m iprange --src-range 192.168.1.5-192.168.1.124 -m iprange --dst-range 192.168.1.5-192.168.1.124 -j ACCEPT && KLUDGEFREE=Yes
fi
fi
qt $IPTABLES -A $chain -m recent --update -j ACCEPT && RECENT_MATCH=Yes
qt $IPTABLES -A $chain -m owner --uid-owner 0 -j ACCEPT && OWNER_MATCH=Yes
if qt $IPTABLES -A $chain -m connmark --mark 2 -j ACCEPT; then
CONNMARK_MATCH=Yes
qt $IPTABLES -A $chain -m connmark --mark 2/0xFF -j ACCEPT && XCONNMARK_MATCH=Yes
fi
qt $IPTABLES -A $chain -p tcp -m ipp2p --edk -j ACCEPT && IPP2P_MATCH=Yes
if [ -n "$IPP2P_MATCH" ]; then
qt $IPTABLES -A $chain -p tcp -m ipp2p --ipp2p -j ACCEPT && OLD_IPP2P_MATCH=Yes
fi
qt $IPTABLES -A $chain -m length --length 10:20 -j ACCEPT && LENGTH_MATCH=Yes
qt $IPTABLES -A $chain -j REJECT --reject-with icmp-host-prohibited && ENHANCED_REJECT=Yes
qt $IPTABLES -A $chain -j ACCEPT -m comment --comment "This is a comment" && COMMENTS=Yes
if [ -n "$MANGLE_ENABLED" ]; then
qt $IPTABLES -t mangle -N $chain
if qt $IPTABLES -t mangle -A $chain -j MARK --set-mark 1; then
MARK=Yes
qt $IPTABLES -t mangle -A $chain -j MARK --and-mark 0xFF && XMARK=Yes
fi
if qt $IPTABLES -t mangle -A $chain -j CONNMARK --save-mark; then
CONNMARK=Yes
qt $IPTABLES -t mangle -A $chain -j CONNMARK --save-mark --mask 0xFF && XCONNMARK=Yes
fi
qt $IPTABLES -t mangle -A $chain -j CLASSIFY --set-class 1:1 && CLASSIFY_TARGET=Yes
qt $IPTABLES -t mangle -A $chain -j IPMARK --addr src && IPMARK_TARGET=Yes
qt $IPTABLES -t mangle -F $chain
qt $IPTABLES -t mangle -X $chain
qt $IPTABLES -t mangle -L FORWARD -n && MANGLE_FORWARD=Yes
fi
qt $IPTABLES -t raw -L -n && RAW_TABLE=Yes
if qt mywhich ipset; then
qt ipset -X $chain # Just in case something went wrong the last time
if qt ipset -N $chain iphash ; then
if qt $IPTABLES -A $chain -m set --set $chain src -j ACCEPT; then
qt $IPTABLES -D $chain -m set --set $chain src -j ACCEPT
IPSET_MATCH=Yes
fi
qt ipset -X $chain
fi
fi
qt $IPTABLES -A $chain -m pkttype --pkt-type broadcast -j ACCEPT && USEPKTTYPE=Yes
qt $IPTABLES -A $chain -m addrtype --src-type BROADCAST -j ACCEPT && ADDRTYPE=Yes
qt $IPTABLES -A $chain -p tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1000:1500 -j ACCEPT && TCPMSS_MATCH=Yes
qt $IPTABLES -A $chain -m hashlimit --hashlimit 4 --hashlimit-burst 5 --hashlimit-name $chain --hashlimit-mode dstip -j ACCEPT && HASHLIMIT_MATCH=Yes
qt $IPTABLES -A $chain -j NFQUEUE --queue-num 4 && NFQUEUE_TARGET=Yes
qt $IPTABLES -A $chain -m realm --realm 4 && REALM_MATCH=Yes
qt $IPTABLES -A $chain -m helper --helper "ftp" && HELPER_MATCH=Yes
qt $IPTABLES -A $chain -m connlimit --connlimit-above 8 -j DROP && CONNLIMIT_MATCH=Yes
qt $IPTABLES -A $chain -m time --timestart 23:00 -j DROP && TIME_MATCH=Yes
qt $IPTABLES -A $chain -g $chain1 && GOTO_TARGET=Yes
qt $IPTABLES -A $chain -j LOGMARK && LOGMARK_TARGET=Yes
qt $IPTABLES -A $chain -j LOG || LOG_TARGET=
qt $IPTABLES -F $chain
qt $IPTABLES -X $chain
qt $IPTABLES -F $chain1
qt $IPTABLES -X $chain1
CAPVERSION=$SHOREWALL_CAPVERSION
}
report_capabilities() {
report_capability() # $1 = Capability Description , $2 Capability Setting (if any)
{
local setting
setting=
[ "x$2" = "xYes" ] && setting="Available" || setting="Not available"
echo " " $1: $setting
}
if [ $VERBOSE -gt 1 ]; then
echo "Shorewall has detected the following iptables/netfilter capabilities:"
report_capability "NAT" $NAT_ENABLED
report_capability "Packet Mangling" $MANGLE_ENABLED
report_capability "Multi-port Match" $MULTIPORT
[ -n "$MULTIPORT" ] && report_capability "Extended Multi-port Match" $XMULTIPORT
report_capability "Connection Tracking Match" $CONNTRACK_MATCH
if [ -n "$CONNTRACK_MATCH" ]; then
report_capability "Extended Connection Tracking Match Support" $NEW_CONNTRACK_MATCH
report_capability "Old Connection Tracking Match Syntax" $OLD_CONNTRACK_MATCH
fi
report_capability "Packet Type Match" $USEPKTTYPE
report_capability "Policy Match" $POLICY_MATCH
report_capability "Physdev Match" $PHYSDEV_MATCH
report_capability "Physdev-is-bridged Support" $PHYSDEV_BRIDGE
report_capability "Packet length Match" $LENGTH_MATCH
report_capability "IP range Match" $IPRANGE_MATCH
report_capability "Recent Match" $RECENT_MATCH
report_capability "Owner Match" $OWNER_MATCH
report_capability "Ipset Match" $IPSET_MATCH
report_capability "CONNMARK Target" $CONNMARK
[ -n "$CONNMARK" ] && report_capability "Extended CONNMARK Target" $XCONNMARK
report_capability "Connmark Match" $CONNMARK_MATCH
[ -n "$CONNMARK_MATCH" ] && report_capability "Extended Connmark Match" $XCONNMARK_MATCH
report_capability "Raw Table" $RAW_TABLE
report_capability "IPP2P Match" $IPP2P_MATCH
[ -n "$IPP2P_MATCH" ] && report_capability "Old IPP2P Match Syntax" $OLD_IPP2P_MATCH
report_capability "CLASSIFY Target" $CLASSIFY_TARGET
report_capability "Extended REJECT" $ENHANCED_REJECT
report_capability "Repeat match" $KLUDGEFREE
report_capability "MARK Target" $MARK
[ -n "$MARK" ] && report_capability "Extended MARK Target" $XMARK
report_capability "Mangle FORWARD Chain" $MANGLE_FORWARD
report_capability "Comments" $COMMENTS
report_capability "Address Type Match" $ADDRTYPE
report_capability "TCPMSS Match" $TCPMSS_MATCH
report_capability "Hashlimit Match" $HASHLIMIT_MATCH
report_capability "NFQUEUE Target" $NFQUEUE_TARGET
report_capability "Realm Match" $REALM_MATCH
report_capability "Helper Match" $HELPER_MATCH
report_capability "Connlimit Match" $CONNLIMIT_MATCH
report_capability "Time Match" $TIME_MATCH
report_capability "Goto Support" $GOTO_TARGET
report_capability "LOGMARK Target" $LOGMARK_TARGET
report_capability "IPMARK Target" $IPMARK_TARGET
report_capability "LOG Target" $LOG_TARGET
fi
[ -n "$PKTTYPE" ] || USEPKTTYPE=
}
report_capabilities1() {
report_capability1() # $1 = Capability
{
eval echo $1=\$$1
}
echo "#"
echo "# Shorewall $VERSION detected the following iptables/netfilter capabilities - $(date)"
echo "#"
report_capability1 NAT_ENABLED
report_capability1 MANGLE_ENABLED
report_capability1 MULTIPORT
report_capability1 XMULTIPORT
report_capability1 CONNTRACK_MATCH
report_capability1 NEW_CONNTRACK_MATCH
report_capability1 OLD_CONNTRACK_MATCH
report_capability1 USEPKTTYPE
report_capability1 POLICY_MATCH
report_capability1 PHYSDEV_MATCH
report_capability1 PHYSDEV_BRIDGE
report_capability1 LENGTH_MATCH
report_capability1 IPRANGE_MATCH
report_capability1 RECENT_MATCH
report_capability1 OWNER_MATCH
report_capability1 IPSET_MATCH
report_capability1 CONNMARK
report_capability1 XCONNMARK
report_capability1 CONNMARK_MATCH
report_capability1 XCONNMARK_MATCH
report_capability1 RAW_TABLE
report_capability1 IPP2P_MATCH
report_capability1 OLD_IPP2P_MATCH
report_capability1 CLASSIFY_TARGET
report_capability1 ENHANCED_REJECT
report_capability1 KLUDGEFREE
report_capability1 MARK
report_capability1 XMARK
report_capability1 MANGLE_FORWARD
report_capability1 COMMENTS
report_capability1 ADDRTYPE
report_capability1 TCPMSS_MATCH
report_capability1 HASHLIMIT_MATCH
report_capability1 NFQUEUE_TARGET
report_capability1 REALM_MATCH
report_capability1 HELPER_MATCH
report_capability1 CONNLIMIT_MATCH
report_capability1 TIME_MATCH
report_capability1 GOTO_TARGET
report_capability1 LOGMARK_TARGET
report_capability1 IPMARK_TARGET
report_capability1 LOG_TARGET
echo CAPVERSION=$SHOREWALL_CAPVERSION
}
# Function to truncate a string -- It uses 'cut -b -<n>'
# rather than ${v:first:last} because light-weight shells like ash and
# dash do not support that form of expansion.
#
truncate() # $1 = length
{
cut -b -${1}
}
#
# Determine how to do "echo -e"
#
find_echo() {
local result

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More