SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: Raspberry Pi As a Wireless Access Point/Router

Wed Aug 15, 2012 12:49 am

lol. Thats what I get for using a suspect PSU :P
Seems like the adapter doesnt like being powered on/ofdf multiple times a second lol.

https://docs.google.com/open?id=0B1RhPr ... klsNS1Ya28 <-- linky to the img file. should be around 500mb.

Should mention the changes I did.
RaspAP is the SSID
raspiwlan is the wpa psk
root user has been activated, password is pi
and I've stripped a whole bunch of stuff off, No X
It's not the final version, but one that I wanted to test out.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Wed Aug 15, 2012 8:52 am

simplesi wrote:Lets be clear - So you've burnt YOUR device up with YOUR code and you want US to try it out :eek:
I have one in the post, will let you know if mine survives.

It's only $6, so it is worth the risk.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Wed Aug 15, 2012 8:54 am

Dear oh dear,

Why did you activate a root account on an appliance which will be connected permanently to a network?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: Raspberry Pi As a Wireless Access Point/Router

Wed Aug 15, 2012 1:42 pm

I was still testing it, so originally I didn't intend to release it this early.
Was activated so that when I was remoted onto it from a device like my phone, it was easier.
Final build won't have it activated.
Also planning for it to have a simple WebGUI and a rasp-config type setup wizard also.
*planning* being the key word there haha
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

DarkSorrow
Posts: 1
Joined: Tue Aug 21, 2012 10:38 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Tue Aug 21, 2012 10:51 pm

Hey,

Nice article! Thanks :-)

I'm thinking of getting a Pi to set up to use as an alternative to a router to share a wired network connection. From your article, it seems simple enough to do.

However, knowing me I'd probably also want to mess around with my Pi - I'm a Windows person, so ideally I'd want to SSH into it via e.g. Cygwin, from a computer connected to the access point running on it.

This may be a stupid question, but is this possible? I couldn't gather from your articles whether it can be done by default, and I don't know enough about Linux networking to know whether, if not, setting it up would be a matter of editing a configuration file or something like that.

Taking this a step further, if I knew the IP of the WAN port, do you know if I would be able to set something up so I could access it over the internet?

Thanks again for a great article!

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: Raspberry Pi As a Wireless Access Point/Router

Wed Aug 22, 2012 1:44 am

DarkSorrow wrote:Hey,

Nice article! Thanks :-)

I'm thinking of getting a Pi to set up to use as an alternative to a router to share a wired network connection. From your article, it seems simple enough to do.

However, knowing me I'd probably also want to mess around with my Pi - I'm a Windows person, so ideally I'd want to SSH into it via e.g. Cygwin, from a computer connected to the access point running on it.

This may be a stupid question, but is this possible? I couldn't gather from your articles whether it can be done by default, and I don't know enough about Linux networking to know whether, if not, setting it up would be a matter of editing a configuration file or something like that.

Taking this a step further, if I knew the IP of the WAN port, do you know if I would be able to set something up so I could access it over the internet?

Thanks again for a great article!
Thanks for reading :)

You can still SSH into the Pi when it's acting as an access point. Depending on whether you set it up as a router or a bridge, the IP of the Pi may change when you activate the bridge, however you can ssh into the new IP address all the same.

By default, if SSH is on before the router/bridge is setup, it stays active after. You will just need to connect to the new IP address if you are bridging the Ethernet and WiFi.

If you knew the IP address of your internet connection do you mean ? How will the network be setup if you use the PI as a router ?

Internet -> Modem -> PI as router -> Network ?
In that case, yes you can.


Internet -> Modem/Router -> Pi as router ?
You will need to do some port forwarding in this case.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

victagayun
Posts: 129
Joined: Sun Apr 15, 2012 4:01 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Thu Sep 06, 2012 8:38 am

hello SirLagz,
is there anyway this can be done thru gui? i'm coming from windows.
can this be done using wicd or any other network gui?
thanks in advance..

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: Raspberry Pi As a Wireless Access Point/Router

Thu Sep 06, 2012 1:23 pm

Possibly. I'm not sure though, sorry.
I'll have a look for you though.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

victagayun
Posts: 129
Joined: Sun Apr 15, 2012 4:01 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Thu Sep 06, 2012 1:50 pm

SirLagz wrote:Possibly. I'm not sure though, sorry.
I'll have a look for you though.
hello SirLagz,
if u just have spare time. i think this would also be helpful to others..
thanks a lot!

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: Raspberry Pi As a Wireless Access Point/Router

Fri Sep 07, 2012 1:09 am

At the moment my Pi is out of commission, the SD card broke the socket, so this will have to wait for a little while until I can either fix the socket or get another Pi. Sorry guys !
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

victagayun
Posts: 129
Joined: Sun Apr 15, 2012 4:01 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Fri Sep 07, 2012 7:32 am

