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,053
  • 17
  • 30
FreshTendrils
  • 463
  • 1
  • 7
  • 13

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,053
  • 17
  • 30