Skip to content

Commit 33b8e77

Browse files
kaberdavem330
authored andcommitted
[NETFILTER]: Add CONFIG_NETFILTER_ADVANCED option
The NETFILTER_ADVANCED option hides lots of the rather obscure netfilter options when disabled and provides defaults (M) that should allow to run a distribution firewall without further thinking. Defaults to 'y' to avoid breaking current configurations. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3449882 commit 33b8e77

File tree

6 files changed

+124
-11
lines changed

6 files changed

+124
-11
lines changed

net/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,21 @@ config NETFILTER_DEBUG
144144
You can say Y here if you want to get additional messages useful in
145145
debugging the netfilter code.
146146

147+
config NETFILTER_ADVANCED
148+
bool "Advanced netfilter configuration"
149+
depends on NETFILTER
150+
default y
151+
help
152+
If you say Y here you can select between all the netfilter modules.
153+
If you say N the more ununsual ones will not be shown and the
154+
basic ones needed by most people will default to 'M'.
155+
156+
If unsure, say Y.
157+
147158
config BRIDGE_NETFILTER
148159
bool "Bridged IP/ARP packets filtering"
149160
depends on BRIDGE && NETFILTER && INET
161+
depends on NETFILTER_ADVANCED
150162
default y
151163
---help---
152164
Enabling this option will let arptables resp. iptables see bridged

net/bridge/netfilter/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
menu "Bridge: Netfilter Configuration"
6-
depends on BRIDGE && NETFILTER
6+
depends on BRIDGE && BRIDGE_NETFILTER
77

88
config BRIDGE_NF_EBTABLES
99
tristate "Ethernet Bridge tables (ebtables) support"

net/decnet/netfilter/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
menu "DECnet: Netfilter Configuration"
66
depends on DECNET && NETFILTER && EXPERIMENTAL
7+
depends on NETFILTER_ADVANCED
78

89
config DECNET_NF_GRABULATOR
910
tristate "Routing message grabulator (for userland routing daemon)"

net/ipv4/netfilter/Kconfig

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ menu "IP: Netfilter Configuration"
88
config NF_CONNTRACK_IPV4
99
tristate "IPv4 connection tracking support (required for NAT)"
1010
depends on NF_CONNTRACK
11+
default m if NETFILTER_ADVANCED=n
1112
---help---
1213
Connection tracking keeps a record of what packets have passed
1314
through your machine, in order to figure out how they are related
@@ -32,6 +33,7 @@ config NF_CONNTRACK_PROC_COMPAT
3233

3334
config IP_NF_QUEUE
3435
tristate "IP Userspace queueing via NETLINK (OBSOLETE)"
36+
depends on NETFILTER_ADVANCED
3537
help
3638
Netfilter has the ability to queue packets to user space: the
3739
netlink device can be used to access them using this driver.
@@ -44,6 +46,7 @@ config IP_NF_QUEUE
4446

4547
config IP_NF_IPTABLES
4648
tristate "IP tables support (required for filtering/masq/NAT)"
49+
default m if NETFILTER_ADVANCED=n
4750
select NETFILTER_XTABLES
4851
help
4952
iptables is a general, extensible packet identification framework.
@@ -57,6 +60,7 @@ config IP_NF_IPTABLES
5760
config IP_NF_MATCH_IPRANGE
5861
tristate '"iprange" match support'
5962
depends on IP_NF_IPTABLES
63+
depends on NETFILTER_ADVANCED
6064
help
6165
This option makes possible to match IP addresses against IP address
6266
ranges.
@@ -66,6 +70,7 @@ config IP_NF_MATCH_IPRANGE
6670
config IP_NF_MATCH_RECENT
6771
tristate '"recent" match support'
6872
depends on IP_NF_IPTABLES
73+
depends on NETFILTER_ADVANCED
6974
help
7075
This match is used for creating one or many lists of recently
7176
used addresses and then matching against that/those list(s).
@@ -78,6 +83,7 @@ config IP_NF_MATCH_RECENT
7883
config IP_NF_MATCH_ECN
7984
tristate '"ecn" match support'
8085
depends on IP_NF_IPTABLES
86+
depends on NETFILTER_ADVANCED
8187
help
8288
This option adds a `ECN' match, which allows you to match against
8389
the IPv4 and TCP header ECN fields.
@@ -87,6 +93,7 @@ config IP_NF_MATCH_ECN
8793
config IP_NF_MATCH_AH
8894
tristate '"ah" match support'
8995
depends on IP_NF_IPTABLES
96+
depends on NETFILTER_ADVANCED
9097
help
9198
This match extension allows you to match a range of SPIs
9299
inside AH header of IPSec packets.
@@ -96,6 +103,7 @@ config IP_NF_MATCH_AH
96103
config IP_NF_MATCH_TTL
97104
tristate '"ttl" match support'
98105
depends on IP_NF_IPTABLES
106+
depends on NETFILTER_ADVANCED
99107
help
100108
This adds CONFIG_IP_NF_MATCH_TTL option, which enabled the user
101109
to match packets by their TTL value.
@@ -105,17 +113,19 @@ config IP_NF_MATCH_TTL
105113
config IP_NF_MATCH_ADDRTYPE
106114
tristate '"addrtype" address type match support'
107115
depends on IP_NF_IPTABLES
116+
depends on NETFILTER_ADVANCED
108117
help
109118
This option allows you to match what routing thinks of an address,
110119
eg. UNICAST, LOCAL, BROADCAST, ...
111-
120+
112121
If you want to compile it as a module, say M here and read
113122
<file:Documentation/kbuild/modules.txt>. If unsure, say `N'.
114123