SirLagz wrote:At the moment my Pi is out of commission, the SD card broke the socket, so this will have to wait for a little while until I can either fix the socket or get another Pi. Sorry guys !
possible to use vm or qemu just to test?

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Fri Sep 07, 2012 7:58 am

victagayun wrote:hello SirLagz,
is there anyway this can be done thru gui? i'm coming from windows.
can this be done using wicd or any other network gui?
thanks in advance..
It is not clear what you are looking for.

The image referred to in the post from SirLagz on 15 August will turn your Raspberry Pi into a WiFi Access Point. It just sits under your stairs or in your attic with no keyboard or monitor connected. It behaves just like any other WiFi Access Point.

What would you expect the GUI to do?

recantha
Posts: 209
Joined: Mon Jun 25, 2012 10:41 am

Re: Raspberry Pi As a Wireless Access Point/Router

Fri Sep 07, 2012 8:05 am

I think he means a gui to set it up.
My Raspberry Pi blog with all my latest projects and links to articles
http://raspberrypipod.blogspot.com. +++ Current project: PiPodTricorder - lots of sensors, lots of mini-displays, breadboarding, bit of programming.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: Raspberry Pi As a Wireless Access Point/Router

Fri Sep 07, 2012 10:50 am

victagayun wrote:
SirLagz wrote:At the moment my Pi is out of commission, the SD card broke the socket, so this will have to wait for a little while until I can either fix the socket or get another Pi. Sorry guys !
possible to use vm or qemu just to test?
not to my knowledge unfortunately. The VM would have to emulate a wifi connection and I don't think it can do that.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

stevhorn5
Posts: 120
Joined: Wed Jul 04, 2012 5:47 pm
Location: Ontario, Canada

Re: Raspberry Pi As a Wireless Access Point/Router

Fri Sep 07, 2012 5:52 pm

Thanks SirLagz. Great tutorial.

I've had my laptop serving as an access point so it will be nice to replace it with the RPi.
I'm going to leave it up and running for the weekend and see if it stays connected.

I'm using the latest Raspian distro and a Linksys WUSB600N v2 wifi dongle, plugged directly into the RPi and it's running headless.

Just a couple of things I noticed working through the tutorial and trying to get this up and running:

1) Install bridge-utils BEFORE you install and configure hostapd and things will go more smoothly
2) Make sure there aren't any trailing spaces in any lines in the /etc/hostapd/hostapd.conf file. hostapd will not start if they're there. (It took me quite awhile to troubleshoot this.) I also removed all commented out lines in all the configuration files as some of them were throwing out errors.
3) If you're just using the RPi as an access point, there is no need to install and configure dnsmasq as ip addresses will come from your router's dhcp server.

It's been running smoothly for an hour now.

Again, thanks for this!

Creagan
Posts: 3
Joined: Sun Sep 23, 2012 3:08 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Sun Sep 23, 2012 3:40 pm

Did anyone get their Pi working as an access point using the Edimax EW-7811Un with RTL8188CUS?
I would like to use it to access my Pi directly from my phone, but get a "failed to initialise driver nl80211" error when I run: hostapd -B /etc/hostapd/hostapd.conf to start the thingy.

I can connect fine out of the box with the latest Rasbian (Spt 18th) to my own wireless router, but cannot get the Pi to act as one - following instructions from here:

http://sirlagz.net/2012/08/09/how-to-us ... er-part-1/

Any thoughts please?

argief
Posts: 18
Joined: Sat Aug 18, 2012 6:35 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Sun Oct 07, 2012 12:42 am

I'm using RT5370 chipset successfully with my Raspi and hostapd. On ebay you can pick them up for around 4pounds including shipping! They were SO cheap I think I may have bought to many... :D I bought twice from different suppliers, so as long as the picture looks similar it should be the same product. Ons batch came with a purple CD, the next with a green CD as in the picture.

Image

User avatar
The Judge
Posts: 4
Joined: Sun Oct 07, 2012 12:23 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Sun Oct 07, 2012 12:26 pm

I'm stuck trying to start hostapd.
my /etc/hostapd/hostapd.conf contains :

Code: Select all

interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=RasGaz
hw_mode=g
channel=2
wpa=2
wpa_psk=928519398acf811e96f5dcac68a11d6aa876140599be3dd49612e760a2aaac0e
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
beacon_int=100
auth_algs=3
wmm_enabled=1
but when I run "/etc/init.d/hostapd start" I get

Code: Select all

Starting advanced IEEE 802.11 management: hostapd failed!
if I try "hostapd /etc/hostapd/hostapd.conf" it tells me there is 1 error :

Code: Select all

Configuration file: /etc/hostapd/hostapd.conf
1 errors found in configuration file '/etc/hostapd/hostapd.conf'

but doesn't tell me what the error is.

Wireless is working ok via a belkin wireless dongle.

Any ideas ?

User avatar
The Judge
Posts: 4
Joined: Sun Oct 07, 2012 12:23 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Thu Oct 18, 2012 9:32 pm

