Page 1 of 1

'Network is unreachable'

Posted: Tue Oct 30, 2012 3:03 pm
by dausua
Hi,

I have been working with my Raspi for a few weeks now, and I've come across a problem.

The ethernet port seems to have stopped working. It does not want to connect to my mac or router, and I cannot diagnose the problem properly.
All the lights are on: FDX, LNK and 10M

Code: Select all

$ ip addr
reveals that there is no IP address for the ethernet, despite it being up.
output is:

Code: Select all

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether b8……… brd ff:ff:ff………

Code: Select all

ping 192.168.2.1
reveals

Code: Select all

connect: Network is unreachable
The raspi boots fine, and I have reflashed the same image I started with before on the SD card, but it comes up with the same problem.

Previously I had it plugged directly by ethernet to my Mac, but now I've got it plugged into a wired router, and it's exactly the same problem.

How can I solve this? Any help is greatly appreciated

Re: 'Network is unreachable'

Posted: Tue Oct 30, 2012 3:57 pm
by SirLagz
try running ifdown eth0 && ifup eth0 and see if it gets an IP address
Otherwise, paste the stuff it outputs when you do that.

Re: 'Network is unreachable'

Posted: Wed Oct 31, 2012 1:53 pm
by abishur
have you set a ip address manually?

what do you have in /etc/network/interfaces

Re: 'Network is unreachable'

Posted: Wed Oct 31, 2012 3:33 pm
by dausua
SirLagz wrote:try running ifdown eth0 && ifup eth0 and see if it gets an IP address
Otherwise, paste the stuff it outputs when you do that.
No IP address:

Code: Select all

$ sudo ifdown eth0 && ifup eth0
Internet Systems Consortium DHCP Client 4.2.2
Copyright blah blah blah
…
Listening on LPF/eth0/b8:27:eb…
Sending on LPF/eth0/b8:27:eb…
Sending on Socket/fallback
ifup: failed to open statefile /run/network/ifstate: Permission denied

Code: Select all

$ ip addr
1: lo: <LOOPBACK blah blah blah
…
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
     link/ether b8:27… brd ff:ff:ff:…
Apologies couldn't be bothered typing all the useless stuff out. :shock:

Re: 'Network is unreachable'

Posted: Wed Oct 31, 2012 3:42 pm
by Joe Schmoe
This illustrates well what's really wrong with the "sudo mentality".

The fact that it doesn't chain. I.e.,

sudo command1 && command 2

doesn't do what you expect it to.

OTOH:

sudo bash
command1 && command2

does work as expected.

Re: 'Network is unreachable'

Posted: Wed Oct 31, 2012 4:33 pm
by bgirardot
Joe is saying your command:

sudo ifdown eth0 && ifup eth0

will not work, so you need to do:

sudo ifdown eth0 && sudo ifup eth0

or

sudo bash
ifdown eth0 && ifup eth0

but the second command in what you put in failed due to not being sudo/root

Re: 'Network is unreachable'

Posted: Wed Oct 31, 2012 4:48 pm
by jojopi
Joe Schmoe wrote:This illustrates well what's really wrong with the "sudo mentality".
Do you dislike at, nice, nohup, strace, time, chrt, ionice, taskset too?

Re: 'Network is unreachable'

Posted: Thu Nov 01, 2012 12:39 am
by SirLagz
dausua wrote:
SirLagz wrote:try running ifdown eth0 && ifup eth0 and see if it gets an IP address
Otherwise, paste the stuff it outputs when you do that.
No IP address:

Code: Select all

$ sudo ifdown eth0 && ifup eth0
Internet Systems Consortium DHCP Client 4.2.2
Copyright blah blah blah
…
Listening on LPF/eth0/b8:27:eb…
Sending on LPF/eth0/b8:27:eb…
Sending on Socket/fallback
ifup: failed to open statefile /run/network/ifstate: Permission denied

Code: Select all

$ ip addr
1: lo: <LOOPBACK blah blah blah
…
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
     link/ether b8:27… brd ff:ff:ff:…
Apologies couldn't be bothered typing all the useless stuff out. :shock:
Paste the output of
sudo ifdown eth0 && sudo ifup eth0

Re: 'Network is unreachable'

Posted: Thu Nov 01, 2012 11:43 am
by dausua
Thanks - sudo
ifdown eth0 && sudo ifup eth0
helped me diagnose the problem. DHCPDISCOVER was requesting an ip address, and then failing. This was due to the fact that I had it plugged into a switch where there was no DHCP server, and for some reason my Mac was not switching the ethernet over and acting as DHCP server when plugged into it. So, it was my Mac's fault and not the Raspberry... should have known it.

Many thanks for your help everyone. Now I can get back to Csound. :D

Re: 'Network is unreachable'

Posted: Thu Feb 07, 2013 3:39 am
by rocketero
seems like there has not been an answer to this issue so far, last post was Nov 1 last year.

I get the following answer to:

sudo ifdown eth0 && ifup eth0
ifdown: eth0 interface not configured
ifup: failed to open statefile /run/network/ifstate: Permission denied


during the boot process I see this messages:

19.683026] CIFS:VFS: Error connecting to socket. Aborting operation.

I also see other messages down when I type: dmesg | more command:
21.726980] smsc95xx: 1-1.1:1.0: eth0 link up; 100Mbps, full duplex, lpa 0x45E1

I have to report on this message that the cable I'm using is fine, as I have a PC and it connects OK to the 4port ethernet box and it gets an IP address through DHCP. But the RPI doesn't connect.

Also the light gets green in the 4port ethernet box when the RJ45 cable is connected to the RPI meaning there is continuity and the cable is OK.

Re: 'Network is unreachable'

Posted: Thu Feb 07, 2013 4:57 am
by rocketero
somehow I'm now getting an IP address, kinda weird. I however still see some messages during boot process saying: Network is unreachable. and at the end of the boot process it gives an IP address from the router box through DHCP.

Re: 'Network is unreachable'

Posted: Thu Feb 07, 2013 7:47 am
by SirLagz
rocketero wrote:seems like there has not been an answer to this issue so far, last post was Nov 1 last year.

I get the following answer to:

sudo ifdown eth0 && ifup eth0
ifdown: eth0 interface not configured
ifup: failed to open statefile /run/network/ifstate: Permission denied


during the boot process I see this messages:

19.683026] CIFS:VFS: Error connecting to socket. Aborting operation.

I also see other messages down when I type: dmesg | more command:
21.726980] smsc95xx: 1-1.1:1.0: eth0 link up; 100Mbps, full duplex, lpa 0x45E1

I have to report on this message that the cable I'm using is fine, as I have a PC and it connects OK to the 4port ethernet box and it gets an IP address through DHCP. But the RPI doesn't connect.

Also the light gets green in the 4port ethernet box when the RJ45 cable is connected to the RPI meaning there is continuity and the cable is OK.
keep in mind, sudo only applies to the first command when doing

Code: Select all

sudo ifdown eth0 && ifup eth0
for sudo to work properly in that case you need to run it this way

Code: Select all

sudo ifdown eth0 && sudo ifup eth0