115124
# `filter', generic and specific targets
116125
config IP_NF_FILTER
117126
tristate "Packet filtering"
118127
depends on IP_NF_IPTABLES
128+
default m if NETFILTER_ADVANCED=n
119129
help
120130
Packet filtering defines a table `filter', which has a series of
121131
rules for simple packet filtering at local input, forwarding and
@@ -126,6 +136,7 @@ config IP_NF_FILTER
126136
config IP_NF_TARGET_REJECT
127137
tristate "REJECT target support"
128138
depends on IP_NF_FILTER
139+
default m if NETFILTER_ADVANCED=n
129140
help
130141
The REJECT target allows a filtering rule to specify that an ICMP
131142
error should be issued in response to an incoming packet, rather
@@ -136,6 +147,7 @@ config IP_NF_TARGET_REJECT
136147
config IP_NF_TARGET_LOG
137148
tristate "LOG target support"
138149
depends on IP_NF_IPTABLES
150+
default m if NETFILTER_ADVANCED=n
139151
help
140152
This option adds a `LOG' target, which allows you to create rules in
141153
any iptables table which records the packet header to the syslog.
@@ -145,6 +157,7 @@ config IP_NF_TARGET_LOG
145157
config IP_NF_TARGET_ULOG
146158
tristate "ULOG target support"
147159
depends on IP_NF_IPTABLES
160+
default m if NETFILTER_ADVANCED=n
148161
---help---
149162

150163
This option enables the old IPv4-only "ipt_ULOG" implementation
@@ -165,6 +178,7 @@ config IP_NF_TARGET_ULOG
165178
config NF_NAT
166179
tristate "Full NAT"
167180
depends on IP_NF_IPTABLES && NF_CONNTRACK_IPV4
181+
default m if NETFILTER_ADVANCED=n
168182
help
169183
The Full NAT option allows masquerading, port forwarding and other
170184
forms of full Network Address Port Translation. It is controlled by
@@ -180,6 +194,7 @@ config NF_NAT_NEEDED
180194
config IP_NF_TARGET_MASQUERADE
181195
tristate "MASQUERADE target support"
182196
depends on NF_NAT
197+
default m if NETFILTER_ADVANCED=n
183198
help
184199
Masquerading is a special case of NAT: all outgoing connections are
185200
changed to seem to come from a particular interface's address, and
@@ -192,6 +207,7 @@ config IP_NF_TARGET_MASQUERADE
192207
config IP_NF_TARGET_REDIRECT
193208
tristate "REDIRECT target support"
194209
depends on NF_NAT
210+
depends on NETFILTER_ADVANCED
195211
help
196212
REDIRECT is a special case of NAT: all incoming connections are
197213
mapped onto the incoming interface's address, causing the packets to
@@ -203,6 +219,7 @@ config IP_NF_TARGET_REDIRECT
203219
config IP_NF_TARGET_NETMAP
204220
tristate "NETMAP target support"
205221
depends on NF_NAT
222+
depends on NETFILTER_ADVANCED
206223
help
207224
NETMAP is an implementation of static 1:1 NAT mapping of network
208225
addresses. It maps the network address part, while keeping the host
@@ -214,6 +231,7 @@ config IP_NF_TARGET_NETMAP
214231
config NF_NAT_SNMP_BASIC
215232
tristate "Basic SNMP-ALG support (EXPERIMENTAL)"
216233
depends on EXPERIMENTAL && NF_NAT
234+
depends on NETFILTER_ADVANCED
217235
---help---
218236

