-
All replies
-
Helpful answers
-
Mar 11, 2016 12:36 AM in response to mikengrayby kadiwhitsken,mikengray wrote:
I definitely think this is a Mavericks issue. My iMac running Mavericks is the ONLY system in the house that drops the network randomly while all other systems never lose the network. No idea how to resolve this, but here is the workaround I'm posting:
I've had the 'network drop' issue with my Airport Extreme for the last 2 months. It reconnects when I pull the ethernet cable and plug it back in. I've tried downgrading the AE firmware, resetting to factory, etc. Nothing worked. I finally threw in the towel and created a script that monitors my network connectivity and restarts my interface if it senses it has dropped:
##############
#!/bin/ksh
while true
do
yup=`ping -c1 -t2 www.google.com|grep from`
if [[ -n $yup ]]
then echo "Internet is connected!"
else
ifconfig en0 down; ifconfig en0 up
echo "Down at `date +%m%d%Y%H%M%S`">>./dropped.out
fi
sleep 5
clear
done
###############
I know its a workaround, but its saving me the headache of constantly pulling my cable and putting it back in!
Good luck!
-Mike Gray
Macbook Pro mid 2015 Yosemite. Virgin Media Super Hub 2 here in the UK.
mikengray's solution is the only thing that worked for me. I modified the script as 'ifconfig up/down' required root privilages so this uses the 'networksetup' command. This script seems to do a decent job at reconnecting after sleeping the laptop. Now I don't have to right-click disconnect/reconnect the WIFI every 5 minutes. Also this script keeps a log in the home folder of all the dropouts. Looking at the log for yesterday there are over 100 dropouts throughout the day.
Put this in a textfile 'keepalive-script' in your home folder and 'sudo chmod +x ~/keepalive-script' it in the terminal to make it executable on double-click. I moved mine to the desktop and run it when I log in, leaving it on in the corner of the screen...
#! /bin/bash
# Adapted from mikengray https://discussions.apple.com/message/24226685#24226685
# Needs root permissions for ifconfig down/up so using method from
# http://www.cyberciti.biz/faq/howto-restart-airport-wireless-from-bash-command-li ne-in-macosx/
while true
do
yup=`ping -c1 -t1 -n 8.8.8.8|grep round-trip` # Relatively hacky way to check
# connection. Pings Google DNS.
# Greps for a line with
# 'round-trip', fills yup
# variable if found.
if [[ -n $yup ]]
then echo "wifi" # We have a connection.
sleep 1 # Wait before trying again.
else
echo "DOWN at `date +%Y%m%d-%H%M-%S`" # No connection! Log the time.
echo "DOWN at `date +%Y%m%d-%H%M-%S`">>~/wifi_dropouts.log
networksetup -setairportpower en0 off # Switch network off.
networksetup -setairportpower en0 on # Switch network on.
sleep 4 # Wait to give time to connect.
fi
done