The goal was to have the Pi share a wifi-equipped Mac's network connection.
Mac running Lion (OS X 10.7) is connected to Internet via wifi.
Pi connected via Ethernet cable to Mac.
Share the Mac's Internet connection: on the Mac, go to System Preferences - Sharing.
- Check the box Internet Sharing from the list of services.
- Confirm that that the sharing status is On.
- Confirm that Ethernet is checked on the list of ports to share to.
Macintosh:~ dan$ ping raspberrypi.local
PING raspberrypi.local (192.168.2.2): 56 data bytes
64 bytes from 192.168.2.2: icmp_seq=0 ttl=64 time=0.720 ms
64 bytes from 192.168.2.2: icmp_seq=1 ttl=64 time=0.982 ms
64 bytes from 192.168.2.2: icmp_seq=2 ttl=64 time=0.919 ms
^C
--- raspberrypi.local ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.720/0.874/0.982/0.112 ms
But, it wasn't working for us. The Pi wasn't registering its name, we couldn't reach it from the Mac. Pings just resulted in "ping: cannot resolve raspberrypi.local: Unknown host". We tried all the suggestions on the FAQ and troubleshooting wiki (cable swapping, reflashing the Pi's software, swapping power supplies) but they did not help.
There were two problems: the Pi's network configuration needed to be changed, and the Mac's Internet Sharing needed to be restarted.
Fixing the network configuration on the Pi, David Singleton's web page gave me a clue about needing to enable the Ethernet interface on the Pi to make it get configuration from DHCP.
This is the original network interface configuration on Occidentalis:
pi@raspberrypi:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "my-network-ssid"
wpa-psk "my-wifi-password"
Using nano, and opening the file as superuser because it is a restricted system file,
pi@raspberrypi:~$ sudo nano /etc/network/interfaces
we make the following additions (in bold):
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
#auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp
# wpa-ssid "my-network-ssid"
# wpa-psk "my-wifi-password"
We don't have a wireless adapter on our Pi, so we commented out the three lines of wireless interface configuration.
Then, we restart the network, forcing it to load the new interfaces file.
pi@raspberrypi:~$ sudo /etc/init.d/networking restart
That worked better. The Pi was now coming up and making a DHCP request. But it wasn't getting a response. That's not a Pi problem, that's a problem with the Mac's Internet Connection Sharing.
Off to Google again - this thread showed other people had problems with ICS in Lion. The easiest suggestion was to simply stop and restart the service, and this worked. One more restart of the Pi's networking, and as David says: "yay, network!"