Linux Netfilter discussions
 help / color / mirror / Atom feed
* -f option used with iptables
@ 2012-06-21 10:46 rahul shrivastava
  2012-06-21 14:27 ` Jan Engelhardt
  0 siblings, 1 reply; 7+ messages in thread
From: rahul shrivastava @ 2012-06-21 10:46 UTC (permalink / raw)
  To: netfilter

Hi,
kernel version is 2.6.35+
I am defining following ACL

iptables -A INPUT -p icmp -i eth1 -m iprange --src-range
172.31.114.1-172.31.114.254 -m iprange --dst-range 192.168.1.1-192.168.1.254 -j
DROP

with above rule i can dop all icmp packets on eth1 interface
but when i add -f option to deny on fragmented packets rule doesnt work

iptables -A INPUT -p icmp -i eth1 -m iprange --src-range
172.31.114.1-172.31.114.254 -m iprange --dst-range 192.168.1.1-192.168.1.254 -f
-j DROP

My abjective is to deny only fragmented packets with specified ip, protocol and
interface and "-f" option doesnt seem to work

Thanks and Regards,
Rahul Shrivastava

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: -f option used with iptables
  2012-06-21 10:46 rahul shrivastava
@ 2012-06-21 14:27 ` Jan Engelhardt
  2012-06-26 10:24   ` rahul shrivastava
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Engelhardt @ 2012-06-21 14:27 UTC (permalink / raw)
  To: rahul shrivastava; +Cc: netfilter

On Thursday 2012-06-21 12:46, rahul shrivastava wrote:

>iptables -A INPUT -p icmp -i eth1 -m iprange --src-range
>172.31.114.1-172.31.114.254 -m iprange --dst-range 192.168.1.1-192.168.1.254
>-f -j DROP
>
>My abjective is to deny only fragmented packets with specified ip, protocol
>and interface and "-f" option doesnt seem to work

I can guarantee you that -f matches fragments -- if there are any
by the time the rule is executed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: -f option used with iptables
  2012-06-21 14:27 ` Jan Engelhardt
@ 2012-06-26 10:24   ` rahul shrivastava
  2012-06-26 10:46     ` Jan Engelhardt
  0 siblings, 1 reply; 7+ messages in thread
From: rahul shrivastava @ 2012-06-26 10:24 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: netfilter

this rule is not working for me
if you know if provide me a rule to drop only fragmented packets

On 6/21/12, Jan Engelhardt <jengelh@inai.de> wrote:
> On Thursday 2012-06-21 12:46, rahul shrivastava wrote:
>
>>iptables -A INPUT -p icmp -i eth1 -m iprange --src-range
>>172.31.114.1-172.31.114.254 -m iprange --dst-range
>> 192.168.1.1-192.168.1.254
>>-f -j DROP
>>
>>My abjective is to deny only fragmented packets with specified ip,
>> protocol
>>and interface and "-f" option doesnt seem to work
>
> I can guarantee you that -f matches fragments -- if there are any
> by the time the rule is executed.
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: -f option used with iptables
  2012-06-26 10:24   ` rahul shrivastava
@ 2012-06-26 10:46     ` Jan Engelhardt
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Engelhardt @ 2012-06-26 10:46 UTC (permalink / raw)
  To: rahul shrivastava; +Cc: netfilter

On Tuesday 2012-06-26 12:24, rahul shrivastava wrote:

>this rule is not working for me

Then you don't have any fragments.
Remember that there may be defragmenter modules (nf_defrag_ipv4/ipv6)
loaded.

(And cease top-posting.)

>if you know if provide me a rule to drop only fragmented packets


>
>On 6/21/12, Jan Engelhardt <jengelh@inai.de> wrote:
>> On Thursday 2012-06-21 12:46, rahul shrivastava wrote:
>>
>>>iptables -A INPUT -p icmp -i eth1 -m iprange --src-range
>>>172.31.114.1-172.31.114.254 -m iprange --dst-range
>>> 192.168.1.1-192.168.1.254
>>>-f -j DROP
>>>
>>>My abjective is to deny only fragmented packets with specified ip,
>>> protocol
>>>and interface and "-f" option doesnt seem to work
>>
>> I can guarantee you that -f matches fragments -- if there are any
>> by the time the rule is executed.
>>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* -f option used with iptables
@ 2012-07-24 15:33 rahul shrivastava
  0 siblings, 0 replies; 7+ messages in thread
From: rahul shrivastava @ 2012-07-24 15:33 UTC (permalink / raw)
  To: netfilter

Hi,

my objective is to drop all fragmented packets on my system
following rules are used

iptables -A INPUT -f -j DROP
iptables -A OUTPUT -f -j DROP
iptables -A FORWARD -f -j DROP

above rules are not making any effect
For information, there is no connection tracking support on my
kernel.Since i understand that if connection tracking is enabled on
kernel then filtering based on fragmentation won't work, so i have
remeved connection tracking support.

i have disable offloading parameters disabled for NIC card

i am using ping -s 32768 10.2.2.2 for generating fragments

Am i doing something wrong
or is there anything  that is conflicting with these rules

Thanks in advance

^ permalink raw reply	[flat|nested] 7+ messages in thread

* -f option used with iptables
@ 2012-08-06 14:30 rahul shrivastava
  2012-08-07  6:15 ` Michal Kubeček
  0 siblings, 1 reply; 7+ messages in thread
From: rahul shrivastava @ 2012-08-06 14:30 UTC (permalink / raw)
  To: netfilter

Hi,

my objective is to drop all fragmented packets on my system
following rules are used

iptables -A INPUT -f -j DROP
iptables -A OUTPUT -f -j DROP
iptables -A FORWARD -f -j DROP

above rules are not making any effect
For information, there is no connection tracking support on my
kernel.Since i understand that if connection tracking is enabled on
kernel then filtering based on fragmentation won't work, so i have
remeved connection tracking support.

i have disable offloading parameters for NIC card

i am using ping -s 32768 10.2.2.2 for generating fragments

Am i doing something wrong
or is there anything  that is conflicting with these rules

Thanks in advance

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: -f option used with iptables
  2012-08-06 14:30 -f option used with iptables rahul shrivastava
@ 2012-08-07  6:15 ` Michal Kubeček
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Kubeček @ 2012-08-07  6:15 UTC (permalink / raw)
  To: netfilter; +Cc: rahul shrivastava

On Monday 06 of August 2012 20:00EN, rahul shrivastava wrote:
> 
> my objective is to drop all fragmented packets on my system
> following rules are used

Not a good idea, IMHO.

> iptables -A INPUT -f -j DROP
> iptables -A OUTPUT -f -j DROP
> iptables -A FORWARD -f -j DROP

This doesn't drop every fragmented packet, only second and further 
fragments. Thus the first fragment passes through, waits in a queue 
until it times out (30 seconds on my system) and then causes a 
"fragmentation timeout exceeded" ICMP message.

> i am using ping -s 32768 10.2.2.2 for generating fragments

You should at least tell where are the rules from above set. On the 
system sending the packets, on the system receiving the packets or 
somewhere between them? Also don't forget to mention the kernel version.

                                                      Michal Kubeèek


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-08-07  6:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06 14:30 -f option used with iptables rahul shrivastava
2012-08-07  6:15 ` Michal Kubeček
  -- strict thread matches above, loose matches on Subject: below --
2012-07-24 15:33 rahul shrivastava
2012-06-21 10:46 rahul shrivastava
2012-06-21 14:27 ` Jan Engelhardt
2012-06-26 10:24   ` rahul shrivastava
2012-06-26 10:46     ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox