1

I've 2 wifi adapters and I'm searching to find a valid method to create a hotspot connecting it to my wlan0 interface That is connected to the internet via wifi. I've found some tutorials/articles but does not work or they speak about only one Wifi adapter. For example i've found this https://github.com/DrRowland/pifi2wifi

INTERNET <-- wlan0 (internet connection) --> MACHINE <-- wlan1 (hotspot) --> OTHER DEVICES

How i can do this? Sorry in advance for my bad english :)

2

I have done this with 2 USB nano wifi adapters. The first challenge is making sure one of the wifi adapters supports "master" mode which is necessary to configure it as a hotspot. Try sudo iwconfig wlanX mode master on each one. If one of them supports master mode (no error), you're in business. If not, there's no sense continuing until you have one that does.

There are 3 steps involved:

  1. Configure one of your wifi interfaces as a hotspot. You do this with hostapd.
  2. Configure the other wifi interface to connect to your Internet connection - presumably some sort of existing network.
  3. Configure routing or bridging to pass the traffic between the wifi interfaces. From what you're describing, you probably want routing with Network Address Translation (NAT) to allow your wifi devices connecting to the RPi to share its IP address for Internet access.

Dave Conroy has a nice howto, including links to a version of hostapd modified for the Edimax nano wifi adapter that I use for creating hostspots. His tutorial uses bridged mode, which is suitable for a simple repeater, but you'll want to replace the bridging configuration with a routed+NAT configuration.

None of these steps are particularly hard, but there is one major consideration. The throughput of the cheap wifi adapters is dismal. I found that none of the 3 I tried (Edimax, TP-Link and generic) would provide more than 45-56 Mbps on a full desktop system, despite claims of 802.11n support. In a bridged or routed configuration, I was never able to get more than 10 Mbps of throughput on my 60 Mbps Internet connection. Local tests using iperf confirmed this. Testing with 2 bridged USB3 1 Gbps (wired) Ethernet showed that the RPi can handle over 100 Mbps throughout, so the problem is the wifi adapters. Performance is mediocre at best.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.