Mac os restart network

How To: Restart Apple Mac OS X Airport Networking From the Bash Terminal

H ow do I enable and/or disable networking (AirPort) Ethernet and Wireless from the bash command Line in Apple Mac OS X? How can I restart Wi-Fi via command Line in OS X?

[donotprint]

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Terminal app
Est. reading time 2m

[/donotprint]You can use ifconfig command to to assign an address to a network interface and/or configure network interface parameters including restarting interface.

Procedure: How to restart Wifi (en0) using the terminal

  1. Open the terminal.
  2. Type the following command to shutdown en0 interface:
    sudo ifconfig en0 down
  3. Type the following command to bring it back en0 interface:
    sudo ifconfig en0 up
  4. Verify that interface is back online again:
    ifconfig -u en0

Fig.01: Enable and Disable OSX Wi-Fi

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

To restart simply type:

Say hello to networksetup command

The networksetup is a configuration tool for network settings in OS X.

Use networksetup restart (on and off) Mac OS X networking

Type the following command to turn it off en0:
networksetup -setairportpower en0 off
OR
networksetup -setairportpower «Wi-Fi» off
Type the following command to turn it on en0:
networksetup -setairportpower en0 on
OR
networksetup -setairportpower «Wi-Fi» on
Sample outputs:

Both commands have many more options. See the man page by typing the following command:
man ifconfig
man networksetup

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

Mac OS X: Быстрая перезагрузка сетевого интерфейса

Иногда случается, что система бьет себя пяткой в грудь, что все работает в штатном режиме, но интернета все равно нет. Одной из причин такого явления может стать подвисший сетевой интерфейс Mac OS X. В такой ситуации обычно советуют перезагрузить Мак. Но можно попробовать решение попроще: перезагрузить только сетевой интерфейс. Для этого в «Терминале» введите сначала команду sudo ifconfig en0 down , а потом — sudo ifconfig en0 up . Единственное важное условие: вы должны знать пароль администратора, который необходимо ввести после первой команды. На перезагрузку сетевого интерфейса нужны считанные секунды. Но если и после этого интернет все равно не заработал, обращайтесь к своему провайдеру.

P. S. Вот какие замечания в комментариях я люблю: те, которые очень толково дополняют соответствующую публикацию. Читатель Wayfinder Tm предложил более универсальный способ перезагрузки не только LAN- (en0), но WAN-интерфейса (en1), который также, при стечении обстоятельств, может подвиснуть. Чтобы перезагрузить сразу оба интерфейса, в тот же «Терминал» введите такой набор команд: for EN in ‘en0’ ‘en1’; do if [ `ifconfig $EN | grep status | awk -Fstatus: ‘’` = ‘active’ ] ; then sudo ifconfig $EN down && sudo ifconfig $EN up; fi; done. Этот небольшой сценарий учитывает, включен ли каждый из двух интерфейсов. Если какой-либо из них не включен, сценарий его и не включит, а лишь перезагрузит тот интерфейс, которым вы в данный момент пользуетесь (или оба, если ваш Мак подключен и к проводной, и беспроводной сети).

Источник

How To Reset Network Settings On Mac

This article teaches you how to reset your network settings in macOS. You may find this article very helpful, as resetting your network settings can be the first step you may try if you continually have trouble with your network connectivity.

Do you have Wi-Fi Internet connection problems on your Mac? For example, websites will not load? Facetime will not connect? Mails will not go? This may be because you’re not connected to your network. Then you may want to reset your network settings to fix these problems.

Fortunately, you can reset your network settings easily on iOS devices. For example, if you own an iPad or iPhone, you can go to Settings > General > Reset and then Reset Network Settings. Unfortunately, however, unlike iOS, for Macs we don’t have an equivalent feature to do the reset but there are workarounds, you can delete the WiFi interface, which in return remove all previous networks connected and its settings.

Method 1: Remove and add the Wi-Fi interface

Erase the Wi-Fi interface, please make sure that Wi-Fi is selected on the sidebar. Once done, click the minus (-) sign just below the left corner of network preferences to remove it. Once you remove the interface, you can then create a new one to add your WiFi network. After you remove it, click + then on the Interface dropdown, select Wi-Fi then click Create. Once done, click Apply. Here is how:

Follow the steps below to remove and re-add and the Wi-Fi connection:

  1. Go to Apple menu > System Preferences > Network
  2. Select Wi-Fi and click minus (-) button to remove. And click Apply.
  3. No add the Wi-Fi interface by clicking the plus (+) sign. Select Wi-Fi as Interface and click Create.Then Click Apply and exit Settings.

Method 2: Wipe all Wi-Fi Settings

You can also remove all your Wi-Fi settings. So that you can start fresh. This involves deleting all preference plist files associated with wireless settings in macOS. Here is how:

  1. Turn off Wifi by clicking the Turn Wi-Fi Off in the menu bar.
  2. Go to Finder and click Go and Go To Folder… (or press Command+Shift+G)
  3. Enter the following and click Go
  4. /Library/Preferences/SystemConfiguration/
  5. This will open a window and select the following files:
    • com.apple.airport.preferences.plist
    • com.apple.network.identification.plist
    • com.apple.wifi.message-tracer.plist
    • NetworkInterfaces.plist
    • preferences.plist
  6. Copy these files to the desktop for a backup (you can restore them later by placing these folder back here again) and then delete (move them to the Trash) them from this folder. Make sure that they are no longer in the SystemConfiguration folder.
  7. Empty the Trash. Do not worry. Your Mac will recreate all new preference files for wireless networking.
  8. Reboot your Mac by going to Apple menu > Restart
  9. Turn on Wi-Fi

