osmates vm egress
Show or change what a machine may reach on the network.
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>RequiredThe machine's name or identifier.
--mode <mode>open, allowlist or blocked.
One of
open,allowlist,blocked.--allow <rule>RepeatableA destination to allow; repeat for more.
--remove <rule>RepeatableA destination to allow no longer; repeat for more.
--jsonPrint machine-readable JSON.
JSON output
With --json, it prints an object with these fields.
JSON Schema: /schemas/0/cli/vm/egress.json
allowedintegerRequiredappliedstringOne of
live,detached,detachedUntilRestart,atNextStart.lastRefusalobjectlastRefusal.countintegerRequiredlastRefusal.destinationstringRequiredlastRefusal.portintegerAt least 0.
lastRefusal.reasonstringRequiredOne 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.transportstringOne of
tcp,udp.pathstringOne of
direct,filtered.pathFollowsPolicybooleanRequiredpolicyobjectRequiredpolicy.modestringRequiredOne of
open,allowlist,blocked.policy.rulesarray of stringsRequiredrefusedintegerRequiredrestartNeededbooleanRequiredrunstringOne of
direct,filtered,detached.sharedNetworkstring
Exit statuses
Its exit status is one of these.
| Status | Meaning |
|---|---|
| 0 | The command did what it was asked. |
| 1 | The command failed; with --json, standard error's last line is the error object. |
| 64 | The command line is wrong, as ArgumentParser found before the command ran. |
| 65 | What was given is wrong, found while the command ran; the same command fails until it changes. |
| 75 | The same command can work later with nothing changed, as while an update finishes. |
| 130 | Control-C cancelled what the command started. |