tonydenson

Q: Setting up Mac OS X  as a DHCP server

I want to be able to sit on a plane and connect my Raspberry Pi to My Mac on a private local network for software development on the Pi.

I have tried to follow this to set it up but failed (my ip address was still an unassigned one) -

 

http://www.iconnectit.nl/?p=29

 

Can anyone point me at an idiot proof guide to doing just this please.

MacBook Pro with Retina display, OS X Yosemite (10.10.2)

Posted on May 4, 2015 7:17 AM

Close

Q: Setting up Mac OS X  as a DHCP server

  • All replies
  • Helpful answers

  • by Camelot,

    Camelot Camelot May 4, 2015 11:21 AM in response to tonydenson
    Level 8 (47,285 points)
    Mac OS X
    May 4, 2015 11:21 AM in response to tonydenson

    At first glance, the most obvious missing component in that page you linked to is any discussion about your Mac's own IP address.

    The article seems to be valid to setup a DHCP server to hand out addresses in the range 192.168.222.2-254 via en0. I would expect the Pi to connect as long as it's on the same physical network, so things to check:

     

    1) are you sure 'en0' is the right interface on your Mac? is your Pi connecting wirelessly or wired?

     

    2) the server advertises 192.168.222.2-254, but the article doesn't mention that it's only practical if your Mac's interface is set to 192.168.222.1. Is that the address you've assigned your Mac? If your Mac is in a different subnet then it's not going to work.


    There may be other considerations, but I'd start with these two.

  • by rccharles,

    rccharles rccharles May 4, 2015 11:29 AM in response to tonydenson
    Level 6 (8,486 points)
    Classic Mac OS
    May 4, 2015 11:29 AM in response to tonydenson

    What I'd do is enable a hotspot on one of your devices. For the mac, here  is a write-up:

     

    http://www.imore.com/how-turn-your-macs-internet-connection-wifi-hotspot-interne t-sharing

  • by BobHarris,

    BobHarris BobHarris May 4, 2015 11:31 AM in response to tonydenson
    Level 6 (19,395 points)
    Mac OS X
    May 4, 2015 11:31 AM in response to tonydenson

    Just wondering if you have tried "Create Network..." from the WiFi menu?  This is suppose to create a ad-hoc network for point-to-point connection between 2 computers.

     

    Screen shot 2015-05-04 at 4 Mon 2.28 PM.jpg

     

    Screen shot 2015-05-04 at 4 Mon 2.29 PM.jpg

  • by tonydenson,

    tonydenson tonydenson May 4, 2015 12:20 PM in response to rccharles
    Level 1 (7 points)
    Desktops
    May 4, 2015 12:20 PM in response to rccharles

    rccharles wrote:

     

    What I'd do is enable a hotspot on one of your devices. For the mac, here  is a write-up:

     

    http://www.imore.com/how-turn-your-macs-internet-connection-wifi-hotspot-interne t-sharing

    I often use the ad-hoc network feature. However, I did say in my OP I want to sit on a plane - while it is airborne

  • by tonydenson,

    tonydenson tonydenson May 4, 2015 12:20 PM in response to BobHarris
    Level 1 (7 points)
    Desktops
    May 4, 2015 12:20 PM in response to BobHarris

    BobHarris wrote:

     

    Just wondering if you have tried "Create Network..." from the WiFi menu?  This is suppose to create a ad-hoc network for point-to-point connection between 2 computers.

     

    Screen shot 2015-05-04 at 4 Mon 2.28 PM.jpg

     

    Screen shot 2015-05-04 at 4 Mon 2.29 PM.jpg

    See my reply above

  • by tonydenson,

    tonydenson tonydenson May 4, 2015 12:24 PM in response to Camelot
    Level 1 (7 points)
    Desktops
    May 4, 2015 12:24 PM in response to Camelot

    Camelot wrote:

     

    At first glance, the most obvious missing component in that page you linked to is any discussion about your Mac's own IP address.

    The article seems to be valid to setup a DHCP server to hand out addresses in the range 192.168.222.2-254 via en0. I would expect the Pi to connect as long as it's on the same physical network, so things to check:

     

    1) are you sure 'en0' is the right interface on your Mac? is your Pi connecting wirelessly or wired?

     

    2) the server advertises 192.168.222.2-254, but the article doesn't mention that it's only practical if your Mac's interface is set to 192.168.222.1. Is that the address you've assigned your Mac? If your Mac is in a different subnet then it's not going to work.


    There may be other considerations, but I'd start with these two.

    1. That's a good point. When I do  "ls /dev" from a Terminal I don't see en0 - however I don't see any ethernet devices, even though the ethernet connection is fine and working.

    2. I rather assumed that I leave the Mac in DHCP mode. I'll try that.

  • by rccharles,

    rccharles rccharles May 4, 2015 12:29 PM in response to tonydenson
    Level 6 (8,486 points)
    Classic Mac OS
    May 4, 2015 12:29 PM in response to tonydenson

    I would not expect being on a plane would make a difference.  I do not think the uplink has to be active.  I've only done it with an active uplink.

     

    But, I'll defer to the other posters.

     

    Robert

  • by tonydenson,

    tonydenson tonydenson May 4, 2015 12:55 PM in response to rccharles
    Level 1 (7 points)
    Desktops
    May 4, 2015 12:55 PM in response to rccharles

    rccharles wrote:

     

    I would not expect being on a plane would make a difference.  I do not think the uplink has to be active.  I've only done it with an active uplink.

     

    But, I'll defer to the other posters.

     

    Robert

    I think you were missing my point. You cannot switch on wifi in a plane. But even putting that aside I want a wired connection as I find wifi rather erratic on a Pi.

  • by BobHarris,Helpful

    BobHarris BobHarris May 5, 2015 6:16 AM in response to tonydenson
    Level 6 (19,395 points)
    Mac OS X
    May 5, 2015 6:16 AM in response to tonydenson

    I think you were missing my point. You cannot switch on wifi in a plane. But even putting that aside I want a wired connection as I find wifi rather erratic on a Pi.

    Yea, I think several of us were not clear on that point, and our natural bias for using WiFi dominated our brains

     

    If you use Applications -> Utilities -> Terminal -> ifconfig (After connecting the Pi to the Mac via Ethernet), does the Ethernet device (typically en0) have a self-assigned IP address (169.254.x.x) that you can use from your Pi to make a connection?

     

    Or is this a matter of the Pi needing the DHCP server to pick its own IP address so that the Mac can connect and control the Pi ?

     

    Can you just run "sudo /usr/libexec/bootpd -D -d -i en0" from a Terminal session?  "man bootpd" for more information.  This is apparently what Internet Sharing runs.  If this works, then after you connect your Pi, you can use ifconfig to see what IP address was assigned to en0 (I think).

     

    Applications -> Utilities -> Console -> system.log should contain any error messages from /usr/libexec/bootpd

     

    At the moment I'm sitting in a coffee shop with ONLY my Macbook Pro to play with, and no other computer systems I can attach to see if my guesses work.

  • by tonydenson,

    tonydenson tonydenson May 5, 2015 6:18 AM in response to BobHarris
    Level 1 (7 points)
    Desktops
    May 5, 2015 6:18 AM in response to BobHarris

    BobHarris wrote:

     

    I think you were missing my point. You cannot switch on wifi in a plane. But even putting that aside I want a wired connection as I find wifi rather erratic on a Pi.

    Yea, I think several of us were not clear on that point, and our natural bias for using WiFi dominated our brains

     

    If you use Applications -> Utilities -> Terminal -> ifconfig (After connecting the Pi to the Mac via Ethernet), does the Ethernet device (typically en0) have a self-assigned IP address (169.254.x.x) that you can use from your Pi to make a connection?

     

    Or is this a matter of the Pi needing the DHCP server to pick its own IP address so that the Mac can connect and control the Pi ?

     

    Can you just run "sudo /usr/libexec/bootpd -D -d -i en0" from a Terminal session?  "man bootpd" for more information.  This is apparently what Internet Sharing runs.  If this works, then after you connect your Pi, you can use ifconfig to see what IP address was assigned to en0 (I think).

     

    Applications -> Utilities -> Console -> system.log should contain any error messages from /usr/libexec/bootpd

     

    At the moment I'm sitting in a coffee shop with ONLY my Macbook Pro to play with, and no other computer systems I can attach to see if my guesses work.

    Thanks for all your input. I have now got it working by simply fixing my ip address at both ends (192.168.0.x), I seem to have been making heavy weather of it ! The problem I had as that for some reason it takes about 10-15 seconds before it responds to an SSH command and I was being too impatient.

  • by rbstackhouse,

    rbstackhouse rbstackhouse Mar 3, 2016 4:46 PM in response to tonydenson
    Level 1 (0 points)
    Mar 3, 2016 4:46 PM in response to tonydenson

    Glad you got it working.

     

    I too have been having difficulties when trying to set up bootpd as a dhcp server on OS X. I am also trying to communicate directly with an R-Pi over network cable.

     

    If you would be so kind, what does it say when you enter the command networksetup -getinfo Ethernet