Best way to check if there is internet?
Dennis Lee Bieber
wlfraed at ix.netcom.com
Mon Feb 7 15:41:33 EST 2022
On Mon, 07 Feb 2022 11:40:24 -0800 (PST), Grant Edwards
<grant.b.edwards at gmail.com> declaimed the following:
>On 2022-02-07, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
>
>> Also, for a machine freshly booted, with no cache, even pinging
>> Google first requires making contact with a DNS server to ask for
>> Google's IP address. With no network, the DNS look-up will fail
>> before ping even tries to hit Google.
>
>Ah, c'mon... Every geek worth his salt knows a few real world IP
>addresses without relying on DNS. If you want to "ping Google", it's
>
> $ ping 8.8.8.8
>or
> $ ping 8.8.4.4
>
Which happen to be Google's DNS servers -- not what most think of as
"Google"
C:\Users\Wulfraed>ping www.google.com -4
Pinging www.google.com [142.251.45.36] with 32 bytes of data:
...
>:)
>
>If that doesn't work, then you ask 'route -n' for the IP address of
>the default gateway, and try pinging that. It's possible your default
>gateway is alive but configured to ignore ICMP ping requests, but I've
>never run into one like that.
>
No "route -n" here...
C:\Users\Wulfraed>route -n
Manipulates network routing tables.
ROUTE [-f] [-p] [-4|-6] command [destination]
[MASK netmask] [gateway] [METRIC metric] [IF interface]
-f Clears the routing tables of all gateway entries. If this
is
used in conjunction with one of the commands, the tables are
cleared prior to running the command.
-p When used with the ADD command, makes a route persistent
across
boots of the system. By default, routes are not preserved
when the system is restarted. Ignored for all other
commands,
which always affect the appropriate persistent routes.
-4 Force using IPv4.
-6 Force using IPv6.
command One of these:
PRINT Prints a route
ADD Adds a route
DELETE Deletes a route
CHANGE Modifies an existing route
destination Specifies the host.
MASK Specifies that the next parameter is the 'netmask' value.
netmask Specifies a subnet mask value for this route entry.
If not specified, it defaults to 255.255.255.255.
gateway Specifies gateway.
interface the interface number for the specified route.
METRIC specifies the metric, ie. cost for the destination.
...
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed at ix.netcom.com http://wlfraed.microdiversity.freeddns.org/
More information about the Python-list
mailing list