Skip to content
mulga

Network Configuration Reference

Every spinifex.toml network setting for VPC networking: external_mode, external IP pools, per-node vpcd settings, pool selection, IPAM storage, and examples.

vpcnetworkingconfigurationip-poolsipam

Overview

All network configuration lives in spinifex.toml. Settings are split into three levels: cluster-wide mode, IP pool definitions, and per-node NIC settings.


Instructions

Configuration Levels

spinifex.toml configuration layers — cluster mode, IP pools, per-node WAN bridge

Cluster-Wide: external_mode

toml
[network]
external_mode = "pool"    # "pool", "nat", or "" (disabled)
ValueBehavior
"pool"Default. Full public networking — public subnets, auto-assign, Elastic IPs
"nat"Outbound-only SNAT — all VMs share one external IP. Add a public pool for full parity. For uplinks that cannot be bridged, including every cloud host
"" / omittedOverlay-only — no external connectivity

IP Pools: network.external_pools

Each pool defines where external IPs come from. Most clusters have one pool.

toml
[[network.external_pools]]
name        = "wan"                  # Pool identifier (unique within cluster)
source      = "static"              # "static" (default) or "dhcp"
range_start = "192.168.1.150"        # First allocatable IP (static source only)
range_end   = "192.168.1.250"        # Last allocatable IP (static source only)
gateway     = "192.168.1.1"          # WAN default gateway (next hop for 0.0.0.0/0)
gateway_ip  = ""                     # Address reserved in a static pool (defaults to range_start)
prefix_len  = 24                     # Subnet mask length
region      = ""                     # Scope to region (optional)
az          = ""                     # Scope to AZ (optional)
dns_servers = ["8.8.8.8"]           # DNS for VMs (optional)

Field Details

FieldRequiredDescription
nameYesUnique pool name. Referenced by AllocateAddress to target a specific pool.
sourceNoIP source: "static" (default) uses range_start/range_end. "dhcp" obtains IPs from the router's DHCP server on each VM launch. "oci", "exoscale", "vultr" and "latitude" get addresses from the API of that cloud provider.
bind_bridgeDHCP onlyLinux bridge on which vpcd sends its DHCP requests (for example br-wan). Required with source = "dhcp", and refused with any other source.
range_startStatic onlyFirst IP in the range. Spinifex reserves the first IP and does not give it to an instance, unless gateway_ip names a different address.
range_endStatic onlyLast IP in the range.
gatewayYesPhysical router/switch — the WAN default gateway. OVN sets 0.0.0.0/0 → gateway.
gateway_ipNoAddress that Spinifex reserves in a static pool and does not give to an instance. Defaults to range_start. In nat mode, VM egress uses the nat-transit pool and the uplink address of the host, not this address.
prefix_lenYesSubnet mask for the external network (e.g., 24 = /24).
regionNoScopes pool to a region. Instances in this region prefer this pool.
azNoScopes pool to an AZ. More specific than region.
dns_serversNoDNS servers propagated to VMs via OVN DHCP.
gw_lrp_range_start / gw_lrp_range_endNoReserve gateway-LRP IPs for per-VPC OVN routers. When unset, the allocator auto-derives the top 16 host IPs of the pool subnet (~15 concurrent VPCs). Widen to raise the concurrent-VPC ceiling — the nat-transit pool defaults to 100.127.0.16-100.127.0.254 (239 VPCs). Must not overlap range_start/range_end.

Why range_start/range_end Instead of CIDR?

Customer IP ranges rarely align to CIDR boundaries. A datacenter might have 203.0.113.10-203.0.113.200 from their ISP. Start/end avoids forcing admins to calculate CIDR blocks.

Gateway vs Gateway_IP

These are different things:

  • gateway = Your network's default gateway (e.g., 192.168.1.1). This is where OVN sends packets destined for the internet. It's your router.
  • gateway_ip = An address that Spinifex reserves in a static pool and does not give to an instance. It defaults to the first IP in the range. In nat mode, OVN SNATs each VPC to an address from the nat-transit pool, and the host masquerades that pool to its uplink address.

Per-Node: nodes.NAME.vpcd

toml
[nodes.spx1.vpcd]
# Comma-separated list of the OVN NB/SB quorum endpoints (3 DB nodes). vpcd and
# ovn-controller fail over across them and follow the RAFT leader.
ovn_nb_addr        = "tcp:10.1.3.181:6641,tcp:10.1.3.182:6641,tcp:10.1.3.183:6641"
ovn_sb_addr        = "tcp:10.1.3.181:6642,tcp:10.1.3.182:6642,tcp:10.1.3.183:6642"
external_interface = "br-wan"                 # WAN Linux bridge name
FieldDescription
ovn_nb_addr / ovn_sb_addrOVN Northbound / Southbound DB endpoint(s). The NB and SB databases run clustered via OVSDB RAFT across the first three nodes (client ports 6641/6642, RAFT ports 6643/6644). Each node's config lists all three quorum endpoints so the loss of one DB node does not stall the control plane. A single tcp:IP:6641 string remains valid for single-node dev.
external_interfaceLinux bridge that owns the WAN uplink on this node (e.g. br-wan). The physical NIC is enslaved to this bridge — not configured here. vpcd expects the bridge name br-wan.

Pool Selection Logic

When an instance needs a public IP:

  1. AZ-scoped pool first: Pool with matching region + az
  2. Region-scoped fallback: Pool with matching region, no az (overflow)
  3. Unscoped fallback: Pool with no region/az (global, homelab configs)
  4. No match: No pool matches → InsufficientAddressCapacity error

Spinifex selects one pool. When that pool is full, the allocation fails with InsufficientAddressCapacity; Spinifex does not try the next pool.

AllocateAddress accepts optional pool name to target a specific block (maps to AWS PublicIpv4Pool).

IPAM Storage

Pool allocation state is stored durably in the cluster (NATS KV bucket spinifex-external-ipam, one entry per pool) and survives restarts. Each allocation records the ENI and instance holding the address. Pools are initialized from spinifex.toml on vpcd startup (idempotent).

Deployment Examples

Homelab / Dev (Single Pool)

Network: 192.168.1.0/24
Router: 192.168.1.1 (DHCP .2–.149)
Spinifex: 192.168.1.150–.250 (100 IPs)
toml
[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"
prefix_len  = 24

[nodes.homelab.vpcd]
external_interface = "br-wan"

Setup: Configure br-wan to enslave your physical WAN NIC (netplan, cloud-init, or systemd-networkd). Change your router's DHCP range to end at .149. Run sudo setup-ovn.sh — it auto-detects the WAN bridge from the default route, or specify it with --wan-bridge=br-wan.

Homelab / Dev (DHCP Pool — No Range Reservation)

Network: 192.168.1.0/24
Router: 192.168.1.1 (DHCP serves full range, no carve-out needed)
Spinifex: gets IPs from router DHCP on demand
toml
[network]
external_mode = "pool"

[[network.external_pools]]
name        = "wan"
source      = "dhcp"
bind_bridge = "br-wan"
gateway     = "192.168.1.1"
prefix_len  = 24
dns_servers = ["192.168.1.1", "8.8.8.8"]

[nodes.homelab.vpcd]
external_interface = "br-wan"

Setup: No router changes needed. Spinifex requests IPs from the router's DHCP server when VMs launch and releases them on terminate. vpcd runs its own DHCP client on bind_bridge, so the host needs no DHCP client package.

Host-Local Subnet (No Upstream Router)

Network: 192.168.10.0/24 — host-local, reachable from the host only
Host WAN: 198.51.100.10/24 on br-wan (existing address — unchanged)
Gateway: 192.168.10.1 — second address added to br-wan

Add the VM pool gateway as a second address on br-wan alongside the existing WAN IP. The host acts as the gateway for the pool — no upstream router or DHCP server needed for this range.

yaml
# /etc/netplan/…
bridges:
  br-wan:
    addresses:
      - 192.168.10.1/24      # VM pool gateway — host-local
      - 198.51.100.10/24     # existing WAN IP — unchanged
    routes:
      - to: default
        via: 198.51.100.1
toml
[network]
external_mode = "pool"

[[network.external_pools]]
name        = "wan"
source      = "static"         # required — no upstream DHCP for this range
range_start = "192.168.10.2"
range_end   = "192.168.10.100"
gateway     = "192.168.10.1"   # second address on br-wan
prefix_len  = 24
dns_servers = ["8.8.8.8"]

Setup: Apply with sudo netplan apply. VMs are reachable from the host at 192.168.10.x. For internet access through the host's WAN interface:

bash
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o br-wan -j MASQUERADE

Persist via /etc/sysctl.d/99-ip-forward.conf and netfilter-persistent save.

Datacenter / Colo (ISP Block)

ISP-assigned: 203.0.113.0/28 (14 usable IPs)
ISP gateway: 203.0.113.1
Servers: 3x with separate mgmt NIC (eth0) and public NIC enslaved to br-wan
toml
[network]
external_mode = "pool"

[[network.external_pools]]
name        = "public"
range_start = "203.0.113.2"
range_end   = "203.0.113.14"
gateway     = "203.0.113.1"
prefix_len  = 28

[nodes.dc1.vpcd]
external_interface = "br-wan"      # br-wan enslaves eth1

[nodes.dc2.vpcd]
external_interface = "br-wan"      # br-wan enslaves eth1

[nodes.dc3.vpcd]
external_interface = "br-wan"      # br-wan enslaves eno1

Enterprise On-Prem (VLAN)

The Linux WAN bridge br-wan enslaves a VLAN sub-interface (e.g. eth1.200) instead of a raw NIC. From OVN's perspective nothing changes — external_interface still points at the bridge.

toml
[network]
external_mode = "pool"

[[network.external_pools]]
name        = "dmz"
range_start = "172.16.0.100"
range_end   = "172.16.0.200"
gateway     = "172.16.0.1"
prefix_len  = 24

[nodes.srv1.vpcd]
external_interface = "br-wan"      # br-wan enslaves eth1.200

[nodes.srv2.vpcd]
external_interface = "br-wan"      # br-wan enslaves bond0.200

Edge / Branch (Outbound Only)

toml
[network]
external_mode = "nat"

[[network.external_pools]]
name               = "nat-transit"
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.edge1.vpcd]
bridge_mode = "nat"

Setup: Run sudo setup-ovn.sh --management --nat-uplink, then spx admin init --external-mode=nat, which writes this configuration.

Multiple Regions (Not Supported)

A Spinifex cluster has one region and one Availability Zone. Do not configure pools for more than one region: a cluster cannot launch instances in a second region, so those pools are never used. The region and az fields of a pool can only name the region and AZ of the cluster.


Troubleshooting