0

I already tried dist-update and this post

I have a Raspberry Pi 3 B + and my operating system is "Raspbian GNU/Linux 9 (stretch)"

I am connected to it using a Lan cable and use ssh or Remmina to connect to it.

This is my wlan configuration in wpa suppliant:

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

network={
    ssid="secret"
    psk="secret"
    key_mgmt=WPA-PSK
}
network={
        ssid="eduroam"
    scan_ssid=1
    proto=RSN
    pairwise=CCMP
    eap=PEAP
    identity="secret"
    password="secret"
    key_mgmt=WPA-EAP
}

When connected to either of the 2 Wlan (they do connect) I dont recieve internet from them. The only way I can get internet from my raspberry pi is if my laptop is connected to wifi and then through the ethernet cable connected to my Pi I get internet. EDIT:

pi@raspberrypi:~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.42.0.1       0.0.0.0         UG    202    0        0 eth0
0.0.0.0         10.68.64.4      0.0.0.0         UG    303    0        0 wlan0
10.42.0.0       0.0.0.0         255.255.255.0   U     202    0        0 eth0
10.68.64.0      0.0.0.0         255.255.192.0   U     303    0        0 wlan0

what i found strange is that my route -n from my raspberry pi output is always the same no matter if i enable or disable the laptop wifi and reboot inbetween.

Output of iwconfig:

pi@raspberrypi:~ $ iwconfig
eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11  ESSID:"eduroam"  
          Mode:Managed  Frequency:5.28 GHz  Access Point: 40:E3:D6:56:67:D0   
          Bit Rate=24 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=32/70  Signal level=-78 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:160  Invalid misc:0   Missed beacon:0

my laptop is connected not to eduroam but a third wireless connection not mentioned, though there is internet on all of them, so wlan0 is from the raspberrypi for sure.

pi@raspberrypi:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.42.0.253  netmask 255.255.255.0  broadcast 10.42.0.255
        inet6 fe80::4819:8dbd:df90:5a6f  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:81:dc:b1  txqueuelen 1000  (Ethernet)
        RX packets 7722  bytes 1829686 (1.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8297  bytes 2438399 (2.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 33  bytes 15914 (15.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 33  bytes 15914 (15.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.68.107.205  netmask 255.255.192.0  broadcast 10.68.127.255
        inet6 fe80::aa8b:b7e0:9252:a9eb  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:d4:89:e4  txqueuelen 1000  (Ethernet)
        RX packets 118  bytes 35794 (34.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 637  bytes 103843 (101.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
pi@raspberrypi:~ $ cat /etc/network/interfaces
# 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
pi@raspberrypi:~ $ cat /etc/resolv.conf
# Generated by resolvconf
domain eduroam.local
nameserver 10.42.0.1
nameserver 208.67.222.222
nameserver 208.67.220.220
maxsieg
  • 70
  • 2
  • 8
  • disconnect ethernet ... now do you get internet via wifi? – Jaromanda X Jan 11 '19 at 11:41
  • nope no internet when disconnecting ethernet cable but was worth trying :) – maxsieg Jan 11 '19 at 11:51
  • I am connected to it using a Lan cable and use ssh - if you are not connected to your laptop, what is on the other side of the Lan cable? Are access point secret and eduroam both connected to the internet and routing trafic to it? – Ingo Jan 11 '19 at 11:56
  • There is a similar question here - https://raspberrypi.stackexchange.com/questions/9098/wifi-works-ssh-can-connect-but-cannot-connect-out-to-the-internet-cannot-ping?rq=1. Check out everything in there - especially the routing table if you are not having trouble with ethernet. – John Pettit Jan 11 '19 at 13:32
  • @Ingo the laptop recieves internet from the 2 connnections just not when i connect the raspberry pi to the same connection aswell through wlan – maxsieg Jan 12 '19 at 22:35
  • @JohnPettit I suppose that u r suggesting that i should use a different DNS server instead of the providor suggested DNS server? – maxsieg Jan 12 '19 at 22:37
  • If you are connected to one of the wlan router with the RasPi are you able to ping 8.8.8.8 and ping google.com? – Ingo Jan 13 '19 at 10:57
  • when i ping 8.8.8.8: "From 10.42.0.1 icmp_seq=19 Destination Net Unreachable" – maxsieg Jan 14 '19 at 09:01
  • Can you ping the WiFi gateway at 10.68.64.4 from wlan0 (no ethernet connected)? – Roger Jones Jan 14 '19 at 10:29
  • yes --- 10.68.107.205 ping statistics --- 42 packets transmitted, 42 received, 0% packet loss, time 42565ms rtt min/avg/max/mdev = 0.058/0.104/0.132/0.017 ms – maxsieg Jan 14 '19 at 11:16
  • but also this one --- 10.68.64.4 ping statistics --- 39 packets transmitted, 39 received, 0% packet loss, time 38050ms rtt min/avg/max/mdev = 1.754/7.200/78.253/13.525 ms – maxsieg Jan 14 '19 at 11:25

1 Answers1

3

Seems there is simply a problem with your default route. As shown in your question with route -n you have two default routes:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.42.0.1       0.0.0.0         UG    202    0        0 eth0
0.0.0.0         10.68.64.4      0.0.0.0         UG    303    0        0 wlan0

The kernel has to decide what route to use. For this it uses the Metric. The route with the lowest metric 202 comes first so it will try to connect to the internet through eth0 but it seems there is no route to the internet.

You can check if you can connect to the internet through wlan0 with:

rpi ~$ ping -I wlan0 8.8.8.8

If you receive packages then that is the route to the internet. You should just delete the wrong route:

rpi ~$ sudo ip route del default dev eth0

and configure your network not to set this route, for example not to set static routers=10.42.0.1 in /etc/dhcpcd.conf.

By the way /etc/resolv.conf shows that resolvconf sets searching

domain eduroam.local

The DNS domain .local is reserved for Link-local addresses and never managed by any DNS server and as far as I know resolvconf will never set this by itself. So you should reconfigure your settings (maybe in /etc/dhcpcd.conf?) not to use this domain. If you use avahi for link-local addresses instead of a dhcp server then it will use this domain.

Ingo
  • 42,107
  • 20
  • 85
  • 197
  • yes after "sudo ip route del default dev eth0" my internet works, though all routers setting were commented out with a hashtag. How do I set wlan0 to be the default route? – maxsieg Jan 16 '19 at 12:33
  • @maxsieg Interface wlan0 has already a default route so the question must be "how to avoid setting an additional default route for eth0?" or "how to set the metric of default route for wlan0* lower than for eth0?*" You don't tell us how do you configure the interfaces so it is difficult to guess what to do. Maybe you edit the question for this? In general you can always correct the settings afterwards with a script or systemd unit but for me it would not be a good solution because it only fixes a symtom not the real cause. – Ingo Jan 16 '19 at 18:13