From: Alok Shukla <alokshukla@yahoo.com>
To: netfilter@lists.netfilter.org
Cc: Antony Stone <Antony@Soft-Solutions.co.uk>
Subject: Re: HELP : How to group IP addresses by refering to them as a single name ?
Date: Fri, 20 Sep 2002 05:43:03 -0700 (PDT) [thread overview]
Message-ID: <20020920124303.17644.qmail@web40209.mail.yahoo.com> (raw)
In-Reply-To: <20020919193311.UPJU287.mta02-svc.ntlworld.com@there>
HI,
THANKS A LOT..!
I have understood a lot of things. Now just for the
sake..tell me if the following are valid
iptables -t nat -A POSTROUTING -s 192.168.0.10/27 -d
any/0 -J MASQUERADE
for allowing all the machines starting from 11 to 41
and in the similar way...
if the above is a correct way then it might be a
shortcut but it is still better to design properely
rather than to take shortcuts...
Thanks in Advance
Alok Shukla
--- Antony Stone <Antony@Soft-Solutions.co.uk> wrote:
> On Thursday 19 September 2002 7:00 pm, Alok Shukla
> wrote:
>
> > Let me say if i am able to sort out the lab in the
> > accordance that i start my ip settings of lab2
> > like 192.168.9.1-63 for lab 1
> >
> > and next 64 for lab 2 , would that help and how ?
>
> I think it would help a lot, yes. I would
> recommend putting machines into
> three groups:
> 1. User machines in Lab1
> 2. User machines in Lab2
> 3. System machines such as servers, routers, etc.
>
> Separate the IP addresses for each of these three
> groups so that you can
> specify a single group with an easy netmask.
>
> I'll explain this slowly - apologies if some is too
> obvious...
>
> 192.168.0.0/24 specifies 256 addresses, ranging from
> 192.168.0.0 to
> 192.168.0.255
>
> 192.168.0.0/25 specifies 128 addresses, ranging from
> 192.168.0.0 to
> 192.168.0.127.
>
> Similarly 192.168.0.128/25 specifies the other 128
> addresses from the
> original range of 256: 192.168.0.128 to
> 192.168.0.255
>
> Every time you increase the netmask value by one,
> you are talking about half
> the number of machines (because you are specifying
> one more bit for the
> network address and one less bit for the host
> address).
>
> Therefore you can specify groups of the following
> numbers of addresses:
>
> /24 = 256
> /25 = 128
> /26 = 64
> /27 = 32
> /28 = 16
> /29 = 8
> /30 = 4
> /31 = 2
> /32 = 1
>
> Hence it is common for ISPs to provide you with a
> network range such as
> 213.121.241.128/27, which means you have 32
> addresses. In the older dotted
> quad netmask notation this would be specified as a
> netmask of 255.255.255.224
>
> Suppose you rearranged the addresses on your
> network, so that all the Lab1
> machines had addresses between 192.168.0.0 and
> 192.168.0.63, all the Lab2
> machines had addresses between 192.168.0.64 and
> 192.168.0.127, and all the
> routers, servers etc which are not really part of
> either Lab had addresses
> above 192.168.0.128.
>
> Then you could refer in a netfilter rule to a source
> address coming from any
> machine in Lab1 by the notation "-s 192.168.0.0/26".
>
> Similarly you could refer to a source address of any
> machine in Lab2 with the
> notation "-s 192.168.0.64/26", and if you wanted a
> rule to apply to the other
> machines (routers & servers etc) you could specify
> "-s 192.168.0.128/26" if
> there were less than 64 of them (or
> "-s192.168.0.128/27" if there were more
> than 64... unlikely...)
>
> This is the reason I think you would benefit from
> assigning the machines to
> different address ranges, one smaller subnet per
> category of machines.
>
> > But i would request you to explain in detail as
> you said
>
> Okay - here are the rules I suggested earlier, with
> comments to show why they
> match your current address ranges.
>
> > > # add rules to match machines *not* in LAB1 and
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
next prev parent reply other threads:[~2002-09-20 12:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200209041320.g84DKjv31137@vulcan.rissington.net>
2002-09-19 7:45 ` HELP : How to group IP addresses by refering to them as a single name ? Alok Shukla
2002-09-19 9:37 ` Rohan Almeida
2002-09-19 13:01 ` Antony Stone
2002-09-19 18:00 ` Alok Shukla
2002-09-19 19:33 ` Antony Stone
2002-09-20 2:55 ` Joel Newkirk
2002-09-20 12:43 ` Alok Shukla [this message]
2002-09-20 13:11 ` Antony Stone
2002-09-21 5:34 ` Darrell A. Escola
2002-09-21 8:01 ` Antony Stone
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=20020920124303.17644.qmail@web40209.mail.yahoo.com \
--to=alokshukla@yahoo.com \
--cc=Antony@Soft-Solutions.co.uk \
--cc=netfilter@lists.netfilter.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