It also addresses what to do with routers.

But assuming you want to open a port directly, selectAdvanced Settingsfrom the left-hand menu.

Select theInbound Rulesitem from the panel on the left and then clickNew Rulefrom the right-hand panel.

The Windows Defender Firewall Entry in the Start Menu.

Then choose to either openAll local ports(this is very risky!)

with this rule or aSpecific local portor range.

Firewall rules allow you to explicitly alloworblock connections.

The Windows Defender Firewall Entry in the Start Menu.

ClickNextwhen you’re done.

Select whichever of these make sense for your app; if you’re unsure, select them all.

Finally, give the rule a name and optionally a description.

The Windows Defender Firewall Settings Screen.

Then clickFinishto create your rule.

After you’ve checked that your firewall is on, then adhere to these instructions:

Open theTerminalapp.

you’re able to add your custom rule, but confirm you do sobelowany existing configurations.

Windows Defender Firewall with Advanced Security tool.

In this case, you should launch the internet port and let that traffic through to your app.

To do that, you need toset up port forwarding.

New Inbound Rule Wizard’s “Port” Option.

New Inbound Rule Wizard’s Protocol and Port Selection.

New Inbound Rule Wizard’s Action Selection.

The Firewall Toggle in macOS System Preferences.

A Custom Firewall Rule Added to the pf.conf File.