dausua
Posts: 6
Joined: Sun Sep 23, 2012 5:44 am

'Network is unreachable'

Tue Oct 30, 2012 3:03 pm

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

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: 'Network is unreachable'

Tue Oct 30, 2012 3:57 pm

try running ifdown eth0 && ifup eth0 and see if it gets an IP address
Otherwise, paste the stuff it outputs when you do that.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: 'Network is unreachable'

Wed Oct 31, 2012 1:53 pm

have you set a ip address manually?

what do you have in /etc/network/interfaces
Dear forum: Play nice ;-)

dausua
Posts: 6
Joined: Sun Sep 23, 2012 5:44 am

Re: 'Network is unreachable'

Wed Oct 31, 2012 3:33 pm

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:

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: 'Network is unreachable'

Wed Oct 31, 2012 3:42 pm

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.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

bgirardot
Posts: 518
Joined: Wed Oct 10, 2012 6:20 am
Location: Switzerland

Re: 'Network is unreachable'

Wed Oct 31, 2012 4:33 pm

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

User avatar
jojopi
Posts: 3287
Joined: Tue Oct 11, 2011 8:38 pm

Re: 'Network is unreachable'

Wed Oct 31, 2012 4:48 pm

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?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: 'Network is unreachable'

Thu Nov 01, 2012 12:39 am

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
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

dausua
Posts: 6
Joined: Sun Sep 23, 2012 5:44 am

Re: 'Network is unreachable'

Thu Nov 01, 2012 11:43 am

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

rocketero
Posts: 64
Joined: Wed Jul 11, 2012 5:45 pm

Re: 'Network is unreachable'

Thu Feb 07, 2013 3:39 am

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.

rocketero
Posts: 64
Joined: Wed Jul 11, 2012 5:45 pm

Re: 'Network is unreachable'

Thu Feb 07, 2013 4:57 am

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.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: 'Network is unreachable'

Thu Feb 07, 2013 7:47 am

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
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Return to “General discussion”