For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > February 2008 > address translation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author address translation
J. Peng

2008-02-21, 4:04 am

how to translate this mask to clear text form with perl?
netmask 0xffffffff

thanks.
John W. Krahn

2008-02-21, 4:04 am

J. Peng wrote:
> how to translate this mask to clear text form with perl?
> netmask 0xffffffff


If you mean an IP address netmask then 0xffffffff is an invalid netmask
because all the bits are 1.


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
J. Peng

2008-02-21, 4:04 am

On Thu, Feb 21, 2008 at 3:29 PM, John W. Krahn <krahnj@telus.net> wrote:
> J. Peng wrote:
>
> If you mean an IP address netmask then 0xffffffff is an invalid netmask
> because all the bits are 1.
>


John,

all 1 means 255.255.255.255, is it?
it's also a valid netmask I think.

I dont know how to translate that,:)
J. Peng

2008-02-21, 4:04 am

On Thu, Feb 21, 2008 at 4:03 PM, John W. Krahn <krahnj@telus.net> wrote:
>
> So 0xffffffff would indicate a network with no hosts on it and thus it
> is not a valid netmask.
>


yup, but sometime we need a 255.255.255.255 netmask to forbit the host
don't reply to any ARP requests.
for example, you have the realservers behind the LVS, if the LVS is
running on DR or Tunning mode, you need to bind the VIP on realservers
and let the hosts don't reply any arp requests to that VIP. Sorry if I
have let people .
John W. Krahn

2008-02-21, 4:04 am

J. Peng wrote:
> On Thu, Feb 21, 2008 at 3:29 PM, John W. Krahn <krahnj@telus.net> wrote:
>
> John,
>
> all 1 means 255.255.255.255, is it?
> it's also a valid netmask I think.
>
> I dont know how to translate that,:)


According to the RFC's

<QUOTE>
ipAdEntNetMask OBJECT-TYPE
SYNTAX IpAddress
ACCESS read-only
STATUS mandatory
DESCRIPTION
"The subnet mask associated with the IP address of
this entry. The value of the mask is an IP
address with all the network bits set to 1 and all
the hosts bits set to 0."
::= { ipAddrEntry 3 }
</QUOTE>

So 0xffffffff would indicate a network with no hosts on it and thus it
is not a valid netmask.



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
J. Peng

2008-02-21, 4:04 am

On Thu, Feb 21, 2008 at 4:11 PM, J. Peng <peng.kyo@gmail.com> wrote:
> On Thu, Feb 21, 2008 at 4:03 PM, John W. Krahn <krahnj@telus.net> wrote:
>
> yup, but sometime we need a 255.255.255.255 netmask to forbit the host
> don't reply to any ARP requests.


sorry please s/forbit/force/;
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com