Aug 092012
 

** Quick Tip For The QuickLinks **
If you want a wifi router, ignore Part 2, and go from this part straight to Part 3. Need internet access ? Part 2 or 3 is the go depending on your need :)
QuickLinks:
Part 2 – How to make your RPi into a Wireless Access Point
Part 3 – How to make your RPi into a Router

Also if you are using a RTL8188CUS based device check this forum thread
** Update – 2012-11-10 **
Looks like the newest version of the Raspbian distro adds an extra line to /etc/network/interfaces which needs to be removed or commented out.
The line is wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Thanks to hunternet93

I recently bought a Wifi dongle for my Raspberry Pi – A Ralink RT5370.
While I was poking around, I noticed that the USB dongle could act as an Access Point.
I haven’t tried with any others, but the way I found out about mine is by using the iw utility.
Running iw list spat out a list of abilities.
This was a part of the list
Supported interface modes:
* IBSS
* managed
* AP
* AP/VLAN
* WDS
* monitor
* mesh point

So I decided to try it out.
I installed hostapd so that I could run an access point off the Raspberry Pi.
apt-get install hostapd

After I installed hostapd, I had to modify a few files before hostapd would run.

Before I go modifying the files though, I need to give my WiFi adapter a static IP address.
In /etc/network/ there is a file called interfaces. This file contains the details for the network adapters.
I have the lines below in order to set a static IP address.

iface wlan0 inet static
address 10.0.0.1
netmask 255.255.255.0

Now, we need to edit some files.
First up, I had to modify /etc/default/hostapd. The DAEMON_CONF variable was not configured, so I pointed it to a configuration file that I was about to create.
DAEMON_CONF="/etc/hostapd/hostapd.conf"

After that, I created the configuration file in the location specified.
In the configuration file, I specified the following parameters

# First we configure the interface we'll be listening on
interface=wlan0 # The interface to listen on
driver=nl80211
# The driver that is being used by the WiFi adapter, this could be different for everyone
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0 # These 2 are just parameters so that the hostap daemon runs.


# Now onto the important WiFi configuration
ssid=RaspAP
# First up, the SSID or Network name. This is what other devices will see when they try to connect.
hw_mode=g
# I'm setting this to Wireless G mode. A, B, and G are available here.
channel=8
# This is setting the channel that the WiFi is on, valid channels are from 1-11, or 1-14 depending on location.

# Wifi Security Settings
wpa=2 # This sets the security settings to WPA2
wpa_psk=928519398acf811e96f5dcac68a11d6aa876140599be3dd49612e760a2aaac0e
# The line above sets the wpa passphrase to "raspiwlan", this is obtained via the wpa_passphrase command.
# However, you can also set a passphrase like the line below.
#wpa_passphrase=raspiwlan

wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
# I've set these to WPA-PSK to indicate that we are using a Pre-Shared Key with CCMP encryption.
# Otherwise, hostapd also has a built in RADIUS server that we can use for authentcation
# But I'll leave that to another post.

# Other settings
beacon_int=100 # This sets how often the WiFi will send a beacon out.
auth_algs=3
wmm_enabled=1

** Note ** You may need to strip out all the comments when you save your configuration file as hostapd does not have consistent comment handling.

With the above configuration file saved, I downloaded dnsmasq in order to give my Raspberry Pi the ability to and out IP addresses to clients that connected to the RaspAP.
apt-get install dnsmasq

For now, we’ll only do a base configuration of dnsmasq, just enough for it to hand out IP addresses so we can test out our new RasAP.

interface=wlan0 # To get dnsmasq to listen only on wlan0.
dhcp-range=10.0.0.2,10.0.0.5,255.255.255.0,12h # This sets the available range from 10.0.0.2 to 10.0.0.5
# It also sets the subnet mask to 255.255.255.0 and specifies a lease time of 12 hours.

After the configuration file has been created in /etc/dnsmasq.conf, start up hostapd and restart dnsmasq.
You should now be able to see the WiFi network “RaspAP” and be able to connect to it and get an IP address.

In the next post, we will turn the Raspberry Pi into a bridge so that it can act as a wireless access point.


