📄 00000009.htm
字号:
The TCP extensions are automatically loaded if `-p tcp' is specified. <BR>Iton
<BR> provides the following options (none of which match fragments). When this
<BR> happens, the packet is divided into fragments, and sent as multiple
<BR> --tcp-flags
<BR>
<BR> Followed by an optional `!', then two strings of flags, allows <BR>you
<BR> to filter on specific TCP flags. The first string of flags is the
<BR> header fmask: a list of flags you want to examine. The second string ofts
<BR> flags tells which one(s) should be set. For example,
<BR> <BR>n
<BR> # iptables -A INPUT --protocol tcp --tcp-flags ALL SYN,ACK -j DENY .
<BR>
<BR> This indicates that all flags should be examined (`ALL' is et
<BR> synonymous with `SYN,ACK,FIN,RST,URG,PSH'), but only SYN and ACK
<BR> should be set. There is also an argument `NONE' meaning no flags.
<BR>
<BR> --syn by the
<BR>
<BR> Optionally preceded by a `!', this is shorthand for `--tcp-flags
<BR> SYN,RST,ACK SYN'. p
<BR>
<BR> --source-port
<BR>
<BR>OK followed by an optional `!', then either a single TCP port, or a
<BR> range of ports. Ports can be port names, as listed in
<BR> /etc/services, or numeric. Ranges are either two port <BR>names
<BR> separated by a `:', or (to specify greater than or equal to a
<BR> given port) a port with a `:' appended, or (to specify less than
<BR> or equal to a given port), a port preceded by a `:'. <BR>his
<BR>3.1 <BR>the
<BR> --sport
<BR>
<BR> is synonymous with `--source-port'.
<BR> t
<BR> --destination-port es,
<BR>
<BR> and
<BR> s
<BR> --dport
<BR> e
<BR> S are the same as above, only they specify the destination, rather
<BR> than source, port to match. <BR>on
<BR> When this
<BR> --tcp-option packet is divided into fragments, and sent as multiple
<BR>
<BR> followed by an optional `!' and a number, matches a packet with a
<BR> TCP option equaling that number. A packet which does not have a
<BR> complete TCP header is dropped automatically if an attempt is <BR>made
<BR> header fto examine its TCP options. ts
<BR>
<BR> An Explanation of TCP Flags <BR>n
<BR> .
<BR> It is sometimes useful to allow TCP connections in one direction, but not
<BR> the other. For example, you might want to allow connections to an <BR>external
<BR> WWW server, but not connections from that server.
<BR>
<BR> The naive approach would be to block TCP packets coming from the server.
<BR> Unfortunately, TCP connections require packets going in both directions <BR>to
<BR> work at all.
<BR>
<BR> The solution is to block only the packets used to request a connection.
<BR> These packets are called SYN packets (ok, technically they're packets <BR>with
<BR> the SYN flag set, and the FIN and ACK flags cleared, but we call them SYN
<BR> packets for short). By disallowing only these packets, we can stop
<BR>OK attempted connections in their tracks.
<BR>LinOnly packets traversing the FORWARD chain have both an input and out9ut a <BR>Ma
<BR> The `--syn' flag is used for this: it is only valid for rules which
<BR> specify TCP as their protocol. For example, to specify TCP connection
<BR> attempts from 192.168.1.1:
<BR> <BR>his
<BR>3-p TCP -s 192.168.1.1 --syn <BR>the
<BR>
<BR> This flag can be inverted by preceding it with a `!', which means every
<BR> packet other than the connection initiation.
<BR> t
<BR> UDP Extensions es,
<BR>
<BR> These extensions are automatically loaded if `-p udp' is specified. It
<BR> provides the options `--source-port', `--sport', `--destination-port' and
<BR> `--dport' as detailed for TCP above.
<BR> e
<BR> ICMP Extensions
<BR> <BR>on
<BR> This extension is automatically loaded if `-p icmp' is specified. It this
<BR> provides only one new option:d into fragments, and sent as multiple
<BR>
<BR> --icmp-type
<BR>
<BR> followed by an optional `!', then either an icmp type name (eg
<BR> header f`host-unreachable'), or a numeric type (eg. `3'), or a numeric ts
<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -