📄 00000009.htm
字号:
3.1is extremely useful for dial-up PPP links (usually interface ppp0) and <BR>the
<BR> like.
<BR>
<BR> As a special case, an interface name ending with a `+' will match all
<BR> interfaces (whether they currently exist or not) which begin with that
<BR> string. For example, to specify a rule which matches all PPP interfaces,
<BR> the -i ppp+ option would be used.
<BR>
<BR> The interface name can be preceded by a `!' to match a packet which does
<BR> not match the specified interface(s).
<BR> e
<BR> Specifying Fragments
<BR> <BR>on
<BR> Sometimes a packet is too large to fit down a wire all at once. When this
<BR> happens, the packet is divided into fragments, and sent as multiple
<BR> packets. The other end reassembles these fragments to reconstruct the
<BR> whole packet.
<BR>
<BR> The problem with fragments is that the initial fragment has the complete
<BR> header fields (IP + TCP, UDP and ICMP) to examine, but subsequent packets
<BR> only have a subset of the headers (IP without the additional protocol
<BR> fields). Thus looking inside subsequent fragments for protocol headers <BR>n
<BR> (such as is done by the TCP, UDP and ICMP extensions) is not possible.
<BR>
<BR> If you are doing connection tracking or NAT, then all fragments will get
<BR> merged back together before they reach the packet filtering code, so you
<BR> need never worry about fragments.
<BR>
<BR> Otherwise, it is important to understand how fragments get treated by the
<BR> filtering rules. Any filtering rule that asks for information we don't
<BR> have will not match. This means that the first fragment is treated like
<BR> any other packet. Second and further fragments won't be. Thus a rule -p
<BR> TCP --sport www (specifying a source port of `www') will never match a
<BR> fragment (other than the first fragment). Neither will the opposite rule
<BR> -p TCP --sport ! www.
<BR> interface.
<BR> However, you can specify a rule specifically for second and further
<BR> fragments, using the `-f' (or `--fragment') flag. It is also legal to
<BR> specify that a rule does not apply to second and further fragments, <BR>byThis
<BR>3.1preceding the `-f' with `!'. d <BR>the
<BR>
<BR> Usually it is regarded as safe to let second and further fragments
<BR> through, since filtering will effect the first fragment, and thus prevent
<BR> reassembly on the target host; however, bugs have been known to allowt
<BR> crashing of machines simply by sending fragments. Your call. es,
<BR>
<BR> Note for network-heads: malformed packets (TCP, UDP and ICMP packets too
<BR> short for the firewalling code to read the ports or ICMP code and type)s
<BR> are dropped when such examinations are attempted. So are TCP fragments
<BR> starting at position 8. e
<BR> S
<BR> As an example, the following rule will drop any fragments going to <BR>on
<BR> 192.168.1.1: is too large to fit down a wire all at once. When this
<BR> happens, the packet is divided into fragments, and sent as multiple
<BR> # iptables -A OUTPUT -f -d 192.168.1.1 -j DROP
<BR> #
<BR>
<BR> Extensions to iptables: New Matches the initial fragment has the complete
<BR> header fields (IP + TCP, UDP and ICMP) to examine, but subsequent packets
<BR> iptables is extensible, meaning that both the kernel and the iptables <BR>tool
<BR> can be extended to provide new features. <BR>n
<BR> .
<BR> Some of these extensions are standard, and other are more exotic.
<BR> Extensions can be made by other people and distributed separately for et
<BR> niche users.together before they reach the packet filtering code, so you
<BR>
<BR> Kernel extensions normally live in the kernel module subdirectory, such <BR>as
<BR> /lib/modules/2.3.15/net. They are demand loaded if your kernel was by the
<BR> compiled with CONFIG_KMOD set, so you should not need to manually insert
<BR> them.
<BR> p
<BR> Extensions to the iptables program are shared libraries which live <BR>usually
<BR> live in /usr/local/lib/iptables/, although a distribution would put them
<BR> in /lib/iptables or /usr/lib/iptables.
<BR>OK
<BR> Extensions come in two types: new targets, and new matches (we'll talk
<BR> about new targets a little later). Some protocols automatically offer <BR>new
<BR> tests: currently these are TCP, UDP and ICMP as shown below.
<BR>
<BR> For these you will be able to specify the new tests on the command <BR>linehis
<BR>3.1after the `-p' option, which will load the extension. For explicit new <BR>the
<BR> tests, use the `-m' option to load the extension, after which the <BR>extended
<BR> options will be available.
<BR>
<BR> To get help on an extension, use the option to load it (`-p', `-j' ort
<BR> `-m') followed by `-h' or `--help', eg: es,
<BR>
<BR> # iptables -p tcp --help
<BR> # s
<BR>
<BR> TCP Extensions e
<BR> S
<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -