- 论坛徽章:
- 0
|
ipf的规则?
在man中
- IP addresses may be specified in one of two ways: as a
- numerical address/mask, or as a hostname mask netmask.
- The hostname may either be a valid hostname, from either
- the hosts file or DNS (depending on your configuration and
- library) or of the dotted numeric form. There is no spe-
- cial designation for networks but network names are recog-
- nised. Note that having your filter rules depend on DNS
- results can introduce an avenue of attack, and is discour-
- aged.
- There is a special case for the hostname any which is
- taken to be 0.0.0.0/0 (see below for mask syntax) and
- matches all IP addresses. Only the presence of "any" has
- an implied mask, in all other situations, a hostname MUST
- be accompanied by a mask. It is possible to give "any" a
- hostmask, but in the context of this language, it is non-
- sensical.
- The numerical format "x/y" indicates that a mask of y con-
- secutive 1 bits set is generated, starting with the MSB,
- so a y value of 16 would give 0xffff0000. The symbolic "x
- mask y" indicates that the mask y is in dotted IP notation
- or a hexadecimal number of the form 0x12345678. Note that
- all the bits of the IP address indicated by the bitmask
- must match the address on the packet exactly; there isn't
- currently a way to invert the sense of the match, or to
- match ranges of IP addresses which do not express them-
- selves easily as bitmasks (anthropomorphization; it's not
- just for breakfast anymore).
复制代码
address/mask or hostname mask netmask
作用应该是一样的,但是它们指的是子网 还是ip? |
|