Roger Wilco Jr wrote:Offline Mode? Oh yeah - sorry.
I bet if thebs reads this, he will have a suggestion.
Indeed I do, and use something similar in hotel rooms.
A) ICMP ping one time, with a 5 second timeout (or traceroute UDP port 53, with a TTL of 3), hitting ...
B) Various, public DNS servers (not just the same one), so the AP/Router thinks you're doing public DNS lookups on the Internet, and ...
C) Only do it every 15 seconds, so it doesn't look like a sustained ICMP flood that possibly gets filtered after awhile
Off Topic
More ideal would be to use traceroute UDP to port 53 (DNS) with a low TTL (even just 3 will usually suffice). But since Windows pathetic version of "tracetr" uses ICMP ping like, well ping itself, it's really no difference on Windows. Unless, of course, you install a full POSIX environment with it on Windows, like Red Hat's Cygwin.
Now if you're a DOS BAT or OS/2-NT CMD guru and can loop this, go for it. Even better if you know your Java/.NET System calls, so PowerShell is easy for you.
I'm a POSIX (UNIX/Linux) wennie, so I like Bourne-based shells (and Python). So on every Windows system, I install MSYS, (Minimal SYStem) from the MinGW project (long story), to get Bourne Again Shell (bash). Newer versions of Windows 10 will come with something similar with bash, so you might not need to install anything.
Basically just launch whatever gives you a bash shell (e.g., MSYS) and create a shell script in your home directory, aka folder, named something like "lp.sh" (for loop ping), like such. If you don't know where that is, launch your shell and run "touch ./lp.sh" and a blank file will be created. You should now be able to find it in Windows Explorer with something like Notepad++ (do not use regular notepad).
Code: Select all
#!/bin/bash
# lp.sh -- loop ping DNS servers to provide a poor man's keepalive
# space separated list of DNS servers
# e.g., AT&T, Google and ye'olde UUNET are good set of 6 in Norteamericana
MYDNS="4.2.2.1 4.2.2.2 8.8.4.4 8.8.8.8 198.6.1.2 198.6.1.3"
# number of seconds to wait in between
# use at least 15
MYSLEEP=15
# Loop forever (run in a MSYS window, minimize it, maximize again and hit Ctrl-C to exit)
while true ; do
for s in $MYDNS ; do
# windows ping options, 1 ping, 5000 (milliseconds = 5s) timeout
# NOTE: do *not* use for POSIX ping (which has completely different execution/options)
ping -n 1 -w 5000 $s
# More Ideal? On POSIX, use traceroute udp to port 53 with a TTL of 3 instead of any ICMP
sleep $MYSLEEP
done
done
From now on you can bring up your shell and just run "sh ./lp.sh" (or set the execute bit so it's just "./lp.sh" -- but I'm trying not to overload people).