1

I'm trying to access to the network with the WiFi.

I'm able to connect to the raspberry via SSH and I followed many tutorials but it still doesn't work. Below you can see that I have my ethernet connection via SSH with IP address = 192.168.0.23, and also that I have a IP address = 192.168.0.34 via WiFi.

pi@raspberrypi:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.23  netmask 255.255.255.0  broadcast 192.168.0.255
        ether dc:a6:32:6e:8e:d4  txqueuelen 1000  (Ethernet)
        RX packets 287  bytes 36139 (35.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 193  bytes 27297 (26.6 KiB)
        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
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 20  bytes 1420 (1.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 1420 (1.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.34  netmask 255.255.255.0  broadcast 192.168.0.255
        ether dc:a6:32:6e:8e:d5  txqueuelen 1000  (Ethernet)
        RX packets 206  bytes 13153 (12.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30  bytes 3344 (3.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The issue is : when I try to ping the router from my raspberry it doesn't work.

Thanks !

UPDATE :

It's extremely strange, because when I ping google.com it works, but when I ping my router it doesn't :

pi@raspberrypi:~ $ ping google.com
PING google.com (216.58.209.238) 56(84) bytes of data.
64 bytes from par10s29-in-f238.1e100.net (216.58.209.238): icmp_seq=1 ttl=54 time=19.9 ms
64 bytes from par10s29-in-f238.1e100.net (216.58.209.238): icmp_seq=2 ttl=54 time=18.7 ms
64 bytes from par10s29-in-f238.1e100.net (216.58.209.238): icmp_seq=3 ttl=54 time=20.6 ms
64 bytes from par10s29-in-f238.1e100.net (216.58.209.238): icmp_seq=4 ttl=54 time=19.5 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 60ms
rtt min/avg/max/mdev = 18.685/19.680/20.649/0.712 ms
pi@raspberrypi:~ $ ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
From 192.168.0.23 icmp_seq=1 Destination Host Unreachable
From 192.168.0.23 icmp_seq=2 Destination Host Unreachable
From 192.168.0.23 icmp_seq=3 Destination Host Unreachable
^C
--- 192.168.0.1 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 180ms
pipe 4
2

You have two connections to your internet router, one wired on interface eth0 and one wireless on interface wlan0. The RasPi only uses one connection determined by the metric of the route. You can show the route with:

rpi ~$ ip route

There you will find the metric. The route with the lowest metric is used. I suppose its the wired connection. With the available information now its difficult to see why the router is confusing the two connections. Anyway, the complete route to google.com is working. Try to ping the router with source interface:

rpi ~$ ping -I 192.168.0.23 192.168.0.1
rpi ~$ ping -I eth0 192.168.0.1
rpi ~$ ping -I 192.168.0.34 192.168.0.1
rpi ~$ ping -I wlan0 192.168.0.1

I suggest to only use one connection.

| improve this answer | |
  • Can you please correct me if I'm wrong : Lets say the router in my house has an IP address = 192.168.0.1/24. I connect my Rasp on my WiFi with a static IP address (because I will use it like a server) = 192.168.0.2/24 (in order to be in the same subnet). So, I should make a gateway of 192.168.0.1/24 because gateway is the router's IP address. Is the logic correct ? – user676767 Mar 17 at 20:40
  • @user676767 Yes, that is correct. – Ingo Mar 17 at 21:51

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.