Page 1 of 1

[RPi 3] Wifi connected but only occasional internet

Posted: Fri Mar 10, 2017 12:02 pm
by SirJohnDoe
A couple days ago I received my Raspberry Pi 3 on which I installed Raspbian. Ethernet works well, but I'd like to use Wifi as unfortunately my university network is limited to 40 GB a month. On the university network 'eduroam' I have no data limitations.

After setting up the wpa-supplicant file with the required info I can connect just fine. However, though being connected, I often do not have internet access. Chromium reports 'Name resolution failed', but I'm pretty sure it has nothing to do with DNS as I can't even connect to IP addresses (e.g. my server).

I've tried turning off power management on the on-board wifi as this caused problems in the past for many here, but to no avail. Someone asked a similar question and got asked to post the output of a bunch of stuff, so here it is:

Internet working:

Code: Select all

pi@raspberrypi:~ $ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b8:27:eb:02:08:bf brd ff:ff:ff:ff:ff:ff
    inet6 fe80::6538:ceac:3e0a:12d7/64 scope link tentative
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:57:5d:ea brd ff:ff:ff:ff:ff:ff
    inet 10.46.151.110/17 brd 10.46.255.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::4a12:48bd:5635:feb7/64 scope link
       valid_lft forever preferred_lft forever

Code: Select all

pi@raspberrypi:~ $ ip route
default via 10.46.255.254 dev wlan0  metric 303
10.46.128.0/17 dev wlan0  proto kernel  scope link  src 10.46.151.110  metric 303

Code: Select all

pi@raspberrypi:~ $ sudo ping -c3 $(ip route | awk '/default/ {print $3})
>

Code: Select all

pi@raspberrypi:~ $ sudo ping -c3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=44 time=15.3 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=44 time=14.7 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=44 time=15.5 ms

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 14.710/15.204/15.545/0.371 ms

Code: Select all

pi@raspberrypi:~ $ sudo ping -c3 google.com
PING google.com (172.217.17.142) 56(84) bytes of data.
64 bytes from ams15s30-in-f14.1e100.net (172.217.17.142): icmp_seq=1 ttl=54 time=9.89 ms
64 bytes from ams15s30-in-f14.1e100.net (172.217.17.142): icmp_seq=2 ttl=54 time=11.1 ms
64 bytes from ams15s30-in-f14.1e100.net (172.217.17.142): icmp_seq=3 ttl=54 time=11.8 ms

--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 9.896/10.968/11.891/0.830 ms

Code: Select all

pi@raspberrypi:~ $ cat /etc/resolv.conf
# Generated by resolvconf
domain *****************
nameserver 134.58.126.3
nameserver 134.58.127.1
I will post the same output once it stops working once again. Here are my WPA supplicant and interfaces files, in case that sheds any light:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=BE

network={
  ssid="eduroam"
  key_mgmt=WPA-EAP
  pairwise=CCMP
  group=CCMP TKIP
  eap=PEAP
  ca_cert="/home/pi/.cat_installer/ca.pem"
  identity="****"
  domain_suffix_match="****"
  phase2="auth=MSCHAPV2"
  password="****"
  scan_ssid=1
}

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

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
    pre-up wpa_supplicant -B -Dwext -i wlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
    post-up /home/pi/tunnel
    post-down killall -q wpa_supplicant
I changed 'iface wlan0 inet dhcp' to 'iface wlan0 inet manual' later on, but the result is the same. The tunnel file refers to a reverse ssh tunnel I use to SSH into my RPi from outside the network (and also inside as I can't connect to other internal IP's).

I'm also not sure if this matters, but I noticed that sometimes 'hostname -I' shows one IP address, and sometimes two. Now it's working it shows one, but it also worked before with two, so not entirely sure what that means.

Code: Select all

pi@raspberrypi:~ $ hostname -I
10.46.151.110
Here are the results of iwconfig, ifconfig and 'route -n':

Code: Select all

pi@raspberrypi:~ $ iwconfig
wlan0     IEEE 802.11bgn  ESSID:"eduroam"
          Mode:Managed  Frequency:2.462 GHz  Access Point: 5C:83:8F:F2:F3:C0
          Bit Rate=72.2 Mb/s   Tx-Power=31 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=61/70  Signal level=-49 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:59  Invalid misc:0   Missed beacon:0

lo        no wireless extensions.

eth0      no wireless extensions.

Code: Select all

pi@raspberrypi:~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:02:08:bf
          inet6 addr: fe80::6538:ceac:3e0a:12d7/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

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:9860 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9860 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:1192125 (1.1 MiB)  TX bytes:1192125 (1.1 MiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:57:5d:ea
          inet addr:10.46.151.110  Bcast:10.46.255.255  Mask:255.255.128.0
          inet6 addr: fe80::4a12:48bd:5635:feb7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:33462 errors:0 dropped:5571 overruns:0 frame:0
          TX packets:4076 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4645220 (4.4 MiB)  TX bytes:985611 (962.5 KiB)

Code: Select all

pi@raspberrypi:~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.46.255.254   0.0.0.0         UG    303    0        0 wlan0
10.46.128.0     0.0.0.0         255.255.128.0   U     303    0        0 wlan0
I read somewhere that it could be that the gateway is not working properly, but although sometimes there are three entries (usually the first one twice), there is no consistency between working/not working.

Any help would be much appreciated!

Re: [RPi 3] Wifi connected but only occasional internet

Posted: Sat Mar 11, 2017 10:20 am
by DougieLawson
Apart from mucking up the ping -c3 $(ip route | awk '/default/ {print $3}') command [you dropped an apost] everything you've posted shows a normal working, fully configured network

Re: [RPi 3] Wifi connected but only occasional internet

Posted: Sat Mar 11, 2017 12:54 pm
by Ernst
Please show us the output of:

Code: Select all

sudo dhcpcd -U wlan0
when it internet access is working and after it has stopped working.