<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Mac Wi-Fi Dropping? Use a Simple Keepalive Bash Script to Maintain Wireless Connection</title>
	<atom:link href="http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/feed/" rel="self" type="application/rss+xml" />
	<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/</link>
	<description>News, tips, software, reviews, and more for Mac OS X, iPhone, iPad</description>
	<lastBuildDate>Thu, 23 May 2013 18:55:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Crates</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-515724</link>
		<dc:creator>Crates</dc:creator>
		<pubDate>Tue, 12 Mar 2013 18:46:53 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-515724</guid>
		<description>Grr... SO close... Same problem with the ping binary.

Here&#039;s another (hopefully final) revision:

*/30 * * * * /usr/sbin/netstat -nr &#124; grep ^default &#124; awk ‘ { print $2; } ‘ &#124; xargs /sbin/ping -i 30 -n -c 59 &gt; /dev/null &amp;

(Moderators, please feel free to merge my many comments. I don&#039;t have the ability to edit them.)</description>
		<content:encoded><![CDATA[<p>Grr&#8230; SO close&#8230; Same problem with the ping binary.</p>
<p>Here&#8217;s another (hopefully final) revision:</p>
<p>*/30 * * * * /usr/sbin/netstat -nr | grep ^default | awk ‘ { print $2; } ‘ | xargs /sbin/ping -i 30 -n -c 59 &gt; /dev/null &amp;</p>
<p>(Moderators, please feel free to merge my many comments. I don&#8217;t have the ability to edit them.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Crates</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-515714</link>
		<dc:creator>Crates</dc:creator>
		<pubDate>Tue, 12 Mar 2013 18:22:22 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-515714</guid>
		<description>Whoops! I was eating my own dog food here (to make sure that what I posted actually _worked_ ... fancy that), and I realized that there isn&#039;t enough specificity on the location of the netstat binary for it to work in cron.

So, third time&#039;s a charm...

*/30 * * * * /usr/sbin/netstat -nr &#124; grep ^default &#124; awk ‘ { print $2; } ‘ &#124; xargs ping -i 30 -n -c 59 &gt; /dev/null &amp;

Try that. Hope it works!</description>
		<content:encoded><![CDATA[<p>Whoops! I was eating my own dog food here (to make sure that what I posted actually _worked_ &#8230; fancy that), and I realized that there isn&#8217;t enough specificity on the location of the netstat binary for it to work in cron.</p>
<p>So, third time&#8217;s a charm&#8230;</p>
<p>*/30 * * * * /usr/sbin/netstat -nr | grep ^default | awk ‘ { print $2; } ‘ | xargs ping -i 30 -n -c 59 &gt; /dev/null &amp;</p>
<p>Try that. Hope it works!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-515712</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Tue, 12 Mar 2013 18:21:31 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-515712</guid>
		<description>This is a great idea, thanks for this!</description>
		<content:encoded><![CDATA[<p>This is a great idea, thanks for this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Crates</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-515687</link>
		<dc:creator>Crates</dc:creator>
		<pubDate>Tue, 12 Mar 2013 17:44:08 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-515687</guid>
		<description>Oh... here&#039;s a slightly different version that guarantees all output is redirected to /dev/null and the task executes in the background (put this in the crontab instead if you want to have this instead)...

*/30 * * * * netstat -nr &#124; grep ^default &#124; awk ‘ { print $2; } ‘ &#124; xargs ping -i 30 -n -c 59 &gt; /dev/null &amp;

... although, frankly, it doesn&#039;t matter at all, since cron will execute this task in parallel with any other tasks, and without a stdout to push output to, it essentially goes to /dev/null anyways. It&#039;s more for the obsessive-compulsive types.</description>
		<content:encoded><![CDATA[<p>Oh&#8230; here&#8217;s a slightly different version that guarantees all output is redirected to /dev/null and the task executes in the background (put this in the crontab instead if you want to have this instead)&#8230;</p>
<p>*/30 * * * * netstat -nr | grep ^default | awk ‘ { print $2; } ‘ | xargs ping -i 30 -n -c 59 &gt; /dev/null &amp;</p>
<p>&#8230; although, frankly, it doesn&#8217;t matter at all, since cron will execute this task in parallel with any other tasks, and without a stdout to push output to, it essentially goes to /dev/null anyways. It&#8217;s more for the obsessive-compulsive types.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Crates</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-515684</link>
		<dc:creator>Crates</dc:creator>
		<pubDate>Tue, 12 Mar 2013 17:40:15 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-515684</guid>
		<description>Here&#039;s the thing about your script above, William... it doesn&#039;t take into account the very nature of WiFi, which is such that a user may move from one environment to another at will.

Instead, I&#039;d recommend the user to execute &quot;crontab -e&quot; to edit their crontab file, and add the following:

*/30 * * * * netstat -nr &#124; grep ^default &#124; awk &#039; { print $2; } &#039; &#124; xargs ping -i 30 -n -c 59


This will automagically determine every 30 minutes what your gateway is, and only send pings to that address. If the gateway changes (and you haven&#039;t lost connectivity in the last 30 minutes), you will start pinging the new one. If you DO lose connectivity, but re-establish it later, this still works.

I noticed someone else put a similar comment about crontab above, but this one takes into account a key point from your post: hitting the closest node (the gateway) to not waste bandwidth.

Anyways, thanks for a great post.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s the thing about your script above, William&#8230; it doesn&#8217;t take into account the very nature of WiFi, which is such that a user may move from one environment to another at will.</p>
<p>Instead, I&#8217;d recommend the user to execute &#8220;crontab -e&#8221; to edit their crontab file, and add the following:</p>
<p>*/30 * * * * netstat -nr | grep ^default | awk &#8216; { print $2; } &#8216; | xargs ping -i 30 -n -c 59</p>
<p>This will automagically determine every 30 minutes what your gateway is, and only send pings to that address. If the gateway changes (and you haven&#8217;t lost connectivity in the last 30 minutes), you will start pinging the new one. If you DO lose connectivity, but re-establish it later, this still works.</p>
<p>I noticed someone else put a similar comment about crontab above, but this one takes into account a key point from your post: hitting the closest node (the gateway) to not waste bandwidth.</p>
<p>Anyways, thanks for a great post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robert</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-504617</link>
		<dc:creator>robert</dc:creator>
		<pubDate>Thu, 28 Feb 2013 10:39:36 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-504617</guid>
		<description>Hi, i dont reallz know a lot about this things, but after doing all the steps but the bash keeps sendin pings. 
It says: 
ping: sendto: Host is down
request timeout for icmp_seq 70

the number increases as it keeps sending ping. 

Is this normal?</description>
		<content:encoded><![CDATA[<p>Hi, i dont reallz know a lot about this things, but after doing all the steps but the bash keeps sendin pings.<br />
It says:<br />
ping: sendto: Host is down<br />
request timeout for icmp_seq 70</p>
<p>the number increases as it keeps sending ping. </p>
<p>Is this normal?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-432392</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Sun, 30 Sep 2012 11:18:05 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-432392</guid>
		<description>When i execute keepalive appear the following msg

/sbin/ping: /sbin/ping: cannot execute binary file
[1]+  Exit 126  

and it not work

what can i do?</description>
		<content:encoded><![CDATA[<p>When i execute keepalive appear the following msg</p>
<p>/sbin/ping: /sbin/ping: cannot execute binary file<br />
[1]+  Exit 126  </p>
<p>and it not work</p>
<p>what can i do?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ali</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-421919</link>
		<dc:creator>ali</dc:creator>
		<pubDate>Wed, 29 Aug 2012 18:18:03 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-421919</guid>
		<description>I try clean install but it does not help .</description>
		<content:encoded><![CDATA[<p>I try clean install but it does not help .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anney</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-389335</link>
		<dc:creator>Anney</dc:creator>
		<pubDate>Fri, 18 May 2012 13:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-389335</guid>
		<description>Unfortunately, it didn&#039;t work for me.
It showed &#039;Request timeout for icmp_seq 16&#039; and just reconnected anyway.
Can anyone tell me what that means?</description>
		<content:encoded><![CDATA[<p>Unfortunately, it didn&#8217;t work for me.<br />
It showed &#8216;Request timeout for icmp_seq 16&#8242; and just reconnected anyway.<br />
Can anyone tell me what that means?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sncery</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-348930</link>
		<dc:creator>sncery</dc:creator>
		<pubDate>Fri, 02 Mar 2012 23:38:59 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-348930</guid>
		<description>use screen

screen [command]

then to resume

screen -r pid</description>
		<content:encoded><![CDATA[<p>use screen</p>
<p>screen [command]</p>
<p>then to resume</p>
<p>screen -r pid</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-348927</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Fri, 02 Mar 2012 23:11:25 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-348927</guid>
		<description>So, how do you &quot;keep it running&quot;? Can you close Terminal and still have it running in the background or does Terminal have to stay open the whole time?</description>
		<content:encoded><![CDATA[<p>So, how do you &#8220;keep it running&#8221;? Can you close Terminal and still have it running in the background or does Terminal have to stay open the whole time?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-335220</link>
		<dc:creator>Ray</dc:creator>
		<pubDate>Mon, 13 Feb 2012 19:53:39 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-335220</guid>
		<description>No this one did not work, but thanks and I am glad it worked for you</description>
		<content:encoded><![CDATA[<p>No this one did not work, but thanks and I am glad it worked for you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-335219</link>
		<dc:creator>Ray</dc:creator>
		<pubDate>Mon, 13 Feb 2012 19:51:48 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-335219</guid>
		<description>This is just a disgrace from Apple, all these people running around trying to help each other ...come on APPLE sort it, even the latest fix is not working</description>
		<content:encoded><![CDATA[<p>This is just a disgrace from Apple, all these people running around trying to help each other &#8230;come on APPLE sort it, even the latest fix is not working</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zek</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-327282</link>
		<dc:creator>zek</dc:creator>
		<pubDate>Tue, 31 Jan 2012 15:07:29 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-327282</guid>
		<description>Thanks for the idea... I&#039;m trying it out now and hope it works. 

However, I do think it&#039;s possible to consider that it&#039;s a software issue. 

I have bootcamp and 2 routers. while connected on lion to either router, both drops for no apparent reason after awhile. Regardless if i&#039;m playing an online game or simply not online. can tell because my dropbox stops syncing. 

However when i reboot into windows. No problems whatsoever. 

Hope this feedback helps whoever in developing a solution.</description>
		<content:encoded><![CDATA[<p>Thanks for the idea&#8230; I&#8217;m trying it out now and hope it works. </p>
<p>However, I do think it&#8217;s possible to consider that it&#8217;s a software issue. </p>
<p>I have bootcamp and 2 routers. while connected on lion to either router, both drops for no apparent reason after awhile. Regardless if i&#8217;m playing an online game or simply not online. can tell because my dropbox stops syncing. </p>
<p>However when i reboot into windows. No problems whatsoever. </p>
<p>Hope this feedback helps whoever in developing a solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grant Wray</title>
		<link>http://osxdaily.com/2011/08/08/mac-wi-fi-dropping-use-a-simple-keepalive-bash-script-to-maintain-wireless-connection/#comment-319588</link>
		<dc:creator>Grant Wray</dc:creator>
		<pubDate>Fri, 20 Jan 2012 16:14:27 +0000</pubDate>
		<guid isPermaLink="false">http://osxdaily.com/?p=19939#comment-319588</guid>
		<description>Slightly different take on the same issue.
I have two MacMinis on which I intend to run a single, auto-running on auto-login, App in a headless (no screen, no keyboard) mode.
When these machines (10.7.2) startup, they connect to the wireless network fine, and will stay connected for hours (I turned sleep etc. off).
If the wireless router freezes or power cycles or the WiFi is blocked in some way, then the MacMinis will NOT auto-join the network when it becomes available again. Even running a keep-alive script, the network must be rejoined manually by e.g. selecting it from the drop-down list.
I consider it a fault in the routing protocol. Instead of &quot;Network traffic - let&#039;s find a route. Auto-join known network. Route packet.&quot; it&#039;s doing &quot;Network traffic - let&#039;s find a route. No known route. Drop packet.&quot;

I&#039;ve done a quick and dirty Automator script that hits the network list every 30 seconds, but that is really a inelegant solution. Apple Tech just told me it&#039;s &quot;not a supported scenario&quot;, but I reckon that for people with weak signals, that&#039;ll be why they are getting network outage.</description>
		<content:encoded><![CDATA[<p>Slightly different take on the same issue.<br />
I have two MacMinis on which I intend to run a single, auto-running on auto-login, App in a headless (no screen, no keyboard) mode.<br />
When these machines (10.7.2) startup, they connect to the wireless network fine, and will stay connected for hours (I turned sleep etc. off).<br />
If the wireless router freezes or power cycles or the WiFi is blocked in some way, then the MacMinis will NOT auto-join the network when it becomes available again. Even running a keep-alive script, the network must be rejoined manually by e.g. selecting it from the drop-down list.<br />
I consider it a fault in the routing protocol. Instead of &#8220;Network traffic &#8211; let&#8217;s find a route. Auto-join known network. Route packet.&#8221; it&#8217;s doing &#8220;Network traffic &#8211; let&#8217;s find a route. No known route. Drop packet.&#8221;</p>
<p>I&#8217;ve done a quick and dirty Automator script that hits the network list every 30 seconds, but that is really a inelegant solution. Apple Tech just told me it&#8217;s &#8220;not a supported scenario&#8221;, but I reckon that for people with weak signals, that&#8217;ll be why they are getting network outage.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 1/3 queries in 0.003 seconds using disk: basic
Object Caching 344/344 objects using disk: basic
Content Delivery Network via cdn.osxdaily.com

Served from: osxdaily.com @ 2013-05-23 14:45:09 -->