4

I have a raspberry pi and I connected it via ethernet to my Mac computer using a thunderbolt-to-ethernet adapter, I get a solid orange and solid green light on the ethernet port on the pi, and am confused why I can't ping google and just simply connect to the internet, when I do ifconfig, I get the following:

eth0

Link encap:Ethernet HWaddr b8:27:eb:d7:43
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B)  TX bytes:1750 (1.7 KiB)

lo

Link encap:local Loopback
inet addr:127.0.0.1  Mask:255.0.0.0
UP LOOPBACK RUNNING  MTU:16436  Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0  (0.0 B)  TX bytes:0  (0.0 B)
Phil B.
  • 5,043
  • 15
  • 30
FreshTendrils
  • 463
  • 1
  • 7
  • 13
  • "am confused why I ping google and just simply connect to the internet" - can you rephrase this? From your question and your ifconfig output, it looks like you are NOT connected .... – Phil B. May 12 '15 at 13:37
  • @PhilB. Sorry about that, you are right, I updated my question. – FreshTendrils May 12 '15 at 13:38

1 Answers1

3

Judging from the output of ifconfig, your eth0 connection does not have an IP address assigned. There are 2 things you can do:

  1. Make sure you have DHCP turned on on your router so that the Pi can get its IP address from the router when it boots up.

  2. Manually configure a static IP address on your Pi by editing /etc/network/interfaces. See this article on modmypi.com for more details on how to do this. The key part here is to update the eth0 section to read something like this:

iface eth0 inet static
address 192.168.1.81 
netmask 255.255.255.0 
network 192.168.1.0 
broadcast 192.168.1.255 
gateway 192.168.1.254

Of course all those IP addresses and masks need to be modified to your specific scenario - the modmypi article explains how to do this.

EDIT: From the comments it is clear that you are trying to connect the Pi via your Mac to your Internet connection. This requires you to set up Internet Connection Sharing on the Mac, the procedure for this is detailed in this article.. The basic steps are:

  1. Launch System Preferences.
  2. Select the Sharing pane.
  3. Click Internet Sharing in the left pane.
  4. Click the drop-down menu beside Share your Internet connection from and select Wi-Fi.
  5. In the To computers using list, check the box beside Ethernet, or Thunderbolt Ethernet if you’re using an adapter.
  6. Check the box beside Internet Sharing in the left pane.
  7. Check the connection on your other computer.

(copied from the computers.tutsplus.com article)

Phil B.
  • 5,043
  • 15
  • 30
  • I am not sure if this matters, but I am using an ethernet to thunderbolt adaptor on my mac. – FreshTendrils May 12 '15 at 13:56
  • It certainly does - you are connecting your Pi to the Mac directly? In that case, the Mac needs to do something to share the network with your Pi. I'm not a Mac user - it should be called something like "Internet Connection Sharing" and you would need to enable it on your Mac. This article explains how to do this. – Phil B. May 12 '15 at 14:02
  • Updated your question with the adapter & Mac info, and updated my answer accordingly. – Phil B. May 12 '15 at 14:08
  • Yes, I realized that, I allowed connection on my Mac and the internet seems to be working on the pi based on ifconfig, but I still can't ping google – FreshTendrils May 12 '15 at 14:08
  • Can you update your question with the new info (add it at the bottom) and insert the output of ifconfig and ping -c 5 google.com and potentially dig google.com after you get connected? – Phil B. May 12 '15 at 14:10
  • 1
    I figured it out, I had to share my Wifi on the thunderbolt port, thanks! – FreshTendrils May 12 '15 at 14:19