Set network port forwards
set_network_port_forwardsReplaces a network's complete NAT port forwarding rule set for TCP or UDP traffic to eligible Firecracker server ports; send an empty rules list to withdraw all rules.
Instructions
Replace the COMPLETE NAT port forwarding rule set of an owned network (rules: [] withdraws all of them) at the router generation read from get_network_port_forwards. Each rule forwards TCP or UDP from the network's NAT public address (external_port) to a server's private port (private_port_id, internal_port). Targets are ports of this network's Firecracker servers that get_network_port_forwards lists as eligible: the first interface of a server without a public IPv4 of its own (kind private_primary) or the private interface of a server that has its own public IPv4 (kind own_ipv4; it answers forwarded connections through the network, and the target's reply_route says whether that reply route is in place or which command the customer runs on the server). Cloud VPS servers are not accepted. Security groups still decide whether the server takes the traffic: this never opens a security group and never buys an address. Mail ports 25, 465, 587 and 2525 are refused for every rule (nat_port_forward_smtp_refused) and a new or changed rule on a port the platform refuses is refused with nat_port_forward_port_refused; a refusal of one rule names it in context.rule_index. At most capability.limit rules (64 at most). A set equal to the applied one answers 200 outcome unchanged; otherwise 202, with outcome queued when an earlier change is still being applied and retried when the identical failed set is sent again. A request that only removes rules is never stopped by a service two-factor or abuse lock. Poll get_network_port_forwards until applied_generation equals generation and state is active or empty; last_change names a change the router refused (the applied rules are unchanged then). Requires explicit networking:read for reads or networking:manage for changes; full/read defaults do not grant networking. The backend enforces ownership, feature availability and service 2FA locks. Read current capabilities and owned resource state first; obtain approval for the exact change. An accepted operation is pending, not proof of connectivity. Poll the returned operation/resource on its in_progress flag, waiting next_check_seconds between reads: while in_progress is true its reason_code is what is awaited (reason_kind waiting, e.g. a queued or pending reason, or a control plane that has not answered yet), never an error; only in_progress false with reason_kind failure is a failure. Preserve reason_code. On transport uncertainty inspect state and reuse only the original key and unchanged request; never automatically retry.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"network_id": "<network_id>",
"expected_generation": "<expected_generation>",
"rules": "<rules>",
"idempotencyKey": "<idempotencyKey>"
},
"name": "set_network_port_forwards"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rules | Yes | ||
| network_id | Yes | Exact lowercase UUID returned by an owned networking resource | |
| idempotencyKey | Yes | Idempotency-Key for this exact change; preserve it and the unchanged body on uncertain recovery | |
| expected_generation | Yes |