0

I configured my RPI as a wifi repeater (using hostapd and dnsmasq). When I download something to my pi I have a downstream up to 1.5 MB/s. On my device connected to the pi the downstream is only about 500 KB/s. When I download local files from my pi, it works with up to 3 MB/s, so I think it is not an issue with my access point.

I'm using a Raspberry Pi 1 Model B with two USB to wifi adapter.

Why do I lose so much internet speed? Have I configured something wrong?

My configuration:

/etc/dhcpcd.conf

interface wlan0
static ip_address=192.168.42.1/24
nohook wpa_supplicant

/etc/dnsmasq.conf

interface=wlan0
dhcp-range=192.168.42.20,192.168.42.100,255.255.255.0,12h

Iptables (wlan0 is the AP, wlan1 connects to the internet)

iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
iptables -A FORWARD -i wlan1 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o wlan1 -j ACCEPT
  • How do you measure the download speed? Do you have constant test conditions? Maybe your device connected to the access point is limited? – Ingo Oct 24 '18 at 17:29
  • I have made an answer for the comment above by accident. I've deleted the answer. Here is the reply from @jake to it: I measure the download speed by running wget -O /dev/null http://speedtest.belwue.net/10G. I'm sure the connected device is not limited, since I can download directly from the pi or in other networks with higher speed. – Ingo Oct 24 '18 at 17:34
  • Hmm... what's left over is ip forwarding. Btw. You use wlan0 and wlan1. That's usually given to physical devices. I guess you use a RPi with an on board wifi chip and a second wifi adapter, isn't it? – Ingo Oct 24 '18 at 17:45
  • I use two wifi adapters (the Pi 1 Model B has no onboard wifi chip). Is something wrong with my iptables configuration? – jake Oct 24 '18 at 17:52
  • At first glance I would say nothing wrong. But just for a try I would omit the last two FORWARD rules. They are only restrictions to forward only wlan0 and wlan1 but not needed for the NAT. – Ingo Oct 24 '18 at 18:01
2

From your download tests there seems only one possibility to be left over. The ip forwarding between wlan0 and wlan1 could be limited. You are using a Raspberry Pi 1 model B. This is one of the first models ever. There are newer models with more performance. It has no wifi chip on board so you use two USB to wifi dongle for your wireless networks. Both adapter have to share the capacity of the USB bus. If you download for example from the RasPi itself it uses only one adapter that is connected to your internet router. It can use the whole bandwidth of the USB bus and the download speed is good. But if you download from a device connected to the access point then there are used both wifi adapter on the RasPi. They have to share the bandwidth of the USB bus. Theoretical it is just the half of the speed from a download to the RasPi. Together with other edge conditions (e.g. performance of the cpu) it may be a bit more reduced.

It seems there is no other way than to use a RasPi with more performance and an on board wifi chip. It do not use the USB bus. With one additional USB wifi dongle there is no interference between the two interfaces.

  • But what is strange, is that I have even more then 3 MB/s downstream from the pi directly. Divided by two it means I should get 1.5 MB/s not 500 KB/s. When I download something the CPU usage is about 10 % (2 % for htop). But maybe your are still right. Thanks! – jake Oct 24 '18 at 22:10
1

I solved the problem. (I couldn't really believe this to be a performance issue.)

It seems that the problem was interference between wlan0 and wlan1, although they are using different channels (1 and 6). After changing the position and orientation of the dongle providing the hotspot, the download speed on my pi and my device has become almost the same.

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.