
- #Connect raspberry pi to mac ethernet how to
- #Connect raspberry pi to mac ethernet pro
- #Connect raspberry pi to mac ethernet mac
Otherwise, your settings should look as follows: auto eth0 If you want to make sure you don’t forget your existing Ethernet settings, you can comment them out with a hash. This time there are a few more lines to add. We’ll use Vim again, this time enter the following command: sudo vim.tiny /etc/network/interfaces Having saved the changes, we now need to set the static configuration for the Ethernet port.
#Connect raspberry pi to mac ethernet mac
This tells the Pi to use the Mac as its DNS server, rather like you might expect with a connection to a home router. You want a single line it as follows: nameserver 192.168.2.1 This will open the Vim editor (same commands as Vi). Once the Pi is started, connect via SSH from the Mac and once logged in and on the command prompt, enter the following command: sudo vim.tiny /etc/nf I’ve not tested the theory of whether that ever changes, but to make absolutely sure (and certainty is definitely preferred when doing demos) we will configure the Ethernet adapter with static settings based on the Mac’s configuration. Connect the Pi to the Mac’s Ethernet adapter and start it up.įirst time of asking the Pi will be assigned an IP of 192.168.2.2 by the Mac’s DHCP server (assuming your Pi by default is set up for DHCP from the Ethernet port). Apple have made things easier still by making the Ethernet adapter work out when you’re using it to connect to another machine and automatically flipping into “crossover” mode so you can connect the Pi with bog standard Ethernet cable. Getting the Mac and the Pi to see each other is the easy bit, the harder bit was making the Pi be able to see the internet beyond. I was surprised how resilient the local configuration between the Mac and the Pi was when I was fiddling with these next steps.

Select Wi-fi and Thunderbolt Ethernet as the points where you want to share from and to as per the screenshot below. It couldn’t be easier - back to System Preferences, select Sharing and tick Internet Sharing. Having set up the Ethernet port, we now need to tell the Mac we want to share the wifi internet connection with devices connected via Ethernet. Click OK when you’re done to save the settings. I’ve got a mix of public DNS, a couple from work and my home router. You can simply lift the DNS settings from your Wifi configuration (provided of course your wifi is already up and happily resolving!) or indeed use some public DNS server settings. Without any DNS servers set, the Ethernet connection (and therefore the Pi) will not be able to resolve any of the domain names we throw at it.Ĭlick the Advanced… button, then the DNS tab and then the + button to add a DNS server entry. As in the above picture, use the following settings:īecause we’re using a static configuration, we now need to set the DNS server settings ourselves.

There are therefore some settings we need to set up to make this hang together, not least a static IP configuration for the Mac as it will appear to the Pi so we can use it as our IP gateway. Now of course DHCP would be fine, and whilst you can probably guess at which IP the Mac’s DHCP server will give you each time, it’s more predictable to have a static IP defined, particularly when running your Pi in “headless” mode. You can give the configuration a name of its own, I’ve imaginatively called mine “Raspberry Pi Ethernet (home)” as you can see below.

You’ll notice your Ethernet port appears on the list of adapters on the left hand side. Once plugged in, open up System Preferences, and then Network. You can get cheaper non-Apple alternatives but I’ve no experience of whether they work or not. For this you’ll need the (rather expensive) Thunderbolt to Ethernet adapter if your Macbook (like mine) doesn’t have an onboard Ethernet socket.

#Connect raspberry pi to mac ethernet pro
The mechanism I’m using to connect my Mac (Macbook Pro Retina running OS X Mavericks 10.9.5) is via good old Ethernet. So, to save you that trouble, I’m recording my configuration here.
#Connect raspberry pi to mac ethernet how to
There are a number of articles out there claiming to show you how to make it all work when you Google for it, but it still took me a fair bit of puzzling and piecing of the bits together to come up with something that worked. Normally it connects to my home router where I can configure the router to have a static IP address so I know where to find it and off I go, not so easy when you’re mobile. One of the great things you can do with a Mac is share your internet connection, and I’ve found this particularly invaluable for doing development with my Raspberry Pi, and especially when I want to take it somewhere to show people.
