1

I have a Raspberry Pi 2 Model B V1.1 running Raspbian (I'm not a confident Linux user, but I understand this is the "Jessie" distribution) and have been using it to install matplotlib and other MATLAB-esque packages to work on audio DSP. I had been using an Ethernet cable to attach to my laptop as a access point to the home WiFi router, and would highly prefer to keep this arrangement.

A fortnight ago the Pi couldn't access the internet, though I cannot trace as to where the error is. I have looked at far too many tutorials and suggestions, here and on the Pi forum, which suggested setting up a static IP address, but these have failed to work though I don't understand why.

I'm not qualified or knowledgeable to accurately diagnose the problem, but it stems from having no access to DNS servers for name resolution and an issue with the IP addresses of both the Pi's eth0 port and my PC's Local Area Network port. Pinging both a website name and IP addresses fail, though both give different error messages (see below).

I have attached below some console outputs which I understand are relevant, after picking up several commands from different questions on this site.

pi@raspberrypi ~ $ ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:db:f7:7d  
          inet addr:169.254.67.214  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::ba27:ebff:fedb:f77d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:50 errors:0 dropped:0 overruns:0 frame:0
          TX packets:53 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7944 (7.7 KiB)  TX bytes:12677 (12.3 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:320 errors:0 dropped:0 overruns:0 frame:0
          TX packets:320 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:25920 (25.3 KiB)  TX bytes:25920 (25.3 KiB)

pi@raspberrypi ~ $ route -ne
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0

pi@raspberrypi ~ $ hostname -I
169.254.67.214 

pi@raspberrypi ~ $ ip -4 addr show | grep global
    inet 169.254.67.214/16 brd 169.254.255.255 scope global eth0

pi@raspberrypi ~ $ cat /etc/network/interfaces
# Please note that this file is written to be used with dhcpcd.
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'.

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

pi@raspberrypi ~ $ cat /etc/resolv.conf
# Generated by resolvconf

pi@raspberrypi ~ $ cat /etc/dhcpcd.conf
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname

pi@raspberrypi ~ $ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether b8:27:eb:db:f7:7d brd ff:ff:ff:ff:ff:ff

pi@raspberrypi ~ $ ping 8.8.8.8
connect: Network is unreachable

pi@raspberrypi ~ $ ping www.duckduckgo.com
ping: unknown host www.duckduckgo.com

I would follow the Static IP address answer from: How do I set up networking/WiFi/static IP address? but since the connection was working without any interference I'd like to see if I could just fix something to return to that scenario rather than manually set up the network.

My question is should I overwrite the /etc/networking/interfaces & /etc/dhcpcd.conf with the static IP address I wish to use, or is there a problem preventing the current configuration from running as intended? I know sod all about networking and am struggling to work out where the problem is in this, but I highly appreciate all help with this.

Thanks

  • 2
    You should consider to upgrade to the current up to date version Raspbian Buster – Ingo Jun 27 at 16:57
  • 1
    169.254.67.214 - not an IP that is generally routable - do you have a router capable of DHCP on your LAN? – Jaromanda X Jun 27 at 23:51
  • @Ingo - why? how will that fix an IP address issue? – Jaromanda X Jun 27 at 23:51
  • @JaromandaX It will not fix the issue with Jessie, but I believe it is easier to get help for an up to date operating system. – Ingo Jun 28 at 0:34
  • @Ingo - oh, right, I didn't even see that the OP was still on Jessie!! – Jaromanda X Jun 28 at 0:36
1

As suggested by JaramandaX, I connected the Pi to the router (An EE Smart Hub for those in the UK who know) and it is able to connect to the internet once I put the following line into /etc/network/interfaces:

auto eth0
allow-hotplug eth0
iface eth0 inet dchp

This isolates the issue with the connection between the Pi and my laptop which uses a standard Ethernet Cat5e cable (non-cross over). When I reconnect to the laptop and used "Internet Connection Sharing" in the control panel the connection was lost.

The IP of the laptop's eth0 is 192.168.137.1 which is consistent with examples of this being used online. I set the Pi's IP address to be 192.168.137.5 just as an initial example. Both computers can ping each other successfully, so the issue is not with the local connection between the two.

Since this issue is now beyond the scope of the Pi forum, I'll ask in a different site for advice on the ICS issue. If someone can see an error in my ways, then I am all ears for a solution. Thanks.

  • Please accept your answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again and again for years. – Ingo Dec 1 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.