IP Math anyone?

Sandipan Gangopadhyay sandipan at vsnl.com
Tue Feb 27 03:45:48 EST 2001


Actually, not only .0 or .255, could be any other IP address as defined by
the netmask in sub-nets.

Eg, .184 is similar to .0 (network address) if netmask is 252 instead of 0
Similarly, .187 is similar to .255 (broadcast address) with this netmask.
In other words, 252 delivers a 4 address sub-net.

Therefore the maths operations will have to involve the netmask.

Regards,

Sandipan
----- Original Message -----
From: "Remco Gerlich" <scarblac at pino.selwerd.nl>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Tuesday, February 27, 2001 1:38 PM
Subject: Re: IP Math anyone?


> Erno Kuusela <erno-news at erno.iki.fi> wrote in comp.lang.python:
> > In article <mailman.983221028.6007.python-list at python.org>, Timothy
> > Grant <tjg at exceptionalminds.com> writes:
> >
> > | Hi all,
> > | I checked Parnassus, but couldn't find anything, so I'll ask
> > | here. Has anyone done anything with IP math (e.g.,
> > | 192.168.0.254 + 1 = 192.168.1.1).
> >
> > assuming you actually mean 192.168.0.254 + 1 = 192.168.0.255,
>
> He doesn't; .0.255 and .1.0 are not IP addresses you could give to a
machine.
> I've never seen existing code for this, seems to need some custom hacking.
>
> (I don't know if .255 and .0 are the only exceptions, probably not).
>
> --
> Remco Gerlich
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>






More information about the Python-list mailing list