You are not logged in.

#1 2012-04-22 14:30:09

Duke of Straylight
Member
Registered: 2012-04-22
Posts: 1

Sharing internet connection over WLAN: some sites OK, most fail

I am sharing my internet connection over WLAN. Both the connection between the gateway and the internet, and the internal machine and the gateway, work perfectly, and I can do things like ping google from the internal computer and it'll work perfectly. However, most other connections (I've basically only tested HTTP) fail at some point, in various different ways. For instance, from playing around with wget, trying to wget wikipedia.org gets me the headers (at least enough of them to show the document length) but stalls after that. wget speedtest.net downloads eithre 860 or 979 bytes, then stalls for a few seconds, then says "Connection reset by peer" and retries, wget of a lot of other sites just stalls directly after sending the HTTP request.

Because of the variability of the failures I'm basically completely stumped as to where to even start looking. I do know that I get more or less the same failures whether I'm on Linux or on Windows on the internal computer, so I'll assume whatever's going wrong is going wrong on the gateway. Here's my setup in more detail:

The gateway connects to the internet by getting an address in a 10.0.0.0/8 by DHCP (the default ethernet-dhcp in netcfg) and doing PPPoE over that. This connection works perfectly as far as I can tell.

The gateway has wlan0's IP address manually set to 192.168.0.1, with this controller according to lspci:

03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)

I'm running hostapd with this configuration file:

interface=wlan0
driver=nl80211
ssid=Terminal Dogma
hw_mode=g
channel=3

macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=aahfuckit
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

I tried to get DHCP using dnsmasq to work, but haven't figured out what I'm doing wrong with it yet. Instead, I'm just using assigning the IP address statically on the internal machine (to 192.168.0.2). This connection as configured so works perfectly as well, as far as I can tell. I can pingflood one computer from the other with no packet loss, transfer stuff over ssh, etc..

On the gateway, I've enabled IPv4 forwarding and NAT:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

And, as stated, I can do things like ping google.com (and in fact use Google search - the results page is one of the things that works) perfectly, but not properly connect to most things I tried. I've looked through everything in iptables and the above rule is the only one in it. I've rebooted the internal host into Windows to find out that the error is on the gateway. I've looked at the traffic on wlan0 with wireshark but can't make heads or tails of it, other than that the internal host seems to occasionally sends packets that wireshark calls duplicate ACKs, and occasionally packets from external hosts get tagged as "TCP Previous segment lost" by it. Anyone have any idea what to look into next?

Offline

Board footer

Powered by FluxBB