goldencircuit
Posts: 2
Joined: Thu Feb 23, 2017 6:29 pm

Need Help Troubleshooting Internet Connection Dropping Issue

Thu Feb 23, 2017 8:07 pm

Hello,

I recently set up a Pi Zero using the instructions found here: https://frillip.com/using-your-raspberr ... h-hostapd/

The only difference is that I'm using a 4 port USB hub "hat" on top of the PI zero and am using two wireless dongles instead of ethernet in and wifi out. I am using dual Edimax EW-7811UN WiFi modules.

My problem is that everything seems to be working fine for about 5-10 minutes and then the internet connectivity just stops. I can still connect to the dongle serving as the AP. The dongle that's providing internet access which is tunneled to the dongle that is serving as the AP is connected to the internet just fine and has a connection. Yet, for some reason, whatever device that is connected to the dongle serving as the AP cannot connect to the internet. For example, when i connect my phone to the AP dongle I get a message saying "Connected, No Internet". But, when I disassociate from the AP and then reconnect the internet connection works again for a short 5-10 minute amount of time. This can be done repeatedly with identical results.

I have tried the power saving fix which can sometimes plague these modules by creating a custom .config file as described viewtopic.php?f=28&t=51543 in this post. I've tried running hostapd in -dd mode but there are no significant log entries to note when the connection drops out. The log looks the same as it did when internet connection is present and when it somehow disconnects. I've even increased the logging output in the hostadp.conf file to see if that would give me something to work with to no avail. I initially thought this was somehow related to iptables so i installed iptables-persistent but this did not help. I also tried to use a completely different WiFi module from a different manufacturer. This did not help and the problem was still there with identical properties.

I would love to be able to solve this issue or get some help troubleshooting what could be causing the drop in internet connectivity because, at this point, I don't even know where else to look to try and fix this problem. Also, any and all tips, ideas, and suggestions would greatly be appreciated also.

Thanks!

My settings are as follows:

ifconfig:

Code: Select all

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:34 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:2982 (2.9 KiB)  TX bytes:2982 (2.9 KiB)

wlan0     Link encap:Ethernet  HWaddr <DELETED THIS>
          inet addr:192.168.42.1  Bcast:192.168.42.255  Mask:255.255.255.0
          inet6 addr: <DELETED THIS>/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:110460 errors:0 dropped:3862 overruns:0 frame:0
          TX packets:178093 errors:0 dropped:51 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13786406 (13.1 MiB)  TX bytes:240969777 (229.8 MiB)

wlan1     Link encap:Ethernet  HWaddr <DELETED THIS>  
          inet addr:10.0.0.214  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: <DELETED THIS>/64 Scope:Global
          inet6 addr: <DELETED THIS>/128 Scope:Global
          inet6 addr: <DELETED THIS>/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:201560 errors:0 dropped:23581 overruns:0 frame:0
          TX packets:94992 errors:0 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:273260098 (260.6 MiB)  TX bytes:12964056 (12.3 MiB)
/etc/network/interfaces

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0

iface wlan0 inet static
    address 192.168.42.1 
    netmask 255.255.255.0

allow-hotplug wlan1
iface wlan1 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    wpa-ssid "RASPBERRY"
    wpa-psk "VERYBERRY"

# forwarding
up iptables-restore < /etc/iptables.ipv4.nat 
/etc/hostapd/hostapd.conf (I commented out a few things when testing)

Code: Select all

interface=wlan0
driver=nl80211
ssid=CLIENTS-CONNECT-TO-THIS
country_code=US
hw_mode=g
channel=8
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=A-SIMPLE-PASSPHRASE
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
wpa_group_rekey=86400
ieee80211n=1
wme_enabled=1
#Enable WMM as in frillip.com post
#wmm_enabled=1
#Enable 40mhz channels with 20ns guard interval
#ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
/etc/dnsmasq.conf

Code: Select all

bogus-priv
server=8.8.8.8
interface=wlan0
listen-address=192.168.42.1
bind-interfaces
dhcp-range=192.168.42.50,192.168.42.150,12h
iptables rules

Code: Select all

sudo iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
sudo iptables -A FORWARD -i wlan1 -o wlan1 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o wlan1 -j ACCEPT

Return to “Troubleshooting”