If you have found this post useful, please consider donating by pressing on the button below. Donating will help keep this site up and running :)




TwitterFacebookGoogle+LinkedInRedditDeliciousDiggShare

  117 Responses to “How To : Use The Raspberry Pi As A Wireless Access Point/Router Part 1”

  1. Still waiting for my USB Wifi adaptor to arrive – but this looks like a great little guide. Will let you know how it goes!

    • Thanks :)
      Feel free to ask for help if needed :)
      I’m uploading a “Instant RaspAP Wifi Bridge” image online now to make it easier for people as well so if you wanted that I’ll make a post about it when it’s up :)

      • Where is this image on your site?

        • Unfortunately my Pi died before I could properly get the image going. I will be creating a new one based on the recent Pi developments in the coming months. In the meantime, if you use the Raspbian foundation image and follow the steps, it should be pretty easy to setup.

          Feel free to contact me if you have questions :)

          • I’ve followed the instructions to the letter. The only part I am not clear on is the “driver=” part of the equation. I have a Realtek RTL8188CUS. Where do I find name of the driver to populate on (driver=?) ?

          • Did you run iw list to see if your adapter is capable of running hostapd ?

          • I did and yes iw list revelad under supported interface modes:
            *AP
            *AP/VLAN

          • In that case, you should be able to use nl80211 for the driver parameter :)

  2. I got this “semi” working… after the initial setup following the tutorial. I got i working. the AP was detected and I was able to connect a device and got an IP. however, when I rebooted everything worked. except the devices I tired to connect could not get an ip.

  3. How can I set this to automatically start when I turn the PI on?

    • You can add it into a startup script to turn it on, or add it into a script in /etc/network/if-up.d so it only turns on if the networking on the Pi goes up. Otherwise it won’t turn the AP on.

  4. i have a rt2800usb dongle connected to the pi.

    this dongle supports the master mode and i want to use it as an accesspoint.
    but it failed to start hostapd and failed to set the master mode.

    does the rt2800usb driver support the master mode ?

    in windows it works as accesspoint.

    • Theoretically it should work in Linux if it works in windows. what does iw list show ?
      what’s the error message that hostapd spits out ?

      • first, thank you for your fast reply.

        hostapd says FAIL/failed at start. i tried -v(vvvvv) but nothing appears.
        iw list dont work ! command not found

        now i have pwnpi 2.0 on the card but it is the same. i tried rt2800usb and ath9k_htc.

        alfa ubdo-n and tl wn-422g.

        • have you checked the syslog or anything for any error messages ?
          install iw and make sure AP mode is there, just in case.

          I’m not too familiar with those USB sticks as I don’t have one so I’m doing a best guess here lol.

  5. So working with a D-Link DWA-131. Driver is r8712u. When I run iw wlan0 I get a message of nl80211 not found.

    So I changed the Driver to r8712u in the hostapd.conf file. But it appears the system is trying the other. Where do I change that instance of the driver variable?

    • AFAIK in the hostapd.conf file is the only place, but check the command line parameters for a driver one. also check WPA_supplicant to see what drivee that is running in case you need a different one for now.

      Edit – After having a quick look online, looks like the D-Link DWA-131 does not support AP mode…
      If someone donates one to me I can find out for sure though :D

    • You cannot use just any driver you would like with hostapd… hostapd currently only supports 7 drivers (hostap/wired/madwifi/test/none/nl80211/bsd). Of which, really only 1 is usefull… nl80211. It’s not as bad as it may look, because the nl80211 driver is just an interface layer and works with the majority of cards. To check if your wifi dongle is supported by nl80211, run the following command:

      lsmod | grep mac80211

      If you get two lines of output, your in business… If you get no output, chances are very slim that your specific adapter will work with hostapd.

      Notes: The above command assumes you have a working wifi dongle. If your wifi dongle has not been configured, chances are that the drivers have not yet been loaded. Therefore, start by trying to use your wifi dongle as a client, and confirm you can connect to a AP.

      • Thanks for all that extra information.

        Correct me if I’m wrong, from what I understand, the iw command makes use of nl80211, so if the iw command doesn’t work, it’s a safe bet that hostapd won’t either.

        • That seems right based on the kernel.org page for iw. The page further states that nl80211 supports almost ALL network cards. In my experience, it can be a bit of a mission to get your drivers going for wireless cards. This is mainly because they use proprietary firmware. Because the firmware is proprietary, it does not get shipped with any linux distribution because that would violate copyright. Firmware is usually a single file that must be placed in /lib/firmware, and can be obtained from the manufacturer’s website. The second common problem I have found why nl80211 does not work with some wifi cards, is when the user tries to compile the driver from source. This is called a “stagging” driver, and will have “sta” in the driver name. (example: linux driver rt2800, stagging driver rt2870sta) When you compile the driver from source, you have to enable support for nl80211 in the make config file. However this method is prone to failure, mainly because it is dependent on a specific kernel (headers) version, and nl80211 (also cfg80211) version. Definitely not the recommend path unless you are very well versed with linux. Just try and stick to the linux drivers for your card. With the appropriate updated firmware, it should work perfectly.

          (Side note: I guess technically it would be more correct to refer to “modules” and not drivers, these two terms are used to indicate the same concept in the linux community depending on the level of experience of the audience.)

  6. I have an Alfa AWUS036EH with a rtl8781 chipset. iw list says:
    *IBSS
    *managed
    *AP
    *AP/VLAN
    *mesh point
    *P2P-client
    *P2P-GO

    Haven’t finished your tut though, I’ll report back later.

  7. I have to the best of my abilities duplicated your set up and it doesn’t send an SSID using the USB dongle RT5370. I configured DAEMON_CONF=”/etc/hostapd/hostapd.conf”. I am not sure what to do at this point to figure out what I have not done correctly. I’m a basic Linux user.

    hostapd:
    interface=wlan0
    driver=nl80211
    ctrl_interface=/var/run/hostapd
    ctrl_interface_group=0
    ssid=RaspAP
    hw_mode=g
    channel=10
    wpa=2
    wpa_psk=928519398acf811e96f5dcac68a11d6aa876140599be3dd49612e760a2aaac0e
    wpa_passphrase=raspiwlan
    wpa_key_mgmt=WPA-PSK
    wpa_pairwise=CCMP
    rsn_pairwise=CCMP
    beacon_int=100
    auth_algs=3
    wmm_enabled=1

    dnsmasq.conf
    interface=wlan0
    dhcp-range=10.0.0.2,10.0.0.5,255.255.255.0,12h

    • You may need to restart hostapd if you haven’t already using the /etc/init.d/hostapd restart command

      Also. Your config should have either WPA_passphrase or WPA_psk but not.both.

  8. I figured it out. hostapd was not starting

  9. I’ve seen a new shield to add Wifi to our Raspi. Have you heard about that? http://www.cooking-hacks.com/index.php/documentation/tutorials/wifi-module-for-raspberry-pi-roving-rn-xvee

  10. [...] a wireless bridge, taking in Internet from a WiFi dongle and sending it back out via a serial port. Here’s a great guide for enabling PPPD on the Raspi, and giving just about anything with a serial port an Internet [...]

  11. Thanks for your guide!
    I have an issue where dnsmasq intermittently spews out a ‘warning’ that ‘wlan0′ ‘does not currently exist’, wlan0 does exist. I can’t work out why this is happening (I have dnsmasq starting in rc.local and wlan0 is up at the time), have you come across this/do you have any idea what might be happening? I only want an ‘ad-hoc’ network really (no bridging) but I can’t use ad-hoc mode because android fails to recognise it.Perhaps I need something different?
    Many thanks.

    • I haven’t come across that before unfortunately. When that happens, if you restart dnsmasq, does it work ?

      • Thanks for your reply. Sadly not. I thought I was having some success forcing wlan0 down and back up again before starting dnsmasq and hostapd but when I added this to my startup script I still had issue.
        I do sort-of suspect the wireless card might not getting enough power, but I have a hub that is ‘verified’ to work with the rPi and I don’t see anything in the log to suggest that power issues. I don’t really need dns forwarding so perhaps I’ll try dhcpd when I next get the chance.

  12. I ran into some issues figuring out which driver my card uses. If you do “sudo apt-get install lshw” and then “lshw -C network”, it will display your driver info under the “configuration” section.

  13. Hi !

    First, great article. But I still have questions.

    Have you tried to connect several device to the RPi ? So if you did, how much ?

    I ask because I can’t find what’s the maximum of connexion, and what it’s depending on : the RPi, the dongle, both ?

    My point is to make an offline node.js server on witch I could connect 20 wi-fi device. You think it’s possible and rather easy ?

    And, sorry for my low level in english … french guy inside ;)

    • Hi thanks for reading !

      I only tried with a phone and a laptop together, so only 2 devices.
      If there is any limit, it would be from the USB wifi adapter.

      I think making an offline node.js server would be a piece of cake. Assuming that the Dongle works properly of course.

  14. [...] How To : Use The Raspberry Pi As A Wireless Access Point/Router Part 1 [...]

  15. small typo found. You have put ‘iw list’ instead of ‘iwlist’.
    Great tutorial though my dongle, a rtl8191, wont work as an access point so it off to the market for me.

  16. oops. bit of a linux newb, guess it shows. Shot my keyboard off before i did enough research. Please kill my previous post,
    sorry

  17. [...] WiFi adapter seems to turn up everywhere you Google “raspberry pi access point” (e.g. here, here, and here)- primarily because its driver actually implements the nl80211 interface public [...]

  18. Hi.
    Step by step with part one, I met one trouble.
    Using a RT3370 dongle, I made the RaspAP visible, but could not connect to it.

  19. Hi.
    According to Part one, I made the RaspAP visiable, but I could not connect it.
    The following is the output of ifconfig


    mon.wlan0 Link encap:UNSPEC HWaddr C8-3A-35-CF-97-B1-00-00-00-00-00-00-00-00-00-00
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:75227 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:21467123 (20.4 MiB) TX bytes:0 (0.0 B)

    wlan0 Link encap:Ethernet HWaddr c8:3a:35:cf:97:b1
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:706 errors:0 dropped:503 overruns:0 frame:0
    TX packets:651 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:181201 (176.9 KiB) TX bytes:186132 (181.7 KiB)

    • Are you using it as an Access Point, Router, or Bridge ?
      If you are using it as an Access Point or Router, you will need to give wlan0 a static IP address, and also run dnsmasq or udhcpd as a dhcp server to hand out IP addresses.

      • Yes! I made a mistake. There was a line in the intefaces “iface default dhcp”.
        I remove it and restart. Now wlan0 has IP andress.

        wlan0 Link encap:Ethernet HWaddr c8:3a:35:cf:97:b1
        inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
        inet6 addr: fe80::ca3a:35ff:fecf:97b1/64 Scope:Link
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
        RX packets:0 errors:0 dropped:0 overruns:0 frame:0
        TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:0 (0.0 B) TX bytes:8948 (8.7 KiB)

        But the client still could not connect it .

        • Do you have dnsmasq or udchpd running to hand out IP addresses ?
          What sort of client is it ?
          What’s the config of the dhcp server ?


  20. sudo service dnsmasq status
    [ ok ] Checking DNS forwarder and DHCP server: dnsmasq[....] (running).

    dnsmasq.conf

    server=8.8.8.8
    interface=wlan0
    dhcp-range=192.168.0.50,192.168.0.150,24h

  21. Hi.

    Do you know how many station your dongle can manage ?

    I tried this a few month ago. My Dongle was a TP-LINK TL-WN721N.
    I used the ath9k_htc driver.
    The accespoint could not handle more than 8 station.
    Finally it was explicit in the ath9k_htc driver :
    http://www.mail-archive.com/ath9k-devel@lists.ath9k.org/msg04823.html
    quote : ”
    The maximum number of stations that can be handled in
    the firmware is 8, manage the station slots accordingly.

    So there are limits but hard to find.

    So if somebody knows of a dongle that can manage more station, I would really be interrested.

  22. [...] Setup went roughly along the lines of this Raspberry Pi Access Point guide. [...]

  23. [...] This post is a copy from how-to-use-the-raspberry-pi-as-a-wireless-access-pointrouter-part-1/ [...]

  24. [...] to install the drivers and configure the WiFi network on the Pi. The RT5370 can also be used as an Acess Point/Router, follow this tutorial to know more about these advanced [...]

  25. I have replicated your setup with mostly good results. My problem is that my wlan0 doesn’t have an IP address on boot up completion. if I run ifdown wlan0 then ifup wlan0 if gets the static IP address assigned and everything works swimmingly. I tried creating a script that takes the interface down and back up but it must not run at the end. Any ideas?

    Rod

    Thanks for your documentation!!

    • Thanks for reading !

      Where did you add the script or get it to run ?
      You may be able to add it in to the /etc/init.d/hostapd file to get the hostapd startup to take down and bring back up wlan0 when hostapd starts, assuming that you are using Debian.

  26. Hi,
    thanks for this guide.
    I saw that you ask for donations. Have you considered adding flattr (http://flattr.com/) support? This has become very popular for blog donations in europe and I’d much rather use it than paypal.

  27. [...] gem, however, was the blog written by SirLagz, the maintainer of RSE, and specifically his post on how to turn your Raspberry Pi into an access point. While it’s not directly applicable to the current stage of development, once I start testing [...]

  28. I am facing some of the same problems as Flybeans: RaspAP visible, but i cannot connect. I looked over his posts, and where he got it to work, mine still will not connect. My connecting divice is an apple ipad2, and a table pc, running arch-linux.

    my hostapd.conf is the same as Jim.

    my dnsmasq.conf is:
    interface=wlan0
    dhcp-range=192.168.0.2,192.168.0.199,255.255.255.0,12h

    ifconfig displays this:

    eth0 Link encap:Ethernet HWaddr b8:27:eb:56:9e:f7
    inet addr:192.168.1.199 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:1827 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1408 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:151447 (147.8 KiB) TX bytes:262040 (255.8 KiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:8 errors:0 dropped:0 overruns:0 frame:0
    TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:1104 (1.0 KiB) TX bytes:1104 (1.0 KiB)

    mon.wlan0 Link encap:UNSPEC HWaddr F0-7D-68-F7-D8-FC-00-00-00-00-00-00-00-00-00-00
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:1721 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:450494 (439.9 KiB) TX bytes:0 (0.0 B)

    wlan0 Link encap:Ethernet HWaddr f0:7d:68:f7:d8:fc
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

  29. Rebooted and now it connected. YEY! A question, i am running an airplay server on this raspberry pi: http://trouch.com/2012/08/03/airpi-airplay-audio-with-raspberry/

    Is it possible to make it visible on the internal web i just created?

  30. [...] with SpeedBooster (model number WUSB54GSC). While working through SirLagz’s tutorial on how to turn your Raspberry Pi into an access point, I ran into a few issues. Namely, the wifi adapter that I was (attempting) to use has some driver [...]

  31. Any ideas on how to offer a BANDWIDTH-LIMITED WiFi access point to visitors. We live in New Zealand and have limited data allowances. I’d like to allow anyone to access email but not for example videos.

    My only thought is to connect the Pi using 10M ethernet and configure 80211.b but that is probably still rather too fast.

  32. Thank you for a well written tutorial! Despite that our systems seem very similar (I just bought the Pi also use an RT5370 dongle), I can only see the network but not connect to it. I uploaded some diagnostics aid at http://home.student.uu.se/chba4051/outputs.txt, if you have time to take a quick look I’d be most grateful. I have tried it a few times from scratch already, both on raspbian and raspbmc, and rebooted after I set it up. Could it be a firmware-problem? I’ve been experimenting with that too but not managed to figure out anything.

    Not only comments but trailing whitspaces in hostapd.conf also cause trouble, maybe you can add a notice about that?

    • Looks like wlan0 has no ip address. Run ifdown wlan0 && ifup wlan0 after hostapd starts and see how you go

      • Yes, that was essentially it. It took me some time though to realize that I should only follow part 1 and 3 of the tutorial, but not part 2 (since I want a router, not a bridge). It is obvious when you think of it (and know what you are doing) but maybe you could add a hint about it? Thanks again!

  33. I have had this working but now I cannot get an ip address from dnsmasq. When I attempt to connect I get authenticated but no ip is issued.

    /etc/network/interfaces
    iface wlan0 inet static
    address 10.0.0.1
    netmask 255.255.255.0

    /etc/dnsmasq.conf
    interface=wlan0
    dhcp-range=10.0.0.2,10.0.0.5,255.255.255.0,12h

    There does not seem to be much to setup for dnsmasq. Any ideas on how to investigate this would be greatly appreciated

    thanks

    • you’re using the wrong netmask – should be 255.0.0.0 for a 10.x address.

      • doesn’t have to be, though in general that’s what people use for the 10.x.x.x range.

        In my example, I’ve just restricted it to 10.0.0.x for simplicity’s sake.

  34. okay thanks for the tip..:)

  35. Iv followed these instructions but i cant seem to get my pi to broadcast an ssid….has anybody had any problems with getting the ssid to broadcast? any help would be much appreciated :)

  36. Thanks for the tutor! It’s the best I’ve found. But I’ve got an issue. Computers in one network(Rpi’s, other Linux machines, Windows) don’t ping each other(and see each other as well). I can only ping other devices from the Rpi with hostapd. Could you please give me a hint?
    Thank’s a lot for the article again!

  37. Just been following your pi wireless access point and after some problems have managed to complete parts 1 and 3.

    I did try part 2 but as soon as I put the bridge option in hostapd.conf and restarted everything and tried to connect, it kept asking me for the wifi pass phrase and kept asking me. So I moved straight to part 3 which is what I wanted originally anyway.

    Biggest problem with part1 was choosing the wifi adapter, started out with a Edimax EW-7811UN which I already new iw didn’t work on this, moved to a Widemac Ralink RT5370 which did work, but won’t work now for some reason, and then finally moved to a more reliable ALFA NETWORKS AWUS036NHA.

    The other problem here was the dropping of wlan0 every time hostapd was started which is covered in part3b.

    Part 3 went off with out a hitch and I now have a pi raspberry router that works really well, haven’t added wifi down starter script yet or anything else but hope to look at these things when I have a spare min.

    Anyway just wanted to say that these are really good how to’s and they helped a lot.

  38. I have been trying to setup my Pi as a router using the Wi-Pi dongle (Ralink RT5370) and Raspbian, but I can’t seem to get it working.

    I got to the end of Part 1 so far, but the Pi won’t broadcast an SSID. I have tried restarting the hostapd and dnsmasq services, but no luck.
    The WLAN is being assigned its static address correctly, but I can’t see the network on any other computer.

    I have tried adding this line: ignore_broadcast_ssid=0, but that doesn’t work either.

    Any suggestions?

  39. hii…
    if have to just create an hotspot and ssh wirelessly into my pi which are the tutorials should i follow…??

  40. While a Linux noob I did manage to to get my access point to work by following these and other directions. Mr. Google is great! My smart phone and iPad both see the AP and get network addresses assigned when they connect. I ended up using udhcpd instead of dnsmasq to provide DHCP.

    My end goal is to have a stand alone web server (that is not connected to the internet) that smart phones / iPads, etc can connect to. The web server would provide information to club members at meetings.

    So — I got the AP to work. The RPi is configured as a web server and I can get to web pages via the hard wire interface just fine. However, when I connect my smart phone to the AP I can’t see the web server — or anything else for that matter.

    I am thinking I need some sort of connection between the AP and the Apache web server. Maybe just a config setting? Maybe another software module?

    I am close to my end goal. I have an AP and I have a web server. I am just stuck on this last piece that connects to two.

    Any advice would be appreciated.

    • You may need to configure apache to listen on the wifi interface

    • Never mind. I was able to get things to work.

      Solved!

      SirLagz — thank for the hint but I had already configured Apache to look at both interfaces.

      The problem was I had set up the wlan0 and eth0 to the same network. One of my Google searches seemed to indicate that was the right thing to do. However after changing the wlan0 address to 192.168.2.121 (it was 192.168.1.121), leaving eth0 at 192.168.1.120 — and updating udhcpd to hand out 192.168.2.xxx addresses it all seemed to work.

      So now I can unplug the hard wire Ethernet and still SSH in via WiFi to make changes to web pages and use a web browser to go through the access point and bring up web pages.

      So cool!

      -Mike

  41. I tried working through your tutorial and I seem to be having one persisting issue when I try to run hostapd:
    nl80211: 'nl80211' generic netlink not found
    Failed to initialize driver 'nl80211'
    Segmentation fault

    I’ve done a lot of googling over the last few days to try to figure it out, and everything I’ve found turned out to be a dead end. This may go without saying, but the iw command gives me the same error. Any help you can provide would be greatly appreciated.

    Thanks for the guide and your continued help.

  42. Hi,

    does anyone know of a list of usb wlan adapters that can be recommended for AP use, which especially implies running for weeks or months unattended? Currently I’m working with a TP-Link TL-WN821N as a client to some other AP and it locks up randomly after some hours. I don’t think I’ll try using hostapd in the future with this stick. It makes no sense if I always have to run to the AP and replug the WLAN. -.-

    Thanks!

    Joachim

  43. So i followed your guide a little time ago, it all seemed to work but after a little while, in about 5 – 10 minutes the connection seemed to drop. The usb-dongle is still “sending signal” because the light is still blinking for activity. But the “RaspAP” is dropped from the menu of available wlan’s on my computer and ipad. Sometimes i can use the wifi for 30 min or more before it drops, and sometimes it doesn’t show at all. I am trying to find some kind of logfile that may explain what is happening, but i don’t know what part of the router that may be the reason for this bug. Do you have any tips on this issue?

    If you want some output from ifconfig its the same as in post 31 except in
    wlan0
    RX bytes:0 (0.0 B) TX bytes:9875 (9.6 KiB)

  44. The previous statement was wrong, here is the output:

    eth0 Link encap:Ethernet HWaddr b8:27:eb:56:9e:f7
    inet addr:192.168.1.199 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:2577 errors:0 dropped:0 overruns:0 frame:0
    TX packets:2010 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:235286 (229.7 KiB) TX bytes:1600111 (1.5 MiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    mon.wlan0 Link encap:UNSPEC HWaddr 00-0E-2E-4C-55-DB-00-00-00-00-00-00-00-00-00-00
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    wlan0 Link encap:Ethernet HWaddr 00:0e:2e:4c:55:db
    inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:9875 (9.6 KiB)

    root@raspberrypi:/home/pi# ip addr show
    1: lo: mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b8:27:eb:56:9e:f7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.199/24 brd 192.168.1.255 scope global eth0
    3: wlan0: mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:0e:2e:4c:55:db brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/24 brd 192.168.0.255 scope global wlan0
    5: mon.wlan0: mtu 1500 qdisc mq state UNKNOWN qlen 1000
    link/ieee802.11/radiotap 00:0e:2e:4c:55:db brd ff:ff:ff:ff:ff:ff

  45. [...] Inspiration to this tutorial, and thanks goes to sirlagz.net [...]

  46. [...] Raspberry Pi • View topic – 16 x 2 LCD case screen pwnieexpress/Raspberry-Pwn · GitHub How To : Use The Raspberry Pi As A Wireless Access Point/Router Part 1 » The Rantings and Ravings o… raspbian – Boot without starting X-server – Raspberry Pi Beta – Stack Exchange [...]

  47. Thanks for these instructions.

    After following all the steps as close as possible and when running hostapd I get:

    Could not read interface wlan0 flags: No such device
    Could not read interface wlan0 flags: No such device
    nl80211 driver initialization failed
    rmdir[ctrl_interface]: no such file or directory

    however, when running iwconfig, I can see the wlan0 interface…
    could you please help me?

  48. Thanks for your very informative articles. As a nebie to the RasPi and Linux, is it possible for the RasPi as a router, getting its internet from an AP to route packets to either another wifi dongle or the RJ45 port, as needed?
    Thanka

    • Glad it helped !

      Yes, the Pi can route packets whichever way you want. As long as IP tables is setup properly.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>