48.9.3.4.4. Additional Match Option Modules


Additional match options are available through modules loaded by the iptables command.
To use a match option module, load the module by name using the -m <module-name>, where <module-name> is the name of the module.
Many modules are available by default. You can also create modules to provide additional functionality.
The following is a partial list of the most commonly used modules:
  • limit module — Places limits on how many packets are matched to a particular rule.
    When used in conjunction with the LOG target, the limit module can prevent a flood of matching packets from filling up the system log with repetitive messages or using up system resources.
    Refer to Section 48.9.3.5, “Target Options” for more information about the LOG target.
    The limit module enables the following options:
    • --limit — Sets the maximum number of matches for a particular time period, specified as a <value>/<period> pair. For example, using --limit 5/hour allows five rule matches per hour.
      Periods can be specified in seconds, minutes, hours, or days.
      If a number and time modifier are not used, the default value of 3/hour is assumed.
    • --limit-burst — Sets a limit on the number of packets able to match a rule at one time.
      This option is specified as an integer and should be used in conjunction with the --limit option.
      If no value is specified, the default value of five (5) is assumed.
  • state module — Enables state matching.
    The state module enables the following options:
    • --state — match a packet with the following connection states:
      • ESTABLISHED — The matching packet is associated with other packets in an established connection. You need to accept this state if you want to maintain a connection between a client and a server.
      • INVALID — The matching packet cannot be tied to a known connection.
      • NEW — The matching packet is either creating a new connection or is part of a two-way connection not previously seen. You need to accept this state if you want to allow new connections to a service.
      • RELATED — The matching packet is starting a new connection related in some way to an existing connection. An example of this is FTP, which uses one connection for control traffic (port 21), and a separate connection for data transfer (port 20).
      These connection states can be used in combination with one another by separating them with commas, such as -m state --state INVALID,NEW.
  • mac module — Enables hardware MAC address matching.
    The mac module enables the following option:
    • --mac-source — Matches a MAC address of the network interface card that sent the packet. To exclude a MAC address from a rule, place an exclamation point character (!) after the --mac-source match option.
Refer to the iptables man page for more match options available through modules.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.