A wireless hotspot enables a computer to serve as a router over Wi-Fi. Ubuntu lets you easily create a wireless hotspot by using the Network Manager, but it uses an ad hoc network and most Android and Windows Phone devices can't connect to such networks.
For this reason, I've created (
in collaboration with
Satya
) a script called
AP-Hotspot
that
automatically creates an infrastructure (Access Point mode) wireless hotspot in Ubuntu that should work with Android and Windows Phone devices
. The script uses
hostapd
and
dnsmasq
and it requires Access Point mode support for your wireless card - AP-Hotspot checks for this automatically and won't run if your wireless card doesn't support it.
So far, we've tested it in Ubuntu 13.04 with a Dell Inspiron 1545 (Wireless Card: Broadcom Corporation: BCM4312 802.11b/g LP-PHY) and a Dell XPS L702X (Wireless: Intel Centrino Wireless-N 1030) and the Android devices we've used have successfully connected to the Wi-Fi hotspot, unlike using the Ubuntu built-in hotspot feature.
Because this depends on the hardware you're using, it isn't something easy to test and it may not work for everybody but hopefully it will work for most configurations
.
AP-Hotspot is based on
THESE
instructions (which by the way, you can use if you don't want to use our script), however, using the script should be a lot easier to set up an Access Point mode wireless hotspot because it automatically checks if all the requirements are met: the wireless card supports AP mode, if the WiFi is turned on but not connected to any network (without this, the hotspot doesn't work) and so on. Also, the script tries to configure everything automatically so in most cases, the configuration should take just a few seconds.
Another script feature is that it displays notifications: when the hotspot becomes active and when a device connects or disconnects from the hotspot.
Install AP-Hotspot in Ubuntu
AP-Hotspot is available in the main WebUpd8 PPA (note: there are some other packages in the main WebUpd8 PPA which you can see
HERE
) for Ubuntu 13.10, 13.04, 12.10 and 12.04, however, because this can't be tested in VirtualBox, it has only been tested on Ubuntu 13.04 and 13.10. The script requires Hostapd 1.0 which is available by default in Ubuntu 12.10, 13.04 and 13.10 - for Ubuntu 12.04, you can use a
PPA
to install Hostapd 1.0.
That said, let's proceed with installing AP-Hotspot:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install ap-hotspot
If you're not using Ubuntu or don't want to add the main WebUpd8 PPA, you can get the script from
HERE
(but it has only been tested in Ubuntu). If you're not using the deb, make sure you also install the following packages, required by the script:
hostapd
,
dnsmasq
and
iw
.
Usage
To start AP-Hotspot, use the following command:
sudo ap-hotspot start
The first time you run the script, it tries to automatically detect which network interface is connected to the Internet, the wireless network interface and so on, however, if the detection doesn't work correctly, you can enter these manually:
Then, you'll have to enter the desired hotspot Access Point name and password:
If later on you want to run the configuration again, use the following command:
sudo ap-hotspot configure
To stop the wireless hotspot, use:
sudo ap-hotspot stop
Or, if you want to restart it, use:
sudo ap-hotspot restart
To see all the supported commands, simply type the following in a terminal:
ap-hotspot
来源:
http://www.webupd8.org/2013/06/how-to-set-up-wireless-hotspot-access.html
更多:
http://askubuntu.com/questions/180733/how-to-setup-a-wi-fi-hotspot-access-point-mode