Mobius
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA

Pi not setting correct IP address

Thu Nov 22, 2012 5:53 pm

I'm trying to get the Pi to connect to the internet via a direct ethernet connection to my router. When I query the router, I see that it has assigned an address to the Pi but when I run ifconfig on the Pi it shows a bad IP address (127.0.0.0). I have even tried the instructions elsewhere in this forum to edit the /etc/network/interfaces file to set a static IP address but the Pi always comes up with the incorrect address on bootup. I'm running Raspbian and I'm a Linux noobie so I need explicit instructions at this point. Thank you.

User avatar
k4gbb
Posts: 52
Joined: Sun Aug 12, 2012 5:33 am
Location: Dunnellon, FL USA - EL88tx

Re: Pi not setting correct IP address

Thu Nov 22, 2012 6:10 pm

Can you post your /etc/network/interfaces file
and the output if ifconfig?
The Grass may be greener on the other side of the fence, but it still has to be mowed.

Wendo
Posts: 142
Joined: Sun Jun 10, 2012 8:27 pm

Re: Pi not setting correct IP address

Thu Nov 22, 2012 6:55 pm

That address is not 'incorrect' as such, it's the localhost address, and it's normal for the lo interface to have it.

When running ifconfig you need to be looking for the eth0 interface

'ifconfig eth0' will show you only that interface, and be more useful to you

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Pi not setting correct IP address

Thu Nov 22, 2012 6:59 pm

127.0.0.1 is normal it's your network loopback - http://en.wikipedia.org/wiki/Loopback

Richard S.

Mobius
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA

Re: Pi not setting correct IP address

Thu Nov 22, 2012 10:49 pm

Ok. Doing ifconfig with or without the eth0 originally gave no IP address at all. Somehow, after trying the static address and then going back to dhcp, it has finally recognized the correct IP address from the router. Doesn't make sense to me but at least it's correct. Unfortunately, I still cannot get the web browsers in the graphical window (after running "startx") to communicate. I see that at least Midori has some setup allowed so I will fiddle with that. Could it be that the Pi requires set up of Port Forwarding in the router? I have had to do that for my security cameras.

Mobius
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA

Re: Pi not setting correct IP address

Thu Nov 22, 2012 11:14 pm

I stumbled onto another post regarding this problem. Apparently, entering the graphical interface kills my internet connection. If I open a terminal window and do ifconfig, there is no longer an IP address displayed and, of course, ping commands no longer work. In the other post it seems that he problem was related to a wireless mouse but I am hard wired. I am also using a 1 amp USB power supply so I don't think that is the problem. Any thoughts?

User avatar
k4gbb
Posts: 52
Joined: Sun Aug 12, 2012 5:33 am
Location: Dunnellon, FL USA - EL88tx

Re: Pi not setting correct IP address

Thu Nov 22, 2012 11:15 pm

Normally the router will supply you with one or two IP addressed for DNS servicves.
They are stored in /etc/resolv.conf.
The OLD systems allowed you to set these addresses, but the later systems must get them from the router or the /etc/network/interfaces.

add the following line to the eth0 block in /etc/network/interfaces

Code: Select all

       dns-nameservers 208.67.222.222 208.67.220.220 


These addresses are generic DNS servers.
The Grass may be greener on the other side of the fence, but it still has to be mowed.

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

Re: Pi not setting correct IP address

Thu Nov 22, 2012 11:52 pm

k4gbb wrote:208.67.222.222 208.67.220.220
Those OpenDNS resolvers are pretty evil. Instead of returning NXDOMAIN when a domain does not exist, they return a fake result that redirects to a typo-jacking ad site, "website-unavailable.com". As well as being obnoxious, this can potentially cause problems with some software. I would suggest Google Public DNS, 8.8.8.8 and 8.8.4.4, instead.

Anyway, it seems that OP does not have a DNS problem, but a USB conflict trying to run the LAN, keyboard, and mouse at the same time. The first thing to try is to update to the latest stable firmware and kernel: "sudo apt-get update && sudo apt-get upgrade".

User avatar
k4gbb
Posts: 52
Joined: Sun Aug 12, 2012 5:33 am
Location: Dunnellon, FL USA - EL88tx

Re: Pi not setting correct IP address

Fri Nov 23, 2012 12:16 am

I have been using them on my servers for a year or two.
The servers are headless and have nothing to do with Browsing.
Your point is taken... I'll look into using the Google DNS addresses.
The Grass may be greener on the other side of the fence, but it still has to be mowed.

Mobius
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA

Re: Pi not setting correct IP address

Fri Nov 23, 2012 12:32 am

I think the mystery may be solved. I tried a different USB power supply and it appears to be working consistently now. Haven't measured the input voltages under load yet to see what is different but apparently the Pi (or at least my Pi) is a bit finicky regarding operating voltage. I have two supplies that are identical and they both have the issue with losing the ethernet connection. The third supply appears to be stable. All three are rated at 5 volts +/- 5% and 1000 ma.

Return to “Networking and servers”