Guides / Networking

Build an IPv6-only private network

Every network on Etorm starts as a VPC. Here you create one with a single member and read back the addresses Etorm gave them.

A VPC is a private Ethernet segment. If you give it no IPv4 cidr it is IPv6-only, which is the default way to use Etorm. A VPC gets IPv4 only when it is created, so if you will need IPv4, add it now.

Create the VPC and a member

kubectl --server https://acme-prod-api.etorm.com --token "$ETORM_TOKEN" apply -f - <<'YAML'
apiVersion: network.etorm.com/v1alpha1
kind: VPC
metadata: {name: lan}
spec: {}
---
apiVersion: network.etorm.com/v1alpha1
kind: Account
metadata: {name: laptop}
spec: {vpcRef: {name: lan}}
YAML

An Account is one member's attachment to the VPC. If your VPC uses a gateway, the member also needs a WireGuard publicKey. Connect a Linux machine shows how to make one.

Read the addresses you were given

The controller writes the addresses into the status of both objects. Read them back.

kubectl ... get vpc lan -o jsonpath='{.status.ipv6Prefix}{"\n"}'      # a /64, unique-local unless you set spec.ipv6Prefix
kubectl ... get account laptop -o jsonpath='{.status.ipv6Address}{"\n"}' # prefix + the address SLAAC would pick from the MAC
kubectl ... get vpc,accounts

Choose your own prefix, MTU or encapsulation

These fields go in the VPC's spec. The prefix and the encapsulation cannot be changed once the VPC exists, so set them in the first apply.

FieldUse
spec.ipv6Prefixbring your own /64 instead of the generated one. Cannot be changed later.
spec.mtu576 to 1370 requested; the effective value is lower on an IPv6 underlay (up to 1350) and is shown in status.mtu.
spec.encapsulationvxlan (default) or geneve. Cannot be changed later.

If you need IPv4 too, add IPv4, DHCP and DNS next.

Clean up

kubectl ... delete account laptop
kubectl ... delete vpc lan

Delete the account first. A VPC cannot be deleted while accounts are in it. Delete things safely gives the full order.