Dhcp Server For Macos

broken image


[Please note that the following is only known to apply to Mac OS X10.4 'Tiger'. I have not checked the below setup with anylater versions; confirmation is appreciated from any that have.—CDJ]

Dhcp Server For Macbook Pro

Choose Using DHCP from the Configure IPv4 pop-up menu; then click the Apply button. Mac OS X contacts the DHCP server to obtain an IP address, a subnet mask, a gateway router IP address, and a Domain Name System (DNS) address. (DNS servers convert a human-friendly address to a computer-friendly IP address, like 66.218.71.86.). Mac OS X comes with a DHCP server built-in. The server is called bootpd and does both DHCP and BOOTP. These instructions just describe using it for DHCP. To start, you need to create a configuration file for the server. The file should be stored in /etc/bootpd.plist. How to Renew a DHCP Lease on a Mac. Dynamic Host Configuration Protocol (DHCP) is a special server configured to pass out IP information and other IP information to network clients. If a workstation has obtained IP configuration.

I used to have an original Mac mini as my primary desktopmachine, and I used several laptops (Apple and non-Apple) as well. Ileave laptop ethernet ports configured to use DHCP automatically, asthat's typically the easiest way to get them to work when connectedto airport, hotel, or other destinations' ethernet jacks; I decidedit would be nice to connect them directly to the mini when wanting totransfer huge amounts of data, and not have to worry about areconfiguration every time. Apple's newer machines don't requirea crossover cable or hub just to connect to another machine via ethernet,so I essentially just needed to run a DHCP server on the mini providingrouting and configuration information, and connect a cable from the mini tothe laptop-of-the-day, and have a full, fast connection which I can useto transfer files between the laptop and mini or browse the web.

I have a decent amount of home-networking experience, and with the help ofsome of Apple Supportdocuments and Mac Help (specifically, an article entitled 'Connecting twocomputers using Ethernet'), it wasn't hard for me to determine thefollowing process—the results, however, were pleasantlysurprising. Not only could the two 'communicate', but this process infact establishes the mini as a DHCP server, and after the (quite simple)setup below, everything works adequately, if not ideally.

Problems

I'm listing problems with this procedure first for a couple of reasons.First, you should know what will and will not work well after following thisprocedure. Second, the problems provide the basis for some of the decisionsI make later.

Numbers don't work

Some Googling (and cursory testing) seems to suggest that, no matter what,Internet Sharing always uses 'internal' numbers on the 192.168.2.0subnet, a real no-no if there's already another 192.168.2.0 subnet. There are some waysto work around that, but they're far from ideal—they essentiallyinvolve disabling the built-in Internet Sharing and setting up your ownversion. For me, it's fairly easy not to use 192.168.2.0 for any other subnet, so I'm unlikely to pursue it further.

Names don't work

Sure, you can use the IPaddresses if you like (it's set above on the Mac, and doesn't change), but the possibility of not doing so is one of thereasons I wanted to do this in the first place. Instead, I'd like to usethe machine names: to connect to the Mac, just use thename listed in the Sharing pane (as in 'natalie.local'below). To connect to your other computer, check that machine'sdocumentation for how to determine or set its name. This doesn't seemto work at the moment.

This can be partially worked around with either a Mac laptop or byinstalling Bonjour on aWindows laptop. However, there doesn't seem to be an idealOS-agnostic solution that doesn't require installing software on theclient, though the idea of simply installing software on the Mac seemsreasonable.

This can also be worked around in conjunction with the previous problemby running a self-configured nameserver on the Mac instead of the oneset up by Internet Sharing. Again, however, in conjunction with that problem,you always know the Mac will be at 192.168.2.1, so you may as well just use that number.

One more thing…

One other caveat seems to apply: this doesn't seem to work (completely) if you're not logged in on your Mac and you use WEP (or possibly WPA)encryption for your AirPort network. This is likely because the encryptionkey is stored in your 'personal' keychain. There are almostcertainly ways around this, but I don't tend to have this problem (exceptin theory), so I'm not likely to pursue it further at the moment.

The Short Version

  1. Set up ethernet on the Mac
  2. Enable internet sharing on the Mac
  3. Enable personal web sharing & any other filesharingservices
  4. If the firewall is enabled, disable UDP blocking on the Mac
  5. Connect the ethernet port on the Mac to the ethernet port on anothercomputer, and (if necessary) tell the other computer to get its networksettings from DHCP
Dhcp server for macos high sierra

The Long Version

My Mac mini is connected via its built-in AirPort Extreme to my wireless gateway, so the ethernet port is free—I have no idea how well these instructions will work, if at all, if you're using your ethernet connection to connect to the Internet.

I'll assume here you're using the same setup I am—I won'tbe held responsible if you're not. I'll also assume that you'vealready got a working connection via your Mac's AirPort to the Internet.Configuring such a connection is beyond the scope of this document.

Set up ethernet on the Mac

Ethernet must somehow be configured on the Mac. I believe the factoryconfiguration is to set it up for DHCP, and that's fine; when itdoesn't find a DHCP server, it will just default to a 'private' address. If you want to check, open System Preferencesand click on the 'Network' pane:

Click on the menu next to 'Show', and choose 'Built-inEthernet'; set the 'Configure IPv4' menu to 'Using DHCP':

'Apply Now', and go on….

It's also possible (and some might say preferable) to simply set theethernet address to 192.168.2.1. Since that's what is used for thesharing, why take up another address, even if it is private? The actualimplementation of this is left to the reader.

