- 论坛徽章:
- 0
|
如何在程序中获得Iptables规则表中每条的数据包计数信息?
man iptables
-t, --table table
This option specifies the packet matching table which the com-
mand should operate on. If the kernel is configured with auto-
matic module loading, an attempt will be made to load the appro-
priate module for that table if it is not already there.
The tables are as follows:
filter:
This is the default table (if no -t option is passed). It
contains the built-in chains INPUT (for packets coming into
the box itself), FORWARD (for packets being routed through
the box), and OUTPUT (for locally-generated packets).
nat:
This table is consulted when a packet that creates a new
connection is encountered. It consists of three built-ins:
PREROUTING (for altering packets as soon as they come in),
OUTPUT (for altering locally-generated packets before rout-
ing), and POSTROUTING (for altering packets as they are
about to go out).
mangle:
This table is used for specialized packet alteration. Until
kernel 2.4.17 it had two built-in chains: PREROUTING (for
altering incoming packets before routing) and OUTPUT (for
altering locally-generated packets before routing). Since
kernel 2.4.18, three other built-in chains are also sup-
ported: INPUT (for packets coming into the box itself), FOR-
WARD (for altering packets being routed through the box),
and POSTROUTING (for altering packets as they are about to
go out).
如果你要在程序里获得这些信息,就写个程序去获得啊,比如shell什么的 |
|