Connect your Raspberry Pi to the Ethernet port on your Mac.
Be able to connect your Raspberry IP on your router, It allows a quick setup and access Internet is any single. But if you need the Raspberry beside you for electronics, to change the map or connect devices, then it is better to have the Pi next to you. This is what we'll see today.
Then I must begin by apologising to those who are not Mac. The Windows PC is occupied by Madam for her blog (here) so to test and tweak it's hard to say no ! 😉 Mais je ne désespère pas de faire un article sur le même sujet mais pour Windows.
As I do a lot of tests and changes on the map, It is not very convenient for me to have to go under TV, Open the Cabinet, pick up at the bottom the Raspberry and remove map. Once it goes but at the end of 5 en 10 minutes it is painful. The coup, I've been wanting to have everything at your fingertips.
Pour pouvoir brancher le Raspberry sur le port Ethernet le point de blocage est le DHCP. It is this service that will provide an IP address to the IP to allow it to communicate with the Mac. Then it is necessary to share the Internet connection so that Pi can go on raspberrypi.org !
- Create the file /etc/bootpd.plist. It will configure the bootp service to enable the DHCP service that is built into Mac OS.
<!DOCTYPE plist PUBLIC "-//Apple / / DTD PLIST 1.0 / / EN" "http://www.Apple.com/ DTDs/PropertyList-1.0.dtd"> <plist version ="1.0"> <dict> <key>bootp_enabled</key> <false /.> <key>detect_other_dhcp_server</key> <integer>1</integer> <key>dhcp_enabled</key> <array> <string>en0</string> </array> <key>reply_threshold_seconds</key> <integer>0</integer> <key>Subnets</key> <array> <dict> <key>allocate</key> <true.> <key>lease_max</key> <integer>86400</integer> <key>lease_min</key> <integer>86400</integer> <key>name</key> <string>192.168.2</string> <key>net_address</key> <string>192.168.2.0</string> <key>net_mask</key> <string>255.255.255.0</string> <key>net_range</key> <array> <string>192.168.2.2</string> <string>192.168.2.254</string> </array> </dict> </array> </dict> </plist>
This file enables the DHCP on the interface en0 (Ethernet) for a local area network 192.168.2.0. The IPs to be issued will be between 192.168.2.2 and 192.168.2.254
- We must now configure the Ethernet interface of the Mac to be the IP 192.168.2.1. From the preferences panel, Select “Network“. If necessary add a configuration by using the button “+” at the bottom left. Then configure the interface by forcing manually the IP and netmask as below :
- It remains to stop and restart bootpd to support :
sudo/bin/launchctl unload-w/System/Library/LaunchDaemons/bootps.plist sudo/bin/launchctl load-w/System/Library/LaunchDaemons/bootps.plist
- Now we have to share Internet to allow the Raspberry access. For this, go into preferences, choose “Sharing” then turn on Internet sharing :
- Remains to connect the Raspberry and wait. To find what your Mac IP attributed to Raspberry Pi, just launch the console and look for lines such as those above :06/01/13 21:37:31,571 bootpd: interface en0: ip 192.168.2.1 mask 255.255.255.006/01/13 21:37:31,571 bootpd: interface en1: ip 192.168.1.10 mask 255.255.255.006/01/13 21:37:31,572 bootpd: DHCP: Re-reading lease list
06/01/13 21:37:31,572 bootpd: DHCP DISCOVER [en0]: 1,B8:27:EB:B8:9:c <raspberrypi>
06/01/13 21:37:31,572 bootpd: OFFER feels raspberrypi 192.168.2.4 pktsize 300
06/01/13 21:37:31,575 bootpd: DHCP REQUEST [en0]: 1,B8:27:EB:B8:9:c <raspberrypi>
06/01/13 21:37:31,576 bootpd: ACK sent raspberrypi 192.168.2.4 pktsize 300
Here I hope that this little post will help you use your Pi Raspberry.