Enabling the local firewall can protect your device from unwanted connections initiated by other computers when you're connected to a network.
- On your Mac, choose Apple menu > System Preferences, click Security & Privacy, then click Firewall.
- Click the lock in the bottom left to make changes.
- Click Turn On Firewall.
The Microsoft Defender Firewall is enabled by default. Turning off Microsoft Defender Firewall could make your device more vulnerable to unauthorized access. If there's an app you need to use that's being blocked, you can allow it through the firewall, instead of turning the firewall off.
- Select the Start button > Settings > Update & Security > Windows Security and then Firewall & network protection.
Select a network profile: Domain network, Private network, or Public network.
Under Microsoft Defender Firewall, switch the setting to On.