Hi there, but from the top of that file it grabs it states: # # Note that this is *not* an definitive guide, and does not cover all of the # APNIC ranges. (see whois.apnic.net) is there a definitive guide? Kerry. ________________________________ From: Barry Murphy [mailto:barry(a)unix.co.nz] Sent: Thursday, 30 June 2005 9:30 a.m. To: James J. Guidera; NZNOG(a)list.waikato.ac.nz Subject: Re: [nznog] NZ IP-Range I got this script from Paul of linuxsystems, grabs the APNIC IP database and compiles a list of NZ ip ranges: #!/usr/local/bin/php <?php $in_file = "ftp://ftp.apnic.net/pub/apnic/dbase/data/country-ipv4.lst"; // $in_file = "country-ipv4.lst"; $out_file = "nzipranges.txt"; $handle_input = @fopen($in_file,"r") or die("Unable to open $in_file\n\n"); $handle_output = fopen($out_file, "w"); $now = date ("r"); fwrite ($handle_output,"# Generated: $now\n\n"); while (!feof($handle_input)) { $buffer = fgets($handle_input); if ( ereg ( "nz", $buffer) ) { // echo $buffer; $this_range = trim(preg_replace ( "#([\d\.]+) \- [\d\.]+ : [\d\.]+(\/\d+) .+#","$1$2", $buffer )); fwrite ($handle_output,"\n" . $this_range); } } fclose($handle_input); fwrite ($handle_output,"\n"); fclose($handle_output); ?> ----- Original Message ----- From: James J. Guidera mailto:james(a)miracle.co.nz To: NZNOG(a)list.waikato.ac.nz Sent: Thursday, June 30, 2005 9:00 AM Subject: [nznog] NZ IP-Range Just a quick question, Is there a singular complete list of NZ ip range?? I am wanting to allow only NZ traffic access to servers. Thanks James Guidera Systems Engineer Miracle Electronics Ltd Ph:+64-4-385-1293 Cel: +64-21-705-614 ________________________________ _______________________________________________ NZNOG mailing list NZNOG(a)list.waikato.ac.nz http://list.waikato.ac.nz/mailman/listinfo/nznog
On Thu, 30 Jun 2005, Kerry Milestone wrote:
Hi there,
but from the top of that file it grabs it states:
# # Note that this is *not* an definitive guide, and does not cover all of the # APNIC ranges. (see whois.apnic.net) is there a definitive guide?
Kerry.
Think of what you ask. The simple answer is "no" -- Steve.
On 29 Jun 2005, at 22:43, Kerry Milestone wrote:
# Note that this is *not* an definitive guide, and does not cover all of the # APNIC ranges. (see whois.apnic.net)
is there a definitive guide?
The country in which an organisation's headquarters resides for the purpose of address allocation does not necessarily correspond to the country in which end systems are numbered. For example, 192.5.5.0/24 is an ARIN block, but is advertised in Auckland to many networks. There are other similar examples. Whether or not something is local or not depends what you mean by "local". If you mean "if I send a packet, will it leave the country?" then a usefully-attributed BGP feed from a local router will probably give you the information you need, bearing in mind that the "locality" of any address will vary with time. "Will I be billed for replying to this packet?" is a similar question, and can be answered in real-time by application of your upstream provider's billing practices to the previous question. If you mean "if I receive a packet, did it travel through a router outside the country?" then you have no definitive way of knowing, unless you are able to obtain diagnostic information from the end system (e.g. the originating system's initial IP TTL, maybe coupled with other path information which allow intermediate routers to be located). "Will I be billed for receiving this packet?" is best answered by looking at your bill at the end of the month :-) In practical terms, this is not an exact science. Joe
participants (3)
-
Joe Abley
-
Kerry Milestone
-
Steve Phillips