How to use mac as a full router with DHCP, DNS, Port Fowarding etc.?
Simple...yeah right....

Note: Someone please edit this to include only default commands

Covered in this answer


DHCP (Range, reservations, mask, router, lease time)
DNS
Port Forwarding
Setup
Text Book




DHCP

Range

Option 1: com.apple.nat.plist[1]


sudo cp /Library/Preferences/SystemConfiguration/com.apple.nat.plist /Library/Preferences/SystemConfiguration/com.apple.nat.plist.orig // Backup just incase
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkNumberStart [START IP ADDRESS]
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkNumberStart [END IP ADDRESS]


Option 2:  /etc/bootpd.plist


Turn on Internet Sharing
sudo nano /private/etc/bootpd.plist


3.

&lt;key&gt;net_range&lt;/key&gt;
        &lt;array&gt;
             &lt;string&gt;[START IP ADDRESS]&lt;/string&gt;
             &lt;string&gt;[END IP ADDRESS]&lt;/string&gt;
        &lt;/array&gt;


Lease Time


Turn on Internet Sharing
sudo nano /private/etc/bootpd.plist// No need for backup it will recreate incase any issues


3.

 &lt;key&gt;lease_max&lt;/key&gt;
      &lt;integer&gt;[MAX TIME]&lt;/integer&gt;
 &lt;key&gt;lease_min&lt;/key&gt;
      &lt;integer&gt;[MIN TIME]&lt;/integer&gt;


Subnet Mask

Option 1: com.apple.nat.plist


sudo cp /Library/Preferences/SystemConfiguration/com.apple.nat.plist /Library/Preferences/SystemConfiguration/com.apple.nat.plist.orig // Backup just incase
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkMask [SUBNET MASK]


Option 2:  /etc/bootpd.plist


Turn on Internet Sharing 
sudo nano /private/etc/bootpd.plist


3.

&lt;key&gt;net_mask&lt;/key&gt;
     &lt;string&gt;[SUBNET MASK]&lt;/string&gt;


Router IP
1. Turn on Internet Sharing 


sudo nano /private/etc/bootpd.plist


3.

&lt;key&gt;dhcp_router&lt;/key&gt;
                    &lt;string&gt;[ROUTER IP ADDRESS]&lt;/string&gt;




DNS

Change Server


Turn on Internet Sharing 
sudo nano /private/etc/bootpd.plist


3.

&lt;key&gt;dhcp_domain_name_server&lt;/key&gt;
     &lt;array&gt;
         &lt;string&gt;[DNS SERVER IP]&lt;/string&gt;
     &lt;/array&gt;


Alter Settings

Option 1: macOS Server


Use macOS Server | DNS Service
Once you turn it on and alter all setting it will say "Set your network DNS settings to [DNS SERVER IP] to use this server"


Change the Server (how to is above) to this IP address



Option 2: /etc/hosts 4


sudo nano /private/etc/hosts
IP [TAB] DOMAIN




Port Forwarding 5



Setup/Turn on Internet Sharing 6


Open System Preferences
Go to Sharing
Select the pull-down next to "Share your connection from:" and choose an interface
Check off the interfaces you would like to "Share your connection from"
Click WiFI Options and alter settings there
Once finished, Click "OK" then Check "Internet Sharing" on the left




TextBook/Glossary (Not alphabetical)

Router

DHCP: Dynamic Host Configuration Protocol

DNS: Domain Name System

Port

Firewall: macOS Sierra: Firewall pane of Security &amp; Privacy System Preferences

IP Range

Subnet

DHCP Reservations

IP Range: Check if Port is open

Modem: Modulator-demodulator (Who named this???)

Feel Free to edit and add Text Book Terms