?
Solved

Bash:  Mac OS X 10.6.8/SL:  How does Network Diagnostics fix?

Posted on 2011-10-01
4
Medium Priority
?
1,008 Views
Last Modified: 2012-05-12
I have a very easy bash Macintosh network question for you.

I'm currently in a situation where I have to unplug and replug in a Mac's ethernet cable.  (Because of some network configuration which is unrelated to this question.)

When I plug the ethernet back into the Mac, I've found that the fastest way to get the OS to respond to the new network connection is to go to:

Preferences > Network > Ethernet (n) > Assist Me > Diagnostics > Ethernet > Continue.

In which case, a dialog responds that the internet connection appears to be operating.  (And now it is.)

My question is, this is doing this very quickly and surely there must be some bash script I can write that can duplicate this simple procedure.

I can't simply do a
$ sudo ifconfig en0 up

(Macs use en0 instead of enth0 or something.)

What am I missing?  This should be a very simple thing to do.

0
Comment
Question by:coder1313514512456
  • 3
4 Comments
 
LVL 9

Accepted Solution

by:
Shaun McNicholas earned 1000 total points
ID: 36896275
try opening a terminal window and type the commands:

sudo ifconfig en0 down
sudo ifconfig en0 up

if you aren't sure what the interface is called on your system just type
ifconfig

that should display the current network interfaces available on your system.
This should help - http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/ifconfig.8.html
0
 

Author Comment

by:coder1313514512456
ID: 36896629
I'll try having it go down before going up on the next iteration.  Thanks maestropsm.

0
 

Author Comment

by:coder1313514512456
ID: 36896706
Early indications are that it seems to work like a champ.

Thanks again, don't know why I didn't think of bringing it down first.

0
 

Author Closing Comment

by:coder1313514512456
ID: 36896709
Bring the interface down before you bring it up.  Right.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
Most folks would know the basics of how Dropbox works, so that’s not the purpose of this article. Security is what it’s all about, so here I’ll share how I choose to secure my Dropbox Account and the Data it contains.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question