manpages for 17 modules
PATCH 1/1 manpages for 17 modules
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I sat down and put together man pages for most modules that were lacking one.
Most modules (that are affected by my patches) didn't have a manpage, with the exception of owner-socketlookup and ownercmd. These two add to already existing functionality, so for them I added iptables.patch in their pom-ng directory instead so the missing stuff gets patched into the already existing manpages in the iptables directory.
Also, the "comment" match had an libipt_comment.c both in iptables and patch-o-matic-ng so I also added the man page into both locations.
The manpages were constructed mostly based on the "help" files and commandline help texts from libipt_*.c source files. I also added some wording of my own where I felt it was appropriate.
The patches only add new files, no modifications to existing files were made.
I hope you (netfilter maintainers) don't mind that I didn't provide the manpages as separate patches or as a .tar.gz. I can still do that if you feel like it.
- --
- - xkr47
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFCRWr6xyF48ZTvn+4RAglkAKDijTnmz4BwYmHDRrKj5qXpWblPLACeMvcv 3mRmojLhK5v1yxlQuw+cntA=
=6pAe
-----END PGP SIGNATURE-----
extensions/libipt_IPMARK.man +45 -0
@@ -0,0 +1,45 @@ +Allows you to mark a received packet basing on its IP address. This +can replace many mangle/mark entries with only one, if you use +firewall based classifier. + +This target is to be used inside the mangle table, in the PREROUTING, +POSTROUTING or FORWARD hooks. +.TP +.BI "--addr " "src/dst" +Use source or destination IP address. +.TP +.BI "--and-mask " "mask" +Perform bitwise `and' on the IP address and this mask. +.TP +.BI "--or-mask " "mask" +Perform bitwise `or' on the IP address and this mask. +.P +The order of IP address bytes is reversed to meet "human order of bytes": +192.168.0.1 is 0xc0a80001. At first the `and' operation is performed, then +`or'. + +Examples: + +We create a queue for each user, the queue number is adequate +to the IP address of the user, e.g.: all packets going to/from 192.168.5.2 +are directed to 1:0502 queue, 192.168.5.12 -> 1:050c etc. + +We have one classifier rule: +.IP +tc filter add dev eth3 parent 1:0 protocol ip fw +.P +Earlier we had many rules just like below: +.IP +iptables -t mangle -A POSTROUTING -o eth3 -d 192.168.5.2 -j MARK +--set-mark 0x10502 +.IP +iptables -t mangle -A POSTROUTING -o eth3 -d 192.168.5.3 -j MARK +--set-mark 0x10503 +.P +Using IPMARK target we can replace all the mangle/mark rules with only one: +.IP +iptables -t mangle -A POSTROUTING -o eth3 -j IPMARK --addr=dst +--and-mask=0xffff --or-mask=0x10000 +.P +On the routers with hundreds of users there should be significant load +decrease (e.g. twice).
extensions/libipt_IPV4OPTSSTRIP.man +5 -0
@@ -0,0 +1,5 @@ +Strip all the IP options from a packet. + +The target doesn't take any option, and therefore is extremly easy to use : + +# iptables -t mangle -A PREROUTING -j IPV4OPTSSTRIP
extensions/libipt_SAME.man +11 -0
@@ -0,0 +1,11 @@ +Similar to SNAT/DNAT depending on chain: it takes a range of addresses +(`--to 1.2.3.4-1.2.3.7') and gives a client the same +source-/destination-address for each connection. +.TP +.BI "--to " "<ipaddr>-<ipaddr>" +Addresses to map source to. May be specified more than once for +multiple ranges. +.TP +.B "--nodst" +Don't use the destination-ip in the calculations when selecting the +new source-ip
extensions/libipt_TARPIT.man +34 -0
@@ -0,0 +1,34 @@ +Captures and holds incoming TCP connections using no local +per-connection resources. Connections are accepted, but immediately +switched to the persist state (0 byte window), in which the remote +side stops sending data and asks to continue every 60-240 seconds. +Attempts to close the connection are ignored, forcing the remote side +to time out the connection in 12-24 minutes. + +This offers similar functionality to LaBrea +<http://www.hackbusters.net/LaBrea/> but doesn't require dedicated +hardware or IPs. Any TCP port that you would normally DROP or REJECT +can instead become a tarpit. + +To tarpit connections to TCP port 80 destined for the current machine: +.IP +iptables -A INPUT -p tcp -m tcp --dport 80 -j TARPIT +.P +To significantly slow down Code Red/Nimda-style scans of unused address +space, forward unused ip addresses to a Linux box not acting as a router +(e.g. "ip route 10.0.0.0 255.0.0.0 ip.of.linux.box" on a Cisco), enable IP +forwarding on the Linux box, and add: +.IP +iptables -A FORWARD -p tcp -j TARPIT +.IP +iptables -A FORWARD -j DROP +.TP +NOTE: +If you use the conntrack module while you are using TARPIT, you should +also use the NOTRACK target, or the kernel will unnecessarily allocate +resources for each TARPITted connection. To TARPIT incoming +connections to the standard IRC port while using conntrack, you could: +.IP +iptables -t raw -A PREROUTING -p tcp --dport 6667 -j NOTRACK +.IP +iptables -A INPUT -p tcp --dport 6667 -j TARPIT
extensions/libipt_XOR.man +7 -0
@@ -0,0 +1,7 @@ +Encrypt TCP and UDP traffic using a simple XOR encryption +.TP +.BI "--key " "string" +Set key to "string" +.TP +.BI "--block-size" +Set block size
extensions/libipt_account.man +47 -0
47 lines not on this page · raw message
extensions/libipt_comment.man +6 -0
@@ -0,0 +1,6 @@ +Allows you to add comments (up to 256 characters) to any rule. +.TP +.BI "--comment " "comment" +.TP +Example: +iptables -A INPUT -s 192.168.0.0/16 -m comment --comment "A privatized IP block"
extensions/libipt_connbytes.man +30 -0
@@ -0,0 +1,30 @@ +Match by how many bytes or packets a connection (or one of the two +flows constituting the connection) have tranferred so far, or by +average bytes per packet. + +The counters are 64bit and are thus not expected to overflow ;) + +The primary use is to detect long-lived downloads and mark them to be +scheduled using a lower priority band in traffic control. + +The transfered bytes per connection can also be viewed through +/proc/net/ip_conntrack and accessed via ctnetlink +.TP +[\fB!\fR]\fB --connbytes \fIfrom\fB:\fR[\fIto\fR] +match packets from a connection whose packets/bytes/average packet +size is more than FROM and less than TO bytes/packets. if TO is +omitted only FROM check is done. "!" is used to match packets not +falling in the range. +.TP +\fB--connbytes-dir\fR [\fBoriginal\fR|\fBreply\fR|\fBboth\fR] +which packets to consider +.TP +\fB--connbytes-mode\fR [\fBpackets\fR|\fBbytes\fR|\fBavgpkt\fR] +whether to check the amount of packets, number of bytes transferred or +the average size (in bytes) of all packets received so far. Note that +when "both" is used together with "avgpkt", and data is going (mainly) +only in one direction (for example HTTP), the average packet size will +be about half of the actual data packets. +.TP +Example: +iptables .. -m connbytes --connbytes 10000:100000 --connbytes-dir both --connbytes-mode bytes ...
extensions/libipt_connlimit.man +21 -0
@@ -0,0 +1,21 @@ +Allows you to restrict the number of parallel TCP connections to a +server per client IP address (or address block). +.TP +[\fB!\fR] \fB--connlimit-above \fIn\fR +match if the number of existing tcp connections is (not) above n +.TP +.BI "--connlimit-mask " "bits" +group hosts using mask +.P +Examples: +.TP +# allow 2 telnet connections per client host +iptables -p tcp --syn --dport 23 -m connlimit --connlimit-above 2 -j REJECT +.TP +# you can also match the other way around: +iptables -p tcp --syn --dport 23 -m connlimit ! --connlimit-above 2 -j ACCEPT +.TP +# limit the nr of parallel http requests to 16 per class C sized \ +network (24 bit netmask) +iptables -p tcp --syn --dport 80 -m connlimit --connlimit-above 16 +--connlimit-mask 24 -j REJECT
extensions/libipt_hashlimit.man +35 -0
@@ -0,0 +1,35 @@ +This patch adds a new match called 'hashlimit'. +The idea is to have something like 'limit', but either per +destination-ip or per (destip,destport) tuple. + +It gives you the ability to express +.IP + '1000 packets per second for every host in 192.168.0.0/16' +.IP + '100 packets per second for every service of 192.168.1.1' +.P +with a single iptables rule. +.TP +.BI "--hashlimit " "rate" +A rate just like the limit match +.TP +.BI "--hashlimit-burst " "num" +Burst value, just like limit match +.TP +.BI "--hashlimit-mode " "destip | destip-destport" +Limit per IP or per port +.TP +.BI "--hashlimit-name " "foo" +The name for the /proc/net/ipt_hashlimit/foo entry +.TP +.BI "--hashlimit-htable-size " "num" +The number of buckets of the hash table +.TP +.BI "--hashlimit-htable-max " "num" +Maximum entries in the hash +.TP +.BI "--hashlimit-htable-expire " "num" +After how many miliseconds do hash entries expire +.TP +.BI "--hashlimit-htable-gcinterval " "num" +How many miliseconds between garbage collection intervals
extensions/libipt_osf.man +47 -0
47 lines not on this page · raw message
extensions/libipt_psd.man +18 -0
@@ -0,0 +1,18 @@ +Attempt to detect TCP and UDP port scans. This match was derived from +Solar Designer's scanlogd. +.TP +.BI "--psd-weight-threshold " "threshold" +Total weight of the latest TCP/UDP packets with different +destination ports coming from the same host to be treated as port +scan sequence. +.TP +.BI "--psd-delay-threshold " "delay" +Delay (in hundredths of second) for the packets with different +destination ports coming from the same host to be treated as +possible port scan subsequence. +.TP +.BI "--psd-lo-ports-weight " "weight" +Weight of the packet with privileged (<=1024) destination port. +.TP +.BI "--psd-hi-ports-weight " "weight" +Weight of the packet with non-priviliged destination port.
extensions/libipt_sctp.man +28 -0
@@ -0,0 +1,28 @@ +.TP +\fB--source-port\fR,\fB--sport \fR[\fB!\fR] \fIport\fR[\fB:\fIport\fR] +.TP +\fB--destination-port\fR,\fB--dport \fR[\fB!\fR] \fIport\fR[\fB:\fIport\fR] +.TP +\fB--chunk-types\fR [\fB!\fR] \fBall\fR|\fBany\fR|\fBonly \fIchunktype\fR[\fB:\fIflags\fR] [...] +The flag letter in upper case indicates that the flag is to match if set, +in the lower case indicates to match if unset. + +Chunk types: DATA INIT INIT_ACK SACK HEARTBEAT HEARTBEAT_ACK ABORT SHUTDOWN SHUTDOWN_ACK ERROR COOKIE_ECHO COOKIE_ACK ECN_ECNE ECN_CWR SHUTDOWN_COMPLETE ASCONF ASCONF_ACK + +chunk type available flags +.br +DATA U B E u b e +.br +ABORT T t +.br +SHUTDOWN_COMPLETE T t + +(lowercase means flag should be "off", uppercase means "on") +.P +Examples: + +iptables -A INPUT -p sctp --dport 80 -j DROP + +iptables -A INPUT -p sctp --chunk-types any DATA,INIT -j DROP + +iptables -A INPUT -p sctp --chunk-types any DATA:Be -j ACCEPT
extensions/libipt_u32.man +8 -0
@@ -0,0 +1,8 @@ +U32 allows you to extract quantities of up to 4 bytes from a packet, +AND them with specified masks, shift them by specified amounts and +test whether the results are in any of a set of specified ranges. +The specification of what to extract is general enough to skip over +headers with lengths stored in the packet, as in IP or TCP header +lengths. + +Details and examples are in the kernel module source.
comment/iptables/extensions/libipt_comment.man +6 -0
@@ -0,0 +1,6 @@ +Allows you to add comments (up to 256 characters) to any rule. +.TP +.BI "--comment " "comment" +.TP +Example: +iptables -A INPUT -s 192.168.0.0/16 -m comment --comment "A privatized IP block"
geoip/iptables/extensions/libipt_geoip.man +15 -0
@@ -0,0 +1,15 @@ +Match a packet by its source or destination country. +.TP +[\fB!\fR] \fB--src-cc\fR, \fB--source-country \fIcountry\fR[\fB,\fIcountry\fB,\fIcountry\fB,\fI...\fR] +Match packet coming from (one of) the specified country(ies) +.TP +[\fB!\fR] \fB--dst-cc\fR, \fB--destination-country \fIcountry\fR[\fB,\fIcountry\fB,\fIcountry\fB,\fI...\fR] +Match packet going to (one of) the specified country(ies) +.TP +NOTE: +The country is inputed by its ISO3166 code. +.P +The only extra files you need is a binary db (geoipdb.bin) & its index file (geoipdb.idx). +Both files are generated from a countries & subnets database with the csv2bin tool, +available at www.cookinglinux.org/geoip/. Both files MUST also be moved in /var/geoip/ +as the shared library is statically looking for that pathname (ex.: /var/geoip/geoipdb.bin).
owner-socketlookup/iptables.patch +16 -0
@@ -0,0 +1,16 @@ +--- orig-iptables/extensions/libipt_owner.man 2004-10-10 12:56:26.000000000 +0300 ++++ iptables/extensions/libipt_owner.man 2005-03-26 12:45:15.000000000 +0200 +@@ -1,8 +1,9 @@ + This module attempts to match various characteristics of the packet +-creator, for locally-generated packets. It is only valid in the +-.B OUTPUT +-chain, and even this some packets (such as ICMP ping responses) may +-have no owner, and hence never match. ++creator, for locally-generated packets. It is valid in the ++\fBINPUT\fR, \fBOUTPUT\fR and \fBPOSTROUTING\fR chains, however in the ++\fBINPUT\fR chain only TCP and UDP packets can be matched. Also note ++that some packets (such as ICMP ping responses) may have no owner, and ++hence never match. + .TP + .BI "--uid-owner " "userid" + Matches if the packet was created by a process with the given
ownercmd/iptables.patch +12 -0
@@ -0,0 +1,12 @@ +--- orig-iptables/extensions/libip6t_owner.man 2004-10-10 12:56:24.000000000 +0300 ++++ iptables/extensions/libip6t_owner.man 2005-03-26 12:53:03.000000000 +0200 +@@ -20,4 +20,9 @@ + Matches if the packet was created by a process in the given session + group. + .TP ++.BI "--cmd-owner " "name" ++Matches if the packet was created by a process with the given command name. ++(this option is present only if iptables was compiled under a kernel ++supporting this feature) ++.TP + .B NOTE: pid, sid and command matching are broken on SMP
PATCH 1/1 manpages for 6 modules: ACCOUNT ipv4options policy quota recent tproxy
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jonas Berlin wrote:
| I sat down and put together man pages for most modules that were lacking | one.
After getting a kebab, I sat down again.. :)
- --
- - xkr47
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFCRa4txyF48ZTvn+4RAqyYAJ4gB1ruT66xYMVZYpUVPzmL8txg5ACfS2AN f56WUCj28G01ETTJh9X3ua0=
=Q0Dx
-----END PGP SIGNATURE-----
extensions/libipt_ipv4options.man +32 -0
@@ -0,0 +1,32 @@ +Match on IPv4 header options like source routing, record route, +timestamp and router-alert. +.TP +.B "--ssrr" +To match packets with the flag strict source routing. +.TP +.B "--lsrr" +To match packets with the flag loose source routing. +.TP +.B "--no-srr" +To match packets with no flag for source routing. +.TP +.B "\fR[\fB!\fR]\fB --rr" +To match packets with the RR flag. +.TP +.B "\fR[\fB!\fR]\fB --ts" +To match packets with the TS flag. +.TP +.B "\fR[\fB!\fR]\fB --ra" +To match packets with the router-alert option. +.TP +.B "\fR[\fB!\fR]\fB --any-opt" +To match a packet with at least one IP option, or no IP option +at all if ! is chosen. +.TP +Examples: +.TP +$ iptables -A input -m ipv4options --rr -j DROP +will drop packets with the record-route flag. +.TP +$ iptables -A input -m ipv4options --ts -j DROP +will drop packets with the timestamp flag.
extensions/libipt_recent.man +93 -0
93 lines not on this page · raw message
extensions/libipt_quota.man +7 -0
@@ -0,0 +1,7 @@ +Implements network quotas by decrementing a byte counter with each +packet. +.TP +.BI "--quota " "bytes" +The quota in bytes. +.P +KNOWN BUGS: this does not work on SMP systems.
policy/iptables/extensions/libip6t_policy.man +46 -0
46 lines not on this page · raw message
tproxy/iptables/extensions/libipt_TPROXY.man +7 -0
@@ -0,0 +1,7 @@ +Used to redirect new connections to the transparent proxy. +.TP +.BI "--on-port " "port" +Redirect connection to port, or the original port if 0 +.TP +.BI "--on-ip " "ip" +Optionally redirect to the given IP
tproxy/iptables/extensions/libipt_tproxy.man +1 -0
@@ -0,0 +1 @@ +Matches all packets related to transparent-proxied connections.
ACCOUNT/iptables/extensions/libipt_ACCOUNT.man +16 -0
@@ -0,0 +1,16 @@ +A high performance accounting system for local networks. +.TP +.BI "--addr " "network/mask" +the subnet which is accounted for +.TP +.BI "--tname " "name" +is the table name where the information is stored +.P +The data can be queried later using the libipt_ACCOUNT userspace library +or by the "iptaccount" tool which is part of the libipt_ACCOUNT package. + +A special subnet is "0.0.0.0/0": All data is stored in the src_bytes +and src_packets structure of slot "0". This is useful if you want +to account the overall traffic to/from your internet provider. + +For more information go to http://www.intra2net.com/opensource/ipt_account
Quoted 5 lines · Jonas Berlin
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1I sat down and put together man pages for most modules that were lacking one.
thanks, the users will appreciate that. all four patches applied.
Signature · 5 lines
- Harald Welte <[email protected]> http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie