Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SOLVED:easiest way to turn linux pc into a wlan access point
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gw
Apprentice
Apprentice


Joined: 03 Dec 2006
Posts: 215

PostPosted: Fri Apr 15, 2011 3:36 pm    Post subject: SOLVED:easiest way to turn linux pc into a wlan access point Reply with quote

Hi,

I'm looking for an easy way to share my wired desktop network link via wlan, no user management or whatever is necessary, there will be just one single client. So a minimalist solution would fit me best. How can I set up my linux pc to act as a wlan access point, which software and what kind of hardware do I need? Is there something like a wlan stick that works over usb?

Thanks

gw


Last edited by gw on Sat Apr 23, 2011 3:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Fri Apr 15, 2011 3:49 pm    Post subject: Reply with quote

A friend of mine recently turned his server into an access point - so yes it is doable.

but this only works with certain types of wlan chips (e.g the atheros family).
dlink dwa140 or 160 seems a good starting point, but they ain't cheap.

V.
_________________
read the portage output!
If my answer is too concise, ask for an explanation.
Back to top
View user's profile Send private message
gw
Apprentice
Apprentice


Joined: 03 Dec 2006
Posts: 215

PostPosted: Sat Apr 16, 2011 7:48 am    Post subject: Reply with quote

Veldrin wrote:
A friend of mine recently turned his server into an access point - so yes it is doable.

but this only works with certain types of wlan chips (e.g the atheros family).
dlink dwa140 or 160 seems a good starting point, but they ain't cheap.

V.

Thanks! Is this the device you meant:http://www.amazon.de/D-Link-DWA-160-Wireless-N-Dualband-USB-Stick/dp/B001HN3H2M
Does it really have the access point functionality, because from description it would seem it serves only to link a computer to an already existing wireless network, -- whereas I was looking for something to quickly set up a wireless network.

Thanks

gw
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2152
Location: Berlin, Germany

PostPosted: Sat Apr 16, 2011 8:19 am    Post subject: Reply with quote

http://linuxwireless.org/en/users/Drivers
has a list of drivers which support AP mode
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Sun Apr 17, 2011 11:25 am    Post subject: Reply with quote

@chithanh: thanks for the link...

This confirm my initial suggestion. DLink DWA 160 does support hostapd which is the second piece needed to build your own AP.
And I runs with the madwifi drivers, which is another good thing.

V.
_________________
read the portage output!
If my answer is too concise, ask for an explanation.
Back to top
View user's profile Send private message
gw
Apprentice
Apprentice


Joined: 03 Dec 2006
Posts: 215

PostPosted: Mon Apr 18, 2011 2:36 pm    Post subject: Reply with quote

chithanh wrote:
http://linuxwireless.org/en/users/Drivers
has a list of drivers which support AP mode


Thanks for the link and thanks also to Veldrin!
Looking at these tables gives a rather bleak image for my purpose though: if you select AP mode in the table and then look at those drivers that operate on the USB bus, not many remain! The most ominous absence unfortunately is Ralink rt2800usb, which seems to be the chipset built into most of the newer wlan usb sticks, but especially is unclear with regard to its feature set under linux:http://linuxwireless.org/en/users/Drivers/rt2800usb
This chipset is also in the B revision of DLink DWA 160; its A revision on the other hand seems to have another chipset, but, according to amazon feedback, has abysmal net performance.
Other drivers in the matrix that do support AP mode AND work on the USB bus mostly point to really old and crappy devices, that don't even have WAP2 encryption. An exception seems to be http://linuxwireless.org/en/users/Drivers/carl9170 but I don't know exactly what to make out of it, as for example FRITZ!WLAN USB sticks are said to be and not to be supported at the same time!
Anyway, supposed I can get a working device like eg the DLink DWA 160, -- is there any documentation on how to set it up in AP mode? what would be the principal steps to do so?

Thanks again

gw
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Mon Apr 18, 2011 4:05 pm    Post subject: Reply with quote

gw wrote:

Anyway, supposed I can get a working device like eg the DLink DWA 160, -- is there any documentation on how to set it up in AP mode? what would be the principal steps to do so?

Thanks again

gw
It should be easy if you use networkmanager. I think the "Create new wireless network" option in nm-applet should allow you to use your card in AP mode. For this you also need the USE flag connection-sharing enabled.

If you want to do it the hard way, it has to be some variant of the gentoo home router guide that takes in broadcasting over wireless (and WEP, WPA, etc) into account.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
gw
Apprentice
Apprentice


Joined: 03 Dec 2006
Posts: 215

PostPosted: Sat Apr 23, 2011 3:50 pm    Post subject: Reply with quote

ppurka wrote:
It should be easy if you use networkmanager. I think the "Create new wireless network" option in nm-applet should allow you to use your card in AP mode. For this you also need the USE flag connection-sharing enabled.

If you want to do it the hard way, it has to be some variant of the gentoo home router guide that takes in broadcasting over wireless (and WEP, WPA, etc) into account.

