
FYI: If you have a Mac there is a tool called IP NetMonitor by Peter Sichel that has whois, tracroute, ping, and a subnet calculator. It is very nice and long overdue (IMHO). I have no ties to it other than I like it. You can try it for free, and it is only $10 to register... http://www.ultranet.com/~psichel/ We now return you to your regularly scheduled program of name calling and finger pointing.. Tom

At 10:00 AM -0500 1/14/97, Tom Easterday wrote:
FYI: If you have a Mac there is a tool called IP NetMonitor by Peter Sichel that has whois, tracroute, ping, and a subnet calculator. It is very nice and long overdue (IMHO). I have no ties to it other than I like it.
More importantly perhaps, the subnet calculator will find all the components for a given range of addresses -- extremely useful for aggregation, no? -- ala Merit's aggis tool. It also understands /-notation... finally, a peecee tool for people like us, eric ---- R. Eric Bennett <reb@ieng.com> | Internet Engineering Group 313-669-8800 (v) 313-669-8661 (f) | 122 S. Main, Suite 280 http://www.ieng.com/ | Ann Arbor, MI 48104 "Radical Rodent: Superdynamic Rodent of Tomorrow" -- http://home.earthlink.net/~krhughes/Rat.html

More importantly perhaps, the subnet calculator will find all the components for a given range of addresses -- extremely useful for aggregation, no? -- ala Merit's aggis tool. It also understands /-notation...
Does anyone know about a Unix subnet calculator? It would be really really helpful. Thanks -Doug -- Douglas A. Denny denny@rns.net Network Operations Specialist DIRECT: +1 416 443 7941 Rogers Network Services TOLL-FREE: +1 800 267 DATA "A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects." ---Robert A Heinlein.

On Tue, 14 Jan 1997, Douglas Denny wrote:
Does anyone know about a Unix subnet calculator? It would be really really helpful.
Thanks
-Doug
/* ipmask.c * * Given argv[1] as a decimal netmask and argv[2] as a decimal IP address, * print the resulting broadcast and network addresses to stdout. This is * potentially useful in scripts which need the broadcast address and the * network address but want to ask the user as few questions as possible. * * Copyright 1994 by David Niemi. Written in about 30 minutes on 13 Aug. * The author places no restrictions on the use of this program, provided * that this copyright is preserved in any derived source code. * * Typical compilation command for Linux: * cc ipmask.c -Wall -O -m486 -N -o ipmask -s */ #define MYNAME "ipmask" #include <stdio.h> void Usage(void) { fprintf (stderr, "USAGE: %s <decimal netmask> <decimal IP address>\n", MYNAME); } int main(int argc, char *argv[]) { unsigned long netmask, ipaddr, netaddr, broadcast; int in[4], j; unsigned char bc[4],na[4]; if (3 != argc) { Usage(); exit(1); } /* Check netmask */ if (4 != sscanf(argv[1],"%d.%d.%d.%d", &in[0],&in[1],&in[2],&in[3])) { fprintf (stderr,"Invalid netmask \"%s\".\n", argv[1]); Usage(); exit(1); } for (j=0; j<4; ++j) { if (in[j]<0 || in[j]>255) { fprintf (stderr, "Invalid octet %d in netmask \"%s\".\n", j+1, argv[1]); Usage(); exit(1); } } netmask = in[3] + 256 * (in[2] + 256 * (in[1] + 256 * in[0])); /* Check IP address */ if (4 != sscanf(argv[2],"%d.%d.%d.%d", &in[0],&in[1],&in[2],&in[3])) { fprintf (stderr,"Invalid IP address \"%s\".\n", argv[2]); Usage(); exit(1); } for (j=0; j<4; ++j) { if (in[j]<0 || in[j]>255) { fprintf (stderr, "Invalid octet %d in IP address \"%s\".\n", j+1, argv[1]); Usage(); exit(1); } } ipaddr = in[3] + 256 * (in[2] + 256 * (in[1] + 256 * in[0])); broadcast = ipaddr | (~ netmask); bc[0] = broadcast / 256 / 256 / 256; bc[1] = (broadcast / 256 / 256) % 256; bc[2] = (broadcast / 256) % 256; bc[3] = broadcast % 256; netaddr = ipaddr & netmask; na[0] = netaddr / 256 / 256 / 256; na[1] = (netaddr / 256 / 256) % 256; na[2] = (netaddr / 256) % 256; na[3] = netaddr % 256; printf ("%d.%d.%d.%d %d.%d.%d.%d\n", bc[0], bc[1], bc[2], bc[3], na[0], na[1], na[2], na[3]); exit(0); } [-] Brett L. Hawn (blh @ nol dot net) [-] [-] Networks On-Line - Houston, Texas [-] [-] 713-467-7100 [-]

More importantly perhaps, the subnet calculator will find all the components for a given range of addresses -- extremely useful for aggregation, no? -- ala Merit's aggis tool. It also understands /-notation...
Does anyone know about a Unix subnet calculator? It would be really really helpful.
Yeah, the above-mentioned aggis. ;-) habanero:/users/kfiles {10} aggis -q 192.168.4 - 192.168.40 The range of nets from 192.168.4.0 to 192.168.40.0/24 can be represented by: 192.168.4.0/22 ( 4 nets: 192.168.4.0 - 192.168.7.0 ) 192.168.8.0/21 ( 8 nets: 192.168.8.0 - 192.168.15.0 ) 192.168.16.0/20 ( 16 nets: 192.168.16.0 - 192.168.31.0 ) 192.168.32.0/21 ( 8 nets: 192.168.32.0 - 192.168.39.0 ) 192.168.40.0/24 ( 1 net: 192.168.40.0 ) see ftp://merit.edu/pub/nsfnet/cidr/aggis.tar.Z ---- Kirby Files Network Engineer BBN PlaNET Corp kfiles@bbnplanet.com
participants (5)
-
Brett L. Hawn
-
Douglas Denny
-
Kirby Files
-
R Eric Bennett
-
Tom Easterday