Craig Francis


Quick DHCP on OSX 10.8

If you need to quickly connect to a device that uses DHCP to make some changes...

In the OSX System Preferences > Sharing,

Enable Internet Sharing to computers using Ethernet,

Then open a terminal, and run:

tail -f /var/log/system.log

Connect the device via Ethernet, and wait for it to power up.

You should see some output on the terminal, such as:

DHCP REQUEST [bridge0]: 1,aa:aa:aa:aa:aa:aa <raspberrypi>
DHCP DISCOVER [bridge0]: 1,aa:aa:aa:aa:aa:aa <raspberrypi>
OFFER sent <no hostname> 192.168.4.5 pktsize 300
ACK sent <no hostname> 192.168.4.5 pktsize 300

This gives you the IP address of the device.

However you may not be able to ping it, as it could be on a "bridge" interface:

ifconfig
bridge0:
inet 192.168.4.1

ping -b bridge0 192.168.4.5
PING 192.168.4.5 (192.168.4.5): 56 data bytes
64 bytes from 192.168.4.5...

To add the route to this network, just call:

sudo route add -net 192.168.4 -interface bridge0

And now you can connect to it via SSH, or other protocols.