macOS Sierra: Prevent others from discovering your Mac
If you’re concerned about security, you can use “stealth mode” to make it more difficult for hackers and malware to find your Mac. When stealth mode is turned on, your Mac does not respond to “ping” requests and does not answer connection attempts from a closed TCP or UDP network.
To open the Firewall pane, choose Apple menu > System Preferences, click Security & Privacy, then click Firewall.
Click the lock icon to unlock it, then enter an administrator name and password.
Click Firewall Options.
If the Firewall Options button is disabled, first click Turn On Firewall to turn on the firewall for your Mac. For more information, see Prevent unwanted connections by using a firewall.
Select “Enable Stealth Mode.”