langera
Posts: 2
Joined: Sat May 28, 2016 8:04 am

No network. ip route has no default

Sat May 28, 2016 8:30 am

Hi,

A new raspberry pi 2 out of the box has no network.
Both wireless and a cable fail to connect to the network although when connecting the cable, the icon seem to suggest its connected.

Tried to follow some of the troubleshooting guides:

"ip addr"

seems to return the required eth0 state UP.

"ifconfig -a"

Also looks ok as far as I can see

Code: Select all

eth0      Link encap:Ethernet  HWaddr b8:27:eb:3c:ca:40  
          inet addr:10.0.0.12  Bcast:10.0.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:109 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:19381 (18.9 KiB)  TX bytes:4626 (4.5 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1072 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1072 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:92700 (90.5 KiB)  TX bytes:92700 (90.5 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:0f:60:07:1d:19  
          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)

"ip route" returns:

Code: Select all

10.0.0.0/24 dev eth0 proto kernel scope link src 10.0.0.12 metric 202
And does not have the expected default 192.168.*.* etc.

Anyone knows what could be wrong?

Thanks

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: No network. ip route has no default

Sat May 28, 2016 1:46 pm

You should post the contents of your /etc/network/interfaces file.
The answer lies there I guess.

(I'd say the Pi has network, but it doesn't have the Internet. The default route is missing.)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

langera
Posts: 2
Joined: Sat May 28, 2016 8:04 am

Re: No network. ip route has no default

Sat May 28, 2016 2:39 pm

Thanks for your reply.

/etc/network/interfaces file is:

Code: Select all

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet manual

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

and wpa_supplicant.conf also looks OK (I changed the real ssid + password)

Code: Select all

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

network={
	ssid="********"
	key_mgmt=NONE
	wep_key0="**********"
}

epoch1970 wrote:You should post the contents of your /etc/network/interfaces file.
The answer lies there I guess.

(I'd say the Pi has network, but it doesn't have the Internet. The default route is missing.)

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: No network. ip route has no default

Sat May 28, 2016 3:20 pm

Gah. Thanks, you did all right but I was wrong.
Your setup lies within dhcpcd config files, and unfortunately I don't use that so I can't help you further.
Look around, though, on the forum and man pages, the issue is probably already documented.

In the meantime, assuming your network is 10.0.0.0/24 and your router sits at 10.0.0.1 (that's what I surmise from the ifconfig you posted), you could check if "ip route add default via 10.0.0.1" adds the default route I think this is all about, and gives your Pi access to the internet.
You can remove it afterwards with "ip route del default".

(Also, I think it's better to activate one interface at a time. Leave wlan0 down the way it is, and just use eth0 for a start. Or the other way around, if you prefer. I don't know what dhcpcd has in store for this but out-of-the-box, linux gets confused if there are multiple default gateways.)
Last edited by epoch1970 on Sat May 28, 2016 3:32 pm, edited 1 time in total.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: No network. ip route has no default

Sat May 28, 2016 3:31 pm

langera wrote:

Code: Select all

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

network={
	ssid="********"
	key_mgmt=NONE
	wep_key0="**********"
}
IIRC you don't use quotes around the wep key entry

Return to “Troubleshooting”