219237
This module implements an Application Layer Gateway (ALG) for
@@ -277,6 +295,7 @@ config NF_NAT_SIP
277295
config IP_NF_MANGLE
278296
tristate "Packet mangling"
279297
depends on IP_NF_IPTABLES
298+
default m if NETFILTER_ADVANCED=n
280299
help
281300
This option adds a `mangle' table to iptables: see the man page for
282301
iptables(8). This table is used for various packet alterations
@@ -287,6 +306,7 @@ config IP_NF_MANGLE
287306
config IP_NF_TARGET_ECN
288307
tristate "ECN target support"
289308
depends on IP_NF_MANGLE
309+
depends on NETFILTER_ADVANCED
290310
---help---
291311
This option adds a `ECN' target, which can be used in the iptables mangle
292312
table.
@@ -301,6 +321,7 @@ config IP_NF_TARGET_ECN
301321
config IP_NF_TARGET_TTL
302322
tristate 'TTL target support'
303323
depends on IP_NF_MANGLE
324+
depends on NETFILTER_ADVANCED
304325
help
305326
This option adds a `TTL' target, which enables the user to modify
306327
the TTL value of the IP header.
@@ -316,6 +337,7 @@ config IP_NF_TARGET_CLUSTERIP
316337
tristate "CLUSTERIP target support (EXPERIMENTAL)"
317338
depends on IP_NF_MANGLE && EXPERIMENTAL
318339
depends on NF_CONNTRACK_IPV4
340+
depends on NETFILTER_ADVANCED
319341
select NF_CONNTRACK_MARK
320342
help
321343
The CLUSTERIP target allows you to build load-balancing clusters of
@@ -328,6 +350,7 @@ config IP_NF_TARGET_CLUSTERIP
328350
config IP_NF_RAW
329351
tristate 'raw table support (required for NOTRACK/TRACE)'
330352
depends on IP_NF_IPTABLES
353+
depends on NETFILTER_ADVANCED
331354
help
332355
This option adds a `raw' table to iptables. This table is the very
333356
first in the netfilter framework and hooks in at the PREROUTING
@@ -340,6 +363,7 @@ config IP_NF_RAW
340363
config IP_NF_ARPTABLES
341364
tristate "ARP tables support"
342365
select NETFILTER_XTABLES
366+
depends on NETFILTER_ADVANCED
343367
help
344368
arptables is a general, extensible packet identification framework.
345369
The ARP packet filtering and mangling (manipulation)subsystems

net/ipv6/netfilter/Kconfig

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ menu "IPv6: Netfilter Configuration (EXPERIMENTAL)"
88
config NF_CONNTRACK_IPV6
99
tristate "IPv6 connection tracking support (EXPERIMENTAL)"
1010
depends on INET && IPV6 && EXPERIMENTAL && NF_CONNTRACK
11+
default m if NETFILTER_ADVANCED=n
1112
---help---
1213
Connection tracking keeps a record of what packets have passed
1314
through your machine, in order to figure out how they are related
@@ -22,6 +23,7 @@ config NF_CONNTRACK_IPV6
2223
config IP6_NF_QUEUE
2324
tristate "IP6 Userspace queueing via NETLINK (OBSOLETE)"
2425
depends on INET && IPV6 && NETFILTER && EXPERIMENTAL
26+
depends on NETFILTER_ADVANCED
2527
---help---
2628

2729
This option adds a queue handler to the kernel for IPv6
@@ -44,6 +46,7 @@ config IP6_NF_IPTABLES
4446
tristate "IP6 tables support (required for filtering)"
4547
depends on INET && IPV6 && EXPERIMENTAL
4648
select NETFILTER_XTABLES
49+
default m if NETFILTER_ADVANCED=n
4750
help
4851
ip6tables is a general, extensible packet identification framework.
4952
Currently only the packet filtering and packet mangling subsystem
@@ -56,6 +59,7 @@ config IP6_NF_IPTABLES
5659
config IP6_NF_MATCH_RT
5760
tristate '"rt" Routing header match support'
5861
depends on IP6_NF_IPTABLES
62+
depends on NETFILTER_ADVANCED
5963
help
6064
rt matching allows you to match packets based on the routing
6165
header of the packet.
@@ -65,6 +69,7 @@ config IP6_NF_MATCH_RT
6569
config IP6_NF_MATCH_OPTS
6670
tristate '"hopbyhop" and "dst" opts header match support'
6771
depends on IP6_NF_IPTABLES
72+
depends on NETFILTER_ADVANCED
6873
help
6974
This allows one to match packets based on the hop-by-hop
7075
and destination options headers of a packet.
@@ -74,6 +79,7 @@ config IP6_NF_MATCH_OPTS
7479
config IP6_NF_MATCH_FRAG
7580
tristate '"frag" Fragmentation header match support'
7681
depends on IP6_NF_IPTABLES
82+
depends on NETFILTER_ADVANCED
7783
help
7884
frag matching allows you to match packets based on the fragmentation
7985
header of the packet.
@@ -83,6 +89,7 @@ config IP6_NF_MATCH_FRAG
8389
config IP6_NF_MATCH_HL
8490
tristate '"hl" match support'
8591
depends on IP6_NF_IPTABLES
92+
depends on NETFILTER_ADVANCED
8693
help
8794
HL matching allows you to match packets based on the hop
8895
limit of the packet.
@@ -92,6 +99,7 @@ config IP6_NF_MATCH_HL
9299
config IP6_NF_MATCH_IPV6HEADER
93100
tristate '"ipv6header" IPv6 Extension Headers Match'
94101
depends on IP6_NF_IPTABLES
102+
depends on NETFILTER_ADVANCED
95103
help
96104
This module allows one to match packets based upon
97105
the ipv6 extension headers.
@@ -101,6 +109,7 @@ config IP6_NF_MATCH_IPV6HEADER
101109
config IP6_NF_MATCH_AH
102110
tristate '"ah" match support'
103111
depends on IP6_NF_IPTABLES
112+
depends on NETFILTER_ADVANCED
104113
help
105114
This module allows one to match AH packets.
106115