Thanks! I tried first with networkmanager, but that did so massively tinker with config files in /etc that I unmerged immediately.
What did work though was the following:

  • my device is a d-link dwa-160 hardware rev A2. That means that it has an atheros chipset, not the newer ralink ones; windows people normally complain that it has bad 802.11n performance, but I don't care for my purpose
  • the kernel driver for this is carl9170 (not the legacy ar9170usb!), enable in kernel and recompile
  • best general info is http://www.linuxwireless.org/en/users/Documentation/hostapd and http://www.linuxwireless.org/en/users/Drivers/carl9170
  • I then basically followed http://exain.wordpress.com/2011/03/31/making-a-wifi-hotspot-access-point-using-linux-wifi-lan-cardusb-adapter (1); there is also gentoo specific documentation: http://www.gentoo-wiki.info/Wireless/libnl_Access_Point (2) but unfortunately much older and sloppily written
  • I used documentation (1) for nearly everything (especially their dhcp setup), the gentoo wiki (2) only for the startup parts at the end of the wiki (iptables and ip-forwarding); I also used the /etc/conf.d/net related instructions in (2)
  • in /etc/conf.d/dhcpd I also added: DHCPD_IFACE="wlan0"
  • So here's the process: 1) recompile kernel with appropriate driver support (carl9170 in my case). --- 2) reboot. --- 3) insert wlan stick. --- 4) interface wlan0 is created. --- 5) net.wlan0 is started with the settings in /etc/conf.d/net (which basically gives wlan0 an ip address). --- 6) start /etc/init.d/dhcpd (I configured a subnet in /etc/dhcp/dhcpd.conf following (1)). 7) activate ip-forwarding and define iptables rule according to (2). --- 8) start hostapd: hostapd -dd /etc/hostapd/hostapd.conf, again configured after (1). wlan clients can connect to the stick, and their traffic is forwarded to my eth0 interface


So that's it. Feel free to ask, if you need to know further details of my setup.
Briefly: with the d-link dwa160 rev A2 and the driver carl9170 it is relatively straightforward to set up your machine as an access point!

gw
Back to top
View user's profile Send private message
javeree
Guru
Guru


Joined: 29 Jan 2006
Posts: 417

PostPosted: Tue Apr 26, 2011 12:31 pm    Post subject: Reply with quote

A few days ago, I had a question about almost exactly the same setup (which worked with baselayout, but not with baselayout2). As my setup fails at your step 5. Would you care for sharing your conf.d/net setup ?

Edit: you can ignore my request, sonce I just solved my issue: https://forums.gentoo.org/viewtopic-t-874739-highlight-.html
Back to top
View user's profile Send private message
gw
Apprentice
Apprentice


Joined: 03 Dec 2006
Posts: 215

PostPosted: Wed Apr 27, 2011 11:28 am    Post subject: Reply with quote

javeree wrote:
A few days ago, I had a question about almost exactly the same setup (which worked with baselayout, but not with baselayout2). As my setup fails at your step 5. Would you care for sharing your conf.d/net setup ?

Edit: you can ignore my request, sonce I just solved my issue: https://forums.gentoo.org/viewtopic-t-874739-highlight-.html

Just for the record: what solved the problem for you, is exactly what I have:
Code:
modules_wlan="!iwconfig !wpa_supplicant"

gw
Back to top
View user's profile Send private message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 653
Location: San Diego, CA

PostPosted: Fri Aug 19, 2011 7:38 pm    Post subject: Reply with quote

gw:

Is your hostapd configured with WPA? If so, would it be possible for you to share "/etc/hostapd/hostapd.conf" file (with sensitive info blocked, of course)?

I have pretty much the same setup, except that it works only if I don't enable WPA. It does look like the devices are talking to each other, but the client is not getting an IP. Once I disable WPA, everything works.
__
sol
Back to top
View user's profile Send private message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 653
Location: San Diego, CA

PostPosted: Sat Aug 20, 2011 7:43 am    Post subject: Reply with quote

Just to keep everyone informed, I think my case has more to do with the WiFi adapter's driver than the configuration, because when I used the exactly same "/etc/hostapd/hostapd.conf" and "/etc/dnsmasq.conf" on a different machine that has an Atheros chipset adapter, it worked flawlessly. In fact, I verified it on two different interfaces.

Code:
06:00.0 Ethernet controller: Atheros Communications Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)

02:00.0 Ethernet controller: Atheros Communications Inc. AR5001 Wireless Network Adapter (rev 01)


Anyhow, if anyone knows how to make WPA work with the following device, please share. Thank you.

Code:
Bus 001 Device 003: ID 18e8:6238 Qcom
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x18e8 Qcom
  idProduct          0x6238
  bcdDevice            0.01
  iManufacturer           1 Ralink
  iProduct                2 802.11 bg WLAN
  iSerial                 0
  bNumConfigurations      1

__
sol


Last edited by solamour on Sat Aug 20, 2011 11:12 am; edited 1 time in total
Back to top
View user's profile Send private message
jippy
n00b
n00b


Joined: 20 Aug 2011
Posts: 1

PostPosted: Sat Aug 20, 2011 10:19 am    Post subject: Reply with quote

Nice. Will try this
_________________
GNU for life
Back to top
View user's profile Send private message
solamour
l33t
l33t


Joined: 21 Dec 2004
Posts: 653
Location: San Diego, CA

PostPosted: Thu Aug 25, 2011 9:25 pm    Post subject: Reply with quote

As for the "non-working WPA" case (i.e. hostapd and dnsmasq work perfectly as long as WPA is not enabled), I think the firmware update did the trick. As soon as I updated the firmware, WPA started working.

Code:
# emerge -ptv linux-firmware

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild   R   ] sys-kernel/linux-firmware-20110604  USE="-savedconfig" 0 kB


Kernel configuration:
Code:
Device Drivers
   Network device support (NETDEVICES)
      Wireless LAN (WLAN)
         Ralink driver support (RT2X00)
            Ralink rt2501/rt73 (USB) support (RT73USB)


USB WiFi interface:
Code:
# lsusb | grep 18e8
Bus 001 Device 003: ID 18e8:6238 Qcom

__
sol
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum