Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Linux 桌面分享 WiFi 熱點給 Android 手機(ap-hotspot 實測可行)

編輯:Linux 系統常見問題解答

適用環境

  • Ubuntu 14.04+ / Deepin / Linux Mint 等衍生版
  • 無線網卡支援 AP 模式(大多數 Intel、Atheros 晶片支援)
  • 有線網路連網,無線網卡釋出熱點

安裝步驟

1. 移除衝突的 hostapd(如有)

sudo apt-get remove hostapd

2. 安裝支援 AP 模式的 hostapd 修正版

下載預編譯 deb(來自社群修正版):

wget https://pan.baidu.com/s/1kT0xWmN  # 連結可能失效,建議自行搜尋 "hostapd ap-hotspot deb"
sudo dpkg -i hostapd_*.deb
sudo apt-mark hold hostapd  # 防止更新覆蓋

3. 安裝依賴與 ap-hotspot

sudo apt-get install libnotify-bin
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install ap-hotspot

4. 設定熱點參數

sudo ap-hotspot configure
# 依提示輸入:
#   SSID (熱點名稱)
#   密碼 (至少 8 碼)
#   選擇有線介面 (如 eth0) 作為網際網路來源
#   選擇無線介面 (如 wlan0) 作為熱點介面

5. 啟動/停止熱點

sudo ap-hotspot start   # 啟動,顯示 "Wireless Hotspot active"
sudo ap-hotspot stop    # 停止

驗證

Android 手機搜尋 WiFi,連線輸入密碼,即可上網。

常見問題

  • 啟動失敗 "Your wireless card does not support AP mode":換支援 AP 的網卡,或改用 create_ap 腳本(GitHub 開源專案,相容性更好)。
  • 網速慢:受限於無線晶片同時處理 STA+AP 模式效能,建議 5GHz 頻段網卡。
  • 系統升級後失效:執行 sudo apt-mark hold hostapd 鎖定版本。

替代方案:create_ap(推薦)

git clone https://github.com/oblique/create_ap
cd create_ap
sudo make install
# 直接啟動
sudo create_ap wlan0 eth0 MyHotspot PassWord123

create_ap 內建處理 hostapd、dnsmasq、iptables NAT,無需 PPA,跨發行版相容性極佳。

結語

ap-hotspot 曾是 Ubuntu 熱點首選,現建議改用 create_ap 或 NetworkManager 內建熱點(GNOME 控制中心 → Wi-Fi → 開啟熱點),更穩定、免裝額外套件。

Copyright © Windows教程網 All Rights Reserved