[lug] Calculating network addresses

winrip winrip at speakeasy.org
Wed Mar 8 18:44:23 MST 2000

   But that only gives you a network address that exists. Say for example you
were trying to plan for a new netowrk or subnet, you will still have to do the
calculations anyway, atleast to get machines to talk. So lets say you have IP
address N.N.N.N and want to use a non standard subnet mask ( just an example),
which would mean you're subnetted anyway,  you can take the time to plug it into
linux and grep route, or write a perl script to calculate it, or by the time
both of those are done simply AND it.  Writing a perl script in the long run
would probably be the fastest way since it would be reusable, greping route is
a good trick to know, but a one time use it would be easier to AND it by hand,
besides you have to understand the basics first before you know if you have the
correct answer anyway. 

On Wed, 08 Mar 2000, you wrote:
> On Wed, 8 Mar 2000, winrip wrote:
> > Yet I still believe the fastest way is to AND it by hand. You could get the
> > answer in half the time it takes to write a perl script or program. But maybe I
> > like doing things the hard way. 
> The quick and dirty way to do it in bash, I've found is to grep the output
> of route -nfor the interface name, then grep again for the netmask. The
> first field is your network address.
> -Ian
> --
> <cosmo> wow, this is kinda nifty. the win98 protocol stack is 
> like a chinese finger puzzle, twist and turn in the right places, 
> and it pops right off			--Seen on EFNet IRC
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug

More information about the LUG mailing list