Mailinglist Archive: opensuse-security (183 mails)

< Previous Next >
Re: [suse-security] iptables wildcard for IP Addresses?
  • From: Dave Lists <dave.lists@xxxxxxxxx>
  • Date: Wed, 11 May 2005 15:55:02 +0100
  • Message-id: <42821CC6.3060507@xxxxxxxxx>
While on the topic of iptables changes through releases. Does 9.3 have
the tartpit and the string modules for iptables?

Dave.

Martin Köhling wrote:

Hi!


I want to enable several (ten) hosts to access my VPN. I am using SuSEfirewall and I have custom iptables rules in SuSEfirewall2-custom.
Now i want to add one rule for all these hosts. I know that "!" is the wildcard for "any host but the following".
How can I add an iptables rule affecting Source IPs from e.g. 1.1.1.10 to 1.1.1.20? I've been looking, but i didn't ind something.


You might try the "iprange" packet matching module (-m iprange); it's not
domcumented in the man page, but "iptables -m iprange --help" prints the
following (at the end):

iprange match v1.2.9 options:
[!] --src-range ip-ip Match source IP in the specified range
[!] --dst-range ip-ip Match destination IP in the specified range

So you should be able to use something like:

iptables -A INPUT -m iprange --src-range 1.1.1.10-1.1.1.20 -j ACCEPT

This is present in SuSE 9.1, but apparently not in earlier versions.

Martin





< Previous Next >