1 |
Benno Schulenberg wrote: |
2 |
> (By the way, please do not reply to another message when starting a |
3 |
> new topic.) |
4 |
> |
5 |
> Benno |
6 |
|
7 |
Sorry for that. So I start a new thread now. |
8 |
|
9 |
|
10 |
> Daniel Waeber wrote: |
11 |
>> I was looking for a way to set the default rule for the INPUT |
12 |
>> chain to DROP. I do not want to change the rule with iptables -P |
13 |
>> INPUT DROP after loading the kernel, I want that the |
14 |
>> kernel/modules automatically DROPS everything after it has been |
15 |
>> loaded. |
16 |
>> You can do this with the FORWARD chain with the parameter |
17 |
>> forward=0, but nothing is implemented for the INPUT chain as far |
18 |
>> as i know. I looked inside the kernel source of the modules, and |
19 |
>> hey, it is easy to change. I recompiled the module, reloaded it. |
20 |
>> Perfect, now i have default DROP. |
21 |
>> But as it is so easy to edit, why is there no option in the |
22 |
>> kernel or a parameter for the module |
23 |
> |
24 |
> Make a patch that adds this parameter, allowing one to set the |
25 |
> default policy for the input chain (and output chain too), and |
26 |
> submit it to the kernel list. Or show it here first. I'd be |
27 |
> interested. |
28 |
|
29 |
Because I'm new to Linux, this is my first patch, so i don't know if |
30 |
everything is done right. Perhaps someone can examine it before I send |
31 |
it to kernel.org. I added code so you can pass the parameter "input=0" |
32 |
and "output=0" to the iptable_filter module to change the policies. It's |
33 |
the same code already implemented for the forward chain, which can be |
34 |
set to 0 to drop, 1 to accept. |
35 |
I don't now if how/if this parameter can be passed, if netfilter is |
36 |
build inside the kernel, so perhaps this is not the perfect solution. |
37 |
|
38 |
Have fun with a default denying firewall :) |