Started again using a RT5370 dongle like the one above and it's working.

poing
Posts: 1132
Joined: Thu Mar 08, 2012 3:32 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Thu Nov 08, 2012 11:22 am

@SirLagz:

It seems the latest Raspian distro (2012-10-28) changed a few things so your tutorial doesn't work anymore. For more information look at this thread:
http://www.raspberrypi.org/phpBB3/viewt ... 36&t=19120

and especially the posts starting from here:
http://www.raspberrypi.org/phpBB3/viewt ... 25#p210791

Cheers!

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: Raspberry Pi As a Wireless Access Point/Router

Sat Nov 10, 2012 2:57 pm

Thanks for the update
I'll need to check it out on the newest versions, I haven't touched it in a while unfortunately.
I've got my Pi in it's enclosure, which doesn't currently allow enough space for me to plug my USB wifi stick in but that will be rectified soon enough.
Once I fix that up, I'll get cracking on this.

Cheers !
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

disco
Posts: 1
Joined: Mon Dec 17, 2012 11:33 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Tue Dec 18, 2012 12:03 am

Great forum post, It was a good guideline for me to get the raspberry working as an access point, unfortunately it wasn't enough, but at least for now I tracked down the problem and developed kind of a ritual to get it to work :D

My wireless dongle is an rt5370, and have it configured with a static IP in /etc/network/interfaces.

The main problem was that every freakin time I started hostapd and dnsmasq or isc-dhcp-server, I couldn't get any device to finish the connection process. The authentication works great but then when it comes to dhcp, all devices could receive an IP but enter in kind of an infinite loop of new requests, because they keep asking and asking for an IP. First I thought it was an Android problem of some sort, because in Windows it showed as connected, and in Android I could apparently see the state of the connection jump from connected -> authenticating -> requesting ip -> ... in a matter of a second. In a close look to syslog I could see that windows was acting in the same way, but was not apparent. One quick note, if I turned off wireless authentication in hostapd, this "bug" seemed to go away, but WPA2 was a must.

After tons of experiments I came with this ritual to get everything come up correctly and work at boot time.

In a nutshell this is my startup script saved properly as an init.d

/etc/init.d/hostapd start
/etc/init.d/hostapd stop
/etc/init.d/dnsmasq stop
ifdown wlan0
sleep 1
/etc/init.d/hostapd start
sleep 2
ifdown wlan0
sleep 1
ifup wlan0
sleep 2
/etc/init.d/dnsmasq start

My conclusions are:

1) hostapd is bringing very badly wlan0 up (ifconfig shows not IP at all assigned to wlan0).
2) hostapd needs a mon.wlan0 interface for monitoring purposes and creates one if non existent. If I try to start hostapd only once without this interface existing, I enter in that dhcp request infinite loop described before, so I start hostapd, stop it, bring wlan0 down with ifdown, and then start hostapd.

I would love to ear others thoughts on this matter. I've seen similar situations in this or other forums if I'm not mistaken, but didn't found any solution.

If anyone wants some of my configurations, please ask. I didn't post any because I think I done almost everything as other have done. I could be wrong.


MrIch
Posts: 1
Joined: Fri Dec 21, 2012 7:31 am

Re: Raspberry Pi As a Wireless Access Point/Router

Fri Dec 21, 2012 7:36 am

The working solution you linked doesn't resolve the problem that the hostapd startup procedure breaks the ifconfig settings for wlan0.

poing
Posts: 1132
Joined: Thu Mar 08, 2012 3:32 pm

Re: Raspberry Pi As a Wireless Access Point/Router

Fri Dec 21, 2012 2:16 pm

I'm not a Linux expert by any means so what you're talking about seems way over my head, but here's my output from ifconfig:

Code: Select all

 $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:0b:3b:d7
          inet addr:192.168.1.123  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1920 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1089 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:163420 (159.5 KiB)  TX bytes:252657 (246.7 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:400 (400.0 B)  TX bytes:400 (400.0 B)

mon.wlan0 Link encap:UNSPEC  HWaddr 00-0F-54-0A-B1-72-00-00-00-00-00-00-00-00-00-00
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:854 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:83488 (81.5 KiB)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:0f:54:0a:b1:72
          inet addr:192.168.42.1  Bcast:192.168.42.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:169 errors:0 dropped:0 overruns:0 frame:0
          TX packets:221 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30122 (29.4 KiB)  TX bytes:121790 (118.9 KiB)

As far as the infinite loop for dhcp goes, that vanished after commenting out "allow-hotplug wlan0" in /etc/network/interfaces which is now described as such in the linked tutorial.

That said, Im unable to get two WiFi dongles to work simultaniously, one set up normally as a client, the other as access point as in the linked tutorial. I can switch between them though, by stopping and starting hostapd; so yes I think something is fishy. See http://www.raspberrypi.org/phpBB3/viewt ... 36&t=25827

Return to “Networking and servers”