MatsPojken
Posts: 5
Joined: Tue Jul 31, 2018 7:45 pm

One of my Pi:s cannot connect to internet, needs 192.168.x.x, gets 169.254.x.x.

Sat Aug 11, 2018 12:11 pm

One of my Pi 1 B, running Stretch, does not get a good IP address in order to connect to internet. It gets 169.254.126.50, but only this Rpi does. All of my other RPi:s, 1B, 2 and 3, running Weezy, Jessie or Stretch get working 192.168.xx.xx adresses.
"route -n", with the failing RPi, shows only the wrong route, "169.254.0.0".

I have read a lot of topics in this Forum and tried several activities to fix the problem, but without success:
* Static or dynamic addresses
* Switching ethernet cable
* Switching RPi:s into the 'failing' cable set
* Checking the router: No MAC filtering
* Checking the router: IP address interval is wide enough
* Restarting the router with and without power down and with or without a power down pauses

What more could be done?

User avatar
DougieLawson
Posts: 33379
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: One of my Pi:s cannot connect to internet, needs 192.168.x.x, gets 169.254.x.x.

Sat Aug 11, 2018 7:20 pm

Have you eliminated

1. Bad port on router/switch
2. Bad WiFi credentials
3. Bad Raspberry power supply (any sign of the on-screen lightning bolt)
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

drgeoff
Posts: 8363
Joined: Wed Jan 25, 2012 6:39 pm

Re: One of my Pi:s cannot connect to internet, needs 192.168.x.x, gets 169.254.x.x.

Sat Aug 11, 2018 8:02 pm

Swap the SD cards of the "bad" RPi and one of the "good" ones, Does the problem move with the card or stay with the RPi?

andrum99
Posts: 421
Joined: Fri Jul 20, 2012 2:41 pm

Re: One of my Pi:s cannot connect to internet, needs 192.168.x.x, gets 169.254.x.x.

Sat Aug 11, 2018 9:44 pm

MatsPojken wrote:
Sat Aug 11, 2018 12:11 pm
One of my Pi 1 B, running Stretch, does not get a good IP address in order to connect to internet. It gets 169.254.126.50
That IP address indicates that the machine has been unable to contact a DHCP server, so has made up an IP address for itself.

Try connecting the problem Pi to the same port on the router/switch as the working Pi using the same cable. If this fails, then it is either a software problem on the Pi, or there is a hardware fault on that Pi (unlikely but possible).

andrum99
Posts: 421
Joined: Fri Jul 20, 2012 2:41 pm

Re: One of my Pi:s cannot connect to internet, needs 192.168.x.x, gets 169.254.x.x.

Sat Aug 11, 2018 9:48 pm

andrum99 wrote:
Sat Aug 11, 2018 9:44 pm
MatsPojken wrote:
Sat Aug 11, 2018 12:11 pm
One of my Pi 1 B, running Stretch, does not get a good IP address in order to connect to internet. It gets 169.254.126.50
That IP address indicates that the machine has been unable to contact a DHCP server, so has made up an IP address for itself.

Try connecting the problem Pi to the same port on the router/switch as the working Pi using the same cable. If this fails, then it is either a software problem on the Pi, or there is a hardware fault on that Pi (unlikely but possible).
And use the same power supply plugged into the same power socket as well.

Shadow_7
Posts: 39
Joined: Sat Jul 12, 2014 5:50 am

Re: One of my Pi:s cannot connect to internet, needs 192.168.x.x, gets 169.254.x.x.

Mon Aug 13, 2018 2:56 am

Seems like avahi-daemon is stomping on your toes. (steps on mine too). It sets up a default ip/route when it thinks it didn't find one. Which overrides the route you "want" to take.

$ sudo ip addr del 169.254.156.66/16 dev eth0
$ sudo ip route add default via 192.168.1.1 dev eth0

Is a regular part of my first steps after bootup. Along with manually setting up my network.

$ sudo ip link set eth0 up mtu 1500
$ sudo ip addr add 192.168.1.99/24 dev eth0

