forked from extern/shorewall_code
Compare commits
642 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7835feb45e | ||
|
c6565f051e | ||
|
c9b6d4a670 | ||
|
b79191caa5 | ||
|
22662212e3 | ||
|
ffc564bdf9 | ||
|
00d3a94bfd | ||
|
d15956feea | ||
|
f717d097d7 | ||
|
ed9953adb8 | ||
|
bcbb48d16e | ||
|
2ce28154d1 | ||
|
afdcff10c9 | ||
|
77efea65de | ||
|
2b43c28e98 | ||
|
c663f91ec7 | ||
|
ba3a7d0621 | ||
|
15507aa265 | ||
|
4d4e8b3df4 | ||
|
240d3d8cab | ||
|
acda5482c4 | ||
|
e731ea1ca8 | ||
|
65cde3475f | ||
|
b3cd9ab15a | ||
|
fdc391cf49 | ||
|
a9ac9c274e | ||
|
6274f8444f | ||
|
05816e94ee | ||
|
8a19f978bc | ||
|
3311bbd73a | ||
|
9107259a56 | ||
|
8f36c080d0 | ||
|
0561b10adb | ||
|
db1b25b4d7 | ||
|
ad8b05d8f5 | ||
|
4de651ff55 | ||
|
5981ce59e3 | ||
|
54a5e4af52 | ||
|
658f5c6674 | ||
|
57637506ba | ||
|
4bd8d9791c | ||
|
eb70234c52 | ||
|
39b7527cb6 | ||
|
08d29edf1a | ||
|
20b10582b4 | ||
|
093ff580b5 | ||
|
cea237620a | ||
|
6c20071d3b | ||
|
5104b2fa7c | ||
|
733a17470e | ||
|
3ca3b8b552 | ||
|
c9d7370fb4 | ||
|
3cfee0e43c | ||
|
8b4d8bfa16 | ||
|
caa72fb7d2 | ||
|
4eadec234a | ||
|
2b489993ca | ||
|
ded747a51a | ||
|
df09e0ccc5 | ||
|
1bac919ea6 | ||
|
238aa68b28 | ||
|
3abaf124fa | ||
|
024758bdf6 | ||
|
8bf76a5f36 | ||
|
4a88a3b899 | ||
|
454e53bcfa | ||
|
66fdc9f6a7 | ||
|
c74235a200 | ||
|
1759fc75b0 | ||
|
3e87efc82b | ||
|
a011ad8efe | ||
|
0e40a42729 | ||
|
69fe94ef08 | ||
|
669d15e2cf | ||
|
708d58da21 | ||
|
3c5975a106 | ||
|
34207fef1a | ||
|
2e9342aef0 | ||
|
16b80c3e45 | ||
|
2dbcd36a9c | ||
|
0383ca7de6 | ||
|
7ddc65133e | ||
|
1d4a87a0d0 | ||
|
3b3608ad65 | ||
|
081a387f1d | ||
|
f140a8e7e2 | ||
|
3be3c57e65 | ||
|
fbb03248c4 | ||
|
033a1a0367 | ||
|
c08655e0bc | ||
|
50fb8e3f2f | ||
|
4daee95902 | ||
|
245c64478c | ||
|
f029f5b483 | ||
|
86f667afd4 | ||
|
8a63053c13 | ||
|
709e973155 | ||
|
62557cb98e | ||
|
9c4089fc99 | ||
|
51d6aa9165 | ||
|
44e0d48fc5 | ||
|
a5906ece44 | ||
|
5a649dc205 | ||
|
d44bc12df3 | ||
|
6223bdd8e1 | ||
|
dec088566b | ||
|
6d8cadd152 | ||
|
bf26c1790c | ||
|
89fd5ced15 | ||
|
b1a490b50a | ||
|
240c42943b | ||
|
d3af4264c7 | ||
|
6233f79989 | ||
|
a35b7821bf | ||
|
fd28a12653 | ||
|
7e6fc3229d | ||
|
42dd8dfee9 | ||
|
5a7e458104 | ||
|
7e1a310929 | ||
|
78ecf9bdc8 | ||
|
1771bb75cf | ||
|
b4847d6a01 | ||
|
48ceed9ecb | ||
|
1083dd8c26 | ||
|
5e7cd855c2 | ||
|
623bdd2ff1 | ||
|
b61ee2d75e | ||
|
2c2aaf262c | ||
|
6c990a7253 | ||
|
f7bbac6ea8 | ||
|
4c1b83beef | ||
|
ac6a506e35 | ||
|
11e61ec6e5 | ||
|
5985a6e9b3 | ||
|
4cc5ee6b73 | ||
|
66a04e4819 | ||
|
1634267faa | ||
|
c8866ef8bf | ||
|
8b49641e07 | ||
|
8f6f0c94a4 | ||
|
6fe06c82c8 | ||
|
543446f8d7 | ||
|
a1222d10cb | ||
|
45f64aefd7 | ||
|
81370c7b8d | ||
|
3dba1f5bee | ||
|
5a24e7e8a0 | ||
|
75515399e0 | ||
|
615d683848 | ||
|
d3977a7ad9 | ||
|
b5295b2039 | ||
|
3960aaee4c | ||
|
5419109880 | ||
|
89dcd31f15 | ||
|
584b0ac50e | ||
|
f4e2602c89 | ||
|
c80795102a | ||
|
1d84f27efe | ||
|
4c840a05a0 | ||
|
6323372ebd | ||
|
4c2cedb670 | ||
|
f32a777099 | ||
|
cd5be38cfb | ||
|
dd38cdc0f0 | ||
|
a5e8bc6298 | ||
|
2894bb9656 | ||
|
fad3b42bd3 | ||
|
4e4e7cac1d | ||
|
6d72cb3138 | ||
|
cb74b2d706 | ||
|
9abe60bc27 | ||
|
33c5893bdb | ||
|
2bc329aa1d | ||
|
b1241cf695 | ||
|
670ecb203b | ||
|
f22dfcaa75 | ||
|
d71c2688dc | ||
|
8faf756113 | ||
|
95abeaea24 | ||
|
75258083e3 | ||
|
bf44e514e3 | ||
|
88467a1737 | ||
|
dac037b597 | ||
|
e5d250750b | ||
|
d63262a0cb | ||
|
3870157898 | ||
|
80d54ec40b | ||
|
855cb6e7f4 | ||
|
ea21d61f39 | ||
|
3b5c1ad601 | ||
|
6741d087fb | ||
|
4a014d4884 | ||
|
e14d92c5ac | ||
|
472ecc661f | ||
|
8676aebceb | ||
|
9c75895d43 | ||
|
c2c1552484 | ||
|
5f37b5bde6 | ||
|
b00e20d4d0 | ||
|
6eb2c0cb5f | ||
|
fc3ff30009 | ||
|
ca3385d1be | ||
|
5823411091 | ||
|
8fb1ce6810 | ||
|
4cef6f9254 | ||
|
4fb80ca698 | ||
|
bcb2573918 | ||
|
66c2fca2b0 | ||
|
1666a4639f | ||
|
9345219c11 | ||
|
589e048086 | ||
|
b45c9bd0d2 | ||
|
b6c3d9cae1 | ||
|
20946f0711 | ||
|
faeea3bd8a | ||
|
b27e3d2fff | ||
|
75f5d97657 | ||
|
5e67808abd | ||
|
1659d8ce9f | ||
|
fa500b9ea2 | ||
|
b6d7e9ea96 | ||
|
0e61c2f210 | ||
|
3c9d984835 | ||
|
4917500f12 | ||
|
50b7a81b13 | ||
|
8c4bbf0c85 | ||
|
12563c55a8 | ||
|
13db1bd3be | ||
|
8a278a3dd6 | ||
|
4bb7942e17 | ||
|
9c30105fff | ||
|
5b515f007b | ||
|
24218934f8 | ||
|
308aaad8d4 | ||
|
d9c3345a2d | ||
|
9f80ad8fb3 | ||
|
d7cbd1da21 | ||
|
56cb029ef4 | ||
|
a389aa01a8 | ||
|
a5c608e996 | ||
|
e570d91ab1 | ||
|
eb75d0eef4 | ||
|
5bc0931ee4 | ||
|
4524281163 | ||
|
df028e420c | ||
|
8e352d9dc0 | ||
|
ff634ac776 | ||
|
4b9728effe | ||
|
14bd1a9061 | ||
|
159d677acb | ||
|
e46e059b87 | ||
|
f61560509d | ||
|
5dbcdd65e2 | ||
|
4fcf1cdd3a | ||
|
56bfb6fb8e | ||
|
50411e638c | ||
|
a40b3102d7 | ||
|
4c6b3e6596 | ||
|
9125a04c45 | ||
|
96d833780e | ||
|
dc5c0dc069 | ||
|
87ae801c15 | ||
|
ae63a0ab77 | ||
|
dcff4fad37 | ||
|
67603c5eb3 | ||
|
1540e50cce | ||
|
3c1a2d1b41 | ||
|
494cdfb73c | ||
|
eb634fa769 | ||
|
39e348997f | ||
|
156ed38b23 | ||
|
1e245a4832 | ||
|
a298817201 | ||
|
0a2f6c18cc | ||
|
32763e998b | ||
|
84e0c98c88 | ||
|
5f63183247 | ||
|
189b81cd49 | ||
|
ec8bc90cae | ||
|
2f25584dee | ||
|
d127c90924 | ||
|
b3c534bfee | ||
|
fc5c92cabc | ||
|
0f8d9ca491 | ||
|
a10aea280b | ||
|
ceffc000eb | ||
|
6615c1f736 | ||
|
83d1aa6682 | ||
|
e0a222938a | ||
|
bf15b859bc | ||
|
36a4ef1676 | ||
|
4edbad6849 | ||
|
72651a5397 | ||
|
b10a0642e1 | ||
|
aabb22a50f | ||
|
765b748283 | ||
|
7aa33c140d | ||
|
04c2a88d74 | ||
|
8c27b027fc | ||
|
5ba8df81fb | ||
|
3625d9eae7 | ||
|
51d5ec6b2b | ||
|
c7ad12177a | ||
|
891e3e0e1d | ||
|
d6d0cad2f9 | ||
|
5c7500e13e | ||
|
282bf0a78c | ||
|
09240da55a | ||
|
d68b581f3b | ||
|
2df4aae583 | ||
|
501007d0ac | ||
|
89f16bdb37 | ||
|
f99e20ee19 | ||
|
8e30831385 | ||
|
d2725fcd87 | ||
|
9535a7d7df | ||
|
3c6df56b57 | ||
|
411ca87ec3 | ||
|
43d4a8dcf8 | ||
|
948a7fccc2 | ||
|
73060a3761 | ||
|
cd83d7727c | ||
|
5121634457 | ||
|
131c1f432b | ||
|
03885f71d3 | ||
|
b735b93378 | ||
|
afd66157a5 | ||
|
2f8c4e6ddc | ||
|
b639a18eb9 | ||
|
5ce5d5e607 | ||
|
3e1ed30f4e | ||
|
00c5985458 | ||
|
1a44b66656 | ||
|
b215cf379a | ||
|
3ec6745df9 | ||
|
55be5b0119 | ||
|
42a649d093 | ||
|
18e7e43b2f | ||
|
6803ce5d41 | ||
|
565fb74795 | ||
|
fc754040d5 | ||
|
cc5a59231b | ||
|
25f96e6a88 | ||
|
71bcd11ab6 | ||
|
4bd35a0b93 | ||
|
52eb29d01e | ||
|
cb132e2421 | ||
|
53f1cd40df | ||
|
c653d9ce83 | ||
|
6b67f2698d | ||
|
254d2037ef | ||
|
cb8e76b1d2 | ||
|
2b579d2dff | ||
|
fc3e3dbf3c | ||
|
81acedd1b3 | ||
|
d8f53cc0a9 | ||
|
481811d29f | ||
|
3867902b27 | ||
|
adf51d0059 | ||
|
7dbd50708b | ||
|
4340bcffb1 | ||
|
4a05e56d6d | ||
|
2d8078033c | ||
|
c5f2eeea80 | ||
|
5343243f6b | ||
|
4865899018 | ||
|
9b68204865 | ||
|
a550dd3eed | ||
|
e405ab80bf | ||
|
e9badc1f61 | ||
|
f0aa29222f | ||
|
eaf1d0e5c2 | ||
|
446f764d19 | ||
|
9b0b3d4b70 | ||
|
a48a4b7a2e | ||
|
8743b64e00 | ||
|
2de0fbf7d0 | ||
|
f89c704d01 | ||
|
0b5a316cfc | ||
|
31f9ea5b93 | ||
|
dde1f0a779 | ||
|
60d0a50d9d | ||
|
064f9f974c | ||
|
fd11eb7d82 | ||
|
9e77bb5499 | ||
|
8df8fe990a | ||
|
ac02c484f5 | ||
|
1e6578c759 | ||
|
5ec72dad6c | ||
|
f6a55bbf05 | ||
|
739f3779f5 | ||
|
2e293dd356 | ||
|
bc6a38ca64 | ||
|
a5412cff38 | ||
|
46a6a7b258 | ||
|
b38f1416aa | ||
|
105d1db85d | ||
|
96a5d64941 | ||
|
200d347ac8 | ||
|
c8133145e6 | ||
|
e3d9b2762d | ||
|
9178ecbab0 | ||
|
d06a7b55b6 | ||
|
2fb01bec8d | ||
|
6551d67b2e | ||
|
4b76d8c462 | ||
|
1bb5b89ee1 | ||
|
8602dff487 | ||
|
34f3076c6d | ||
|
c3901f1161 | ||
|
3923092468 | ||
|
7215b61aa4 | ||
|
577db69719 | ||
|
be7a6ec35d | ||
|
cc72b75ba9 | ||
|
56318e6cc8 | ||
|
ea71f15b3d | ||
|
13c90e2aef | ||
|
fdfdb49951 | ||
|
61cb105c02 | ||
|
4621dccd53 | ||
|
14cf5aa0d6 | ||
|
a0228e9d3b | ||
|
b83ca4812b | ||
|
80efd095a8 | ||
|
d6961c4c3b | ||
|
54f5aaca63 | ||
|
82bfb5ac50 | ||
|
1012251957 | ||
|
20d38e8b52 | ||
|
b57fd9f2a9 | ||
|
52f5ae15d1 | ||
|
7e830e5df4 | ||
|
8bb03a741d | ||
|
f543c3bd1e | ||
|
68c7782e7d | ||
|
4faf3728f2 | ||
|
ad70240347 | ||
|
b6ceb96ebe | ||
|
739013f248 | ||
|
6d57e7a0ce | ||
|
0d39d7542e | ||
|
5ad69aa650 | ||
|
a56dcc745d | ||
|
1b9fd642bb | ||
|
7c8f1ae020 | ||
|
c5d4a63afe | ||
|
a9ce4c20f0 | ||
|
1fd62e1612 | ||
|
6c2679ce75 | ||
|
610bdf1aac | ||
|
91c4dd2e56 | ||
|
cbdca08fea | ||
|
b87b4b61d8 | ||
|
9c010691a3 | ||
|
d3e9a2f7e8 | ||
|
8ef11a376b | ||
|
4d686e873b | ||
|
f55e34dd8b | ||
|
668bd4a1a4 | ||
|
5d5f168f25 | ||
|
938bd72844 | ||
|
ef01748dc9 | ||
|
8b91575c9e | ||
|
0da38cc38e | ||
|
6950cd2576 | ||
|
ff4fb21044 | ||
|
614c5e6155 | ||
|
35b0b4a4f9 | ||
|
c34cf333ba | ||
|
b33bdeaa02 | ||
|
38f3ae0934 | ||
|
beec4a188f | ||
|
f85d548d40 | ||
|
ee2e85c0fb | ||
|
186f71fa96 | ||
|
477e2bc455 | ||
|
273f109daf | ||
|
50494f667c | ||
|
183a0a75a1 | ||
|
f176f91b7e | ||
|
a56f485797 | ||
|
9e10c38e26 | ||
|
64e7675f45 | ||
|
ee66a45e2e | ||
|
190e43ff51 | ||
|
c200efa6d7 | ||
|
efebda76d2 | ||
|
5b18ff91ca | ||
|
ef5818ce7e | ||
|
58ef8e0ec3 | ||
|
8a84c1c371 | ||
|
1db5741edd | ||
|
1139e1a09c | ||
|
d415de1883 | ||
|
2381b0fd8f | ||
|
448d957e48 | ||
|
8fe7963631 | ||
|
6334b09653 | ||
|
e572d6ce50 | ||
|
792a19bf4b | ||
|
61e21de41b | ||
|
43932f2bbd | ||
|
6e5f00062c | ||
|
b5ea4067e4 | ||
|
1dfbc11cfa | ||
|
0c30e7c013 | ||
|
536fea27a5 | ||
|
215fd9e234 | ||
|
1701bd46fc | ||
|
4c0a0e0ff8 | ||
|
1a4db31ff0 | ||
|
9e5cf92a59 | ||
|
3ac6835650 | ||
|
6ebe28040b | ||
|
1e866eac28 | ||
|
e2123ae276 | ||
|
b27e5f4378 | ||
|
b85880e8e6 | ||
|
3e3cce534e | ||
|
9a4df0fac8 | ||
|
8839ac45cf | ||
|
2763826059 | ||
|
8c53fa175c | ||
|
d246bedab8 | ||
|
d005ffa766 | ||
|
b10218e773 | ||
|
e77ca971bd | ||
|
8442477224 | ||
|
fd2fcc996f | ||
|
6e9fc77f73 | ||
|
8c4c856caa | ||
|
a167e3449e | ||
|
b871fc689c | ||
|
cfe2bd11b0 | ||
|
bd64baa8d9 | ||
|
e1f7a9dbf8 | ||
|
fe6533943c | ||
|
7913082d41 | ||
|
a990ceecba | ||
|
4586568649 | ||
|
b4d4083513 | ||
|
91f5a9dec0 | ||
|
50030bcc2d | ||
|
8eacbe287b | ||
|
6f9a1ba29d | ||
|
6ba02c4a24 | ||
|
c4f0be96ac | ||
|
7da10ff923 | ||
|
ace9a49106 | ||
|
7f2c933cb3 | ||
|
f091935f96 | ||
|
5aa731e963 | ||
|
5e0749da3c | ||
|
06e7f297f7 | ||
|
216029c3a9 | ||
|
ec5e1b54c1 | ||
|
e12bc47546 | ||
|
384c179dd6 | ||
|
ef291b79d5 | ||
|
32b2030e59 | ||
|
0bb62ed290 | ||
|
6ffedae4fb | ||
|
631c1ac843 | ||
|
49918b654e | ||
|
fbfd265c0d | ||
|
0857eb27d5 | ||
|
69f6149d4c | ||
|
5ca3b795fc | ||
|
9499a47a0d | ||
|
c9d8c22b60 | ||
|
8960f72532 | ||
|
252dd9b676 | ||
|
ee091d09eb | ||
|
22c614d30b | ||
|
418034579f | ||
|
78babf0941 | ||
|
45d53bdb1d | ||
|
fb17de0595 | ||
|
6ed1caedd0 | ||
|
1d4f189b5f | ||
|
7006c62892 | ||
|
6b825abeb4 | ||
|
f2ee46b83e | ||
|
e873cb28f4 | ||
|
de1a5a8024 | ||
|
34c6013f1b | ||
|
40865dce4d | ||
|
82f9ba8bb7 | ||
|
6035d49ede | ||
|
67ef1f8b93 | ||
|
8ed6642387 | ||
|
0afcf3c40c | ||
|
e14fe242bd | ||
|
01fdfc4375 | ||
|
0f0a66c2ab | ||
|
849813484c | ||
|
c271d6753c | ||
|
0349a9a88c | ||
|
524d6242b0 | ||
|
2591a17946 | ||
|
b562f7f311 | ||
|
ce28c70c60 | ||
|
d0b2d05d5b | ||
|
010c44d07a | ||
|
088fc1a3a3 | ||
|
6d92d293b8 | ||
|
bb5b6e42d6 | ||
|
430c69b8db | ||
|
0c11a8e0aa | ||
|
536ee427da | ||
|
9eba41669e | ||
|
7e2265dd23 | ||
|
ab4dd54523 | ||
|
7859267539 | ||
|
e486c16513 | ||
|
f44e035a47 | ||
|
2845ffb4bb | ||
|
104c205230 | ||
|
c68513672d | ||
|
1ae6ed9c10 | ||
|
93b3fd9be5 | ||
|
0461e5de20 | ||
|
f8e5950fe5 | ||
|
138638cb1a | ||
|
c5bb16ac26 | ||
|
394850e68e | ||
|
f44becdee1 | ||
|
84c5822c20 | ||
|
b4977db5b2 | ||
|
f23f7400d8 | ||
|
8d0a80a7e2 | ||
|
9f9220f854 | ||
|
a312bfbb42 | ||
|
c35e753b1d | ||
|
8b4349b356 | ||
|
60e3f1015e | ||
|
83111a1126 | ||
|
8e0a90e077 | ||
|
810ebe32ce | ||
|
a8fdfa4e48 | ||
|
2b2200145f |
46
Shorewall-core/configure
vendored
46
Shorewall-core/configure
vendored
@@ -1,16 +1,17 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Shorewall Packet Filtering Firewall RPM configuration program - V4.5
|
||||
# Shorewall Packet Filtering Firewall RPM configuration program - V4.6
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2012,2014 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Shorewall documentation is available at http://www.shorewall.net
|
||||
#
|
||||
# This program is part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -18,8 +19,7 @@
|
||||
# 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.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Usage: ./configure [ <option>=<setting> ] ...
|
||||
#
|
||||
@@ -93,15 +93,38 @@ done
|
||||
|
||||
vendor=${params[HOST]}
|
||||
|
||||
if [ -z "$vendor" ]; then
|
||||
if [ -f /etc/os-release ]; then
|
||||
eval $(cat /etc/os-release | grep ^ID=)
|
||||
|
||||
case $ID in
|
||||
fedora)
|
||||
vendor=redhat
|
||||
;;
|
||||
debian|ubuntu)
|
||||
vendor=debian
|
||||
;;
|
||||
opensuse)
|
||||
vendor=suse
|
||||
;;
|
||||
*)
|
||||
vendor="$ID"
|
||||
;;
|
||||
esac
|
||||
|
||||
params[HOST]="$vendor"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$vendor" ]; then
|
||||
case `uname` in
|
||||
Darwin)
|
||||
$params[HOST]=apple
|
||||
params[HOST]=apple
|
||||
rcfile=shorewallrc.apple
|
||||
;;
|
||||
|
||||
cygwin*)
|
||||
$params[HOST]=cygwin
|
||||
cygwin*|CYGWIN*)
|
||||
params[HOST]=cygwin
|
||||
rcfile=shorewallrc.cygwin
|
||||
;;
|
||||
*)
|
||||
@@ -187,6 +210,7 @@ for on in \
|
||||
AUXINITSOURCE \
|
||||
AUXINITFILE \
|
||||
SYSTEMD \
|
||||
SERVICEFILE \
|
||||
SYSCONFFILE \
|
||||
SYSCONFDIR \
|
||||
SPARSE \
|
||||
|
@@ -2,15 +2,16 @@
|
||||
#
|
||||
# Shorewall Packet Filtering Firewall RPM configuration program - V4.5
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2012, 2014 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Shorewall documentation is available at http://www.shorewall.net
|
||||
#
|
||||
# This program is part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -18,8 +19,7 @@
|
||||
# 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.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Usage: ./configure.pl <option>=<setting> ...
|
||||
#
|
||||
@@ -56,6 +56,28 @@ my $vendor = $params{HOST};
|
||||
my $rcfile;
|
||||
my $rcfilename;
|
||||
|
||||
unless ( defined $vendor ) {
|
||||
if ( -f '/etc/os-release' ) {
|
||||
my $id = `cat /etc/os-release | grep ^ID=`;
|
||||
|
||||
chomp $id;
|
||||
|
||||
$id =~ s/ID=//;
|
||||
|
||||
if ( $id eq 'fedora' ) {
|
||||
$vendor = 'redhat';
|
||||
} elsif ( $id eq 'opensuse' ) {
|
||||
$vendor = 'suse';
|
||||
} elsif ( $id eq 'ubuntu' ) {
|
||||
$vendor = 'debian';
|
||||
} else {
|
||||
$vendor = $id;
|
||||
}
|
||||
}
|
||||
|
||||
$params{HOST} = $vendor;
|
||||
}
|
||||
|
||||
if ( defined $vendor ) {
|
||||
$rcfilename = $vendor eq 'linux' ? 'shorewallrc.default' : 'shorewallrc.' . $vendor;
|
||||
die qq("ERROR: $vendor" is not a recognized host type) unless -f $rcfilename;
|
||||
@@ -146,6 +168,7 @@ for ( qw/ HOST
|
||||
AUXINITSOURCE
|
||||
AUXINITFILE
|
||||
SYSTEMD
|
||||
SERVICEFILE
|
||||
SYSCONFFILE
|
||||
SYSCONFDIR
|
||||
SPARSE
|
||||
|
@@ -2,24 +2,24 @@
|
||||
#
|
||||
# Script to install Shoreline Firewall Core Modules
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2000-2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2000-2011,2014 - 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 part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# 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 the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# 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.
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
VERSION=xxx #The Build script inserts the actual version
|
||||
@@ -194,8 +194,30 @@ if [ -z "$BUILD" ]; then
|
||||
BUILD=apple
|
||||
;;
|
||||
*)
|
||||
if [ -f /etc/debian_version ]; then
|
||||
if [ -f /etc/os-release ]; then
|
||||
eval $(cat /etc/os-release | grep ^ID)
|
||||
|
||||
case $ID in
|
||||
fedora)
|
||||
BUILD=redhat
|
||||
;;
|
||||
debian)
|
||||
BUILD=debian
|
||||
;;
|
||||
gentoo)
|
||||
BUILD=gentoo
|
||||
;;
|
||||
opensuse)
|
||||
BUILD=suse
|
||||
;;
|
||||
*)
|
||||
BUILD="$ID"
|
||||
;;
|
||||
esac
|
||||
elif [ -f /etc/debian_version ]; then
|
||||
BUILD=debian
|
||||
elif [ -f /etc/gentoo-release ]; then
|
||||
BUILD=gentoo
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
BUILD=redhat
|
||||
elif [ -f /etc/slackware-version ] ; then
|
||||
@@ -254,7 +276,7 @@ case "$HOST" in
|
||||
apple)
|
||||
echo "Installing Mac-specific configuration...";
|
||||
;;
|
||||
debian|redhat|slackware|archlinux|linux|suse)
|
||||
debian|gentoo|redhat|slackware|archlinux|linux|suse)
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Unknown HOST \"$HOST\"" >&2
|
||||
@@ -325,7 +347,7 @@ if [ -n "${INITFILE}" ]; then
|
||||
if [ -n "$AUXINITSOURCE" -a -f "$AUXINITSOURCE" ]; then
|
||||
install_file $AUXINITSOURCE ${DESTDIR}${INITDIR}/$AUXINITFILE 0544
|
||||
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${INITDIR}/$AUXINITFILE
|
||||
echo "$Product script installed in ${DESTDIR}${INITDIR}/$AUXINITFILE"
|
||||
echo "SysV init script $AUXINITSOURCE installed in ${DESTDIR}${INITDIR}/$AUXINITFILE"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
@@ -371,12 +393,13 @@ if [ -z "${DESTDIR}" ]; then
|
||||
|
||||
echo 'VARDIR=${VARLIB}/${PRODUCT}' >> $file
|
||||
fi
|
||||
|
||||
[ ! -f ~/.shorewallrc ] && cp ${SHAREDIR}/shorewall/shorewallrc ~/.shorewallrc
|
||||
fi
|
||||
|
||||
[ $file != "${DESTDIR}${SHAREDIR}/shorewall/shorewallrc" ] && cp $file ${DESTDIR}${SHAREDIR}/shorewall/shorewallrc
|
||||
|
||||
|
||||
[ -z "${DESTDIR}" ] && [ ! -f ~/.shorewallrc ] && cp ${SHAREDIR}/shorewall/shorewallrc ~/.shorewallrc
|
||||
|
||||
if [ ${SHAREDIR} != /usr/share ]; then
|
||||
for f in lib.*; do
|
||||
if [ $BUILD != apple ]; then
|
||||
|
@@ -1,15 +1,16 @@
|
||||
#
|
||||
# Shorewall 4.5 -- /usr/share/shorewall/lib.base
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 1999-2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 1999-2014 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -17,8 +18,7 @@
|
||||
# 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.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This library contains the code common to all Shorewall components except the
|
||||
# generated scripts.
|
||||
|
@@ -1,15 +1,16 @@
|
||||
#
|
||||
# Shorewall 4.5 -- /usr/share/shorewall/lib.cli.
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 1999-2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 1999-2014 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -17,15 +18,14 @@
|
||||
# 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.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This library contains the command processing code common to /sbin/shorewall[6] and
|
||||
# /sbin/shorewall[6]-lite. In Shorewall and Shorewall6, the lib.cli-std library is
|
||||
# loaded after this one and replaces some of the functions declared here.
|
||||
#
|
||||
|
||||
SHOREWALL_CAPVERSION=40512
|
||||
SHOREWALL_CAPVERSION=40600
|
||||
|
||||
[ -n "${g_program:=shorewall}" ]
|
||||
|
||||
@@ -277,8 +277,7 @@ logwatch() # $1 = timeout -- if negative, prompt each time that
|
||||
elif [ -r $LOGFILE ]; then
|
||||
g_logread="tac $LOGFILE"
|
||||
else
|
||||
echo "LOGFILE ($LOGFILE) does not exist!" >&2
|
||||
exit 2
|
||||
fatal_error "LOGFILE ($LOGFILE) does not exist!"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -472,7 +471,10 @@ save_config() {
|
||||
;;
|
||||
*)
|
||||
validate_restorefile RESTOREFILE
|
||||
do_save && rm -f ${VARDIR}/save
|
||||
if do_save; then
|
||||
rm -f ${VARDIR}/save
|
||||
result=0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@@ -480,7 +482,7 @@ save_config() {
|
||||
echo "$g_product isn't started" >&2
|
||||
fi
|
||||
|
||||
return 0
|
||||
return $result
|
||||
|
||||
}
|
||||
|
||||
@@ -557,7 +559,7 @@ show_routing() {
|
||||
ip -$g_family rule list | find_tables | sort -u | while read table; do
|
||||
heading "Table $table:"
|
||||
if [ $g_family -eq 6 ]; then
|
||||
ip -$g_family -o route list table $table | fgrep -v cache | sort_routes
|
||||
ip -$g_family -o route list table $table | grep -vF cache | sort_routes
|
||||
else
|
||||
ip -4 -o route list table $table | sort_routes
|
||||
fi
|
||||
@@ -570,7 +572,7 @@ show_routing() {
|
||||
else
|
||||
heading "Routing Table"
|
||||
if [ $g_family -eq 6 ]; then
|
||||
ip -$g_family -o route list | fgrep -v cache | sort_routes
|
||||
ip -$g_family -o route list | grep -vF cache | sort_routes
|
||||
else
|
||||
ip -4 -o route list table $table | sort_routes
|
||||
fi
|
||||
@@ -580,7 +582,7 @@ show_routing() {
|
||||
determine_ipset_version() {
|
||||
local setname
|
||||
|
||||
if [ -z "$IPSET" -o $IPSET = ipset ]; then
|
||||
if [ -z "$IPSET" -o "$IPSET" = "ipset" ]; then
|
||||
IPSET=$(mywhich ipset)
|
||||
[ -n "$IPSET" ] || fatal_error "The ipset utility cannot be located"
|
||||
fi
|
||||
@@ -677,6 +679,11 @@ version_command() {
|
||||
echo "$product: $(cat ${SHAREDIR}/$product/version)"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$(id -u)" -eq 0 -a -f $g_firewall ]; then
|
||||
echo $g_echo_n "$g_firewall was compiled by Shorewall version "
|
||||
$g_firewall version
|
||||
fi
|
||||
else
|
||||
echo $SHOREWALL_VERSION
|
||||
fi
|
||||
@@ -726,6 +733,104 @@ show_nfacct() {
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
show_event() {
|
||||
local address
|
||||
local ttl_label
|
||||
local ttl
|
||||
local last_seen
|
||||
local last
|
||||
local oldest_pkt
|
||||
local oldest
|
||||
local intimes
|
||||
local outtimes1
|
||||
local outtimes2
|
||||
local time
|
||||
local count
|
||||
|
||||
while read address ttl_label ttl last_seen last oldest_pkt oldest intimes; do
|
||||
case $address in
|
||||
*.*)
|
||||
[ $g_family -eq 4 ] || continue
|
||||
;;
|
||||
*:*)
|
||||
[ $g_family -eq 6 ] || continue
|
||||
;;
|
||||
*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
outtimes1=''
|
||||
outtimes2=''
|
||||
count=0
|
||||
last=$((($currenttime - $last)/1000))
|
||||
for time in $intimes; do
|
||||
time=${time%,}
|
||||
time=$(($currenttime - $time))
|
||||
if [ $time -lt 10 ]; then
|
||||
time="000$time"
|
||||
elif [ $time -lt 100 ]; then
|
||||
time="00$time"
|
||||
elif [ $time -lt 1000 ]; then
|
||||
time="0$time"
|
||||
fi
|
||||
|
||||
if [ $count -lt $oldest ]; then
|
||||
outtimes2="$outtimes2 $time"
|
||||
else
|
||||
outtimes1="$outtimes1 $time"
|
||||
fi
|
||||
|
||||
count=$(($count + 1))
|
||||
done
|
||||
|
||||
outtimes1="${outtimes1}${outtimes2}"
|
||||
|
||||
[ -n "$outtimes1" ] && outtimes1=$(echo "$outtimes1 " | sed -r 's/([[:digit:]]{3}) /\.\1, /g') && outtimes1=${outtimes1%, }
|
||||
|
||||
echo " $address : ${outtimes1}"
|
||||
done < /proc/net/xt_recent/$1
|
||||
}
|
||||
|
||||
show_events() {
|
||||
local file
|
||||
local base
|
||||
local currenttime
|
||||
|
||||
if [ -f /proc/net/xt_recent/%CURRENTTIME ]; then
|
||||
echo -127.0.0.1 > /proc/net/xt_recent/%CURRENTTIME
|
||||
echo +127.0.0.1 > /proc/net/xt_recent/%CURRENTTIME
|
||||
currenttime=$(cat /proc/net/xt_recent/%CURRENTTIME | cut -d ' ' -f 5 -)
|
||||
# echo Current time: $currenttime
|
||||
# echo
|
||||
else
|
||||
currenttime=0
|
||||
fi
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
for event in $@ ; do
|
||||
if [ -f /proc/net/xt_recent/$event ]; then
|
||||
echo $event:
|
||||
show_event $event
|
||||
echo
|
||||
else
|
||||
error_message "WARNING: Event $event not found"
|
||||
fi
|
||||
done
|
||||
else
|
||||
for file in /proc/net/xt_recent/*; do
|
||||
base=$(basename $file)
|
||||
|
||||
if [ $base != %CURRENTTIME ]; then
|
||||
echo $base
|
||||
show_event $base
|
||||
echo
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Show Command Executor
|
||||
#
|
||||
@@ -914,8 +1019,7 @@ show_command() {
|
||||
elif [ -r $LOGFILE ]; then
|
||||
g_logread="tac $LOGFILE"
|
||||
else
|
||||
echo "LOGFILE ($LOGFILE) does not exist!" >&2
|
||||
exit 2
|
||||
fatal_error "LOGFILE ($LOGFILE) does not exist!"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -969,8 +1073,7 @@ show_command() {
|
||||
done < ${VARDIR}/zones
|
||||
echo
|
||||
else
|
||||
echo " ERROR: ${VARDIR}/zones does not exist" >&2
|
||||
exit 1
|
||||
fatal_error "${VARDIR}/zones does not exist"
|
||||
fi
|
||||
;;
|
||||
capabilities)
|
||||
@@ -1066,6 +1169,19 @@ show_command() {
|
||||
error_message "Cannot locate the arptables executable"
|
||||
fi
|
||||
;;
|
||||
event)
|
||||
[ $# -gt 1 ] || usage 1
|
||||
echo "$g_product $SHOREWALL_VERSION events at $g_hostname - $(date)"
|
||||
echo
|
||||
shift
|
||||
show_events $@
|
||||
;;
|
||||
events)
|
||||
[ $# -gt 1 ] && usage 1
|
||||
echo "$g_product $SHOREWALL_VERSION events at $g_hostname - $(date)"
|
||||
echo
|
||||
show_events
|
||||
;;
|
||||
*)
|
||||
case "$g_program" in
|
||||
*-lite)
|
||||
@@ -1276,8 +1392,7 @@ do_dump_command() {
|
||||
elif [ -r $LOGFILE ]; then
|
||||
g_logread="tac $LOGFILE"
|
||||
else
|
||||
echo "LOGFILE ($LOGFILE) does not exist! - See http://www.shorewall.net/shorewall_logging.html" >&2
|
||||
exit 2
|
||||
fatal_error "LOGFILE ($LOGFILE) does not exist! - See http://www.shorewall.net/shorewall_logging.html"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1361,6 +1476,9 @@ do_dump_command() {
|
||||
heading "NF Accounting"
|
||||
show_nfacct
|
||||
|
||||
heading "Events"
|
||||
show_events
|
||||
|
||||
if qt mywhich setkey; then
|
||||
heading "PFKEY SPD"
|
||||
setkey -DP
|
||||
@@ -1390,7 +1508,12 @@ do_dump_command() {
|
||||
|
||||
if [ $g_family -eq 4 ]; then
|
||||
heading "ARP"
|
||||
arp -na
|
||||
if qt mywhich arp; then
|
||||
arp -na
|
||||
else
|
||||
ip -4 neigh ls
|
||||
ip -4 neigh ls proxy
|
||||
fi
|
||||
else
|
||||
heading "Neighbors"
|
||||
ip -6 neigh ls
|
||||
@@ -1412,11 +1535,7 @@ do_dump_command() {
|
||||
|
||||
echo
|
||||
|
||||
if qt netstat -4; then
|
||||
netstat -${g_family}tunap
|
||||
else
|
||||
netstat -tunap
|
||||
fi
|
||||
ss -${g_family}tunap
|
||||
|
||||
if [ -n "$TC_ENABLED" ]; then
|
||||
heading "Traffic Control"
|
||||
@@ -1427,7 +1546,7 @@ do_dump_command() {
|
||||
}
|
||||
|
||||
dump_command() {
|
||||
do_dump_command | dump_filter
|
||||
do_dump_command $@ | dump_filter
|
||||
}
|
||||
|
||||
#
|
||||
@@ -1720,8 +1839,7 @@ separate_list() {
|
||||
add_command() {
|
||||
local interface host hostlist zone ipset
|
||||
if ! product_is_started ; then
|
||||
echo "$g_product Not Started" >&2
|
||||
exit 2
|
||||
fatal_error "$g_product Not Started"
|
||||
fi
|
||||
|
||||
determine_ipset_version
|
||||
@@ -1778,6 +1896,8 @@ add_command() {
|
||||
ipset=6_${zone}_${interface};
|
||||
fi
|
||||
|
||||
ipset=$(echo $ipset | sed 's/./_/g');
|
||||
|
||||
if ! qt $IPSET -L $ipset; then
|
||||
fatal_error "Zone $zone, interface $interface does not have a dynamic host list"
|
||||
fi
|
||||
@@ -1809,8 +1929,7 @@ add_command() {
|
||||
delete_command() {
|
||||
local interface host hostent hostlist zone ipset
|
||||
if ! product_is_started ; then
|
||||
echo "$g_product Not Started" >&2
|
||||
exit 2;
|
||||
fatal_error "$g_product Not Started"
|
||||
fi
|
||||
|
||||
determine_ipset_version
|
||||
@@ -1867,6 +1986,8 @@ delete_command() {
|
||||
ipset=6_${zone}_${interface};
|
||||
fi
|
||||
|
||||
ipset=$(echo $ipset | sed 's/./_/g');
|
||||
|
||||
if ! qt $IPSET -L $ipset -n; then
|
||||
fatal_error "Zone $zone, interface $interface does not have a dynamic host list"
|
||||
fi
|
||||
@@ -1995,8 +2116,7 @@ allow_command() {
|
||||
range='--src-range'
|
||||
|
||||
if ! chain_exists dynamic; then
|
||||
echo "Dynamic blacklisting is not enabled in the current $g_product configuration" >&2
|
||||
exit 2
|
||||
fatal_error "Dynamic blacklisting is not enabled in the current $g_product configuration"
|
||||
fi
|
||||
|
||||
[ -n "$g_nolock" ] || mutex_on
|
||||
@@ -2118,8 +2238,7 @@ determine_capabilities() {
|
||||
g_tool=$(mywhich $tool)
|
||||
|
||||
if [ -z "$g_tool" ]; then
|
||||
echo " ERROR: No executable $tool binary can be found on your PATH" >&2
|
||||
exit 1
|
||||
fatal-error "No executable $tool binary can be found on your PATH"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -2139,15 +2258,19 @@ determine_capabilities() {
|
||||
OLD_CONNTRACK_MATCH=
|
||||
MULTIPORT=
|
||||
XMULTIPORT=
|
||||
EMULTIPORT=
|
||||
POLICY_MATCH=
|
||||
PHYSDEV_MATCH=
|
||||
PHYSDEV_BRIDGE=
|
||||
IPRANGE_MATCH=
|
||||
RECENT_MATCH=
|
||||
REAP_OPTION=
|
||||
OWNER_MATCH=
|
||||
OWNER_NAME_MATCH=
|
||||
IPSET_MATCH=
|
||||
OLD_IPSET_MATCH=
|
||||
IPSET_MATCH_NOMATCH=
|
||||
IPSET_MATCH_COUNTERS=
|
||||
IPSET_V5=
|
||||
CONNMARK=
|
||||
XCONNMARK=
|
||||
@@ -2192,6 +2315,7 @@ determine_capabilities() {
|
||||
CONDITION_MATCH=
|
||||
IPTABLES_S=
|
||||
BASIC_FILTER=
|
||||
BASIC_EMATCH=
|
||||
CT_TARGET=
|
||||
STATISTIC_MATCH=
|
||||
IMQ_TARGET=
|
||||
@@ -2202,6 +2326,10 @@ determine_capabilities() {
|
||||
NFACCT_MATCH=
|
||||
CHECKSUM_TARGET=
|
||||
ARPTABLESJF=
|
||||
MASQUERADE_TGT=
|
||||
UDPLITEREDIRECT=
|
||||
NEW_TOS_MATCH=
|
||||
|
||||
AMANDA_HELPER=
|
||||
FTP_HELPER=
|
||||
FTP0_HELPER=
|
||||
@@ -2220,7 +2348,7 @@ determine_capabilities() {
|
||||
|
||||
resolve_arptables
|
||||
|
||||
if [ -n "$arptables" -a -x $arptables ]; then
|
||||
if [ -n "$arptables" -a -x "$arptables" ]; then
|
||||
qt $arptables -L OUT && ARPTABLESJF=Yes
|
||||
fi
|
||||
|
||||
@@ -2230,7 +2358,11 @@ determine_capabilities() {
|
||||
if qt $g_tool -t nat -N $chain; then
|
||||
if [ $g_family -eq 4 ]; then
|
||||
qt $g_tool -t nat -A $chain -j SNAT --to-source 1.2.3.4 --persistent && PERSISTENT_SNAT=Yes
|
||||
else
|
||||
qt $g_tool -t nat -A $chain -j SNAT --to-source 2001::1 --persistent && PERSISTENT_SNAT=Yes
|
||||
fi
|
||||
qt $g_tool -t nat -A $chain -j MASQUERADE && MASQUERADE_TGT=Yes
|
||||
qt $g_tool -t nat -A $chain -p udplite -m multiport --dport 33 -j REDIRECT --to-port 22 && UDPREDIRECT=Yes
|
||||
qt $g_tool -t nat -F $chain
|
||||
qt $g_tool -t nat -X $chain
|
||||
fi
|
||||
@@ -2239,8 +2371,7 @@ determine_capabilities() {
|
||||
qt $g_tool -F $chain
|
||||
qt $g_tool -X $chain
|
||||
if ! $g_tool -N $chain; then
|
||||
echo " ERROR: The command \"$g_tool -N $chain\" failed" >&2
|
||||
exit 1
|
||||
fatal_error "The command \"$g_tool -N $chain\" failed"
|
||||
fi
|
||||
|
||||
chain1=${chain}1
|
||||
@@ -2249,16 +2380,14 @@ determine_capabilities() {
|
||||
qt $g_tool -X $chain1
|
||||
if ! $g_tool -N $chain1; then
|
||||
qt $g_tool -X $CHAIN
|
||||
echo " ERROR: The command \"$g_tool -N $chain1\" failed" >&2
|
||||
exit 1
|
||||
fatal_error "The command \"$g_tool -N $chain1\" failed"
|
||||
fi
|
||||
|
||||
if ! qt $g_tool -A $chain -m state --state ESTABLISHED,RELATED -j ACCEPT &&
|
||||
! qt $g_tool -A $chain -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT; then
|
||||
qt $g_tool -x $chain
|
||||
qt $g_tool -x $chain1
|
||||
echo " ERROR: Your kernel lacks connection tracking and/or state matching -- $g_product will not run on this system" >&2
|
||||
exit 1
|
||||
fatal_error "Your kernel lacks connection tracking and/or state matching -- $g_product will not run on this system"
|
||||
fi
|
||||
|
||||
if [ $g_family -eq 4 ]; then
|
||||
@@ -2282,7 +2411,8 @@ determine_capabilities() {
|
||||
qt $g_tool -A $chain -p tcp -m multiport --sports 60 -m multiport --dports 99 -j ACCEPT && KLUDEFREE=Yes
|
||||
fi
|
||||
|
||||
qt $g_tool -A $chain -p tcp -m multiport --dports 21:22 -j ACCEPT && XMULTIPORT=Yes
|
||||
qt $g_tool -A $chain -p tcp -m multiport --dports 21:22 -j ACCEPT && XMULTIPORT=Yes
|
||||
qt $g_tool -A $chain -p sctp -m multiport --dports 21,22 -j ACCEPT && EMULTIPORT=Yes
|
||||
qt $g_tool -A $chain -m policy --pol ipsec --mode tunnel --dir in -j ACCEPT && POLICY_MATCH=Yes
|
||||
|
||||
if qt $g_tool -A $chain -m physdev --physdev-out eth0 -j ACCEPT; then
|
||||
@@ -2307,7 +2437,11 @@ determine_capabilities() {
|
||||
fi
|
||||
fi
|
||||
|
||||
qt $g_tool -A $chain -m recent --update -j ACCEPT && RECENT_MATCH=Yes
|
||||
if qt $g_tool -A $chain -m recent --update -j ACCEPT; then
|
||||
RECENT_MATCH=Yes
|
||||
qt $g_tool -A $chain -m recent --rcheck --seconds 10 --reap && REAP_OPTION=Yes
|
||||
fi
|
||||
|
||||
qt $g_tool -A $chain -m owner --uid-owner 0 -j ACCEPT && OWNER_MATCH=Yes
|
||||
|
||||
local name
|
||||
@@ -2370,6 +2504,7 @@ determine_capabilities() {
|
||||
qt $g_tool -t mangle -A $chain -j DSCP --set-dscp 0 && DSCP_TARGET=Yes
|
||||
qt $g_tool -t mangle -A $chain -m rpfilter && RPFILTER_MATCH=Yes
|
||||
qt $g_tool -t mangle -A $chain -j CHECKSUM --checksum-fill && CHECKSUM_TARGET=Yes
|
||||
qt $g_tool -t mangle -A $chain -m tos --tos 0x10/0xff && NEW_TOS_MATCH=Yes
|
||||
|
||||
qt $g_tool -t mangle -F $chain
|
||||
qt $g_tool -t mangle -X $chain
|
||||
@@ -2424,6 +2559,8 @@ determine_capabilities() {
|
||||
|
||||
if [ -n "$have_ipset" ]; then
|
||||
if qt $g_tool -A $chain -m set --match-set $chain src -j ACCEPT; then
|
||||
qt $g_tool -A $chain -m set --match-set $chain src --return-nomatch -j ACCEPT && IPSET_MATCH_NOMATCH=Yes
|
||||
qt $g_tool -A $chain -m set --match-set $chain src --packets-lt 100 -j ACCEPT && IPSET_MATCH_COUNTERS=Yes
|
||||
qt $g_tool -F $chain
|
||||
IPSET_MATCH=Yes
|
||||
elif qt $g_tool -A $chain -m set --set $chain src -j ACCEPT; then
|
||||
@@ -2507,8 +2644,15 @@ determine_capabilities() {
|
||||
qt $g_tool -F $chain1
|
||||
qt $g_tool -X $chain1
|
||||
|
||||
[ -n "$TC" ] && $TC filter add flow help 2>&1 | grep -q ^Usage && FLOW_FILTER=Yes
|
||||
[ -n "$TC" ] && $TC filter add basic help 2>&1 | grep -q ^Usage && BASIC_FILTER=Yes
|
||||
if [ -n "$TC" ]; then
|
||||
$TC filter add flow help 2>&1 | grep -q ^Usage && FLOW_FILTER=Yes
|
||||
|
||||
if $TC filter add basic help 2>&1 | grep -q ^Usage; then
|
||||
BASIC_FILTER=Yes
|
||||
$TC filter add basic help 2>&1 | egrep -q match && BASIC_EMATCH=Yes
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -n "$IP" ] && $IP rule add help 2>&1 | grep -q /MASK && FWMARK_RT_MASK=Yes
|
||||
|
||||
CAPVERSION=$SHOREWALL_CAPVERSION
|
||||
@@ -2539,7 +2683,8 @@ report_capabilities_unsorted() {
|
||||
report_capability "NAT (NAT_ENABLED)" $NAT_ENABLED
|
||||
report_capability "Packet Mangling (MANGLE_ENABLED)" $MANGLE_ENABLED
|
||||
report_capability "Multi-port Match (MULTIPORT)" $MULTIPORT
|
||||
[ -n "$MULTIPORT" ] && report_capability "Extended Multi-port Match (XMULIPORT)" $XMULTIPORT
|
||||
[ -n "$MULTIPORT" ] && report_capability "Extended Multi-port Match (XMULIPORT)" $XMULTIPORT
|
||||
[ -n "$EMULTIPORT" ] && report_capability "Enhanced Multi-port Match (EMULIPORT)" $EMULTIPORT
|
||||
report_capability "Connection Tracking Match (CONNTRACK_MATCH)" $CONNTRACK_MATCH
|
||||
if [ -n "$CONNTRACK_MATCH" ]; then
|
||||
report_capability "Extended Connection Tracking Match Support (NEW_CONNTRACK_MATCH)" $NEW_CONNTRACK_MATCH
|
||||
@@ -2552,11 +2697,14 @@ report_capabilities_unsorted() {
|
||||
report_capability "Packet length Match (LENGTH_MATCH)" $LENGTH_MATCH
|
||||
report_capability "IP range Match(IPRANGE_MATCH)" $IPRANGE_MATCH
|
||||
report_capability "Recent Match (RECENT_MATCH)" $RECENT_MATCH
|
||||
[ -n "$RECENT_MATCH" ] && report_capability 'Recent Match "--reap" option (REAP_OPTION)' $REAP_OPTION
|
||||
report_capability "Owner Match (OWNER_MATCH)" $OWNER_MATCH
|
||||
report_capability "Owner Name Match (OWNER_NAME_MATCH)" $OWNER_NAME_MATCH
|
||||
if [ -n "$IPSET_MATCH" ]; then
|
||||
report_capability "Ipset Match (IPSET_MATCH)" $IPSET_MATCH
|
||||
[ -n "$OLD_IPSET_MATCH" ] && report_capability "OLD_Ipset Match (OLD_IPSET_MATCH)" $OLD_IPSET_MATCH
|
||||
[ -n "$OLD_IPSET_MATCH" ] && report_capability "OLD_Ipset Match (OLD_IPSET_MATCH)" $OLD_IPSET_MATCH
|
||||
[ -n "$IPSET_MATCH_NOMATCH" ] && report_capability "Ipset Match Nomatch (IPSET_MATCH_NOMATCH)" $IPSET_MATCH_NOMATCH
|
||||
[ -n "$IPSET_MATCH_NOMATCH" ] && report_capability "Ipset Match Counters (IPSET_MATCH_COUNTERS)" $IPSET_MATCH_COUNTERS
|
||||
fi
|
||||
report_capability "CONNMARK Target (CONNMARK)" $CONNMARK
|
||||
[ -n "$CONNMARK" ] && report_capability "Extended CONNMARK Target (XCONNMARK)" $XCONNMARK
|
||||
@@ -2593,7 +2741,7 @@ report_capabilities_unsorted() {
|
||||
report_capability "TPROXY Target (TPROXY_TARGET)" $TPROXY_TARGET
|
||||
report_capability "FLOW Classifier (FLOW_FILTER)" $FLOW_FILTER
|
||||
report_capability "fwmark route mask (FWMARK_RT_MASK)" $FWMARK_RT_MASK
|
||||
report_capability "Mark in any table (MARK_ANYWHERE)" $MARK_ANYWHERE
|
||||
report_capability "Mark in the filter table (MARK_ANYWHERE)" $MARK_ANYWHERE
|
||||
report_capability "Header Match (HEADER_MATCH)" $HEADER_MATCH
|
||||
report_capability "ACCOUNT Target (ACCOUNT_TARGET)" $ACCOUNT_TARGET
|
||||
report_capability "AUDIT Target (AUDIT_TARGET)" $AUDIT_TARGET
|
||||
@@ -2608,6 +2756,9 @@ report_capabilities_unsorted() {
|
||||
report_capability "NFAcct match" $NFACCT_MATCH
|
||||
report_capability "Checksum Target" $CHECKSUM_TARGET
|
||||
report_capability "Arptables JF" $ARPTABLESJF
|
||||
report_capability "MASQUERADE Target" $MASQUERADE_TGT
|
||||
report_capability "UDPLITE Port Redirection" $UDPLITEREDIRECT
|
||||
report_capability "New tos Match" $NEW_TOS_MATCH
|
||||
|
||||
report_capability "Amanda Helper" $AMANDA_HELPER
|
||||
report_capability "FTP Helper" $FTP_HELPER
|
||||
@@ -2632,6 +2783,7 @@ report_capabilities_unsorted() {
|
||||
fi
|
||||
|
||||
report_capability "Basic Filter (BASIC_FILTER)" $BASIC_FILTER
|
||||
report_capability "Basic Ematch (BASIC_EMATCH)" $BASIC_EMATCH
|
||||
report_capability "CT Target (CT_TARGET)" $CT_TARGET
|
||||
|
||||
echo " Kernel Version (KERNELVERSION): $KERNELVERSION"
|
||||
@@ -2659,6 +2811,7 @@ report_capabilities_unsorted1() {
|
||||
report_capability1 MANGLE_ENABLED
|
||||
report_capability1 MULTIPORT
|
||||
report_capability1 XMULTIPORT
|
||||
report_capability1 EMULTIPORT
|
||||
report_capability1 CONNTRACK_MATCH
|
||||
report_capability1 NEW_CONNTRACK_MATCH
|
||||
report_capability1 OLD_CONNTRACK_MATCH
|
||||
@@ -2669,10 +2822,13 @@ report_capabilities_unsorted1() {
|
||||
report_capability1 LENGTH_MATCH
|
||||
report_capability1 IPRANGE_MATCH
|
||||
report_capability1 RECENT_MATCH
|
||||
report_capability1 REAP_OPTION
|
||||
report_capability1 OWNER_MATCH
|
||||
report_capability1 OWNER_NAME_MATCH
|
||||
report_capability1 IPSET_MATCH
|
||||
report_capability1 OLD_IPSET_MATCH
|
||||
report_capability1 IPSET_MATCH_NOMATCH
|
||||
report_capability1 IPSET_MATCH_COUNTERS
|
||||
report_capability1 CONNMARK
|
||||
report_capability1 XCONNMARK
|
||||
report_capability1 CONNMARK_MATCH
|
||||
@@ -2716,6 +2872,7 @@ report_capabilities_unsorted1() {
|
||||
report_capability1 CONDITION_MATCH
|
||||
report_capability1 IPTABLES_S
|
||||
report_capability1 BASIC_FILTER
|
||||
report_capability1 BASIC_EMATCH
|
||||
report_capability1 CT_TARGET
|
||||
report_capability1 STATISTIC_MATCH
|
||||
report_capability1 IMQ_TARGET
|
||||
@@ -2726,6 +2883,9 @@ report_capabilities_unsorted1() {
|
||||
report_capability1 NFACCT_MATCH
|
||||
report_capability1 CHECKSUM_TARGET
|
||||
report_capability1 ARPTABLESJF
|
||||
report_capability1 MASQUERADE_TGT
|
||||
report_capability1 UDPLITEREDIRECT
|
||||
report_capability1 NEW_TOS_MATCH
|
||||
|
||||
report_capability1 AMANDA_HELPER
|
||||
report_capability1 FTP_HELPER
|
||||
@@ -2756,10 +2916,10 @@ report_capabilities1() {
|
||||
|
||||
show_status() {
|
||||
if product_is_started ; then
|
||||
echo "$g_product is running"
|
||||
[ $VERBOSITY -ge 1 ] && echo "$g_product is running"
|
||||
status=0
|
||||
else
|
||||
echo "$g_product is stopped"
|
||||
[ $VERBOSITY -ge 1 ] && echo "$g_product is stopped"
|
||||
status=4
|
||||
fi
|
||||
|
||||
@@ -2773,14 +2933,20 @@ show_status() {
|
||||
else
|
||||
state=Unknown
|
||||
fi
|
||||
echo "State:$state"
|
||||
|
||||
if [ $VERBOSITY -ge 1 ]; then
|
||||
if [ -f $g_firewall ]; then
|
||||
state="$state ($g_firewall compiled by Shorewall version $($g_firewall version))"
|
||||
fi
|
||||
echo "State:$state"
|
||||
echo
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
status_command() {
|
||||
echo "${g_product}-$SHOREWALL_VERSION Status at $g_hostname - $(date)"
|
||||
echo
|
||||
[ $VERBOSITY -ge 1 ] && echo "${g_product}-$SHOREWALL_VERSION Status at $g_hostname - $(date)" && echo
|
||||
show_status
|
||||
echo
|
||||
exit $status
|
||||
}
|
||||
|
||||
@@ -2896,7 +3062,7 @@ ipcalc_command() {
|
||||
valid_address $address || fatal_error "Invalid IP address: $address"
|
||||
[ -z "$vlsm" ] && usage 2
|
||||
[ "x$address" = "x$vlsm" ] && usage 2
|
||||
[ $vlsm -gt 32 ] && echo "Invalid VLSM: /$vlsm" >&2 && exit 2
|
||||
[ $vlsm -gt 32 ] && fatal_error "Invalid VLSM: /$vlsm"
|
||||
|
||||
address=$address/$vlsm
|
||||
|
||||
@@ -2978,12 +3144,10 @@ get_config() {
|
||||
if [ -r $config ]; then
|
||||
. $config
|
||||
else
|
||||
echo "Cannot read $config! (Hint: Are you root?)" >&2
|
||||
exit 1
|
||||
fatal_error "Cannot read $config! (Hint: Are you root?)"
|
||||
fi
|
||||
else
|
||||
echo "$config does not exist!" >&2
|
||||
exit 2
|
||||
fatal_error "$config does not exist!"
|
||||
fi
|
||||
|
||||
ensure_config_path
|
||||
@@ -2999,8 +3163,7 @@ get_config() {
|
||||
elif [ -r $LOGFILE ]; then
|
||||
g_logread="tac $LOGFILE"
|
||||
else
|
||||
echo "LOGFILE ($LOGFILE) does not exist!" >&2
|
||||
exit 2
|
||||
fatal_error "LOGFILE ($LOGFILE) does not exist!"
|
||||
fi
|
||||
#
|
||||
# See if we have a real version of "tail" -- use separate redirection so
|
||||
@@ -3017,14 +3180,12 @@ get_config() {
|
||||
if [ $g_family -eq 4 ]; then
|
||||
if [ -n "$IPTABLES" ]; then
|
||||
if [ ! -x "$IPTABLES" ]; then
|
||||
echo " ERROR: The program specified in IPTABLES does not exist or is not executable" >&2
|
||||
exit 2
|
||||
fatal_error "The program specified in IPTABLES does not exist or is not executable"
|
||||
fi
|
||||
else
|
||||
IPTABLES=$(mywhich iptables 2> /dev/null)
|
||||
if [ -z "$IPTABLES" ] ; then
|
||||
echo " ERROR: Can't find iptables executable" >&2
|
||||
exit 2
|
||||
fatal_error "Can't find iptables executable"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -3032,14 +3193,12 @@ get_config() {
|
||||
else
|
||||
if [ -n "$IP6TABLES" ]; then
|
||||
if [ ! -x "$IP6TABLES" ]; then
|
||||
echo " ERROR: The program specified in IP6TABLES does not exist or is not executable" >&2
|
||||
exit 2
|
||||
fatal_error "The program specified in IP6TABLES does not exist or is not executable"
|
||||
fi
|
||||
else
|
||||
IP6TABLES=$(mywhich ip6tables 2> /dev/null)
|
||||
if [ -z "$IP6TABLES" ] ; then
|
||||
echo " ERROR: Can't find ip6tables executable" >&2
|
||||
exit 2
|
||||
fatal_error "Can't find ip6tables executable"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -3071,23 +3230,20 @@ get_config() {
|
||||
|
||||
IP=$(mywhich ip 2> /dev/null)
|
||||
if [ -z "$IP" ] ; then
|
||||
echo " ERROR: Can't find ip executable" >&2
|
||||
exit 2
|
||||
fatal_error "Can't find ip executable"
|
||||
fi
|
||||
|
||||
if [ -n "$IPSET" ]; then
|
||||
case "$IPSET" in
|
||||
*/*)
|
||||
if [ ! -x "$IPSET" ] ; then
|
||||
echo " ERROR: The program specified in IPSET ($IPSET) does not exist or is not executable" >&2
|
||||
exit 2
|
||||
fatal_error "The program specified in IPSET ($IPSET) does not exist or is not executable"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
prog="$(mywhich $IPSET 2> /dev/null)"
|
||||
if [ -z "$prog" ] ; then
|
||||
echo " ERROR: Can't find $IPSET executable" >&2
|
||||
exit 2
|
||||
fatal_error "Can't find $IPSET executable"
|
||||
fi
|
||||
IPSET=$prog
|
||||
;;
|
||||
@@ -3280,7 +3436,7 @@ usage() # $1 = exit status
|
||||
echo " delete <interface>[:<host-list>] ... <zone>"
|
||||
echo " disable <interface>"
|
||||
echo " drop <address> ..."
|
||||
echo " dump [ -x ]"
|
||||
echo " dump [ -x ] [ -l ] [ -m ]"
|
||||
echo " enable <interface>"
|
||||
echo " forget [ <file name> ]"
|
||||
echo " help"
|
||||
@@ -3299,27 +3455,29 @@ usage() # $1 = exit status
|
||||
echo " restart [ -n ] [ -p ] [ -f ] [ <directory> ]"
|
||||
echo " restore [ -n ] [ <file name> ]"
|
||||
echo " save [ <file name> ]"
|
||||
echo " show [ -b ] [ -x ] [ -t {filter|mangle|nat} ] [ {chain [<chain> [ <chain> ... ]"
|
||||
echo " show [ -f ] capabilities"
|
||||
echo " show arptables"
|
||||
echo " show classifiers"
|
||||
echo " show config"
|
||||
echo " show connections"
|
||||
echo " show filters"
|
||||
echo " show ip"
|
||||
echo " [ show | list | ls ] [ -b ] [ -x ] [ -t {filter|mangle|nat} ] [ {chain [<chain> [ <chain> ... ]"
|
||||
echo " [ show | list | ls ] [ -f ] capabilities"
|
||||
echo " [ show | list | ls ] arptables"
|
||||
echo " [ show | list | ls ] classifiers"
|
||||
echo " [ show | list | ls ] config"
|
||||
echo " [ show | list | ls ] connections"
|
||||
echo " [ show | list | ls ] event [ <event> ...]"
|
||||
echo " [ show | list | ls ] events"
|
||||
echo " [ show | list | ls ] filters"
|
||||
echo " [ show | list | ls ] ip"
|
||||
|
||||
if [ $g_family -eq 4 ]; then
|
||||
echo " show ipa"
|
||||
echo " [ show | list | ls ] ipa"
|
||||
fi
|
||||
|
||||
echo " show [ -m ] log [<regex>]"
|
||||
echo " show [ -x ] mangle|nat|raw|rawpost"
|
||||
echo " show nfacct"
|
||||
echo " show policies"
|
||||
echo " show routing"
|
||||
echo " show tc [ device ]"
|
||||
echo " show vardir"
|
||||
echo " show zones"
|
||||
echo " [ show | list | ls ] [ -m ] log [<regex>]"
|
||||
echo " [ show | list | ls ] [ -x ] mangle|nat|raw|rawpost"
|
||||
echo " [ show | list | ls ] nfacct"
|
||||
echo " [ show | list | ls ] policies"
|
||||
echo " [ show | list | ls ] routing"
|
||||
echo " [ show | list | ls ] tc [ device ]"
|
||||
echo " [ show | list | ls ] vardir"
|
||||
echo " [ show | list | ls ] zones"
|
||||
echo " start [ -f ] [ -p ] [ <directory> ]"
|
||||
echo " stop"
|
||||
echo " status"
|
||||
@@ -3365,6 +3523,13 @@ shorewall_cli() {
|
||||
g_recovering=
|
||||
g_timestamp=
|
||||
g_shorewalldir=
|
||||
g_haveconfig=
|
||||
g_conditional=
|
||||
g_file=
|
||||
g_doing="Compiling"
|
||||
g_directives=
|
||||
g_inline=
|
||||
g_tcrules=
|
||||
|
||||
VERBOSE=
|
||||
VERBOSITY=1
|
||||
@@ -3390,9 +3555,9 @@ shorewall_cli() {
|
||||
|
||||
if [ ! -d $2 ]; then
|
||||
if [ -e $2 ]; then
|
||||
echo "$2 is not a directory" >&2 && exit 2
|
||||
fatal_error "$2 is not a directory"
|
||||
else
|
||||
echo "Directory $2 does not exist" >&2 && exit 2
|
||||
fatal_error "Directory $2 does not exist"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -3417,8 +3582,16 @@ shorewall_cli() {
|
||||
g_fast=Yes
|
||||
option=${option#f}
|
||||
;;
|
||||
v*)
|
||||
option=${option#v}
|
||||
[vV]*)
|
||||
case $option in
|
||||
v*)
|
||||
option=${option#v}
|
||||
;;
|
||||
*)
|
||||
option=${option#V}
|
||||
;;
|
||||
esac
|
||||
|
||||
case $option in
|
||||
-1*)
|
||||
g_use_verbosity=-1
|
||||
@@ -3549,10 +3722,10 @@ shorewall_cli() {
|
||||
if product_is_started; then
|
||||
run_it ${VARDIR}/firewall $g_debugging $@
|
||||
else
|
||||
fatal_error "Shorewall is not running"
|
||||
fatal_error "$g_product is not running"
|
||||
fi
|
||||
;;
|
||||
show|list)
|
||||
show|list|ls)
|
||||
get_config Yes No Yes
|
||||
shift
|
||||
show_command $@
|
||||
|
@@ -1,15 +1,16 @@
|
||||
#
|
||||
# Shorewall 4.5 -- /usr/share/shorewall/lib.common.
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2010-2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2010-2014 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -17,8 +18,7 @@
|
||||
# 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.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# The purpose of this library is to hold those functions used by both the CLI and by the
|
||||
# generated firewall scripts. To avoid versioning issues, it is copied into generated
|
||||
@@ -65,6 +65,7 @@ startup_error() # $* = Error Message
|
||||
esac
|
||||
fi
|
||||
|
||||
mutex_off
|
||||
kill $$
|
||||
exit 2
|
||||
}
|
||||
@@ -272,8 +273,11 @@ shorewall6_is_started() {
|
||||
# Echos the fully-qualified name of the calling shell program
|
||||
#
|
||||
my_pathname() {
|
||||
local pwd
|
||||
pwd=$PWD
|
||||
cd $(dirname $0)
|
||||
echo $PWD/$(basename $0)
|
||||
cd $pwd
|
||||
}
|
||||
|
||||
#
|
||||
@@ -601,7 +605,7 @@ find_first_interface_address() # $1 = interface
|
||||
#
|
||||
# get the line of output containing the first IP address
|
||||
#
|
||||
addr=$(${IP:-ip} -f inet6 addr show dev $1 2> /dev/null | fgrep 'inet6 ' | fgrep -v 'scope link' | head -n1)
|
||||
addr=$(${IP:-ip} -f inet6 addr show dev $1 2> /dev/null | grep -F 'inet6 ' | grep -vF 'scope link' | head -n1)
|
||||
#
|
||||
# If there wasn't one, bail out now
|
||||
#
|
||||
@@ -630,7 +634,7 @@ find_first_interface_address_if_any() # $1 = interface
|
||||
#
|
||||
# get the line of output containing the first IP address
|
||||
#
|
||||
addr=$(${IP:-ip} -f inet6 addr show dev $1 2> /dev/null | fgrep 'inet6 ' | fgrep -v 'scope link' | head -n1)
|
||||
addr=$(${IP:-ip} -f inet6 addr show dev $1 2> /dev/null | grep -F 'inet6 ' | grep -vF 'scope link' | 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
|
||||
@@ -676,7 +680,11 @@ find_file()
|
||||
fi
|
||||
done
|
||||
|
||||
echo ${g_confdir}/$1
|
||||
if [ -n "$g_shorewalldir" ]; then
|
||||
echo ${g_shorewalldir}/$1
|
||||
else
|
||||
echo ${g_confdir}/$1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@ INITFILE= #Unused on OS X
|
||||
INITSOURCE= #Unused on OS X
|
||||
ANNOTATED= #Unused on OS X
|
||||
SYSTEMD= #Unused on OS X
|
||||
SERVICEFILE= #Unused on OS X
|
||||
SYSCONFDIR= #Unused on OS X
|
||||
SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR.
|
||||
VARLIB=/var/lib #Unused on OS X
|
||||
|
@@ -16,6 +16,7 @@ INITSOURCE= #Name of the distributed file to be insta
|
||||
ANNOTATED= #If non-zero, annotated configuration files are installed
|
||||
SYSCONFDIR= #Directory where SysV init parameter files are installed
|
||||
SYSTEMD=/usr/lib/systemd/system #Directory where .service files are installed (systems running systemd only)
|
||||
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
|
||||
SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
|
||||
VARLIB=/var/lib #Directory where product variable data is stored.
|
||||
VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data is stored.
|
||||
|
@@ -15,6 +15,7 @@ INITFILE= #Unused on Cygwin
|
||||
INITSOURCE= #Unused on Cygwin
|
||||
ANNOTATED= #Unused on Cygwin
|
||||
SYSTEMD= #Unused on Cygwin
|
||||
SERVICEFILE= #Unused on Cygwin
|
||||
SYSCONFDIR= #Unused on Cygwin
|
||||
SPARSE=Yes #Only install $PRODUCT/$PRODUCT.conf in $CONFDIR.
|
||||
VARLIB=/var/lib #Unused on Cygwin
|
||||
|
@@ -15,6 +15,7 @@ INITFILE=$PRODUCT #Name of the product's installed SysV in
|
||||
INITSOURCE=init.debian.sh #Name of the distributed file to be installed as the SysV init script
|
||||
ANNOTATED= #If non-zero, annotated configuration files are installed
|
||||
SYSCONFFILE=default.debian #Name of the distributed file to be installed in $SYSCONFDIR
|
||||
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
|
||||
SYSCONFDIR=/etc/default #Directory where SysV init parameter files are installed
|
||||
SYSTEMD= #Directory where .service files are installed (systems running systemd only)
|
||||
SPARSE=Yes #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
|
||||
|
@@ -15,6 +15,7 @@ INITFILE=$PRODUCT #Name of the product's installed SysV in
|
||||
INITSOURCE=init.sh #Name of the distributed file to be installed as the SysV init script
|
||||
ANNOTATED= #If non-zero, annotated configuration files are installed
|
||||
SYSTEMD= #Directory where .service files are installed (systems running systemd only)
|
||||
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
|
||||
SYSCONFFILE= #Name of the distributed file to be installed in $SYSCONFDIR
|
||||
SYSCONFDIR= #Directory where SysV init parameter files are installed
|
||||
SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
|
||||
|
@@ -16,6 +16,7 @@ INITSOURCE=init.fedora.sh #Name of the distributed file to be inst
|
||||
ANNOTATED= #If non-zero, annotated configuration files are installed
|
||||
SYSTEMD=/lib/systemd/system #Directory where .service files are installed (systems running systemd only)
|
||||
SYSCONFFILE=sysconfig #Name of the distributed file to be installed as $SYSCONFDIR/$PRODUCT
|
||||
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
|
||||
SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init parameter files are installed
|
||||
SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
|
||||
VARLIB=/var/lib #Directory where product variable data is stored.
|
||||
|
@@ -16,6 +16,7 @@ AUXINITFILE=rc.firewall #Name of the product's installed SysV
|
||||
INITSOURCE=init.slackware.$PRODUCT.sh #Name of the distributed file to be installed as a second SysV init script
|
||||
INITFILE=rc.$PRODUCT #Name of the product's installed second init script
|
||||
SYSTEMD= #Name of the directory where .service files are installed (systems running systemd only)
|
||||
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
|
||||
SYSCONFFILE= #Name of the distributed file to be installed in $SYSCONFDIR
|
||||
SYSCONFDIR= #Name of the directory where SysV init parameter files are installed.
|
||||
ANNOTATED= #If non-empty, install annotated configuration files
|
||||
|
@@ -15,7 +15,8 @@ INITFILE=$PRODUCT #Name of the product's Sys
|
||||
INITSOURCE=init.suse.sh #Name of the distributed file to be installed as the SysV init script
|
||||
ANNOTATED= #If non-zero, annotated configuration files are installed
|
||||
SYSTEMD= #Directory where .service files are installed (systems running systemd only)
|
||||
SYSCONFFILE= #Name of the distributed file to be installed in $SYSCONFDIR
|
||||
SERVICEFILE= #Name of the file to install in $SYSTEMD. Default is $PRODUCT.service
|
||||
SYSCONFFILE=sysconfig #Name of the distributed file to be installed in $SYSCONFDIR
|
||||
SYSCONFDIR=/etc/sysconfig/ #Directory where SysV init parameter files are installed
|
||||
SPARSE= #If non-empty, only install $PRODUCT/$PRODUCT.conf in $CONFDIR
|
||||
VARLIB=/var/lib #Directory where persistent product data is stored.
|
||||
|
@@ -2,24 +2,24 @@
|
||||
#
|
||||
# Script to back uninstall Shoreline Firewall
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2000-2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2000-2014 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Shorewall documentation is available at http://www.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 part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# 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 the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# 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.
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
|
@@ -2,17 +2,18 @@
|
||||
#
|
||||
# Shorewall interface helper utility - V4.2
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2007 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2007,2014 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# This file is installed in /usr/share/shorewall/wait4ifup
|
||||
#
|
||||
# Shorewall documentation is available at http://www.shorewall.net
|
||||
#
|
||||
# This program is part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -20,8 +21,7 @@
|
||||
# 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.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# If an error occurs while starting or restarting the firewall, the
|
||||
# firewall is automatically stopped.
|
||||
|
135
Shorewall-init/ifupdown.debian.sh
Normal file
135
Shorewall-init/ifupdown.debian.sh
Normal file
@@ -0,0 +1,135 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Debian ifupdown script for Shorewall-based products
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2010,2013 - 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.
|
||||
#
|
||||
|
||||
setstatedir() {
|
||||
local statedir
|
||||
if [ -f ${CONFDIR}/${PRODUCT}/vardir ]; then
|
||||
statedir=$( . /${CONFDIR}/${PRODUCT}/vardir && echo $VARDIR )
|
||||
fi
|
||||
|
||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
||||
|
||||
if [ ! -x $STATEDIR/firewall ]; then
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT compile
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
Debian_ppp() {
|
||||
NEWPRODUCTS=
|
||||
INTERFACE="$1"
|
||||
|
||||
case $0 in
|
||||
/etc/ppp/ip-*)
|
||||
#
|
||||
# IPv4
|
||||
#
|
||||
for product in $PRODUCTS; do
|
||||
case $product in
|
||||
shorewall|shorewall-lite)
|
||||
NEWPRODUCTS="$NEWPRODUCTS $product";
|
||||
;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
/etc/ppp/ipv6-*)
|
||||
#
|
||||
# IPv6
|
||||
#
|
||||
for product in $PRODUCTS; do
|
||||
case $product in
|
||||
shorewall6|shorewall6-lite)
|
||||
NEWPRODUCTS="$NEWPRODUCTS $product";
|
||||
;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
PRODUCTS="$NEWPRODUCTS"
|
||||
|
||||
case $0 in
|
||||
*up/*)
|
||||
COMMAND=up
|
||||
;;
|
||||
*)
|
||||
COMMAND=down
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
IFUPDOWN=0
|
||||
PRODUCTS=
|
||||
|
||||
#
|
||||
# The installer may alter this
|
||||
#
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
|
||||
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
|
||||
|
||||
case $0 in
|
||||
/etc/ppp*)
|
||||
#
|
||||
# Debian ppp
|
||||
#
|
||||
Debian_ppp
|
||||
;;
|
||||
*)
|
||||
#
|
||||
# Debian ifupdown system
|
||||
#
|
||||
INTERFACE="$IFACE"
|
||||
|
||||
if [ "$MODE" = start ]; then
|
||||
COMMAND=up
|
||||
elif [ "$MODE" = stop ]; then
|
||||
COMMAND=down
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$LOGFILE" ] || LOGFILE=/dev/null
|
||||
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
setstatedir
|
||||
|
||||
if [ -x $VARLIB/$PRODUCT/firewall ]; then
|
||||
( ${VARLIB}/$PRODUCT/firewall -V0 $COMMAND $INTERFACE >> $LOGFILE 2>&1 ) || true
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
111
Shorewall-init/ifupdown.fedora.sh
Normal file
111
Shorewall-init/ifupdown.fedora.sh
Normal file
@@ -0,0 +1,111 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Redhat/Fedora/Centos/Foobar ifupdown script for Shorewall-based products
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2010,2013 - 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.
|
||||
#
|
||||
|
||||
# Get startup options (override default)
|
||||
OPTIONS=
|
||||
|
||||
setstatedir() {
|
||||
local statedir
|
||||
if [ -f ${CONFDIR}/${PRODUCT}/vardir ]; then
|
||||
statedir=$( . /${CONFDIR}/${PRODUCT}/vardir && echo $VARDIR )
|
||||
fi
|
||||
|
||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
||||
|
||||
if [ ! -x "$STATEDIR/firewall" ]; then
|
||||
if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT $OPTIONS compile
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
IFUPDOWN=0
|
||||
PRODUCTS=
|
||||
|
||||
#
|
||||
# The installer may alter this
|
||||
#
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
|
||||
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
|
||||
|
||||
PHASE=''
|
||||
|
||||
case $0 in
|
||||
/etc/ppp*)
|
||||
INTERFACE="$1"
|
||||
|
||||
case $0 in
|
||||
*ip-up.local)
|
||||
COMMAND=up
|
||||
;;
|
||||
*ip-down.local)
|
||||
COMMAND=down
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#
|
||||
# RedHat ifup/down system
|
||||
#
|
||||
INTERFACE="$1"
|
||||
|
||||
case $0 in
|
||||
*ifup*)
|
||||
COMMAND=up
|
||||
;;
|
||||
*ifdown*)
|
||||
COMMAND=down
|
||||
;;
|
||||
*dispatcher.d*)
|
||||
COMMAND="$2"
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$LOGFILE" ] || LOGFILE=/dev/null
|
||||
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
setstatedir
|
||||
|
||||
if [ -x "$STATEDIR/firewall" ]; then
|
||||
echo "`date --rfc-3339=seconds` $0: Executing $STATEDIR/firewall $OPTIONS $COMMAND $INTERFACE" >> $LOGFILE 2>&1
|
||||
( $STATEDIR/firewall $OPTIONS $COMMAND $INTERFACE >> $LOGFILE 2>&1 ) || true
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
@@ -1,10 +1,10 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# ifupdown script for Shorewall-based products
|
||||
# SuSE 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)
|
||||
# (c) 2010,2013 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Shorewall documentation is available at http://shorewall.net
|
||||
#
|
||||
@@ -37,7 +37,7 @@ setstatedir() {
|
||||
fi
|
||||
}
|
||||
|
||||
Debian_SuSE_ppp() {
|
||||
SuSE_ppp() {
|
||||
NEWPRODUCTS=
|
||||
INTERFACE="$1"
|
||||
|
||||
@@ -99,105 +99,39 @@ fi
|
||||
|
||||
[ "$IFUPDOWN" = 1 -a -n "$PRODUCTS" ] || exit 0
|
||||
|
||||
if [ -f /etc/debian_version ]; then
|
||||
case $0 in
|
||||
/etc/ppp*)
|
||||
#
|
||||
# Debian ppp
|
||||
#
|
||||
Debian_SuSE_ppp
|
||||
;;
|
||||
|
||||
*)
|
||||
#
|
||||
# Debian ifupdown system
|
||||
#
|
||||
INTERFACE="$IFACE"
|
||||
PHASE=''
|
||||
|
||||
if [ "$MODE" = start ]; then
|
||||
case $0 in
|
||||
/etc/ppp*)
|
||||
#
|
||||
# SUSE ppp
|
||||
#
|
||||
SuSE_ppp
|
||||
;;
|
||||
|
||||
*)
|
||||
#
|
||||
# SuSE ifupdown system
|
||||
#
|
||||
INTERFACE="$2"
|
||||
|
||||
case $0 in
|
||||
*dispatcher.d*)
|
||||
INTERFACE="$1"
|
||||
COMMAND="$2"
|
||||
;;
|
||||
*if-up.d*)
|
||||
COMMAND=up
|
||||
elif [ "$MODE" = stop ]; then
|
||||
;;
|
||||
*if-down.d*)
|
||||
COMMAND=down
|
||||
else
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
elif [ -f /etc/SuSE-release ]; then
|
||||
PHASE=''
|
||||
|
||||
case $0 in
|
||||
/etc/ppp*)
|
||||
#
|
||||
# SUSE ppp
|
||||
#
|
||||
Debian_SuSE_ppp
|
||||
;;
|
||||
|
||||
*)
|
||||
#
|
||||
# SuSE ifupdown system
|
||||
#
|
||||
INTERFACE="$2"
|
||||
|
||||
case $0 in
|
||||
*if-up.d*)
|
||||
COMMAND=up
|
||||
;;
|
||||
*if-down.d*)
|
||||
COMMAND=down
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
else
|
||||
#
|
||||
# Assume RedHat/Fedora/CentOS/Foobar/...
|
||||
#
|
||||
PHASE=''
|
||||
|
||||
case $0 in
|
||||
/etc/ppp*)
|
||||
INTERFACE="$1"
|
||||
|
||||
case $0 in
|
||||
*ip-up.local)
|
||||
COMMAND=up
|
||||
;;
|
||||
*ip-down.local)
|
||||
COMMAND=down
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
#
|
||||
# RedHat ifup/down system
|
||||
#
|
||||
INTERFACE="$1"
|
||||
|
||||
case $0 in
|
||||
*ifup*)
|
||||
COMMAND=up
|
||||
;;
|
||||
*ifdown*)
|
||||
COMMAND=down
|
||||
;;
|
||||
*dispatcher.d*)
|
||||
COMMAND="$2"
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$LOGFILE" ] || LOGFILE=/dev/null
|
||||
|
@@ -36,6 +36,8 @@
|
||||
# bringing up the network
|
||||
### END INIT INFO
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
export VERBOSITY=0
|
||||
|
||||
if [ "$(id -u)" != "0" ]
|
||||
@@ -50,16 +52,16 @@ echo_notdone () {
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
# set the STATEDIR variable
|
||||
@@ -71,10 +73,8 @@ setstatedir() {
|
||||
|
||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
||||
|
||||
if [ ! -x $STATEDIR/firewall ]; then
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT compile
|
||||
fi
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT ${OPTIONS} compile -c || echo_notdone
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -83,18 +83,16 @@ setstatedir() {
|
||||
#
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
|
||||
vardir=$VARDIR
|
||||
|
||||
# check if shorewall-init is configured or not
|
||||
if [ -f "$SYSCONFDIR/shorewall-init" ]
|
||||
then
|
||||
. $SYSCONFDIR/shorewall-init
|
||||
if [ -z "$PRODUCTS" ]
|
||||
then
|
||||
not_configured
|
||||
fi
|
||||
else
|
||||
. $SYSCONFDIR/shorewall-init
|
||||
if [ -z "$PRODUCTS" ]
|
||||
then
|
||||
not_configured
|
||||
fi
|
||||
else
|
||||
not_configured
|
||||
fi
|
||||
|
||||
# Initialize the firewall
|
||||
@@ -103,24 +101,23 @@ shorewall_start () {
|
||||
local STATEDIR
|
||||
|
||||
echo -n "Initializing \"Shorewall-based firewalls\": "
|
||||
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
setstatedir
|
||||
|
||||
if [ ! -x ${VARDIR}/$PRODUCT/firewall ]; then
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT compile
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -x ${VARDIR}/$PRODUCT/firewall ]; then
|
||||
#
|
||||
if [ -x ${STATEDIR}/$PRODUCT/firewall ]; then
|
||||
#
|
||||
# Run in a sub-shell to avoid name collisions
|
||||
#
|
||||
(
|
||||
if ! ${VARDIR}/$PRODUCT/firewall status > /dev/null 2>&1; then
|
||||
${VARDIR}/$PRODUCT/firewall stop || echo_notdone
|
||||
if ! ${STATEDIR}/$PRODUCT/firewall status > /dev/null 2>&1; then
|
||||
${STATEDIR}/$PRODUCT/firewall ${OPTIONS} stop || echo_notdone
|
||||
else
|
||||
echo_notdone
|
||||
fi
|
||||
)
|
||||
else
|
||||
echo echo_notdone
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -132,20 +129,14 @@ shorewall_start () {
|
||||
# Clear the firewall
|
||||
shorewall_stop () {
|
||||
local PRODUCT
|
||||
local VARDIR
|
||||
local STATEDIR
|
||||
|
||||
echo -n "Clearing \"Shorewall-based firewalls\": "
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
setstatedir
|
||||
|
||||
if [ ! -x ${VARDIR}/$PRODUCT/firewall ]; then
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT compile
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -x ${VARDIR}/$PRODUCT/firewall ]; then
|
||||
${VARDIR}/$PRODUCT/firewall clear || echo_notdone
|
||||
if [ -x ${STATEDIR}/$PRODUCT/firewall ]; then
|
||||
${STATEDIR}/$PRODUCT/firewall ${OPTIONS} clear || echo_notdone
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -164,7 +155,7 @@ case "$1" in
|
||||
reload|force-reload)
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/shorewall-init {start|stop|reload|force-reload}"
|
||||
echo "Usage: $0 {start|stop|reload|force-reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
@@ -24,8 +24,6 @@ lockfile="/var/lock/subsys/shorewall-init"
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
vardir=$VARDIR
|
||||
|
||||
# Get startup options (override default)
|
||||
OPTIONS=
|
||||
|
||||
@@ -46,17 +44,17 @@ setstatedir() {
|
||||
|
||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
||||
|
||||
if [ ! -x $STATEDIR/firewall ]; then
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT compile
|
||||
fi
|
||||
if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT $OPTIONS compile -c
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Initialize the firewall
|
||||
start () {
|
||||
local PRODUCT
|
||||
local vardir
|
||||
local STATEDIR
|
||||
|
||||
if [ -z "$PRODUCTS" ]; then
|
||||
echo "No firewalls configured for shorewall-init"
|
||||
@@ -65,23 +63,26 @@ start () {
|
||||
fi
|
||||
|
||||
echo -n "Initializing \"Shorewall-based firewalls\": "
|
||||
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
setstatedir
|
||||
retval=$?
|
||||
|
||||
if [ ! -x ${VARDIR}/firewall ]; then
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT compile
|
||||
if [ $retval -eq 0 ]; then
|
||||
if [ -x "${STATEDIR}/firewall" ]; then
|
||||
${STATEDIR}/firewall ${OPTIONS} stop 2>&1 | $logger
|
||||
retval=${PIPESTATUS[0]}
|
||||
[ $retval -ne 0 ] && break
|
||||
else
|
||||
retval=6 #Product not configured
|
||||
break
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -x ${VARDIR}/$PRODUCT/firewall ]; then
|
||||
${VARDIR}/$PRODUCT/firewall stop 2>&1 | $logger
|
||||
retval=${PIPESTATUS[0]}
|
||||
[ $retval -ne 0 ] && break
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ retval -eq 0 ]; then
|
||||
if [ $retval -eq 0 ]; then
|
||||
touch $lockfile
|
||||
success
|
||||
else
|
||||
@@ -94,26 +95,29 @@ start () {
|
||||
# Clear the firewall
|
||||
stop () {
|
||||
local PRODUCT
|
||||
local vardir
|
||||
local STATEDIR
|
||||
|
||||
echo -n "Clearing \"Shorewall-based firewalls\": "
|
||||
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
setstatedir
|
||||
retval=$?
|
||||
|
||||
if [ ! -x ${VARDIR}/firewall ]; then
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT compile
|
||||
if [ $retval -eq 0 ]; then
|
||||
if [ -x "${STATEDIR}/firewall" ]; then
|
||||
${STATEDIR}/firewall ${OPTIONS} clear 2>&1 | $logger
|
||||
retval=${PIPESTATUS[0]}
|
||||
[ $retval -ne 0 ] && break
|
||||
else
|
||||
retval=6 #Product not configured
|
||||
break
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -x ${VARDIR}/$PRODUCT/firewall ]; then
|
||||
${VARDIR}/$PRODUCT/firewall clear 2>&1 | $logger
|
||||
retval=${PIPESTATUS[0]}
|
||||
[ $retval -ne 0 ] && break
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ retval -eq 0 ]; then
|
||||
if [ $retval -eq 0 ]; then
|
||||
rm -f $lockfile
|
||||
success
|
||||
else
|
||||
@@ -144,7 +148,7 @@ case "$1" in
|
||||
status $prog
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/shorewall-init {start|stop|status}"
|
||||
echo "Usage: $0 {start|stop|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
@@ -1,22 +1,24 @@
|
||||
#! /bin/bash
|
||||
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.5
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2010,2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2010,2012-2014 - 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 part of Shorewall.
|
||||
#
|
||||
# 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 free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# 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.
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
@@ -69,7 +71,7 @@ setstatedir() {
|
||||
|
||||
if [ ! -x $STATEDIR/firewall ]; then
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT compile $STATEDIR/firewall
|
||||
${SBINDIR}/$PRODUCT ${OPTIONS} compile $STATEDIR/firewall
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -85,7 +87,7 @@ shorewall_start () {
|
||||
|
||||
if [ -x ${STATEDIR}/firewall ]; then
|
||||
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
||||
${STATEDIR}/firewall stop || echo_notdone
|
||||
${STATEDIR}/firewall ${OPTIONS} stop || exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -100,20 +102,14 @@ shorewall_start () {
|
||||
# Clear the firewall
|
||||
shorewall_stop () {
|
||||
local PRODUCT
|
||||
local VARDIR
|
||||
local STATEDIR
|
||||
|
||||
echo -n "Clearing \"Shorewall-based firewalls\": "
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
setstatedir
|
||||
|
||||
if [ ! -x ${VARDIR}/firewall ]; then
|
||||
if [ $PRODUCT = shorewall -o $product = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT compile
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -x ${VARDIR}/firewall ]; then
|
||||
${VARDIR}/firewall clear || exit 1
|
||||
if [ -x ${STATEDIR}/firewall ]; then
|
||||
${STATEDIR}/firewall ${OPTIONS} clear || exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
|
@@ -34,22 +34,35 @@
|
||||
# prior to bringing up the network.
|
||||
### END INIT INFO
|
||||
|
||||
#Return values acc. to LSB for all commands but status:
|
||||
# 0 - success
|
||||
# 1 - generic or unspecified error
|
||||
# 2 - invalid or excess argument(s)
|
||||
# 3 - unimplemented feature (e.g. "reload")
|
||||
# 4 - insufficient privilege
|
||||
# 5 - program is not installed
|
||||
# 6 - program is not configured
|
||||
# 7 - program is not running
|
||||
|
||||
if [ "$(id -u)" != "0" ]
|
||||
then
|
||||
echo "You must be root to start, stop or restart \"Shorewall \"."
|
||||
exit 1
|
||||
exit 4
|
||||
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
|
||||
. /etc/sysconfig/shorewall-init
|
||||
|
||||
if [ -z "$PRODUCTS" ]
|
||||
then
|
||||
echo "No PRODUCTS configured"
|
||||
exit 6
|
||||
fi
|
||||
else
|
||||
exit 0
|
||||
echo "/etc/sysconfig/shorewall-init not found"
|
||||
exit 6
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -66,10 +79,8 @@ setstatedir() {
|
||||
|
||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
||||
|
||||
if [ ! -x $STATEDIR/firewall ]; then
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT compile
|
||||
fi
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT ${OPTIONS} compile -c || exit
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -84,16 +95,16 @@ shorewall_start () {
|
||||
|
||||
if [ -x $STATEDIR/firewall ]; then
|
||||
if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
|
||||
$STATEDIR/$PRODUCT/firewall stop || echo_notdone
|
||||
$STATEDIR/$PRODUCT/firewall ${OPTIONS} stop || exit
|
||||
fi
|
||||
else
|
||||
exit 6
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
|
||||
ipset -R < "$SAVE_IPSETS"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Clear the firewall
|
||||
@@ -106,7 +117,9 @@ shorewall_stop () {
|
||||
setstatedir
|
||||
|
||||
if [ -x ${STATEDIR}/firewall ]; then
|
||||
${STATEDIR}/firewall clear || exit 1
|
||||
${STATEDIR}/firewall ${OPTIONS} clear || exit
|
||||
else
|
||||
exit 6
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -116,20 +129,21 @@ shorewall_stop () {
|
||||
grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f "${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
shorewall_start
|
||||
;;
|
||||
stop)
|
||||
shorewall_stop
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/shorewall-init {start|stop}"
|
||||
exit 1
|
||||
start)
|
||||
shorewall_start
|
||||
;;
|
||||
stop)
|
||||
shorewall_stop
|
||||
;;
|
||||
reload|forced-reload)
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/shorewall-init {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@@ -2,21 +2,25 @@
|
||||
#
|
||||
# Script to install Shoreline Firewall Init
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2000-2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2000-20114 - 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 part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# 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 the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
@@ -59,7 +63,6 @@ mywhich() {
|
||||
|
||||
for dir in $(split $PATH); do
|
||||
if [ -x $dir/$1 ]; then
|
||||
echo $dir/$1
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
@@ -99,6 +102,8 @@ PRODUCT=shorewall-init
|
||||
#
|
||||
# Parse the run line
|
||||
#
|
||||
T='-T'
|
||||
|
||||
finished=0
|
||||
|
||||
while [ $finished -eq 0 ] ; do
|
||||
@@ -182,8 +187,29 @@ if [ -z "$BUILD" ]; then
|
||||
BUILD=apple
|
||||
;;
|
||||
*)
|
||||
if [ -f /etc/debian_version ]; then
|
||||
if [ -f /etc/os-release ]; then
|
||||
eval $(cat /etc/os-release | grep ^ID=)
|
||||
|
||||
case $ID in
|
||||
fedora)
|
||||
BUILD=redhat
|
||||
;;
|
||||
debian|ubuntu)
|
||||
BUILD=debian
|
||||
;;
|
||||
opensuse)
|
||||
BUILD=suse
|
||||
;;
|
||||
*)
|
||||
BUILD="$ID"
|
||||
;;
|
||||
esac
|
||||
elif [ -f /etc/debian_version ]; then
|
||||
BUILD=debian
|
||||
elif [ -f /etc/ubuntu_version ]; then
|
||||
BUILD=debian
|
||||
elif [ -f /etc/gentoo-release ]; then
|
||||
BUILD=gentoo
|
||||
elif [ -f /etc/redhat-release ]; then
|
||||
BUILD=redhat
|
||||
elif [ -f /etc/SuSE-release ]; then
|
||||
@@ -206,7 +232,7 @@ case $BUILD in
|
||||
apple)
|
||||
T=
|
||||
;;
|
||||
debian|redhat|suse|slackware|archlinux)
|
||||
debian|gentoo|redhat|suse|slackware|archlinux)
|
||||
;;
|
||||
*)
|
||||
[ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment ($BUILD)" >&2 || echo "ERROR: Unknown BUILD environment"
|
||||
@@ -222,7 +248,10 @@ case "$HOST" in
|
||||
debian)
|
||||
echo "Installing Debian-specific configuration..."
|
||||
;;
|
||||
redhat|redhat)
|
||||
gentoo)
|
||||
echo "Installing Gentoo-specific configuration..."
|
||||
;;
|
||||
redhat)
|
||||
echo "Installing Redhat/Fedora-specific configuration..."
|
||||
;;
|
||||
slackware)
|
||||
@@ -233,11 +262,12 @@ case "$HOST" in
|
||||
echo "Shorewall-init is currently not supported on Arch Linux" >&2
|
||||
exit 1
|
||||
;;
|
||||
suse|suse)
|
||||
suse)
|
||||
echo "Installing SuSE-specific configuration..."
|
||||
;;
|
||||
linux)
|
||||
echo "ERROR: Shorewall-init is not supported on this system" >&2
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Unsupported HOST distribution: \"$HOST\"" >&2
|
||||
@@ -283,7 +313,7 @@ if [ -n "$INITFILE" ]; then
|
||||
install_file $INITSOURCE ${DESTDIR}${INITDIR}/$AUXINITFILE 0544
|
||||
fi
|
||||
|
||||
echo "Shorewall-init script installed in ${DESTDIR}${INITDIR}/$INITFILE"
|
||||
echo "SysV init script $INITSOURCE installed in ${DESTDIR}${INITDIR}/$INITFILE"
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -291,14 +321,16 @@ fi
|
||||
#
|
||||
if [ -n "$SYSTEMD" ]; then
|
||||
mkdir -p ${DESTDIR}${SYSTEMD}
|
||||
run_install $OWNERSHIP -m 600 shorewall-init.service ${DESTDIR}${SYSTEMD}/shorewall-init.service
|
||||
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMD}/shorewall-init.service
|
||||
echo "Service file installed as ${DESTDIR}${SYSTEMD}/shorewall-init.service"
|
||||
[ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service
|
||||
run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMD}/$PRODUCT.service
|
||||
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMD}/$PRODUCT.service
|
||||
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMD}/$PRODUCT.service"
|
||||
if [ -n "$DESTDIR" ]; then
|
||||
mkdir -p ${DESTDIR}${SBINDIR}
|
||||
chmod 755 ${DESTDIR}${SBINDIR}
|
||||
fi
|
||||
run_install $OWNERSHIP -m 700 shorewall-init ${DESTDIR}${SBINDIR}/shorewall-init
|
||||
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SBINDIR}/shorewall-init
|
||||
echo "CLI installed as ${DESTDIR}${SBINDIR}/shorewall-init"
|
||||
fi
|
||||
|
||||
@@ -343,6 +375,8 @@ if [ $HOST = debian ]; then
|
||||
|
||||
install_file sysconfig ${DESTDIR}/etc/default/shorewall-init 0644
|
||||
fi
|
||||
|
||||
IFUPDOWN=ifupdown.debian.sh
|
||||
else
|
||||
if [ -n "$DESTDIR" ]; then
|
||||
mkdir -p ${DESTDIR}${SYSCONFDIR}
|
||||
@@ -351,22 +385,28 @@ else
|
||||
if [ $HOST = suse ]; then
|
||||
mkdir -p ${DESTDIR}/etc/sysconfig/network/if-up.d
|
||||
mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d
|
||||
elif [ $HOST = gentoo ]; then
|
||||
# Gentoo does not support if-{up,down}.d
|
||||
/bin/true
|
||||
else
|
||||
mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d ${DESTDIR}${SYSCONFDIR} -a ! -f ${DESTDIR}${SYSCONFDIR}/shorewall-init ]; then
|
||||
install_file sysconfig ${DESTDIR}${SYSCONFDIR}/shorewall-init 0644
|
||||
fi
|
||||
if [ -n "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then
|
||||
run_install $OWNERSHIP -m 0644 ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/$PRODUCT
|
||||
echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
|
||||
fi
|
||||
|
||||
[ $HOST = suse ] && IFUPDOWN=ifupdown.suse.sh || IFUPDOWN=ifupdown.fedora.sh
|
||||
fi
|
||||
|
||||
#
|
||||
# Install the ifupdown script
|
||||
#
|
||||
|
||||
cp ifupdown.sh ifupdown
|
||||
cp $IFUPDOWN ifupdown
|
||||
|
||||
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ifupdown
|
||||
|
||||
@@ -391,11 +431,23 @@ case $HOST in
|
||||
fi
|
||||
;;
|
||||
redhat)
|
||||
if [ -f ${DESTDIR}${SBINDIR}/ifup-local -o -f ${DESTDIR}${SBINDIR}/ifdown-local ]; then
|
||||
echo "WARNING: ${SBINDIR}/ifup-local and/or ${SBINDIR}/ifdown-local already exist; up/down events will not be handled"
|
||||
elif [ -z "$DESTDIR" ]; then
|
||||
install_file ifupdown ${DESTDIR}${SBINDIR}/ifup-local 0544
|
||||
install_file ifupdown ${DESTDIR}${SBINDIR}/ifdown-local 0544
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
install_local=
|
||||
|
||||
if [ -f ${SBINDIR}/ifup-local -o -f ${SBINDIR}/ifdown-local ]; then
|
||||
if ! grep -qF Shorewall-based ${SBINDIR}/ifup-local || ! grep -qF Shorewall-based ${SBINDIR}/ifdown-local; then
|
||||
echo "WARNING: ${SBINDIR}/ifup-local and/or ${SBINDIR}/ifdown-local already exist; up/down events will not be handled"
|
||||
else
|
||||
install_local=Yes
|
||||
fi
|
||||
else
|
||||
install_local=Yes
|
||||
fi
|
||||
|
||||
if [ -n "$install_local" ]; then
|
||||
install_file ifupdown ${DESTDIR}${SBINDIR}/ifup-local 0544
|
||||
install_file ifupdown ${DESTDIR}${SBINDIR}/ifdown-local 0544
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -403,10 +455,26 @@ esac
|
||||
if [ -z "$DESTDIR" ]; then
|
||||
if [ -n "$first_install" ]; then
|
||||
if [ $HOST = debian ]; then
|
||||
|
||||
update-rc.d shorewall-init enable
|
||||
|
||||
echo "Shorewall Init will start automatically at boot"
|
||||
if mywhich insserv; then
|
||||
if insserv ${INITDIR}/shorewall-init; then
|
||||
echo "Shorewall Init will start automatically at boot"
|
||||
else
|
||||
cant_autostart
|
||||
fi
|
||||
elif mywhich update-rc.d ; then
|
||||
if update-rc.d $PRODUCT enable; then
|
||||
echo "$PRODUCT will start automatically at boot"
|
||||
echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable"
|
||||
else
|
||||
cant_autostart
|
||||
fi
|
||||
else
|
||||
cant_autostart
|
||||
fi
|
||||
elif [ $HOST = gentoo ]; then
|
||||
# On Gentoo, a service must be enabled manually by the user,
|
||||
# not by the installer
|
||||
/bin/true
|
||||
else
|
||||
if [ -n "$SYSTEMD" ]; then
|
||||
if systemctl enable shorewall-init.service; then
|
||||
@@ -466,7 +534,7 @@ if [ -f ${DESTDIR}/etc/ppp ]; then
|
||||
for file in ip-up.local ip-down.local; do
|
||||
FILE=${DESTDIR}/etc/ppp/$file
|
||||
if [ -f $FILE ]; then
|
||||
if fgrep -q Shorewall-based $FILE ; then
|
||||
if grep -qF Shorewall-based $FILE ; then
|
||||
cp -fp ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown $FILE
|
||||
else
|
||||
echo "$FILE already exists -- ppp devices will not be handled"
|
||||
|
@@ -1,28 +1,42 @@
|
||||
#! /bin/bash
|
||||
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.5
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2012-2014 - 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 part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# 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 the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# 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.
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#########################################################################################
|
||||
# set the STATEDIR variable
|
||||
setstatedir() {
|
||||
local statedir
|
||||
if [ -f ${CONFDIR}/${PRODUCT}/vardir ]; then
|
||||
statedir=$( . /${CONFDIR}/${PRODUCT}/vardir && echo $VARDIR )
|
||||
fi
|
||||
|
||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
||||
|
||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||
${SBINDIR}/$PRODUCT ${OPTIONS} compile -c || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# This is modified by the installer when ${SHAREDIR} <> /usr/share
|
||||
#
|
||||
@@ -36,21 +50,32 @@ if [ -f "$SYSCONFDIR/shorewall-init" ]; then
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "ERROR: /etc/sysconfig/shorewall-init not found" >&2
|
||||
echo "ERROR: ${SYSCONFDIR}/shorewall-init not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Initialize the firewall
|
||||
shorewall_start () {
|
||||
local PRODUCT
|
||||
local VARDIR
|
||||
local STATEDIR
|
||||
|
||||
echo -n "Initializing \"Shorewall-based firewalls\": "
|
||||
for PRODUCT in $PRODUCTS; do
|
||||
if [ -x ${VARDIR}/firewall ]; then
|
||||
if ! /sbin/$PRODUCT status > /dev/null 2>&1; then
|
||||
${VARDIR}/firewall stop || exit 1
|
||||
fi
|
||||
setstatedir
|
||||
|
||||
if [ -x ${STATEDIR}/$PRODUCT/firewall ]; then
|
||||
#
|
||||
# Run in a sub-shell to avoid name collisions
|
||||
#
|
||||
(
|
||||
if ! ${STATEDIR}/$PRODUCT/firewall status > /dev/null 2>&1; then
|
||||
${STATEDIR}/$PRODUCT/firewall ${OPTIONS} stop || exit 1
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
)
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -64,14 +89,14 @@ shorewall_start () {
|
||||
# Clear the firewall
|
||||
shorewall_stop () {
|
||||
local PRODUCT
|
||||
local VARDIR
|
||||
local STATEDIR
|
||||
|
||||
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
|
||||
setstatedir
|
||||
|
||||
if [ -x ${STATEDIR}/$PRODUCT/firewall ]; then
|
||||
${STATEDIR}/$PRODUCT/firewall ${OPTIONS} clear || exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
|
@@ -13,8 +13,8 @@ Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/sysconfig/shorewall-init
|
||||
StandardOutput=syslog
|
||||
ExecStart=/shorewall-init $OPTIONS start
|
||||
ExecStop=/shorewall-init $OPTIONS stop
|
||||
ExecStart=/sbin/shorewall-init $OPTIONS start
|
||||
ExecStop=/sbin/shorewall-init $OPTIONS stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@@ -21,3 +21,6 @@ SAVE_IPSETS=""
|
||||
#
|
||||
LOGFILE=/var/log/shorewall-ifupdown.log
|
||||
|
||||
# Startup options - set verbosity to 0 (minimal reporting)
|
||||
OPTIONS="-V0"
|
||||
|
||||
|
@@ -2,24 +2,24 @@
|
||||
#
|
||||
# Script to back uninstall Shoreline Firewall
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2000-2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2000-2014 - 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 part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# 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 the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# 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.
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
@@ -140,6 +140,7 @@ remove_file ${CONFDIR}/NetworkManager/dispatcher.d/01-shorewall
|
||||
|
||||
remove_file ${CONFDIR}/network/if-up.d/shorewall
|
||||
remove_file ${CONFDIR}/network/if-down.d/shorewall
|
||||
remove_file ${CONFDIR}/network/if-post-down.d/shorewall
|
||||
|
||||
remove_file ${CONFDIR}/sysconfig/network/if-up.d/shorewall
|
||||
remove_file ${CONFDIR}/sysconfig/network/if-down.d/shorewall
|
||||
@@ -152,7 +153,7 @@ if [ -d ${CONFDIR}/ppp ]; then
|
||||
done
|
||||
|
||||
for file in if-up.local if-down.local; do
|
||||
if fgrep -q Shorewall-based ${CONFDIR}/ppp/$FILE; then
|
||||
if grep -qF Shorewall-based ${CONFDIR}/ppp/$FILE; then
|
||||
remove_file ${CONFDIR}/ppp/$FILE
|
||||
fi
|
||||
done
|
||||
|
@@ -11,7 +11,7 @@
|
||||
# /etc/shorewall-lite
|
||||
### END INIT INFO
|
||||
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
SRWL=/sbin/shorewall-lite
|
||||
SRWL_OPTS="-tvv"
|
||||
|
@@ -3,17 +3,18 @@ RCDLINKS="2,S41 3,S41 6,K41"
|
||||
#
|
||||
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V4.5
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2012 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2012,2014 - 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 part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -21,8 +22,7 @@ RCDLINKS="2,S41 3,S41 6,K41"
|
||||
# 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.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# If an error occurs while starting or restarting the firewall, the
|
||||
# firewall is automatically stopped.
|
||||
|
@@ -2,24 +2,24 @@
|
||||
#
|
||||
# Script to install Shoreline Firewall Lite
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2000-2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2000-2011,2014 - 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 part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# 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 the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# 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.
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
VERSION=xxx #The Build script inserts the actual version
|
||||
@@ -182,6 +182,8 @@ for var in SHAREDIR LIBEXECDIRDIRDIR CONFDIR SBINDIR VARLIB VARDIR; do
|
||||
require $var
|
||||
done
|
||||
|
||||
[ -n "${INITFILE}" ] && require INITSOURCE && require INITDIR
|
||||
|
||||
PATH=${SBINDIR}:/bin:/usr${SBINDIR}:/usr/bin:/usr/local/bin:/usr/local${SBINDIR}
|
||||
|
||||
#
|
||||
@@ -200,8 +202,30 @@ if [ -z "$BUILD" ]; then
|
||||
BUILD=apple
|
||||
;;
|
||||
*)
|
||||
if [ -f ${CONFDIR}/debian_version ]; then
|
||||
if [ -f /etc/os-release ]; then
|
||||
eval $(cat /etc/os-release | grep ^ID)
|
||||
|
||||
case $ID in
|
||||
fedora)
|
||||
BUILD=redhat
|
||||
;;
|
||||
debian)
|
||||
BUILD=debian
|
||||
;;
|
||||
gentoo)
|
||||
BUILD=gentoo
|
||||
;;
|
||||
opensuse)
|
||||
BUILD=suse
|
||||
;;
|
||||
*)
|
||||
BUILD="$ID"
|
||||
;;
|
||||
esac
|
||||
elif [ -f ${CONFDIR}/debian_version ]; then
|
||||
BUILD=debian
|
||||
elif [ -f /etc/gentoo-release ]; then
|
||||
BUILD=gentoo
|
||||
elif [ -f ${CONFDIR}/redhat-release ]; then
|
||||
BUILD=redhat
|
||||
elif [ -f ${CONFDIR}/SuSE-release ]; then
|
||||
@@ -250,6 +274,9 @@ case "$HOST" in
|
||||
debian)
|
||||
echo "Installing Debian-specific configuration..."
|
||||
;;
|
||||
gentoo)
|
||||
echo "Installing Gentoo-specific configuration..."
|
||||
;;
|
||||
redhat)
|
||||
echo "Installing Redhat/Fedora-specific configuration..."
|
||||
;;
|
||||
@@ -281,7 +308,7 @@ if [ -n "$DESTDIR" ]; then
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}/${SBINDIR}
|
||||
install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
|
||||
else
|
||||
if [ ! -f /usr/share/shorewall/coreversion ]; then
|
||||
if [ ! -f ${SHAREDIR}/shorewall/coreversion ]; then
|
||||
echo "$PRODUCT $VERSION requires Shorewall Core which does not appear to be installed" >&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -293,7 +320,7 @@ echo "Installing $Product Version $VERSION"
|
||||
# Check for ${CONFDIR}/$PRODUCT
|
||||
#
|
||||
if [ -z "$DESTDIR" -a -d ${CONFDIR}/$PRODUCT ]; then
|
||||
if [ ! -f /usr/share/shorewall/coreversion ]; then
|
||||
if [ ! -f ${SHAREDIR}/shorewall/coreversion ]; then
|
||||
echo "$PRODUCT $VERSION requires Shorewall Core which does not appear to be installed" >&2
|
||||
exit 1
|
||||
fi
|
||||
@@ -341,24 +368,25 @@ if [ -n "$DESTDIR" ]; then
|
||||
fi
|
||||
|
||||
if [ -n "$INITFILE" ]; then
|
||||
if [ -f "${INITSOURCE}" ]; then
|
||||
initfile="${DESTDIR}/${INITDIR}/${INITFILE}"
|
||||
install_file ${INITSOURCE} "$initfile" 0544
|
||||
|
||||
initfile="${DESTDIR}/${INITDIR}/${INITFILE}"
|
||||
install_file ${INITSOURCE} "$initfile" 0544
|
||||
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' "$initfile"
|
||||
|
||||
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' "$initfile"
|
||||
|
||||
echo "$Product init script installed in $initfile"
|
||||
echo "SysV init script $INITSOURCE installed in $initfile"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
# Install the .service file
|
||||
#
|
||||
if [ -n "$SYSTEMD" ]; then
|
||||
mkdir -p ${DESTDIR}${SYSTEMD}
|
||||
run_install $OWNERSHIP -m 600 $PRODUCT.service ${DESTDIR}/${SYSTEMD}/$PRODUCT.service
|
||||
[ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service
|
||||
run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMD}/$PRODUCT.service
|
||||
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMD}/$PRODUCT.service
|
||||
echo "Service file installed as ${DESTDIR}/lib/systemd/system/$PRODUCT.service"
|
||||
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMD}/$PRODUCT.service"
|
||||
fi
|
||||
|
||||
#
|
||||
# Install the config file
|
||||
#
|
||||
@@ -369,6 +397,9 @@ fi
|
||||
|
||||
if [ $HOST = archlinux ] ; then
|
||||
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
||||
elif [ $HOST = gentoo ]; then
|
||||
# Adjust SUBSYSLOCK path (see https://bugs.gentoo.org/show_bug.cgi?id=459316)
|
||||
perl -p -w -i -e "s|^SUBSYSLOCK=.*|SUBSYSLOCK=/run/lock/$PRODUCT|;" ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -477,13 +508,16 @@ delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/lib.common
|
||||
delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/lib.cli
|
||||
delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/wait4ifup
|
||||
|
||||
if [ -n "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then
|
||||
#
|
||||
# Note -- not all packages will have the SYSCONFFILE so we need to check for its existance here
|
||||
#
|
||||
if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then
|
||||
if [ ${DESTDIR} ]; then
|
||||
mkdir -p ${DESTDIR}${SYSCONFDIR}
|
||||
chmod 755 ${DESTDIR}${SYSCONFDIR}
|
||||
fi
|
||||
|
||||
run_install $OWNERSHIP -m 0644 default.debian ${DESTDIR}${SYSCONFDIR}/${PRODUCT}
|
||||
run_install $OWNERSHIP -m 0644 ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/${PRODUCT}
|
||||
echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
|
||||
fi
|
||||
|
||||
@@ -493,20 +527,20 @@ if [ ${SHAREDIR} != /usr/share ]; then
|
||||
fi
|
||||
|
||||
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then
|
||||
if mywhich update-rc.d ; then
|
||||
echo "$PRODUCT will start automatically at boot"
|
||||
echo "Set startup=1 in ${SYSCONFDIR}/$PRODUCT to enable"
|
||||
touch /var/log/$PRODUCT-init.log
|
||||
perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf
|
||||
update-rc.d $PRODUCT enable defaults
|
||||
elif [ -n "$SYSTEMD" ]; then
|
||||
if [ -n "$SYSTEMD" ]; then
|
||||
if systemctl enable ${PRODUCT}.service; then
|
||||
echo "$Product will start automatically at boot"
|
||||
fi
|
||||
elif mywhich insserv; then
|
||||
if insserv ${INITDIR}/${INITFILE} ; then
|
||||
echo "$PRODUCT will start automatically at boot"
|
||||
echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/${PRODUCT}.conf to enable"
|
||||
if [ $HOST = debian ]; then
|
||||
echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable"
|
||||
touch /var/log/$PRODUCT-init.log
|
||||
perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
||||
else
|
||||
echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable"
|
||||
fi
|
||||
else
|
||||
cant_autostart
|
||||
fi
|
||||
@@ -518,10 +552,22 @@ if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then
|
||||
else
|
||||
cant_autostart
|
||||
fi
|
||||
elif mywhich update-rc.d ; then
|
||||
echo "$PRODUCT will start automatically at boot"
|
||||
echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable"
|
||||
touch /var/log/$PRODUCT-init.log
|
||||
perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
||||
update-rc.d $PRODUCT enable
|
||||
elif mywhich rc-update ; then
|
||||
if rc-update add $PRODUCT default; then
|
||||
echo "$PRODUCT will start automatically at boot"
|
||||
echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable"
|
||||
if [ $HOST = debian ]; then
|
||||
echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable"
|
||||
touch /var/log/$PRODUCT-init.log
|
||||
perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
||||
else
|
||||
echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable"
|
||||
fi
|
||||
else
|
||||
cant_autostart
|
||||
fi
|
||||
|
@@ -1,15 +1,16 @@
|
||||
#
|
||||
# Shorewall 4.4 -- /usr/share/shorewall-lite/lib.base
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2011,2014 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Complete documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redisribute 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 part of Shorewall.
|
||||
#
|
||||
# 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 the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -17,8 +18,7 @@
|
||||
# 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.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This library contains the code common to all Shorewall components.
|
||||
|
||||
|
@@ -6,6 +6,8 @@
|
||||
<refentrytitle>shorewall-lite-vardir</refentrytitle>
|
||||
|
||||
<manvolnum>5</manvolnum>
|
||||
|
||||
<refmiscinfo>Configuration Files</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
@@ -54,7 +56,7 @@
|
||||
/opt/var/lib/shorewall-lite/.</para>
|
||||
</blockquote>
|
||||
|
||||
<para> When VARDIR is set in /etc/shorewall-lite/vardir, Shorewall Lite
|
||||
<para>When VARDIR is set in /etc/shorewall-lite/vardir, Shorewall Lite
|
||||
will save its state in the <replaceable>directory</replaceable>
|
||||
specified.</para>
|
||||
</note>
|
||||
|
@@ -6,6 +6,8 @@
|
||||
<refentrytitle>shorewall-lite.conf</refentrytitle>
|
||||
|
||||
<manvolnum>5</manvolnum>
|
||||
|
||||
<refmiscinfo>Configuration Files</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
@@ -141,7 +143,7 @@
|
||||
stops. Creating and removing this file allows Shorewall to work with
|
||||
your distribution's initscripts. For RedHat, this should be set to
|
||||
/var/lock/subsys/shorewall. For Debian, the value is
|
||||
/var/state/shorewall and in LEAF it is /var/run/shorwall.</para>
|
||||
/var/state/shorewall and in LEAF it is /var/run/shorewall.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@@ -6,6 +6,8 @@
|
||||
<refentrytitle>shorewall-lite</refentrytitle>
|
||||
|
||||
<manvolnum>8</manvolnum>
|
||||
|
||||
<refmiscinfo>Administrative Commands</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
@@ -335,7 +337,7 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>show</option></arg>
|
||||
<arg choice="opt"><option>show | list | ls </option></arg>
|
||||
|
||||
<arg><option>-b</option></arg>
|
||||
|
||||
@@ -357,7 +359,7 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>show</option></arg>
|
||||
<arg choice="opt"><option>show | list | ls </option></arg>
|
||||
|
||||
<arg><option>-f</option></arg>
|
||||
|
||||
@@ -371,10 +373,10 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>show</option></arg>
|
||||
<arg choice="opt"><option>show | list | ls </option></arg>
|
||||
|
||||
<arg
|
||||
choice="req"><option>classifiers|connections|config|filters|ip|ipa|zones|policies|marks</option></arg>
|
||||
choice="req"><option>classifiers|connections|config|events|filters|ip|ipa|zones|policies|marks</option></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
@@ -384,7 +386,20 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>show</option></arg>
|
||||
<arg choice="opt"><option>show | list | ls </option></arg>
|
||||
|
||||
<arg choice="plain"><option>event</option><arg
|
||||
choice="plain"><replaceable>event</replaceable></arg></arg>
|
||||
</cmdsynopsis>
|
||||
|
||||
<cmdsynopsis>
|
||||
<command>shorewall-lite</command>
|
||||
|
||||
<arg choice="opt"><option>trace</option>|<option>debug</option></arg>
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="opt"><option>show | list | ls </option></arg>
|
||||
|
||||
<arg><option>-x</option></arg>
|
||||
|
||||
@@ -398,7 +413,7 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>show</option></arg>
|
||||
<arg choice="opt"><option>show | list | ls </option></arg>
|
||||
|
||||
<arg choice="plain"><option>tc</option></arg>
|
||||
</cmdsynopsis>
|
||||
@@ -410,7 +425,7 @@
|
||||
|
||||
<arg>-<replaceable>options</replaceable></arg>
|
||||
|
||||
<arg choice="plain"><option>show</option></arg>
|
||||
<arg choice="opt"><option>show | list | ls </option></arg>
|
||||
|
||||
<arg><option>-m</option></arg>
|
||||
|
||||
@@ -492,9 +507,9 @@
|
||||
url="shorewall.conf.html">shorewall.conf</ulink>(5). Each <emphasis
|
||||
role="bold">v</emphasis> adds one to the effective verbosity and each
|
||||
<emphasis role="bold">q</emphasis> subtracts one from the effective
|
||||
VERBOSITY. Anternately, <emphasis role="bold">v</emphasis> may be followed
|
||||
VERBOSITY. Alternately, <emphasis role="bold">v</emphasis> may be followed
|
||||
immediately with one of -1,0,1,2 to specify a specify VERBOSITY. There may
|
||||
be no white space between <emphasis role="bold">v</emphasis> and the
|
||||
be no white-space between <emphasis role="bold">v</emphasis> and the
|
||||
VERBOSITY.</para>
|
||||
|
||||
<para>The <emphasis>options</emphasis> may also include the letter
|
||||
@@ -632,7 +647,7 @@
|
||||
<term><emphasis role="bold">forget</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Deletes /var/lib/shorewall-lite/<emphasis>filenam</emphasis>e
|
||||
<para>Deletes /var/lib/shorewall-lite/<emphasis>filename</emphasis>
|
||||
and /var/lib/shorewall-lite/save. If no
|
||||
<emphasis>filename</emphasis> is given then the file specified by
|
||||
RESTOREFILE in <ulink
|
||||
@@ -690,7 +705,7 @@
|
||||
and raw table PREROUTING chains.</para>
|
||||
|
||||
<para>The trace records are written to the kernel's log buffer with
|
||||
faciility = kernel and priority = warning, and they are routed from
|
||||
facility = kernel and priority = warning, and they are routed from
|
||||
there by your logging daemon (syslogd, rsyslog, syslog-ng, ...) --
|
||||
Shorewall-lite has no control over where the messages go; consult
|
||||
your logging daemon's documentation.</para>
|
||||
@@ -747,7 +762,7 @@
|
||||
|
||||
<para>The <replaceable>iptables match expression</replaceable> must
|
||||
be one given in the <command>iptrace</command> command being
|
||||
cancelled.</para>
|
||||
canceled.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -875,7 +890,7 @@
|
||||
<term><emphasis role="bold">config</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Dispays distribution-specific defaults.</para>
|
||||
<para>Displays distribution-specific defaults.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -888,6 +903,24 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">event</emphasis><replaceable>
|
||||
event</replaceable></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.5.19. Displays the named
|
||||
event.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">events</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.5.19. Displays all events.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold">ip</emphasis></term>
|
||||
|
||||
@@ -1055,6 +1088,23 @@
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>EXIT STATUS</title>
|
||||
|
||||
<para>In general, when a command succeeds, status 0 is returned; when the
|
||||
command fails, a non-zero status is returned.</para>
|
||||
|
||||
<para>The <command>status</command> command returns exit status as
|
||||
follows:</para>
|
||||
|
||||
<para>0 - Firewall is started.</para>
|
||||
|
||||
<para>3 - Firewall is stopped or cleared</para>
|
||||
|
||||
<para>4 - Unknown state; usually means that the firewall has never been
|
||||
started.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>FILES</title>
|
||||
|
||||
|
@@ -2,17 +2,18 @@
|
||||
#
|
||||
# Shorewall Lite Packet Filtering Firewall Capabilities Detector
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2006,2007,2008,2009,2010 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2006,2007,2008,2009,2010,2014 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# This file should be placed in /sbin/shorewall.
|
||||
#
|
||||
# Shorewall documentation is available at http://shorewall.sourceforge.net
|
||||
#
|
||||
# This program is part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -20,9 +21,7 @@
|
||||
# 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.
|
||||
#
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# This program may be used to create a /etc/shorewall/capabilities file for
|
||||
# use in compiling Shorewall firewalls on another system.
|
||||
|
@@ -2,16 +2,17 @@
|
||||
#
|
||||
# Shorewall Lite Packet Filtering Firewall Control Program - V4.5
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 -
|
||||
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2014 -
|
||||
# Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Shorewall documentation is available at http://www.shorewall.net
|
||||
#
|
||||
# This program is part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# it under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -19,8 +20,7 @@
|
||||
# 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.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# For a list of supported commands, type 'shorewall help' or 'shorewall6 help'
|
||||
#
|
||||
|
@@ -2,24 +2,24 @@
|
||||
#
|
||||
# Script to back uninstall Shoreline Firewall
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2000-2011 - Tom Eastep (teastep@shorewall.net)
|
||||
# (c) 2000-2011,2014 - 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 part of Shorewall.
|
||||
#
|
||||
# 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.
|
||||
# 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 the
|
||||
# Free Software Foundation, either version 2 of the license or, at your
|
||||
# option, any later version.
|
||||
#
|
||||
# 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.
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
@@ -118,14 +118,14 @@ fi
|
||||
|
||||
if [ -L ${SHAREDIR}/shorewall-lite/init ]; then
|
||||
FIREWALL=$(readlink -m -q ${SHAREDIR}/shorewall-lite/init)
|
||||
elIF [ -n "$INITFILE" ]; then
|
||||
elif [ -n "$INITFILE" ]; then
|
||||
FIREWALL=${INITDIR}/${INITFILE}
|
||||
fi
|
||||
|
||||
if [ -f "$FIREWALL" ]; then
|
||||
if mywhich updaterc.d ; then
|
||||
updaterc.d shorewall-lite remove
|
||||
elif if mywhich insserv ; then
|
||||
elif mywhich insserv ; then
|
||||
insserv -r $FIREWALL
|
||||
elif [ mywhich chkconfig ; then
|
||||
chkconfig --del $(basename $FIREWALL)
|
||||
|
@@ -1,13 +1,15 @@
|
||||
#
|
||||
# Shorewall version 4 - Audited AllowICMPs Macro
|
||||
#
|
||||
# /usr/share/shorewall/macro.AAllowICMPs
|
||||
# /usr/share/shorewall/macro.A_AllowICMPs
|
||||
#
|
||||
# This macro A_ACCEPTs needed ICMP types
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
|
||||
?COMMENT Needed ICMP types
|
||||
|
||||
|
@@ -1,13 +1,15 @@
|
||||
#
|
||||
# Shorewall version 4 - Audited DropDNSrep Macro
|
||||
#
|
||||
# /usr/share/shorewall/macro.ADropDNSrep
|
||||
# /usr/share/shorewall/macro.A_DropDNSrep
|
||||
#
|
||||
# This macro silently audites and drops DNS UDP replies
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
|
||||
?COMMENT Late DNS Replies
|
||||
|
||||
|
@@ -1,13 +1,15 @@
|
||||
#
|
||||
# Shorewall version 4 - ADropUPnP Macro
|
||||
#
|
||||
# /usr/share/shorewall/macro.ADropUPnP
|
||||
# /usr/share/shorewall/macro.A_DropUPnP
|
||||
#
|
||||
# This macro silently drops UPnP probes on UDP port 1900
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
|
||||
?COMMENT UPnP
|
||||
|
||||
|
@@ -6,8 +6,10 @@
|
||||
# This macro ACCEPTs needed ICMP types
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
|
||||
?COMMENT Needed ICMP types
|
||||
|
||||
|
@@ -9,8 +9,9 @@
|
||||
#
|
||||
###############################################################################
|
||||
?FORMAT 2
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
|
||||
?if ( __CT_TARGET && ! $AUTOHELPERS && __AMANDA_HELPER )
|
||||
PARAM - - udp 10080 ; helper=amanda
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles Auth (identd) traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 113
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles BGP4 traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 179 # BGP4
|
||||
|
@@ -6,8 +6,10 @@
|
||||
# This macro handles blacklisting using BLACKLIST_DISPOSITION and BLACKLIST_LOGLEVEL
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
?if $BLACKLIST_LOGLEVEL
|
||||
blacklog
|
||||
?else
|
||||
|
@@ -7,9 +7,12 @@
|
||||
#
|
||||
# If you are running BitTorrent 3.2 or later, you should use the
|
||||
# BitTorrent32 macro.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 6881:6889
|
||||
#
|
||||
# It may also be necessary to allow UDP traffic:
|
||||
|
@@ -6,8 +6,10 @@
|
||||
# This macro handles BitTorrent traffic for BitTorrent 3.2 and later.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 6881:6999
|
||||
#
|
||||
# It may also be necessary to allow UDP traffic:
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles connections to the CVS pserver.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 2401
|
||||
|
@@ -6,9 +6,11 @@
|
||||
# This macro handles Citrix/ICA traffic (ICA, ICA Browser, CGP a.k.a.
|
||||
# ICA Session Reliability)
|
||||
#
|
||||
####################################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
###############################################################################
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 1494 # ICA
|
||||
PARAM - - udp 1604 # ICA Browser
|
||||
PARAM - - tcp 2598 # CGP Session Reliabilty
|
||||
|
@@ -7,7 +7,9 @@
|
||||
# The protocol is used by iTunes, Rythmbox and other similar daemons.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 3689
|
||||
PARAM - - udp 3689
|
||||
|
@@ -7,6 +7,8 @@
|
||||
# DCC is a distributed spam filtering mechanism.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 6277
|
||||
|
@@ -6,7 +6,9 @@
|
||||
# This macro (bidirectional) handles forwarded DHCP traffic
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 67:68 67:68 # DHCP
|
||||
PARAM DEST SOURCE udp 67:68 67:68 # DHCP
|
||||
|
@@ -6,7 +6,9 @@
|
||||
# This macro handles DNS traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 53
|
||||
PARAM - - tcp 53
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles connections to the Distributed Compiler service.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 3632
|
||||
|
@@ -11,12 +11,14 @@
|
||||
# Drop net all
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
#
|
||||
# Don't log 'auth' REJECT
|
||||
# Don't log 'auth' DROP
|
||||
#
|
||||
REJECT - - tcp 113
|
||||
DROP - - tcp 113
|
||||
#
|
||||
# Drop Broadcasts so they don't clutter up the log
|
||||
# (broadcasts must *not* be rejected).
|
||||
|
@@ -6,8 +6,10 @@
|
||||
# This macro silently drops DNS UDP replies
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
|
||||
?COMMENT Late DNS Replies
|
||||
|
||||
|
@@ -6,8 +6,10 @@
|
||||
# This macro silently drops UPnP probes on UDP port 1900
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
|
||||
?COMMENT UPnP
|
||||
|
||||
|
@@ -28,7 +28,9 @@
|
||||
# applications such as aMule WebServer or aMuleCMD.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 4662
|
||||
PARAM - - udp 4665
|
||||
|
@@ -7,8 +7,9 @@
|
||||
#
|
||||
###############################################################################
|
||||
?FORMAT 2
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
?if ( __CT_TARGET && ! $AUTOHELPERS && __FTP_HELPER )
|
||||
PARAM - - tcp 21 ; helper=ftp
|
||||
?else
|
||||
|
@@ -7,6 +7,8 @@
|
||||
# your finger information to internet.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 79
|
||||
|
@@ -6,8 +6,10 @@
|
||||
# This macro handles GNUnet (secure peer-to-peer networking) traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 2086
|
||||
PARAM - - udp 2086
|
||||
PARAM - - tcp 1080
|
||||
|
@@ -7,7 +7,9 @@
|
||||
# traffic (RFC 1701)
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - 47 # GRE
|
||||
PARAM DEST SOURCE 47 # GRE
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles Git traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 9418
|
||||
|
@@ -6,7 +6,9 @@
|
||||
# This macro handles Gnutella traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 6346
|
||||
PARAM - - udp 6346
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles OpenPGP HTTP keyserver protocol traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 11371
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles plaintext HTTP (WWW) traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 80
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles HTTPS (WWW over SSL) traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 443
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles Internet Cache Protocol V2 (Squid) traffic
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 3130
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles ICQ, now called AOL Instant Messenger (or AIM).
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 5190
|
||||
|
@@ -7,6 +7,8 @@
|
||||
# see macro.IMAPS.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 143
|
||||
|
@@ -7,6 +7,8 @@
|
||||
# (not recommended), see macro.IMAP.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 993
|
||||
|
@@ -6,7 +6,9 @@
|
||||
# This macro (bidirectional) handles IPIP capsulation traffic
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - 94 # IPIP
|
||||
PARAM DEST SOURCE 94 # IPIP
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles Internet Printing Protocol (IPP).
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 631
|
||||
|
@@ -6,7 +6,10 @@
|
||||
# This macro handles Internet Printing Protocol (IPP) broadcasts.
|
||||
# If you also need to handle TCP 631 connections in the opposite
|
||||
# direction, use the IPPserver Macro
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 631
|
||||
|
@@ -23,7 +23,9 @@
|
||||
# IPPserver/ACCEPT $FW loc
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM SOURCE DEST tcp 631
|
||||
PARAM DEST SOURCE udp 631
|
||||
|
@@ -6,8 +6,10 @@
|
||||
# This macro (bidirectional) handles IPsec traffic
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 500 500 # IKE
|
||||
PARAM - - 50 # ESP
|
||||
PARAM DEST SOURCE udp 500 500 # IKE
|
||||
|
@@ -7,8 +7,10 @@
|
||||
# This is insecure. You should use ESP with encryption for security.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 500 500 # IKE
|
||||
PARAM - - 51 # AH
|
||||
PARAM DEST SOURCE udp 500 500 # IKE
|
||||
|
@@ -6,8 +6,10 @@
|
||||
# This macro (bidirectional) handles IPsec traffic and Nat-Traversal
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 500 # IKE
|
||||
PARAM - - udp 4500 # NAT-T
|
||||
PARAM - - 50 # ESP
|
||||
|
@@ -7,8 +7,9 @@
|
||||
#
|
||||
###############################################################################
|
||||
?FORMAT 2
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
|
||||
?if ( __CT_TARGET && ! $AUTOHELPERS && __IRC_HELPER )
|
||||
PARAM - - tcp 6667 ; helper=irc
|
||||
|
@@ -8,8 +8,10 @@
|
||||
# to browse anonymously!
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 8080 # HTTP port
|
||||
PARAM - - tcp 6544 # HTTP port
|
||||
PARAM - - tcp 6543 # InfoService port
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro accepts Jabber traffic (plaintext).
|
||||
#
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 5222
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro accepts Jabber traffic (ssl).
|
||||
#
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 5223
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro accepts Jabberd intercommunication traffic
|
||||
#
|
||||
###############################################################################
|
||||
#TARGET SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 5269
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles HP Jetdirect printing.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 9100
|
||||
|
14
Shorewall/Macros/macro.Kerberos
Normal file
14
Shorewall/Macros/macro.Kerberos
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# Shorewall version 4 - Kerberos Macro
|
||||
#
|
||||
# /usr/share/shorewall/macro.Kerberos
|
||||
#
|
||||
# This macro handles Kerberos traffic.
|
||||
#
|
||||
###############################################################################
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 88
|
||||
PARAM - - udp 88
|
@@ -7,7 +7,9 @@
|
||||
# (RFC 2661)
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 1701 # L2TP
|
||||
PARAM DEST SOURCE udp 1701 # L2TP
|
||||
|
@@ -11,6 +11,8 @@
|
||||
# Consult your LDAP server documentation for details.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 389
|
||||
|
@@ -11,6 +11,8 @@
|
||||
# Consult your LDAP server documentation for details.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 636
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles MSNP (MicroSoft Notification Protocol)
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 1863
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles MSSQL (Microsoft SQL Server)
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 1433
|
||||
|
@@ -12,8 +12,10 @@
|
||||
# the POP3 or IMAP macros.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 25
|
||||
PARAM - - tcp 465
|
||||
PARAM - - tcp 587
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles Munin networked resource monitoring traffic
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 4949
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles connections to the MySQL server.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 3306
|
||||
|
@@ -7,6 +7,8 @@
|
||||
# encrypted NNTP, see macro.NNTPS.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 119
|
||||
|
@@ -7,6 +7,8 @@
|
||||
# plaintext NNTP, see macro.NNTP.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - tcp 563
|
||||
|
@@ -7,6 +7,8 @@
|
||||
# For broadcast NTP traffic, use NTPbrd Macro.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 123
|
||||
|
@@ -6,7 +6,9 @@
|
||||
# This macro handles bi-directional NTP (for NTP peers)
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 123
|
||||
PARAM DEST SOURCE udp 123
|
||||
|
@@ -11,7 +11,9 @@
|
||||
# Netfilter doesn't track connections for broadcast traffic.
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - udp 123
|
||||
PARAM - - udp 1024: 123
|
||||
|
@@ -6,6 +6,8 @@
|
||||
# This macro handles OSPF multicast traffic
|
||||
#
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
|
||||
# PORT(S) PORT(S) LIMIT GROUP
|
||||
?FORMAT 2
|
||||
###############################################################################
|
||||
#ACTION SOURCE DEST PROTO DEST SOURCE ORIGIN RATE USER/
|
||||
# PORT(S) PORT(S) DEST LIMIT GROUP
|
||||
PARAM - - 89 # OSPF
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user