How To Fix WiFi Dropping Issues in OS X Lion

If you are one of the unlucky users having issues with your WiFi after upgrading to Lion, then we have a solution for you. The folks over at  OSX Daily have posted this neat little Bash Script to maintain your wireless connection. This walkthrough will show you how to create the script and it will ping your router every 5 seconds, allowing the connection to stay up and not drop.

Step 1: Get your Wireless Router IP Address.

The first thing you will need is the IP address of your router. This IP is normally or In order to get the IP, go to:

System Preferences -> Network -> Advanced -> TCP/IP

Now look for the IP Address next to Router and make a note of the number.

Step 2: Create the Keepalive Bash Script

  • Launch the Terminal (/Applications/Utilities)
  • Type the following command:


  • Paste in the following, be sure to put in your router’s IP Address here:

#! /bin/bash

ping –I 5 –n

  • Hit Control+O to save the contents of
  • Hit Control+X to exit from nano

Step 3: Run the WiFi Keepalive Bash Script

  • Back in the terminal window, we need to make the script executable. Type the following:

Chmod +x

  • Now we just need to run it. Type the following in your terminal window:

./ &

That last command will start and run the script in the background. Your WiFi dropping issues should now be resolved. This is more of a workaround, then a fix but it will keep your WiFi connection up and running. Now the last thing to figure out is if this is a bug in OSX Lion, or if some routers don’t play well with the new version of OSX. Hopefully, the next update will help take care of this issue with some computers.


David is a Systems Engineer by day and a Competitive Triathlete on the weekends. He is an avid Apple fan who also loves everything Google. He writes on everything and loves to share news with fellow techies.
  • Pingback: Download Mac OS X 10.7.1, First Lion Update by Apple | iThinkDifferent()

  • Diogo

    Finally Works!

  • Olivier

    Seems to work : Sorry for stupids questions : does i have to have the terminal run constantly after ? does i have to relaunch the script if i close the terminal ? last : how do i close the script if necessary (after update ?). thanks a lot

  • hfinto

    Could you please post a more detailed step-by-step process to create this work around