Replace with the specs for your system.

$ ip link show
$ ip addr show
$ ip route show

Having the 7" touchscreen helps since I can "see" what I'm doing.

MatsPojken
Posts: 5
Joined: Tue Jul 31, 2018 7:45 pm

Re: One of my Pi:s cannot connect to internet, needs 192.168.x.x, gets 169.254.x.x.

Mon Aug 13, 2018 8:08 am

DougieLawson wrote:
Sat Aug 11, 2018 7:20 pm
Have you eliminated

1. Bad port on router/switch
2. Bad WiFi credentials
3. Bad Raspberry power supply (any sign of the on-screen lightning bolt)
@DougieLawson
1 and 3 are eliminated (forgot to add it in my list), but I'll go for 2 in a while. Thanks

MatsPojken
Posts: 5
Joined: Tue Jul 31, 2018 7:45 pm

Re: One of my Pi:s cannot connect to internet, needs 192.168.x.x, gets 169.254.x.x.

Mon Aug 13, 2018 8:16 am

andrum99 wrote:
Sat Aug 11, 2018 9:44 pm
MatsPojken wrote:
Sat Aug 11, 2018 12:11 pm
One of my Pi 1 B, running Stretch, does not get a good IP address in order to connect to internet. It gets 169.254.126.50
That IP address indicates that the machine has been unable to contact a DHCP server, so has made up an IP address for itself.

Try connecting the problem Pi to the same port on the router/switch as the working Pi using the same cable. If this fails, then it is either a software problem on the Pi, or there is a hardware fault on that Pi (unlikely but possible).
@andrum99, I didn't perform exactly this switch before, but now i have. Sorry, no success, still 169.254.x.x, Thanks

MatsPojken
Posts: 5
Joined: Tue Jul 31, 2018 7:45 pm

Re: One of my Pi:s cannot connect to internet, needs 192.168.x.x, gets 169.254.x.x.

Mon Aug 13, 2018 8:21 am

drgeoff wrote:
Sat Aug 11, 2018 8:02 pm
Swap the SD cards of the "bad" RPi and one of the "good" ones, Does the problem move with the card or stay with the RPi?
@drgeoff, Test now performed: SD with Stretch lite instead of Stretch: no success. Thanks

MatsPojken
Posts: 5
Joined: Tue Jul 31, 2018 7:45 pm

Re: One of my Pi:s cannot connect to internet, needs 192.168.x.x, gets 169.254.x.x.

Mon Aug 13, 2018 8:38 am

Shadow_7 wrote:
Mon Aug 13, 2018 2:56 am
Seems like avahi-daemon is stomping on your toes. (steps on mine too). It sets up a default ip/route when it thinks it didn't find one. Which overrides the route you "want" to take.

$ sudo ip addr del 169.254.156.66/16 dev eth0
$ sudo ip route add default via 192.168.1.1 dev eth0

Is a regular part of my first steps after bootup. Along with manually setting up my network.

$ sudo ip link set eth0 up mtu 1500
$ sudo ip addr add 192.168.1.99/24 dev eth0

Replace with the specs for your system.

$ ip link show
$ ip addr show
$ ip route show

Having the 7" touchscreen helps since I can "see" what I'm doing.
--------------------------------
@Shadow_7, Interesting, I didn't know that I can add a route lika that. Anyway, the "sudo ip addr del...." removed the one route I had and the "sudo ip route add default..." was followed by.
RNETLINKANSWERS: Network is unreachable
and I have no routes at all.

It starts to look like a hardware problem, but first I have to take a trip with my bike (electrical, but not connected) to consider everything. It may help - with a little help from my friends... Thanks for now.

@Shadow_7, Adding the 192-route keeping the 169-route is possible, but how do I test it? Reconnecting the cable after some pause?

@Shadow_7, Unplugging cable, then adding 192 with 169 still there adds 192 in the route -n result. Then removing the 169 route also removes the 192 route and I have zero routes left. /MatsPojken after bike trip

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 61 guests