Request an invite
Docs menu

osmates vm egress

Show or change what a machine may reach on the network.

Usage
osmates vm egress [<options>] <machine>

--mode open lets everything out; allowlist only what a rule allows; blocked nothing. A rule is [tcp |udp ]destination[:ports]: a name, *.name for the names under it, an address range, host for this Mac, or preset:packages, preset:github or preset:models. Without ports a name allows TCP 80 and 443, and a range every port. A running Linux or macOS machine on NAT or a shared network takes blocked and open at once; an allowlist turns its network off now and applies when OSMates restarts it, with osmates vm restart. Inside a run that started limited, every change applies at once. A stopped machine takes the change at its next start. A clone made with --preset agent-sandbox is never open.

Arguments

<machine>Required

The machine's name or identifier.

--mode <mode>

open, allowlist or blocked.

One of open, allowlist, blocked.

--allow <rule>Repeatable

A destination to allow; repeat for more.

--remove <rule>Repeatable

A destination to allow no longer; repeat for more.

--json

Print machine-readable JSON.

JSON output

With --json, it prints an object with these fields.

JSON Schema: /schemas/0/cli/vm/egress.json

allowedintegerRequired
appliedstring

One of live, detached, detachedUntilRestart, atNextStart.

lastRefusalobject
lastRefusal.countintegerRequired
lastRefusal.destinationstringRequired
lastRefusal.portinteger

At least 0.

lastRefusal.reasonstringRequired

One of open, rule, no_rule, unresolved, name_mismatch, address_mismatch, no_server_name, not_inspectable, rebinding, blocked_mode, policy_changed, local_name, spoofed, limit, link, detached, loopback, host, credential, grant_ended, refused_request, upstream.

lastRefusal.transportstring

One of tcp, udp.

pathstring

One of direct, filtered.

pathFollowsPolicybooleanRequired
policyobjectRequired
policy.modestringRequired

One of open, allowlist, blocked.

policy.rulesarray of stringsRequired
refusedintegerRequired
restartNeededbooleanRequired
runstring

One of direct, filtered, detached.

sharedNetworkstring

Exit statuses

Its exit status is one of these.

StatusMeaning
0The command did what it was asked.
1The command failed; with --json, standard error's last line is the error object.
64The command line is wrong, as ArgumentParser found before the command ran.
65What was given is wrong, found while the command ran; the same command fails until it changes.
75The same command can work later with nothing changed, as while an update finishes.
130Control-C cancelled what the command started.

Report a problem with this page