Ubuntu14.04 设置wifi热点

查了一下资料主要有两种方法:php

第一种:network manager设置

  这种方法配置比较复杂.而且不能给Android手机和iPhone共享.果断放弃(其实我是尝试过的,真的没有用).android

第二种:使用ap-hotspot,亲测可用

  这种方法配置简单,用起来也方便.git

  第一步:安装ap-hotspotweb

 

$ sudo add-apt-repository ppa:nilarimogard/webupd8

$ sudo apt-get update

$ sudo apt-get install hostapd

$ sudo apt-get install ap-hotspot

 

 

 

  第二步:配置ap-hotspotubuntu

$ sudo ap-hotspot configure
Detecting configuration...
Detected eth0 as the network interface connected to the Internet. Press ENTER if this is correct or enter the desired interface below (e.g.- eth0, ppp0 etc.):
// 回车确认

Detected wlan0 as your WiFi interface. Press ENTER if this is correct or enter the desired interface (e.g.- wlan1):
// 回车确认

Enter the desired Access Point name or press ENTER to use the default one (myhotspot):
// 输入wifi的名字

Enter the desired WPA Passphrase below or press ENTER to use the default one (qwerty0987):
// 输入wifi的密码

 

  第三步:启动wifiless

$ sudo ap-hotspot start

 

大功告成,如今能够再Android设备上查找到本身发散的wifi了this

 

另外附上几个经常使用的命令选项:spa

Usage:    ap-hotspot [argument]

    start          start wireless hotspot        // 打开wifi
    stop           stop wireless hotspot         // 中止wifi
    restart        restart wireless hotspot      // 重启wifi
    configure      configure hotspot             // 配置wifi
    debug          start with detailed messages  // dubug模式打开wifi,会显示一些详细的信息

 

之前会出现一个一直处于starting...状态的问题,可是,可是尼玛流行的修复方式出了问题了!官网脑残地将hostapd 1.0的deb包删除了,如今的2.x的包尼玛根本不能用。我下载了1.0和2.x版本编译安装仍是不行,后来仍是用的ubuntu官网的hostapd,竟然神奇地能够用了。.net

解释一下ap-hotspot和hostapd的关系把,其实ap-hostpot是依赖hostapd的,至关于ap-hostpot只是个充当客户端的角色,hostapd才是核心,所以hostapd出了问题ap-hostpot天然也用不了了。debug

太折腾了。。。。。

须要手动下载源码编译的戳这里 http://w1.fi/cgit/hostap-1/

下载2.x的deb包的戳这里:http://archive.ubuntu.com/ubuntu/pool/universe/w/wpa/ 然而这并无什么卵用。

本文参考了:

http://ubuntuhandbook.org/index.php/2014/02/wifi-hotspot-ubuntu-laptop-android/

http://blog.csdn.net/wdjhzw/article/details/39118651

相关文章
相关标签/搜索