Re: Connection Stats per interface using iptables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/05/07 02:09, Shyam Prasad wrote:
Is there a way to directly fetch these stats using iptables rule or i have to create separate chains for each interface ,redirect the traffic to these interface specific chains and then calculate the stats.

Yes you can use IPTables to gather this information for you. IPTables its self does not keep track of this information, but you could easily write rules to act act as counters that you would then later check the number of packets they have matched. You just need to add some rules to IPTables to match the input and / or the output interface and / or any other protocol information.

Depending on how many rules you are going to write, you may want to look at optimizing the rules a bit by creating a user defined chain for each interface. With user defined chains you will not have to have packets traverse rules that they will never match.



Grant. . . .
-
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux