Skip to contentSkip to conversation

Place for ipt_ACCOUNT/ipt_NETFLOW

DISCUSSION Srinivasa T N 3 participants 8 messages Feb 3, 2011 – Feb 7, 2011

lore
Share & tools
lore
#0 lore raw

Hi All,
Is it possible for me to place rules related to accounting after
filter table in the INPUT chain so that the accounting takes place only on the packets I am accepting in my box?

Regards,
Seenu.

#1 lore raw
Quoted 4 lines · Srinivasa T N

Hi All,
Is it possible for me to place rules related to accounting after
filter table in the INPUT chain so that the accounting takes place only on the packets I am accepting in my box?

According to the nf-packet-flow diagram I have been referring too, the INPUT chain on the filter table is the place to count packets destined only for the box.
If that is not correct, I hope someone says so, because it would explain some confusion I have been having lately...

Quoted 7 lines

Regards,
Seenu.
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Bob Miller
334-7117/660-5315
http://computerisms.ca
[email protected]
Network, Internet, Server,
and Open Source Solutions

#3 lore raw
In reply to Srinivasa T N
Quoted 3 lines · Srinivasa T N

Is it possible for me to place rules related to accounting after filter table in the INPUT chain so that the accounting takes place only on the packets I am accepting in my box?

I hope I'm understanding you correctly.

It sounds like you are wanting to do your accounting after you filter out most of the chaff / noise / IBR that you don't want. Correct?

If this is the case, why don't you have your filtering rules DROP / REJECT / otherwise discard the packets you don't want and then have a follow up rule that ACCEPTS the packet and do your accounting there?

At least if I understand you correctly, filtering packets before they hit your accounting rule should do what you are wanting.

Grant. . . .

#4 lore raw
Quoted 9 lines · Grant Taylor
Quoted 3 lines · Srinivasa T N

Is it possible for me to place rules related to accounting after filter table in the INPUT chain so that the accounting takes place only on the packets I am accepting in my box?

I hope I'm understanding you correctly.

It sounds like you are wanting to do your accounting after you filter out most of the chaff / noise / IBR that you don't want. Correct?

Yes, you are correct.

Quoted 8 lines

If this is the case, why don't you have your filtering rules DROP / REJECT / otherwise discard the packets you don't want and then have a follow up rule that ACCEPTS the packet and do your accounting there?

At least if I understand you correctly, filtering packets before they hit your accounting rule should do what you are wanting.

But adding rules to discard the unwanted traffic and then do an accounting for the rest of the packets in not a good idea. I may not even know what type of packets may arrive and writing rules to discard each of unwanted packets is difficult. So, I prefer to write rules to accept only the packets that are required and then drop the other packets. I wanted to do the accounting only for packets that I accept.

Quoted 4 lines

Grant. . . .
--

Regards,
Seenu.

#2 lore raw
In reply to Bob Miller
Quoted 11 lines · Bob Miller
Quoted 4 lines · Srinivasa T N

Hi All,
Is it possible for me to place rules related to accounting after
filter table in the INPUT chain so that the accounting takes place only on the packets I am accepting in my box?

According to the nf-packet-flow diagram I have been referring too, the INPUT chain on the filter table is the place to count packets destined only for the box.
If that is not correct, I hope someone says so, because it would explain some confusion I have been having lately...

You are correct in saying that the packets destined for my box come in INPUT chain. But, I will have the rules to filter out unwanted stuff in that table and do the accounting only for those packets which pass through these rules and reach upper layer.

Quoted 9 lines
Quoted 8 lines

Regards,
Seenu.
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 8 lines

Bob Miller
334-7117/660-5315
http://computerisms.ca
[email protected]
Network, Internet, Server,
and Open Source Solutions

Regards,
Seenu.

#5 lore raw
In reply to Srinivasa T N
Quoted 6 lines · Srinivasa T N

But adding rules to discard the unwanted traffic and then do an accounting for the rest of the packets in not a good idea. I may not even know what type of packets may arrive and writing rules to discard each of unwanted packets is difficult. So, I prefer to write rules to accept only the packets that are required and then drop the other packets. I wanted to do the accounting only for packets that I accept.

Do the accounting on the rules that you write to decide what traffic to accept.

Grant. . . .

#6 lore raw
Quoted 11 lines · Grant Taylor
Quoted 6 lines · Srinivasa T N

But adding rules to discard the unwanted traffic and then do an accounting for the rest of the packets in not a good idea. I may not even know what type of packets may arrive and writing rules to discard each of unwanted packets is difficult. So, I prefer to write rules to accept only the packets that are required and then drop the other packets. I wanted to do the accounting only for packets that I accept.

Do the accounting on the rules that you write to decide what traffic to accept.

This will double the number of rules a packet has to traverse (One rule for accounting and one rule for accept). Is there are other alternative?

Regards,
Seenu.

#7 lore raw
Quoted 2 lines · Srinivasa T N

This will double the number of rules a packet has to traverse (One rule for accounting and one rule for accept). Is there are other alternative?

I'd have to see an example of your rules to say for sure...

I'm using the counters of the number of packets / bytes that are matched by the rule for accounting. I'm not adding any additional rules.

Further, you can engineer your rule structure so that the fewest rules / tests per rule are traverse by the largest number of packets.

Grant. . . .