Difference between revisions of "Set up a wifi hotspot"

From Organic Design wiki
m (See also)
m (Dependencies)
Line 7: Line 7:
  
  
Then download the ''create_ap'' script from [https://bbs.archlinux.org/viewtopic.php?pid=1269258 here] (local copy [http://svn.organicdesign.co.nz/filedetails.php?repname=tools&path=%2Fcreate_ap here]) and save into a path location such as ''/usr/bin''. Make sure it has executable permission.
+
Then download the ''create_ap'' script from [https://bbs.archlinux.org/viewtopic.php?pid=1269258 here] (we also have a local copy [http://svn.organicdesign.co.nz/filedetails.php?repname=tools&path=%2Fcreate_ap here] in case that link is down or changes for any reason) and save into a path location such as ''/usr/bin''. Make sure it has executable permission.
  
 
== Running the script ==
 
== Running the script ==

Revision as of 16:26, 27 July 2013

Procedure.svg Set up a wifi hotspot
Organic Design procedure

Sometimes it can be very useful to use a computer with wifi capability as an access point. A typical scenario is when only one computer can connect to the net for example if it were via a USB cellular connection, or if there were only a single cable connection and no hub available. This procedure allows the connected computer to use its wifi card to work as an access point that other systems can then connect to as usual. This procedure is designed for Debian based systems, but should work for any GNU/Linux system that has a reasonably modern wifi card in it.

Dependencies

First we need to install a couple of small packages that the script uses.

<bash>apt-get install hostapd dnsmasq</bash>


Then download the create_ap script from here (we also have a local copy here in case that link is down or changes for any reason) and save into a path location such as /usr/bin. Make sure it has executable permission.

Running the script

To run it open a root terminal and then simply call the script with your network interface names (use ifconfig to find these, the first is you wifi interface and the second your network interface) and SSID and a password. All the other default settings should be fine. It will provide an IP address via DHCP to connecting clients in the 192.168.12.x range and route them to your network interface. The ampersand on the end makes it run in the background so you can close the terminal afterwards. You need to stop the dnsmasq daemon first as the script calls dnsmasq directly instead.

<bash>

/etc/init.d/dnsmasq stop create_ap wlan0 eth0 OurHotspot OurSecretPassword & </bash>


You may also want to prevent dnsmasq from starting automatically at all then do the following:

<bash>update-rc.d -f dnsmasq remove</bash>

See also