Use the MAC address option if, on a given routing switch, it does not matter to the DHCP server which VLAN is the source of a client request (that is, use the MAC address option if the IP addressing policies supported by the target DHCP server do not distinguish between client requests from ports in different VLANs in the same routing switch.). The mail server comes with a lot of newer improvements over the old Server.app Mail server that makes it a lot nicer and more secure to use: up-to-date versions, really fast solr mail searching, rspamd, better spam/ham training workflow, DKIM, postfix in chroot jail, and a lot more.
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'> <plist version='1.0'> <dict> <key>NetBoot</key> <dict/> <key>Subnets</key> <array> <dict> <key>allocate</key> <true/> <key>dhcp_domain_name</key> <string>no-dns-available.example.com</string> <key>dhcp_domain_name_server</key> <array> <string>0.0.0.0</string> </array> <key>dhcp_domain_search</key> <array/> <key>dhcp_router</key> <string>192.168.210.1</string> <key>lease_max</key> <integer>3600</integer> <key>name</key> <string>192.168.210 Wi-Fi</string> <key>net_address</key> <string>192.168.210.0</string> <key>net_mask</key> <string>255.255.255.0</string> <key>net_range</key> <array> <string>192.168.210.200</string> <string>192.168.210.253</string> </array> <key>selected_port_name</key> <string>en0</string> <key>uuid</key> <string>B03BAE3C-AB79-4108-9E5E-F0ABAF32179E</string> </dict> </array> <key>allow</key> <array/> <key>bootp_enabled</key> <false/> <key>deny</key> <array/> <key>detect_other_dhcp_server</key> <false/> <key>dhcp_enabled</key> <false/> <key>old_netboot_enabled</key> <false/> <key>relay_enabled</key> <false/> <key>relay_ip_list</key> <array/> </dict> </plist>
Settings from this file include: serveradmin settings dhcp
The output indicates that dhcp:static_maps = _empty_array dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:WINS_secondary_server = ' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:selected_port_name = 'en0' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:dhcp_router = '192.168.210.1' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:dhcp_domain_name_server:_array_index:0 = '192.168.210.2' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:net_mask = '255.255.255.0' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:WINS_NBDD_server = ' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:net_range_start = '192.168.210.200' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:lease_max = 3600 dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:dhcp_domain_search:_array_index:0 = 'internal.krypted.lan' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:descriptive_name = '192.168.210 Wi-Fi' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:WINS_primary_server = ' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:net_range_end = '192.168.210.253' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:dhcp_ldap_url = _empty_array dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:WINS_node_type = 'NOT_SET' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:net_address = '192.168.210.0' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:dhcp_enabled = yes dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:dhcp_domain_name = 'internal.krypted.lan' dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:WINS_scope_id = ' dhcp:subnet_defaults:logVerbosity = 'MEDIUM' dhcp:subnet_defaults:WINS_node_type_list:_array_index:0 = 'BROADCAST_B_NODE' dhcp:subnet_defaults:WINS_node_type_list:_array_index:1 = 'HYBRID_H_NODE' dhcp:subnet_defaults:WINS_node_type_list:_array_index:2 = 'NOT_SET' dhcp:subnet_defaults:WINS_node_type_list:_array_index:3 = 'PEER_P_NODE' dhcp:subnet_defaults:WINS_node_type_list:_array_index:4 = 'MIXED_M_NODE' dhcp:subnet_defaults:dhcp_domain_name = 'no-dns-available.example.com' dhcp:subnet_defaults:WINS_node_type = 'NOT_SET' dhcp:subnet_defaults:routers = _empty_dictionary dhcp:subnet_defaults:logVerbosityList:_array_index:0 = 'LOW' dhcp:subnet_defaults:logVerbosityList:_array_index:1 = 'MEDIUM' dhcp:subnet_defaults:logVerbosityList:_array_index:2 = 'HIGH' dhcp:subnet_defaults:dhcp_domain_name_server:_array_index:0 = '192.168.210.201' dhcp:subnet_defaults:selected_port_key = 'en0' dhcp:subnet_defaults:selected_port_key_list:_array_index:0 = 'bridge0' dhcp:subnet_defaults:selected_port_key_list:_array_index:1 = 'en0' dhcp:subnet_defaults:selected_port_key_list:_array_index:2 = 'p2p0' dhcp:subnet_defaults:selected_port_key_list:_array_index:3 = 'en1' dhcp:logging_level = 'MEDIUM'
Notice the correlation between the uuid string in /etc/bootp.plist and the arrayid entry for each subnet/network/scope (too many terms referring to the same thing, ahhhh!). Using the serveradmin command you can configure a lot more than you can configure in the Server app gui. For example, on a dedicated DHCP server, you could increase logging level to HIGH (as root/with sudo of course): serveradmin settings dhcp:logging_level = 'MEDIUM'
You can also change settings within a scope. For example, if you realized that you were already using 192.168.210.200 and 201 for statically assigned IPs elsewhere you can go ahead and ssh into the server and change the first IP in a scope to 202 using the following (assuming the uuid of the domain is the same as in the previous examples): serveradmin settings dhcp:subnets:_array_id:B03BAE3C-AB79-4108-9E5E-F0ABAF32179E:net_range_start = '192.168.210.202'
You can also obtain some really helpful information using the fullstatus verb with serveradmin: serveradmin fullstatus dhcp
This output includes the number of active leases, path to log file (tailing that file is helpful when troubleshooting issues), static mappings (configured using the command line if needed), etc. dhcp:state = 'RUNNING' dhcp:backendVersion = '10.11' dhcp:timeOfModification = '2016-10-04 04:24:17 +0000' dhcp:numDHCPActiveClients = 0 dhcp:timeOfSnapShot = '2016-10-04 04:24:19 +0000' dhcp:dhcpLeasesArray = _empty_array dhcp:logPaths:systemLog = '/var/log/system.log' dhcp:numConfiguredStaticMaps = 1 dhcp:timeServiceStarted = '2016-10-04 04:24:17 +0000' dhcp:setStateVersion = 1 dhcp:numDHCPLeases = 21 dhcp:readWriteSettingsVersion = 1
Once started, configure reservations using the /etc/bootptab file. This file should have a column for the name of a computer, the hardware type (1), the hwaddr (the MAC address) and ipaddr for the desired IP address of each entry: %% # hostname hwtype hwaddr ipaddr bootfile a.krypted.lan 1 00:00:00:aa:bb:cc 192.168.210.230 b.krypted.lan 1 00:00:00:aa:bb:cc 192.168.210.240
You can start and stop the service either using the serveradmin command: serveradmin stop dhcp serveradmin start dhcp
Or using the launchctl: sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/bootps.plist sudo /bin/launchctl load -w /System/Library/LaunchDaemons/bootps.plist
Finally, you can define DHCP options in /etc/bootp.plist. This process isn’t necessarily support, there is no GUI control for options, and options are not as widely used with devices as they once were. However, it’s absolutely an option if needed.There comes a point when you ask yourself, ‘there has to be a better way’ (this should be often). This was certainly the case where after a large campus switch out which required many printers to be reconfigure. Part of that reconfiguring was creating new DHCP reservation.
Unfortunately, if you do not cull the old lease, Windows (rightfully so) informs you there is already a device with that MAC in the reservation database. In someone’s at Microsoft’s infinite wisdom, they neglect to tell you what DHCP scope the device is currently reserved in. So I would begin to trawl each scope I guessed in maybe reserved in based on my knowledge of our current scopes. This would waste many minutes of my time (sometimes without success) which means my customers are getting less of me. No good.
But, I did ask myself, ‘there has to be a better way’…and there is!
Open up a command prompt window on your DHCP server (or a remote powershell session) and input the following:
All you need is the MAC address of the device and input it without ‘-‘ in the MACADDRESS space and you should get something a little like the below:
Another time saver for the time poor SysAdmin