Serhat Kurt

Dr. Serhat Kurt worked as a Senior Technology Director. He holds a doctoral degree (or doctorate) from the University of Illinois at Urbana / Champaign and a master’s degree from Purdue University. Here is his LinkedIn profile.

Thank you for choosing to leave a comment.

Please note the following:

  • All comments are moderated.
  • Your email will NOT be published nor shared.
  • All SPAM comments will be deleted.
  • Please see our comment policy page for more info.

25 thoughts on “How To Reset Network Settings On Mac”

Method 2 worked for me like a charm. Glad I found your article.
Thank you so much for sharing this information.

Method 1 – Remove and Add WiFi

2015 MBP 15” – Thank you!

method 2 worked for my 2017 MacBook Air
Thank you!

It worked(method 2) thank you!!

Thank you, method 2 worked for my 2010 MacBook Pro.

Wow! I’d tried everything I could find on the Web to fix this issue and this article is the only one I found that mentioned deleting/reinstalling WiFi (method 1).
That did the trick.
Thank you!

Источник

Mac startup key combinations

Learn about the Mac features and tools that you can access by holding down one or more keys during startup.

On a Mac with Apple silicon

Turn on your Mac with Apple silicon and continue to press and hold the power button until you see the startup options window. From there you can start up from a different disk, start up in safe mode, use macOS Recovery, and more. Learn more about these options, including macOS Recovery.

On an Intel-based Mac

To use any of these key combinations, press and hold the keys immediately after pressing the power button to turn on your Mac, or after your Mac begins to restart. Keep holding until the described behavior occurs.

  • Command (⌘)-R: Start up from the built-in macOS Recovery system. Or use Option-Command-R or Shift-Option-Command-R to start up from macOS Recovery over the internet. macOS Recovery installs different versions of macOS, depending on the key combination you use. If your Mac is using a firmware password, you’re prompted to enter the password.
  • Option (⌥) or Alt: Start up to Startup Manager, which allows you to choose other available startup disks or volumes. If your Mac is using a firmware password, you’re prompted to enter the password.
  • Option-Command-P-R:Reset NVRAM or PRAM. If your Mac is using a firmware password, it ignores this key combination or starts up from macOS Recovery.
  • Shift (⇧): Start up in safe mode. Disabled when using a firmware password.
  • D: Start up to the Apple Diagnostics utility. Or use Option-D to start up to this utility over the internet. Disabled when using a firmware password.
  • N: Start up from a NetBoot server, if your Mac supports network startup volumes. To use the default boot image on the server, press and hold Option-N instead. Disabled when using a firmware password.
  • Command-S: Start up in single-user mode. Disabled in macOS Mojave or later, or when using a firmware password.
  • T: Start up in target disk mode. Disabled when using a firmware password.
  • Command-V: Start up in verbose mode. Disabled when using a firmware password.
  • Eject (⏏) or F12 or mouse button or trackpad button: Eject removable media, such as an optical disc. Disabled when using a firmware password.

If a key combination doesn’t work at startup, one of these solutions might help:

  • Press and hold all keys in the combination together, not one at a time.
  • Shut down your Mac. Then press the power button to turn on your Mac. Then press and hold the keys as your Mac starts up. You might need to wait a few seconds before pressing the keys, to give your Mac more time to recognize the keyboard as it starts up. Some keyboards have a light that flashes briefly at startup, indicating that the keyboard is recognized and ready for use.
  • If you’re using a wireless keyboard, plug it into your Mac, if possible. Or use your built-in keyboard or a wired keyboard. If you’re using a keyboard made for a PC, such as a keyboard with a Windows logo, try a keyboard made for Mac.
  • If you’re using Boot Camp to start up from Microsoft Windows, set Startup Disk preferences to start up from macOS instead. Then shut down or restart and try again.

Источник

Перезагрузка компьютеров с помощью Терминала на Mac

Чтобы перезагрузить компьютер немедленно или в определенное время с помощью приложения «Терминал», используйте команду shutdown или systemsetup . В следующих примерах показано несколько способов использования этих команд. Полная информация о них приведена на man-странице команды shutdown и man-странице команды systemsetup.

Совет. Можно легко перезагрузить Mac, выбрав меню «Apple»

> «Перезагрузить», или выключить компьютер, выбрав меню «Apple» > «Выключить». См. раздел Выход из системы, переход в режим сна, перезагрузка и выключение Mac.

Перезагрузка локального компьютера

В приложении «Терминал» на Mac введите следующую команду:

Немедленная перезагрузка удаленного компьютера

В приложении «Терминал» на Mac введите следующие команды:

Вместо admin укажите короткое имя учетной записи пользователя на удаленном компьютере.

Вместо computer укажите IP-адрес или имя хоста удаленного компьютера.

Перезагрузка удаленного компьютера в определенное время

В приложении «Терминал» на Mac введите следующие команды:

Вместо admin укажите короткое имя учетной записи пользователя на удаленном компьютере.

Вместо computer укажите IP-адрес или имя хоста удаленного компьютера.

Вместо hhmm укажите время перезагрузки удаленного компьютера (в формате ччмм).

Автоматическая перезагрузка при сбое питания

В приложении «Терминал» на Mac введите следующую команду:

Вместо seconds укажите количество секунд, по прошествии которых компьютер должен загружаться после сбоя питания. Значение должно быть равно 0 (нуль) или быть кратно 30.

Примечание. Можно также задать настройки энергосбережения, чтобы компьютер Mac автоматически перезагружался после сбоя питания.

Источник

Читайте также:  Перенос папки windows old
Оцените статью