Macbook Wifi 在喚醒後很慢才恢復連線

Published on:
Tags: wifi

人家常說寂寞會死,現代人的孤單已經不僅是一種狀態,而是一種疾病。聖誕節剛過,接下來就是 2017 跨年了,如果寂寥的你珍愛的 Macbook Pro 蓋上電腦休眠一段時間喚醒後 Wifi 還超級慢才能連上線 ... 那活著就太辛苦了。

沒關係,德不孤,必有鄰!危機就是轉機,你看到這篇文章,就表示接下來的一年會隨著你 Wifi 終於通暢而順風順水,新年快樂。

前言

我的 MBP 平均從休眠中恢復之後,要花個好一陣子才會自動連上本來已經連上的 Wifi 熱點。這是件很奇怪的事情,因為本來不會這樣的。我的情況是:

MBP 從休眠中恢復之後,需要花至少 10 多秒到半分鐘的時間重新連上 Wifi 熱點;而連上熱點之後還要再等待一段時間,網路才真的連上線。

照慣例先講一下我的環境:

  • MacBook Pro 13' 2015 年初版
  • MacOS 10.11.6
  • 藍牙開啟
  • 有安裝 Tunnelblick
  • 有使用 VPN

如果你跟我一樣有這毛病而且不想重慣,你可以試試看以下幾個步驟。

1. 重設 Tunnelblick

看到這篇:mac mavericks after sleep: every time wi-fi see... | Communities
之後,才發現原來兇手可能就是 Tunnelblick

來看看解答描述:

On your Mac, with your OpenVPN and Tunnelblick setup, if a VPN is connected when your computer goes to sleep, OpenVPN leaves the network messed up and can't recover when your computer wakes up.
 
There are several things that can cause this, but fixing it may be as simple as putting a check in Tunnelblick's "Reset the primary interface after disconnecting" checkbox, which is on Tunnelblick's "Advanced" settings page. If that doesn't solve the problem, there are some other  things to try; for those please use the Tunnelblick Discussion Group as I described earlier.
 
There are three things you should know:
Tunnelblick is a user interface for OpenVPN, which is a separate program (which is included inside Tunnelblick). It is OpenVPN that actually creates the VPN.
OpenVPN runs by itself (without Tunnelblick) when you restart a computer and a configuration is set to connect "when computer starts".
Tunnelblick launches when you log in only if it was running when you logged out (or shut down or restarted your computer).
 
It is extremely common for people to not know about or fully understand #3. Because you have brought this to my attention, I may change that behavior so that Tunnelblick also launches when you log in if OpenVPN is running, which I think would be more natural and easily understood by Tunnelblick users. So thank you for bringing this up by providing such a detailed explanation of the problem.

大意就是雖然 Tunnelblick 是 OpenVPN 的客戶端,但是 Tunnelblick 與 OpenVPN 兩者其實是平行執行的。而在 VPN 處於連線的情況下將電腦休眠,OpenVPN 的某種機制會使 Mac 的網路卡狀態不能正確休眠 --- 所以喚醒後網路卡會不能正確連線。

不過這是有辦法解決的,Tunnelblick 提供了相關設定,具體操作如下圖:

2. 更改系統設定

我從找了好多個參考來源,例如 Bugs & Fixes: Slow Wi-Fi reconnect after MacBook wakes up 這篇就整理得滿仔細的,還包含了作者思路,但提供的解決辦法都有點半調子。

沒辦法,不管了,老子就是不想重灌。

2.1 開啟 PowerNap

這招滿爛的,但理論上有效 --- Wifi 睡了不醒是嗎?那就別睡啦!不過我沒有這麼設定。

2.2 關閉 Wifi 喚醒

這招是從 Slow wifi after sleep 看到的,下面有人回報確實有效。我也這麼做了。

2.3 關閉藍芽

這招是從某篇 Stockflow 看來的。原理我也不曉得,不過我這樣做了。

結論

大概還需要幾天來驗證是否真的是 Tunnelblick 與 OpenVPN 造成的。

我照著設定之後似乎是有比較正常一些,不過今天沒什麼機會讓電腦休眠後喚醒來測量時間,所以我也不能完全肯定這些是 work-arond 還是真的解決了問題。

不過,要是有任何幫到你、或是害到你的地方,歡迎都留言告訴我。

Refs

Comments

comments powered by Disqus