* REJECT target
@ 2003-04-10 19:23 Peteris Krumins
0 siblings, 0 replies; 10+ messages in thread
From: Peteris Krumins @ 2003-04-10 19:23 UTC (permalink / raw)
To: netfilter
Hello netfilter,
Holy christ, i relied i could REJECT packets in any table, but
unfortunately after launching the program i was working on i got
ugly 'iptables: Invalid argument' after executing
`iptables -A PREROUTING -t mangle .. -j REJECT`
why cant i put -j REJECT in the PREROUTING chain of mangle table?
Manual says it makes no sense, but it makes sense for me.
I mark certain packets (-j MARK) in the mangle table, and those
which are not marked should be REJECTed.
The only way, i think, i can solve it is using FORWARD and INPUT
chains of the filter table. Match any not marked packets in these
chains and REJECT from there. But this adds some extra time (packet
has to traverse other chain) and i have to duplicate the rules
(because of putting on both INPUT and FORWARD).
Is there a patch or smth to this problem, or it cant be done (REJECT
in mangle)?
P.Krumins
^ permalink raw reply [flat|nested] 10+ messages in thread
* REJECT target
@ 2003-06-25 0:39 DarKRaveR
2003-06-25 7:17 ` Jozsef Kadlecsik
0 siblings, 1 reply; 10+ messages in thread
From: DarKRaveR @ 2003-06-25 0:39 UTC (permalink / raw)
To: netfilter-devel
Hello netfilter-devel list,
I know this is not really a developers question, but maybe the
developers are the right people at hand, to explain this.
From what I read, the REJECT target is only valid in
INPUT/OUPUT/FORWARD. Is there any particular reason why ? I read in
one of the tutorials, that you wouldn't need it at any other place,
but I think this is not perfectly true.
--
Best regards,
DarKRaveR mailto:DarKRaveR@habitat-b.de
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: REJECT target
2003-06-25 0:39 REJECT target DarKRaveR
@ 2003-06-25 7:17 ` Jozsef Kadlecsik
2003-06-25 14:13 ` Re[2]: " DarKRaveR
0 siblings, 1 reply; 10+ messages in thread
From: Jozsef Kadlecsik @ 2003-06-25 7:17 UTC (permalink / raw)
To: DarKRaveR; +Cc: netfilter-devel
On Wed, 25 Jun 2003, DarKRaveR wrote:
> I know this is not really a developers question, but maybe the
> developers are the right people at hand, to explain this.
> From what I read, the REJECT target is only valid in
> INPUT/OUPUT/FORWARD. Is there any particular reason why ? I read in
> one of the tutorials, that you wouldn't need it at any other place,
> but I think this is not perfectly true.
The REJECT target is for filtering. The filter table has got the
INPUT/OUPUT/FORWARD chains, therfore the REJECT target can be used in
those chains (and sub-chains, naturally).
Best regards,
Jozsef
-
E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
H-1525 Budapest 114, POB. 49, Hungary
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re[2]: REJECT target
2003-06-25 7:17 ` Jozsef Kadlecsik
@ 2003-06-25 14:13 ` DarKRaveR
2003-06-26 6:40 ` Jozsef Kadlecsik
0 siblings, 1 reply; 10+ messages in thread
From: DarKRaveR @ 2003-06-25 14:13 UTC (permalink / raw)
To: netfilter-devel
Hello Jozsef,
I understood that, the question is why ? I got a scenarion, where I
would need it in the PREROUTING chain of the nat table, instead of
just dropping the packets ... Is there any reason, why it is only
available in the filter table. I mean, it's for filtering okay, but
maybe I want to reject connections properly at other places (like nat
table, prerouting) instead of plain stupid
dropping them and waiting at the client software to time out.
Wednesday, June 25, 2003, 9:17:56 AM, you wrote:
JK> On Wed, 25 Jun 2003, DarKRaveR wrote:
>> I know this is not really a developers question, but maybe the
>> developers are the right people at hand, to explain this.
>> From what I read, the REJECT target is only valid in
>> INPUT/OUPUT/FORWARD. Is there any particular reason why ? I read in
>> one of the tutorials, that you wouldn't need it at any other place,
>> but I think this is not perfectly true.
JK> The REJECT target is for filtering. The filter table has got the
JK> INPUT/OUPUT/FORWARD chains, therfore the REJECT target can be used in
JK> those chains (and sub-chains, naturally).
JK> Best regards,
JK> Jozsef
JK> -
JK> E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu
JK> PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
JK> Address : KFKI Research Institute for Particle and Nuclear Physics
JK> H-1525 Budapest 114, POB. 49, Hungary
--
Best regards,
DarKRaveR mailto:DarKRaveR@habitat-b.de
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re[2]: REJECT target
2003-06-25 14:13 ` Re[2]: " DarKRaveR
@ 2003-06-26 6:40 ` Jozsef Kadlecsik
2003-06-26 10:14 ` Maciej Soltysiak
2003-06-26 14:56 ` Re[3]: " DarKRaveR
0 siblings, 2 replies; 10+ messages in thread
From: Jozsef Kadlecsik @ 2003-06-26 6:40 UTC (permalink / raw)
To: DarKRaveR; +Cc: netfilter-devel
Hi,
On Wed, 25 Jun 2003, DarKRaveR wrote:
> I understood that, the question is why ? I got a scenarion, where I
> would need it in the PREROUTING chain of the nat table, instead of
> just dropping the packets ... Is there any reason, why it is only
> available in the filter table. I mean, it's for filtering okay, but
> maybe I want to reject connections properly at other places (like nat
> table, prerouting) instead of plain stupid
> dropping them and waiting at the client software to time out.
Thy users of netfilter do not filter packets in the nat or mangle tables.
[Check out the mailing list archive and the documentation if you do not
know why. We discussed it countless times.]
Best regards,
Jozsef
-
E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
H-1525 Budapest 114, POB. 49, Hungary
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re[2]: REJECT target
2003-06-26 6:40 ` Jozsef Kadlecsik
@ 2003-06-26 10:14 ` Maciej Soltysiak
2003-06-26 10:31 ` Jozsef Kadlecsik
2003-06-26 14:56 ` Re[3]: " DarKRaveR
1 sibling, 1 reply; 10+ messages in thread
From: Maciej Soltysiak @ 2003-06-26 10:14 UTC (permalink / raw)
To: Jozsef Kadlecsik; +Cc: DarKRaveR, netfilter-devel
> > I understood that, the question is why ? I got a scenarion, where I
> > would need it in the PREROUTING chain of the nat table, instead of
> > just dropping the packets ... Is there any reason, why it is only
> > available in the filter table. I mean, it's for filtering okay, but
> > maybe I want to reject connections properly at other places (like nat
> > table, prerouting) instead of plain stupid
> > dropping them and waiting at the client software to time out.
>
> Thy users of netfilter do not filter packets in the nat or mangle tables.
>
> [Check out the mailing list archive and the documentation if you do not
> know why. We discussed it countless times.]
Shouldn't it be in the FAQ then ?
Regards,
Maciej
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re[2]: REJECT target
2003-06-26 10:14 ` Maciej Soltysiak
@ 2003-06-26 10:31 ` Jozsef Kadlecsik
0 siblings, 0 replies; 10+ messages in thread
From: Jozsef Kadlecsik @ 2003-06-26 10:31 UTC (permalink / raw)
To: Maciej Soltysiak; +Cc: DarKRaveR, netfilter-devel
On Thu, 26 Jun 2003, Maciej Soltysiak wrote:
> > [Check out the mailing list archive and the documentation if you do not
> > know why. We discussed it countless times.]
> Shouldn't it be in the FAQ then ?
Yes, definitely. The docs should be refreshed anyway.
Best regards,
Jozsef
-
E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu
PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
Address : KFKI Research Institute for Particle and Nuclear Physics
H-1525 Budapest 114, POB. 49, Hungary
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re[3]: REJECT target
2003-06-26 6:40 ` Jozsef Kadlecsik
2003-06-26 10:14 ` Maciej Soltysiak
@ 2003-06-26 14:56 ` DarKRaveR
2003-06-26 15:19 ` Patrick Schaaf
2003-06-26 15:20 ` Patrick McHardy
1 sibling, 2 replies; 10+ messages in thread
From: DarKRaveR @ 2003-06-26 14:56 UTC (permalink / raw)
To: netfilter-devel
Hello Jozsef, list,
Okay, admitted. I would be glad to do that in the filtering table, the
question is: How can I identify those packets, when the were modified
in the nat table ?
Assuming I have a subnet and a cluster of ip addresses, which get
redirected in the PREROUTING chain. since the destination address is
getting changed, how can I now reject some of those packets, when they
are meant for certain hosts/networks. So, what I want to do, redirect
packets, but those send to certain destination, or which were meant
for certain destinations should be rejected. I don't want them to just
be dropped (without further notice).
In the current design I can't see any way, to do such a thing, that's
why I wanted to reject them in nat(PREROUTING).
Any thoughts on that ?
Sorry for bothering again ...
-Sven
Thursday, June 26, 2003, 8:40:22 AM, you wrote:
JK> Hi,
JK> On Wed, 25 Jun 2003, DarKRaveR wrote:
>> I understood that, the question is why ? I got a scenarion, where I
>> would need it in the PREROUTING chain of the nat table, instead of
>> just dropping the packets ... Is there any reason, why it is only
>> available in the filter table. I mean, it's for filtering okay, but
>> maybe I want to reject connections properly at other places (like nat
>> table, prerouting) instead of plain stupid
>> dropping them and waiting at the client software to time out.
JK> Thy users of netfilter do not filter packets in the nat or mangle tables.
JK> [Check out the mailing list archive and the documentation if you do not
JK> know why. We discussed it countless times.]
JK> Best regards,
JK> Jozsef
JK> -
JK> E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu
JK> PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt
JK> Address : KFKI Research Institute for Particle and Nuclear Physics
JK> H-1525 Budapest 114, POB. 49, Hungary
--
Best regards,
DarKRaveR mailto:DarKRaveR@habitat-b.de
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: REJECT target
2003-06-26 14:56 ` Re[3]: " DarKRaveR
@ 2003-06-26 15:19 ` Patrick Schaaf
2003-06-26 15:20 ` Patrick McHardy
1 sibling, 0 replies; 10+ messages in thread
From: Patrick Schaaf @ 2003-06-26 15:19 UTC (permalink / raw)
To: DarKRaveR; +Cc: netfilter-devel
> Okay, admitted. I would be glad to do that in the filtering table, the
> question is: How can I identify those packets, when the were modified
> in the nat table ?
One approach that I used in some places, and which could be workable
for your scenario, is to use the MARK target at mangle/PREROUTING,
and then use the mark match both in the NAT decision, and in the
filter table. The firewall mark stays with the packet, regardless
of application of a NAT action.
The CONNMARK stuff may be even more useful / cover more cases.
best regards
Patrick
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: REJECT target
2003-06-26 14:56 ` Re[3]: " DarKRaveR
2003-06-26 15:19 ` Patrick Schaaf
@ 2003-06-26 15:20 ` Patrick McHardy
1 sibling, 0 replies; 10+ messages in thread
From: Patrick McHardy @ 2003-06-26 15:20 UTC (permalink / raw)
To: DarKRaveR; +Cc: netfilter-devel
Have a look at the conntracl match from pom. This is probably what you want.
Bye,
Patrick
DarKRaveR wrote:
>Hello Jozsef, list,
>
>Okay, admitted. I would be glad to do that in the filtering table, the
>question is: How can I identify those packets, when the were modified
>in the nat table ?
>
>Assuming I have a subnet and a cluster of ip addresses, which get
>redirected in the PREROUTING chain. since the destination address is
>getting changed, how can I now reject some of those packets, when they
>are meant for certain hosts/networks. So, what I want to do, redirect
>packets, but those send to certain destination, or which were meant
>for certain destinations should be rejected. I don't want them to just
>be dropped (without further notice).
>
>In the current design I can't see any way, to do such a thing, that's
>why I wanted to reject them in nat(PREROUTING).
>
>Any thoughts on that ?
>
>Sorry for bothering again ...
>
>-Sven
>
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2003-06-26 15:20 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-25 0:39 REJECT target DarKRaveR
2003-06-25 7:17 ` Jozsef Kadlecsik
2003-06-25 14:13 ` Re[2]: " DarKRaveR
2003-06-26 6:40 ` Jozsef Kadlecsik
2003-06-26 10:14 ` Maciej Soltysiak
2003-06-26 10:31 ` Jozsef Kadlecsik
2003-06-26 14:56 ` Re[3]: " DarKRaveR
2003-06-26 15:19 ` Patrick Schaaf
2003-06-26 15:20 ` Patrick McHardy
-- strict thread matches above, loose matches on Subject: below --
2003-04-10 19:23 Peteris Krumins
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.