Enable internet sharing on the Mac

'Internet Sharing' allows your Mac to act as a gateway,assuming it's connected to the Internet. To enable internet sharing, open System Preferences and click on the 'Sharing' icon:

Choose the 'Internet Sharing' tab and select to share theAirPort connection to computers using the Ethernet connection. Click'Start':

Enable Personal Web Sharing & Any Filesharing Services

Internet Sharing on the Mac is designed to do just that, not tosimply to share data between two computers. If your other computer isrunning a service to allow uploading and downloading files (Windows file sharing, for instance, or SFTP), this step may not be necessary.However, if you have the Mac OS X firewall running, you may want to'open it up' a bit more with this and the next step.

Dhcp Server App For Macos

If you want to use the Mac as your gateway to the web (so that the other computer doesn't need to have its own connection to the Internet), this is also the time to set that up. Note that this also applies if you simply want to share data between the two computers using HTTP, the protocol that runs the web.

Click on the 'Services' tab, and check 'PersonalWeb Sharing' and any filesharing services you want to run on the Mac,like Windows Sharing or Personal File Sharing (AppleShare). (Note thatRemote Login also includes SFTP.)

Disable UDP Blocking

Dhcp Server For Macos Catalina

DHCP and DNS use UDP; if your Mac isn't responding to UDPrequests, DHCP won't work. Click on the 'Firewall' tab:

If the firewall is running, click on the 'Advanced'button, and make sure 'Block UDP Traffic' is not checked:

Connect and Go!

That's it from the Mac side of things. Most computers areinitially set up to use DHCP on their ethernet ports—refer to yourmachine's documentation if you're unsure how to check or how toset that up. Connect an ethernet cable between the two machines, and start browsing.

For

Dhcp Server For Macos High Sierra

Server
Dhcp Server For Macos

The Long Version

My Mac mini is connected via its built-in AirPort Extreme to my wireless gateway, so the ethernet port is free—I have no idea how well these instructions will work, if at all, if you're using your ethernet connection to connect to the Internet.

I'll assume here you're using the same setup I am—I won'tbe held responsible if you're not. I'll also assume that you'vealready got a working connection via your Mac's AirPort to the Internet.Configuring such a connection is beyond the scope of this document.

Set up ethernet on the Mac

Ethernet must somehow be configured on the Mac. I believe the factoryconfiguration is to set it up for DHCP, and that's fine; when itdoesn't find a DHCP server, it will just default to a 'private' address. If you want to check, open System Preferencesand click on the 'Network' pane:

Click on the menu next to 'Show', and choose 'Built-inEthernet'; set the 'Configure IPv4' menu to 'Using DHCP':

'Apply Now', and go on….

It's also possible (and some might say preferable) to simply set theethernet address to 192.168.2.1. Since that's what is used for thesharing, why take up another address, even if it is private? The actualimplementation of this is left to the reader.

Enable internet sharing on the Mac

'Internet Sharing' allows your Mac to act as a gateway,assuming it's connected to the Internet. To enable internet sharing, open System Preferences and click on the 'Sharing' icon:

Choose the 'Internet Sharing' tab and select to share theAirPort connection to computers using the Ethernet connection. Click'Start':

Enable Personal Web Sharing & Any Filesharing Services

Internet Sharing on the Mac is designed to do just that, not tosimply to share data between two computers. If your other computer isrunning a service to allow uploading and downloading files (Windows file sharing, for instance, or SFTP), this step may not be necessary.However, if you have the Mac OS X firewall running, you may want to'open it up' a bit more with this and the next step.

Dhcp Server App For Macos

If you want to use the Mac as your gateway to the web (so that the other computer doesn't need to have its own connection to the Internet), this is also the time to set that up. Note that this also applies if you simply want to share data between the two computers using HTTP, the protocol that runs the web.

Click on the 'Services' tab, and check 'PersonalWeb Sharing' and any filesharing services you want to run on the Mac,like Windows Sharing or Personal File Sharing (AppleShare). (Note thatRemote Login also includes SFTP.)

Disable UDP Blocking

Dhcp Server For Macos Catalina

DHCP and DNS use UDP; if your Mac isn't responding to UDPrequests, DHCP won't work. Click on the 'Firewall' tab:

If the firewall is running, click on the 'Advanced'button, and make sure 'Block UDP Traffic' is not checked:

Connect and Go!

That's it from the Mac side of things. Most computers areinitially set up to use DHCP on their ethernet ports—refer to yourmachine's documentation if you're unsure how to check or how toset that up. Connect an ethernet cable between the two machines, and start browsing.

Dhcp Server For Macos High Sierra

Advanced Features

Despite this configuration being rather limited (see the above problems), there are at least one or two moreadvanced things that can be done quite easily. One of the most useful I've found is static IP assignments based on MAC address. For the specifics (which include adding a NetInfo entry), see the man page forbootpd in the terminal.

All information on this website (http://www.aleph0.com/), unlessotherwise noted, is wholly the work of Christian Jones (chjones@aleph0.com). All information, data, and formatting is hereby released into the publicdomain, with no rights reserved. For questions, concerns, or comments,please email the author.

Dhcp Server For Macos 10.13

The above screenshots are taken from Apple Computer's Mac OS X version 10.4'Tiger'. They are neither the property nor the creation ofChristian Jones, but are believed to be used here under Fair Use.Please avoid reusing them without appropriate legal consideration.





broken image