Solved

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

Posted on 2011-10-01
4
991 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
can't find the executable in Simulator 1 77
Auto-rotate google map 1 56
prezi for presentation 2 44
Migrate Application To New Mac 5 29
If you other experts are anything like me you are always looking into and testing out new features. While I was doing some research one day I ran across an app that I installed on my Mac and used as a security system. Mac OS X: SecureHome uses your …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

930 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now