Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    IPTABLES: two unrelated source IPs in a single rule?

    This isn't exactly of critical importance, but is there any way to block two entirely different addresses in the one rule, rather than writing individual rules for each of them? For example, if the addresses were and, and I only wanted to block these two.

    Or alternatively, if I wanted to block two subnets, say and Can this be done in one rule?

    Thanks to anyone who can offer advice.

  2. #2
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    You may want to get familiar with chains of rules.

    Usually in the PREROUTING chain you would add a reference to your IPSTOBEBLOCKED chain, which examines the IP and decides to forward it to a general BLOCK chain that does all blocking.

  3. #3
    Linux Enthusiast Bemk's Avatar
    Join Date
    Sep 2008
    Oosterhout-NB, Netherlands
    As far as I know, not, but I'm not close to an expert yet.

    Maybe you may find the answer in here:
    Iptables Tutorial 1.2.2

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts