Skip to main content

Private Networks

Create a Private Network

To create a new private network, send a POST request.

POST /compute/v1/private-networks (HTTP 201 - Created)

Body parameters

  • name String Required - The human-readable name set for the private network.
  • description String Optional - The human-readable description set for the private network.
  • region String Required - The identifier for the region in which this network is created (e.g. NORD-NO-KRS-1).
  • cidr_v4 String Optional - The IPv4 CIDR block for the private network.
  • cidr_v6 String Optional - The IPv6 CIDR block for the private network.
  • gateway_ipv4 String Optional, advanced feature - The IPv4 default gateway to advertise to instances via DHCP. Must be an IP address within cidr_v4. Immutable after creation. See Gateway below.

Request Body Example

{
"name": "My-Network",
"description": "Internal communication network",
"region": "NORD-NO-KRS-1",
"cidr_v4": "10.0.0.0/24"
}

Response Body

The response returns the created private network details nested under the private_network field:

  • private_network Object - The created private network resource details.

Response Example

{
"private_network": {
"id": "net-d4dd28c4-9179-4144-8fe6-92ea4e0946c2",
"name": "My-Network",
"description": "",
"cidr_v4": "10.0.0.0/24",
"cidr_v6": null,
"gateway_ipv4": null,
"region": "NORD-NO-KRS-1",
"status": "created",
"created_at": "2026-04-14T07:25:16+00:00",
"updated_at": "2026-04-14T07:25:16+00:00"
}
}

List Private Networks

Lists all private networks associated with your account.

GET /compute/v1/private-networks (HTTP 200 - OK)

Query parameters

  • per_page Integer Optional - Maximum number of items to return (default: 50, max: 100).
  • page Integer Optional - The page to return.

Response Example

{
"page": 1,
"per_page": 50,
"private_networks": [
{
"id": "net-d4dd28c4-9179-4144-8fe6-92ea4e0946c2",
"name": "My-Network",
"description": "",
"cidr_v4": "10.0.0.0/24",
"cidr_v6": null,
"gateway_ipv4": null,
"region": "NORD-NO-KRS-1",
"status": "created",
"created_at": "2026-04-14T07:25:16+00:00",
"updated_at": "2026-04-14T07:25:16+00:00"
}
],
"total_count": 1
}

Get Private Network

Get details of a specific private network by ID.

GET /compute/v1/private-networks/<network_id> (HTTP 200 - OK)

Response Example

{
"private_network": {
"id": "net-d4dd28c4-9179-4144-8fe6-92ea4e0946c2",
"name": "My-Network",
"description": "",
"cidr_v4": "10.0.0.0/24",
"cidr_v6": null,
"gateway_ipv4": null,
"region": "NORD-NO-KRS-1",
"status": "created",
"created_at": "2026-04-14T07:25:16+00:00",
"updated_at": "2026-04-14T07:25:16+00:00"
}
}

Update Private Network

Update an existing private network's details.

PATCH /compute/v1/private-networks/<network_id> (HTTP 200 - OK)

Body parameters

  • name String Optional - The new human-readable name set for the private network.
  • description String Optional - The new human-readable description set for the private network.

Note: cidr_v4, cidr_v6, and gateway_ipv4 are immutable and cannot be changed after creation.

Response Example

{
"private_network": {
"id": "net-d4dd28c4-9179-4144-8fe6-92ea4e0946c2",
"name": "My-Network-updated",
"description": "Updated description",
"cidr_v4": "10.0.0.0/24",
"cidr_v6": null,
"gateway_ipv4": null,
"region": "NORD-NO-KRS-1",
"status": "created",
"created_at": "2026-04-14T07:25:16+00:00",
"updated_at": "2026-06-15T09:49:00+00:00"
}
}

Delete Private Network

Delete a private network with the given ID.

Advanced feature

The gateway_ipv4 field is an advanced feature that must be enabled for your project before use. Please contact support to request access.

DELETE /compute/v1/private-networks/<network_id> (HTTP 204 - No Content)

Examples (cURL)

# Create a new private network
curl -H "Authorization: Bearer $TOKEN" \
-X POST "https://public-api.krs-1.epilayer.eu/compute/v1/private-networks" \
-H "Content-Type: application/json" \
-d '{
"name": "my-private-network",
"region": "NORD-NO-KRS-1",
"cidr_v4": "10.0.0.0/24"
}'

# List all private networks
curl -H "Authorization: Bearer $TOKEN" \
"https://public-api.krs-1.epilayer.eu/compute/v1/private-networks"

# Update a private network
curl -H "Authorization: Bearer $TOKEN" \
-X PATCH "https://public-api.krs-1.epilayer.eu/compute/v1/private-networks/net-d4dd28c4-9179-4144-8fe6-92ea4e0946c2" \
-H "Content-Type: application/json" \
-d '{
"name": "my-private-network-updated"
}'

# Delete a private network
curl -H "Authorization: Bearer $TOKEN" \
-X DELETE "https://public-api.krs-1.epilayer.eu/compute/v1/private-networks/net-d4dd28c4-9179-4144-8fe6-92ea4e0946c2"

Gateway

Advanced feature

The gateway_ipv4 field is an advanced feature that must be enabled for your project before use. Please contact support to request access.

When gateway_ipv4 is set on a private network, instances attached to that network receive the gateway address via DHCP option 3 (Router). This allows instances to route traffic through a designated gateway instance (e.g. a NAT or VPN gateway) you operate on the same network.

The gateway instance itself must be configured to forward traffic — EpiLayer does not automatically enable routing on the gateway IP. A typical setup:

  1. Create a private network with a cidr_v4 and gateway_ipv4.
  2. Launch a gateway instance attached to that network; assign it the gateway IP as a static address.
  3. Enable IP forwarding on the gateway instance and configure your routing rules.
  4. Launch worker instances on the same network — they will automatically receive the gateway IP as their default route via DHCP.
# Create a private network with a gateway
curl -H "Authorization: Bearer $TOKEN" \
-X POST "https://public-api.krs-1.epilayer.eu/compute/v1/private-networks" \
-H "Content-Type: application/json" \
-d '{
"name": "my-gateway-network",
"region": "NORD-NO-KRS-1",
"cidr_v4": "10.0.0.0/24",
"gateway_ipv4": "10.0.0.1"
}'