Any custom network can have a firewall: a default action for each direction and an ordered list of rules. MacVisor enforces it in the Mac's packet filter (pf), outside the VMs. A guest can't turn it off, and nothing is installed inside it.
To turn it on, open Networks, select a custom network, and switch on Enable Firewall.
The firewall filters the network's traffic. A VM's own port forwards (VM Settings → Network, mvz ports) don't cross the network: MacVisor's guest agent carries them to the guest's localhost over a virtual socket, so the firewall doesn't apply to them. They listen on this Mac only.
A rule you remove or change by mistake comes back with Undo Last Change in the editor's footer, or ⌘Z, and is in force again at once.
Directions are relative to the VMs
| Direction | Means |
|---|---|
| Inbound | Traffic arriving at the VMs on this network |
| Outbound | Traffic the VMs send |
Each direction defaults to Allow or Deny. A rule names the other end of the connection: the destination of an outbound rule, or the source of an inbound one.
Rules
Each rule has a switch, a direction, an action, a protocol, a remote address and ports.

- Protocol: Any, TCP, UDP or ICMP. Ports apply to TCP and UDP only.
- Remote CIDR: a range such as
10.0.0.0/8, a single address such as192.168.1.50, orany. - Ports: one port (
443), a range (8000-8080), or empty for all.
Rules are checked from the top and the first match wins. Unmatched traffic gets the direction's default. Allow rules are stateful, so replies to an allowed connection come back even if the other direction denies by default.
Each rule shows its number. New rules go at the bottom; use the up and down arrows at the end of a rule to move it. An exception has to sit above the broader rule it carves out of: an allow for 10.0.0.5 below a deny for 10.0.0.0/8 never matches.
A rule that can't be enforced as written, such as an invalid CIDR or port range, is marked in the editor and skipped. The rest still apply.
Example
A lab network that can reach the internet over HTTPS but not the corporate LAN. Set both defaults to Deny, then add:
| Direction | Action | Protocol | Remote | Ports |
|---|---|---|---|---|
| Outbound | Deny | Any | 10.0.0.0/8 | |
| Outbound | Allow | TCP | any | 443 |
What always stays open
DHCP inside the network, and DNS to the gateway when the DNS proxy is on. Without them, a network that denies by default could never give a VM an address.
When rules apply
The MacVisor background service applies every network's policy whether or not the app is open: when it starts, when you change a policy in the app or with mvz, and when a VM on the network starts. A change takes effect at once. MacVisor also clears pf's connection state for the subnet, so existing connections can't carry on under the old rules. Turning Enable Firewall off removes the network's rules.
The network's Firewall section shows the current state:
| Status | Meaning |
|---|---|
Enforcing on <subnet> | The rules are active. Skipped rules are counted beside it |
| Starts when a VM runs on this network | The network has no subnet yet, or its subnet overlaps one of the Mac's own networks and no VM is on it. The rules load when its first VM starts; hover for the reason |
| Needs approval to enforce | The network helper isn't installed or approved |
| Not enforced | Something is in the way. The reason is shown under the rules |
The network helper is normally installed during first-run setup. If you declined it, click Approve… next to the status. If macOS is holding it for approval, turn it on in System Settings → General → Login Items & Extensions. The helper re-applies the last policy at boot, before anyone logs in. Uninstalling MacVisor takes the rules out of effect. Your networks keep them, and after a reinstall MacVisor applies them again once the helper is approved. While any network's firewall is on, the helper stays running, so Activity Monitor shows MacVisorAdminHelper; with no firewall on, it exits when idle and launchd starts it again on demand.
From the command line
mvz networks firewall lab on --outbound deny --allow out:udp:53 --allow out:tcp:443
mvz networks firewall lab --inbound deny
mvz networks firewall lab --clear --deny out:any::10.0.0.0/8 --allow out:tcp:443
mvz networks firewall lab off
A rule is written in|out[:tcp|udp|icmp|any[:<ports>[:<cidr>]]]. Each part after the direction is optional, from the right.
- Rules keep the order you type them,
--allowand--denymixed, and the first match wins. - New rules go after the existing ones.
--clearremoves the existing ones first. - In the third example the deny comes first, so TCP 443 to
10.xaddresses is blocked and 443 anywhere else is allowed. - A rule that can't be enforced as written is refused with the reason, and nothing is saved.
The command returns once the rules are applied, and prints them in evaluation order:
Firewall on lab: on, enforced on 192.168.105.0/24 - inbound deny, outbound deny, 2 rules.
1. deny outbound any to 10.0.0.0/8
2. allow outbound tcp 443 to any
IPv6 is off on this network while the firewall is on (the firewall filters IPv4 only): the Mac drops all IPv6 on it, and VMs that were already running keep their IPv6 addresses, unused, until every VM on it has stopped.
When the rules aren't in force, the first line says on, but NOT enforced and the reason follows the list. Usually no VM has run on the network yet, or the network helper isn't approved. In mvz networks, each firewall shows as on, pending (saved but not in force) or off.
Verifying
The network's status, or mvz networks firewall <network> with no other options, tells you whether the rules are in force. To see exactly what pf enforces, with a match counter for each rule:
sudo pfctl -a 'com.apple/900.macvisor.firewall' -sr
sudo pfctl -ss
Limits worth knowing before you rely on it
How enforcement works
The rules live in a pf anchor that the stock /etc/pf.conf already evaluates. MacVisor never edits pf.conf or reloads the Mac's main ruleset.
The root helper receives a policy, never raw packet-filter rules, and compiles it itself. A user-level process can't ask it for anything the firewall editor can't express. See Security model.
DeltaSync