[futurebasic] Re: [FB] Network diagnostics

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2011 : Group Archive : Group : All Groups

From: Steve <mactech@...>
Date: Wed, 13 Jul 2011 09:01:06 -0400
Deep,

Yes, I am aware that not all routers, switches, etc.. share a common IP such as 192.168.1.1.  I was just showing an example of some additional diagnostics you could do.

I was not aware of the 172.16.x.x IP addresses being reserved.  

Parsing the trace route command is an excellent idea.

 
thanks

On Jul 13, 2011, at 8:54 AM, Deep wrote:

> 
> Steve,
> 
> Not all routers are on "192.168.1.1" address, some such as Apple's Airport
> devices default to "10.0.1.1" for example.
> 
> The address ranges "192.168.x.x", "10.x.x.x", and "172.16.x.x to 172.31.x.x"
> are all reserved for private (LAN) usage.
> 
> Thus, the router can be anywhere in those ranges for a typical LAN, so
> performing a ping on "192.168.1.1" is probably not reliable unless you knew
> in advance that the router was on that address.
> 
> One way of determining the router address is to use the Unix command
> "traceroute" from Terminal using any valid location such as "www.apple.com":
> 
> traceroute www.apple.com
> 
> The first line is the hop between your computer and your router, hence you
> see the IP Address of the router.
> 
> Using the FB Open Unix command, you can run the "traceroute" and then parse
> the text looking for the Router address?
> 
> If there is no network connection, the traceroute fails:
> 
> "traceroute: unknown host www.apple.com"
> 
> Parsing for the text "unknown host" would indicate you have no network
> connection.
> 
> Hope it helps,
> 
> Kind regards,
> 
> Deep
> 
>> From: Steve <mactech@...>
>> Reply-To: <futurebasic@...>
>> Date: Wed, 13 Jul 2011 07:38:42 -0400
>> To: <futurebasic@...>
>> Subject: Re: [FB] Network diagnostics
>> 
>> This seems to work best.  It is very quick to reply if there is no connection
>> vs. waiting for a timeout to occur.
>> 
>> I have only tested it by turning off Airport.  Later, I will try with Airport
>> on, but turning off router, and then the cable modem.
>> 
>> One could ping 192.168.1.1 and possibly determine if a local connection [
>> router] is present and not the internet.
>> 
>> Thanks for sharing Robert.
>> 
>> ~ steve
>> 
>> 
>> On Jul 11, 2011, at 6:50 PM, Robert Purves wrote:
>> 
>>> 
>>> Brian S wrote:
>>> 
>>>>>> Can someone please confirm this apparent serious bug in CFNetDiagnostics?
>>>>>> I'm running OS X 10.6.6.
>>>>> 
>>>>> I'm getting the same interesting results as you in 10.5.8. With the DSL
>>>>> line disconnected from the modem, I ran the code and:
>>>>> 
>>>>> CFNetDiagnosticCopyNetworkStatusPassively()  returns -66559
>>>>> CFNetDiagnosticDiagnoseProblemInteractively() launches the Diagnostic.app,
>>>>> which then begins a connection scan using chasing arrows that stalls.
>>>> 
>>>> With the cable modem coax disconnected ( but modem powered and router
>>>> powered ) the passive call returns -66559 and the snippet prints
>>>> "Connected". For the interactive call, the app launches, pressed the
>>>> "continue" button and it walked me through it. It finally suggests
>>>> restarting the modem. The other tests all work as expected ( same as Robert
>>>> ). This is OS X 10.6.8.
>>> 
>>> I discovered IsPingable(), in the list archives for 2006. If this function
>>> returns _zTrue there can be no doubt that a connection was made.
>>> 
>>> '--------
>>> local fn IsPingable( server as Str255, timeout as UInt8 )
>>> '~'1
>>> dim as Str255 reply
>>> dim as Boolean pingable
>>> pingable = _false
>>> open "UNIX", 99, "ping -c 1 -q -t" + str$( timeout ) + " " + server
>>> while ( eof( 99 ) == _false )
>>> line input #99, reply
>>> if ( instr( 1, reply, "1 packets received" ) > 0 ) then pingable = _zTrue
>>> wend
>>> close 99
>>> end fn = pingable
>>> 
>>> include "ConsoleWindow"
>>> print "Testing…"
>>> long if ( fn IsPingable( "www.apple.com", 4 ) )
>>> print "Connected to internet"
>>> xelse
>>> print "Not connected"
>>> end if
>>> '--------
>>> 
>>> 
>>> Robert P.
>>> 
>>> 
>>> --
>>> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
>>> To access the list archives, go to:
>>> http://freegroups.net/groups/futurebasic/
>>> 
>> 
>> 
>> --
>> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
>> To access the list archives, go to:  http://freegroups.net/groups/futurebasic/
>> 
> 
> 
> 
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
> To access the list archives, go to:  http://freegroups.net/groups/futurebasic/
>