@@ -109,6 +118,7 @@ config IP6_NF_MATCH_AH
109118
config IP6_NF_MATCH_MH
110119
tristate '"mh" match support'
111120
depends on IP6_NF_IPTABLES
121+
depends on NETFILTER_ADVANCED
112122
help
113123
This module allows one to match MH packets.
114124

@@ -117,6 +127,7 @@ config IP6_NF_MATCH_MH
117127
config IP6_NF_MATCH_EUI64
118128
tristate '"eui64" address check'
119129
depends on IP6_NF_IPTABLES
130+
depends on NETFILTER_ADVANCED
120131
help
121132
This module performs checking on the IPv6 source address
122133
Compares the last 64 bits with the EUI64 (delivered
@@ -128,6 +139,7 @@ config IP6_NF_MATCH_EUI64
128139
config IP6_NF_FILTER
129140
tristate "Packet filtering"
130141
depends on IP6_NF_IPTABLES
142+
default m if NETFILTER_ADVANCED=n
131143
help
132144
Packet filtering defines a table `filter', which has a series of
133145
rules for simple packet filtering at local input, forwarding and
@@ -138,6 +150,7 @@ config IP6_NF_FILTER
138150
config IP6_NF_TARGET_LOG
139151
tristate "LOG target support"
140152
depends on IP6_NF_FILTER
153+
default m if NETFILTER_ADVANCED=n
141154
help
142155
This option adds a `LOG' target, which allows you to create rules in
143156
any iptables table which records the packet header to the syslog.
@@ -147,6 +160,7 @@ config IP6_NF_TARGET_LOG
147160
config IP6_NF_TARGET_REJECT
148161
tristate "REJECT target support"
149162
depends on IP6_NF_FILTER
163+
default m if NETFILTER_ADVANCED=n
150164
help
151165
The REJECT target allows a filtering rule to specify that an ICMPv6
152166
error should be issued in response to an incoming packet, rather
@@ -157,6 +171,7 @@ config IP6_NF_TARGET_REJECT
157171
config IP6_NF_MANGLE
158172
tristate "Packet mangling"
159173
depends on IP6_NF_IPTABLES
174+
default m if NETFILTER_ADVANCED=n
160175
help
161176
This option adds a `mangle' table to iptables: see the man page for
162177
iptables(8). This table is used for various packet alterations
@@ -167,27 +182,29 @@ config IP6_NF_MANGLE
167182
config IP6_NF_TARGET_HL
168183
tristate 'HL (hoplimit) target support'
169184
depends on IP6_NF_MANGLE
185+
depends on NETFILTER_ADVANCED
170186
help
171187
This option adds a `HL' target, which enables the user to decrement
172188
the hoplimit value of the IPv6 header or set it to a given (lower)
173189
value.
174-
190+
175191
While it is safe to decrement the hoplimit value, this option also
176192
enables functionality to increment and set the hoplimit value of the
177193
IPv6 header to arbitrary values. This is EXTREMELY DANGEROUS since
178194
you can easily create immortal packets that loop forever on the
179-
network.
195+
network.
180196

181197
To compile it as a module, choose M here. If unsure, say N.
182198

183199
config IP6_NF_RAW
184200
tristate 'raw table support (required for TRACE)'
185201
depends on IP6_NF_IPTABLES
202+
depends on NETFILTER_ADVANCED
186203
help
187204
This option adds a `raw' table to ip6tables. This table is the very
188205
first in the netfilter framework and hooks in at the PREROUTING
189206
and OUTPUT chains.
190-
207+
191208
If you want to compile it as a module, say M here and read
192209
<file:Documentation/kbuild/modules.txt>. If unsure, say `N'.
193210

0 commit comments

Comments
 (0)