• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1012
  • Last Modified:

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

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.

  • 3
1 Solution
Shaun McNicholasSenior Marketing TechnologistCommented:
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

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
coder1313514512456Author Commented:
I'll try having it go down before going up on the next iteration.  Thanks maestropsm.

coder1313514512456Author Commented:
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.

coder1313514512456Author Commented:
Bring the interface down before you bring it up.  Right.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now