Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Gáspár Lajos" <swifty@freemail.hu>
To: "Mihamina Rakotomandimby (R12y)" <mihamina@lab.vectoris.fr>
Cc: netfilter@vger.kernel.org
Subject: Re: mask 10 -> 29
Date: Wed, 15 Apr 2009 18:37:51 +0200	[thread overview]
Message-ID: <49E60D5F.9070806@freemail.hu> (raw)
In-Reply-To: <49E6044F.5070305@lab.vectoris.fr>

Hi,

Mihamina Rakotomandimby (R12y) írta:
> Hi,
> I have this kind of shell script in order to set something on a bunch 
> of IP addresses:
>
> for ACCEPTED_MACHINE in \
>     192.168.0.10 \
...
>    192.168.0.29
> do
> $IPTABLES [...]
> done
>
>
> How could I use a mask such as 192.168.0.0/NN to exactly match the list?
> Thank you.
>
Use ipcalc!

The closest subnet is:

ipcalc 192.168.0.10/27
Address:   192.168.0.10         11000000.10101000.00000000.000 01010
Netmask:   255.255.255.224 = 27 11111111.11111111.11111111.111 00000
Wildcard:  0.0.0.31             00000000.00000000.00000000.000 11111
=>
Network:   192.168.0.0/27       11000000.10101000.00000000.000 00000
HostMin:   192.168.0.1          11000000.10101000.00000000.000 00001
HostMax:   192.168.0.30         11000000.10101000.00000000.000 11110
Broadcast: 192.168.0.31         11000000.10101000.00000000.000 11111
Hosts/Net: 30                    Class C, Private Internet

Check HosMin and HostMax!

Swifty



  reply	other threads:[~2009-04-15 16:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-15 15:59 mask 10 -> 29 Mihamina Rakotomandimby (R12y)
2009-04-15 16:37 ` Gáspár Lajos [this message]
2009-04-15 17:06   ` Nikolay S. Rybaloff
2009-04-15 17:22 ` Martin Millnert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49E60D5F.9070806@freemail.hu \
    --to=swifty@freemail.hu \
    --cc=mihamina@lab.vectoris.fr \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox