External Connectivity Modes
Choose how Spinifex VPC instances reach the outside world: pool mode with public IPs, routed nat mode for WiFi and cloud uplinks, or overlay-only networking.
Overview
The [network] section in spinifex.toml controls how VMs reach the outside world. There are three modes, and pool mode has two IP sources (static or DHCP).
Instructions
Which Mode Do I Need
The mode depends on what the uplink of the node accepts. pool mode puts each public IP on the wire with its own MAC address. nat mode puts only the MAC address of the host on the wire.
| Uplink of the node | Mode |
|---|---|
| Wired NIC on a switch and router that you control, which accept frames from many MAC addresses | pool |
| WiFi or WWAN | nat |
| Cloud VNIC (any cloud-hosted node) | nat |
| Upstream router, access point or switch port that drops frames from a MAC address it did not assign or learn (port security, a MAC limit, some ISP and home routers) | nat |
| No access outside the VPC is necessary | Disabled |
Some upstream devices accept the frames of a new MAC address but do not forward the replies. In pool mode, the instance then has a public IP, the host sends each reply correctly, and the replies do not arrive. If you see this, use nat with a public pool. To confirm the cause, see Public IP replies leave the host but do not arrive.
pool — Full Public Networking (Recommended)
Each VM in a public subnet gets its own public IP with bidirectional 1:1 NAT. Supports the full AWS feature set: public subnets, auto-assign public IPs, Elastic IPs, and security groups.
Pool mode supports two ways to obtain public IPs:
Static Range (default)
The admin defines a range of routable IPs that Spinifex manages exclusively.
Use when: You have a block of IPs you control — datacenter ISP allocation, homelab range carved out of your router's DHCP scope, enterprise DMZ range.
Requirement: The IP range must NOT be served by any other DHCP server. In a homelab, shrink your router's DHCP scope to exclude the Spinifex range.
[network]
external_mode = "pool"
[[network.external_pools]]
name = "wan"
range_start = "192.168.1.150"
range_end = "192.168.1.250"
gateway = "192.168.1.1" # Router / next-hop IP
prefix_len = 24
dns_servers = ["192.168.1.1", "8.8.8.8"]
DHCP Source
Instead of a static range, public IPs come from the upstream router's DHCP server. When a VM launches, Spinifex requests a DHCP lease from the router on behalf of the VM. When the VM terminates, the lease is released.
The VM itself never talks to the router's DHCP — it only sees its private VPC IP (from OVN's internal DHCP). The host-side DHCP conversation is invisible to the guest.
Use when: You don't control a static IP block but the router's DHCP server has enough leases. Homelabs where you don't want to carve out a range. Environments where IPs are managed centrally by the network team's DHCP.
Requirement: A bind_bridge setting that names the Linux bridge on the router's network. vpcd runs its own DHCP client on that bridge, so the host needs no DHCP client package.
[network]
external_mode = "pool"
[[network.external_pools]]
name = "wan"
source = "dhcp" # "static" (default) or "dhcp"
bind_bridge = "br-wan" # Required with source = "dhcp"
gateway = "192.168.1.1" # Router / next-hop IP
prefix_len = 24
dns_servers = ["192.168.1.1", "8.8.8.8"]
# No range_start/range_end — IPs come from router DHCP
How Pool Mode Works (Both Sources)
Regardless of whether IPs come from a static range or DHCP, the OVN behavior is identical:
Choosing Static vs DHCP
| Static Range | DHCP Source | |
|---|---|---|
| Public IPs from | Admin-defined range_start..range_end | Router's DHCP server |
| IP predictability | You know the exact range | Router assigns whatever is available |
| Setup effort | Must reserve range, shrink router DHCP scope | Just set source = "dhcp" |
| Dependency | None | Working router DHCP |
| Best for | Datacenters, ISP blocks, production | Homelabs, dev environments, shared networks |
| Capacity | Exact: range_end - range_start IPs | Limited by router's DHCP pool size |
Both support the same AWS features: public subnets, Elastic IPs, security groups, DescribeInstances showing public IPs.
nat — Shared SNAT (Simple)
nat is a supported mode, not a fallback. It is covered by the nightly e2e suite (cells 19 and 30, single- and multi-node) and it is the only mode a cloud-hosted node can run, so the OCI deployment depends on it. Read "specialised" below as "fewer deployments need it", never as "less finished".
Start with pool unless one of the reasons below applies. Pool mode is the default, is what most of the VPC networking pages describe, and is what the AWS feature set was built against. nat is the specialised mode: it exists for uplinks that cannot be bridged, and it reaches AWS parity through host-side plumbing rather than by putting VM addresses on the wire.
Reach for nat when the uplink refuses to carry anything but its own MAC and its own addresses — WiFi and WWAN, and any cloud-hosted node, where the VNIC drops a frame whose source address is not registered to it. On such a host nat is not a preference, it is the only mode that works at all; pool mode's localnet needs to announce VM addresses by ARP and a cloud VNIC will not carry them. See oci-integration.
All VMs share a single external IP for outbound SNAT. By default there are no public IPs, no Elastic IPs, and no inbound from WAN — all subnets behave as private subnets with internet access. On routed-NAT nodes, adding a public pool restores full public IP parity (see below).
Limitation (routed-NAT v1): System instances (ECS/EKS/load-balancer agents) source egress from ExternalIPAM pool IPs, which do not exist in
external_mode=nat. Those features requireexternal_mode=pool. A v2 will either allocate transit IPs for system instances or reject the feature at the API level in nat mode.
OVN SNATs each VPC to a transit address on 100.127.0.0/24, the network between OVN and the host. The host then masquerades that network to the address of its uplink, so the uplink address is the single external IP that all VMs share. setup-ovn.sh --nat-uplink creates the transit network, and spx admin init --external-mode=nat writes its pool, nat-transit. You do not set gateway_ip for this mode, and setup-ovn.sh ignores --dhcp with --nat-uplink.
Use when: VMs only need outbound access (apt update, pulling images). Edge deployments behind ISP NAT. Single WAN IP available.
[network]
external_mode = "nat"
[[network.external_pools]]
name = "nat-transit" # internal transit net (auto-generated)
gateway = "100.127.0.1"
gw_lrp_range_start = "100.127.0.16"
gw_lrp_range_end = "100.127.0.254"
prefix_len = 24
[nodes.<node>.vpcd]
bridge_mode = "nat"
Host access to instances (jumpbox pattern)
The spinifex host automatically reaches every instance's private IP: each node converges a host route into OVN (<vpc-cidr> via <gateway-transit-ip> dev spx-nat-host) for every attached VPC, and the IGW attach exempts the transit net from SNAT, so replies to host-initiated connections come back un-NATted. No per-instance setup. This only exists in routed NAT mode; other modes install no host routes. Every node runs this loop itself, on each intent change, on a nudge from the local IGW hooks and every 30 seconds, so a node that missed the attach event still gets the route. A route is removed on every node when no attached VPC holds its CIDR any more, such as after a detach. When several attached VPCs share one CIDR, the bootstrap VPC wins, then the lowest VPC ID, so detaching one gateway repoints the route to another attached VPC instead of removing it.
Security groups still apply and the default SG is closed to the host, same as AWS — open SSH/ICMP from the transit net first:
aws ec2 authorize-security-group-ingress --group-id $SG \
--protocol tcp --port 22 --cidr 100.127.0.0/24
Then use the host as a jumpbox for remote access:
ssh -J admin@<spinifex-host> ubuntu@<instance-private-ip>
Extra networks that must reach instances without SNAT (e.g. a management LAN) can be added via [network] nat_exempt_cidrs = ["192.168.50.0/24"].
Public IPs in NAT mode (public pool)
A routed-NAT node (setup-ovn.sh --nat-uplink + spx admin init --external-mode=nat) can carry a public pool alongside the internal nat-transit pool. With one configured, nat mode behaves like pool mode for public IPs: MapPublicIpOnLaunch on the default subnet, auto-assigned public IPs, and Elastic IPs all work. Spinifex delivers each public IP at the host — a /32 route steers it into OVN and a proxy-ARP neighbor entry answers for it on the uplink (L3 only, same MAC, so it works on WiFi and other non-bridgeable uplinks).
Static range carved out of the router's DHCP scope:
spx admin init --external-mode=nat \
--external-pool 192.168.1.150-192.168.1.250 \
--external-gateway 192.168.1.1
Or lease public IPs from the upstream router's DHCP:
spx admin init --external-mode=nat --external-source=dhcp \
--external-bind-bridge wlan0
On WiFi/WWAN uplinks the leases are requested with the interface's own MAC (dhcp_mac = "interface", written automatically) and distinguished by DHCP client-id. Some routers key leases by MAC and ignore the client-id — Spinifex detects this (the router hands the same IP to two client-ids) and fails the allocation with advice to switch to a static range.
Resulting config:
[network]
external_mode = "nat"
[[network.external_pools]]
name = "nat-transit" # internal transit net (auto-generated)
gateway = "100.127.0.1"
gw_lrp_range_start = "100.127.0.16"
gw_lrp_range_end = "100.127.0.254"
prefix_len = 24
[[network.external_pools]]
name = "wan" # public pool
source = "static"
range_start = "192.168.1.150"
range_end = "192.168.1.250"
gateway = "192.168.1.1"
prefix_len = 24
[nodes.<node>.vpcd]
bridge_mode = "nat"
NAT gateways in NAT mode
CreateNatGateway works here too, and draws its public address from the same public pool an EIP does. On the OVN side it is an snat row on the VPC router rewriting the private subnet's CIDR to that address — not the dnat_and_snat an EIP gets — so it is centralised on the VPC's gateway chassis by construction and there is no port or MAC to bind it to.
That address needs the same host plumbing as an EIP, and on a routed-NAT node it is the host that delivers it: the /32 route steering it into OVN, the proxy-ARP entry answering for it on the uplink, and the FORWARD accepts. Without them an egressing private instance leaves with a source address the host holds no route back to, while the masquerade rule — which matches the transit 100.127.0.0/24 alone — never sees the packet. Spinifex binds it when the gateway is created and re-asserts it on the host EIP pass, so no operator step is involved; ip route show dev spx-nat-host should list the gateway's public address alongside any EIPs.
NAT mode on more than one node
spx admin init --external-mode=nat --nodes N works for N > 1, and each public IP is delivered by the node running its instance rather than by one gateway node. Three things make that true, and all three are automatic:
- The
dnat_and_snatrow carriesexternal_macandlogical_port, so OVN processes it on the instance's own chassis — the same mechanism pool mode has always used. It is safe here becauseext-sharedis a localnet, so the transit veth is node-local and only the node running the instance can answer for the address on it. - Each node installs a host
/32for its own instances' addresses and leaves the rest alone, asking local OVS which ENIs are plugged in here. Runip route show dev spx-nat-hoston each node: exactly one node should hold each public address. - Every node's
spx-nat-hostcarries the same MAC,02:00:64:7f:00:01. OVN keeps one MAC binding for the transit next hop across the whole cluster, so a per-node address would send every chassis's return traffic to whichever node wrote the binding last.setup-ovn.shsets it and vpcd re-asserts it on every start.
Default egress — an instance with no public IP — is still centralised on the VPC's gateway chassis, which is unchanged and is what the gateway LRP's transit address is for.
On a cloud host the address must also be registered on that node's VNIC. The allocator runs per node and registers on the local VNIC, which is the right one exactly because the traffic now leaves there. oci_vnic_iface is the setting; oci_vnic_id is only needed to pin a pool to a specific VNIC and should not be set for this.
Caveat — reaching an EIP from the spinifex host itself. Host-sourced traffic enters OVN from the transit net, which is exempt from NAT (that is what makes the jumpbox pattern work) — so a host connection to an EIP that carries the transit source IP would skip DNAT. Spinifex stamps the EIP route with the uplink's LAN IP as source to avoid this, but if no uplink address can be determined, connect to the instance's private IP from the host instead. Other machines on the LAN are unaffected.
Disabled (Empty/Omitted)
VPC networking is overlay-only. No external connectivity. Instances can only communicate within their VPC.
Mode Comparison
| Capability | pool (static) | pool (dhcp) | nat | Disabled |
|---|---|---|---|---|
| Outbound internet | Yes | Yes | Yes | No |
| Host reaches instance private IPs | No | No | Yes (routed) | No |
| Inbound from WAN | Yes (1:1 NAT) | Yes (1:1 NAT) | With public pool | No |
| Public subnets | Yes | Yes | With public pool | No |
| Auto-assign public IPs | Yes | Yes | With public pool | No |
| Elastic IPs | Yes | Yes | With public pool | No |
| DescribeInstances shows public IP | Yes | Yes | With public pool | No |
| Admin must reserve IP range | Yes | No | Only static pool | No |
| Needs router DHCP | No | Yes | Optional | No |
| Works on a non-bridgeable uplink | No | No | Yes | n/a |
| NAT gateways | Yes | Yes | With public pool | No |
| More than one node | Yes | Yes | Yes | Yes |
If you start with nat and later need public subnets: on a bridgeable uplink switch to pool and define a range (or use source = "dhcp"); on a routed-NAT node just add a public pool alongside nat-transit — no data migration needed.
Troubleshooting
- Public IP replies leave the host but do not arrive: the upstream drops frames from the ENI MAC addresses. Use
natwith a public pool. - Instance has no public IP: check the subnet, the IGW and the pool.
- Public IP not reachable from WAN: check each layer in sequence.