Skip to content
Odinex Cloud
Concepts

Networking

How public addresses, private networks, NAT gateways and Elastic IPs work together.

Choose how each server connects: give it public addresses, connect it to a private network, or combine both. Private networks keep traffic between your servers off the public internet. A NAT gateway lets private servers make outbound internet connections, while an Elastic IP gives a private-only server a stable public IPv4 address for inbound traffic.

Public addresses (primary IPs)

A server gets one public IPv4 address and one IPv6 address. These are primary IPs in the API (GET /primary_ips) and belong to the server's location.

  • You can leave out either one when you create the server (public_net.enable_ipv4 / enable_ipv6, or --without-ipv4 / --without-ipv6 in the CLI), but a server needs at least one.
  • The IPv4 address is billed separately from the server; IPv6 is included. See Pricing.
  • The server receives its addresses automatically at boot; you don't need to configure them.
  • Each server gets a single IPv6 address, not a whole /64.
  • You can set reverse DNS on both.

Private networks

A private network connects servers in the same location over an internal network that is not reachable from the internet.

  • Choose the IPv4 range when you create the network. It must be inside 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16, between /16 and /28. The range can't be changed later.
  • Attach servers when you create them or later (attach_to_network). Each attached server gets an address from the range, or one you choose that is free and inside the range.
  • Servers created from our Linux images configure the private interface themselves (DHCP), also when the network is attached after the server was created. On other images, configure the second interface with DHCP or the address shown in the console.
  • A private network can have one NAT gateway. Without one, a server needs its own public address to reach the internet.
odx network create --name backend --ip-range 10.0.0.0/16 --location fra1
odx server attach-to-network --network backend web-1

NAT gateways

A NAT gateway connects a private network to the internet for outbound traffic. Servers on that network that have no public addresses of their own can download packages and call external services through it. A private network can have one NAT gateway. It takes the network's first address (for example 10.0.0.1) as the default gateway, so servers get addresses from .2 on, and it has its own public IPv4 address that all their outbound traffic leaves from.

odx nat-gateway create --network backend --name backend-egress
# API: POST /v1/nat_gateways {"name": "backend-egress", "network": "backend"}

A NAT gateway costs €2.00 per month (billed hourly, see Billing). NAT does not make private servers reachable from the internet; for inbound connections, assign an Elastic IP or put a load balancer on the network.

Servers without public addresses

Create a server with both public addresses turned off and at least one private network. The first network becomes its primary network, and its default route goes through that network's NAT gateway:

odx server create --name app-1 --type s2 --image ubuntu-24.04 --location fra1 \
  --without-ipv4 --without-ipv6 --network backend
# API: POST /v1/servers with "networks": ["backend"] and
#      "public_net": {"enable_ipv4": false, "enable_ipv6": false}

--network is required here: the first network you give is the primary one.

Without a NAT gateway on its primary network, such a server can only talk to other servers on its networks.

Elastic IPs

An Elastic IP is a public IPv4 address mapped to a server without public addresses. Assigning one makes the server reachable from the internet at that address; traffic to it reaches the server's private address, so nothing needs configuring inside the server. Two conditions apply:

  • the server was created without public IPv4 and IPv6 (see above);
  • its primary network has a NAT gateway.

Each server can have one Elastic IP. Unassign it and assign it to another such server when you move a workload; the address stays the same.

odx elastic-ip create --name web-ip --location fra1   # or --server app-1 to create and assign at once
odx elastic-ip assign web-ip app-1
odx elastic-ip unassign web-ip
# API: POST /v1/elastic_ips, POST /v1/elastic_ips/{id}/actions/assign {"server": <id>}

An Elastic IPv4 costs €2.00 per month and is billed while it exists, whether or not it is assigned. Apply a firewall to control which inbound connections the server accepts. The console has pages for NAT gateways and Elastic IPs under Networking. In Terraform, use odinex_nat_gateway, odinex_elastic_ip and odinex_elastic_ip_assignment, and turn a server's public addresses off with public_net { ipv4_enabled = false, ipv6_enabled = false } and primary_network_id.

Floating IPs

A floating IP is an additional IPv4 or IPv6 address that you can assign to any server in its location and move to another server at any time, for example to fail over to a standby server. It is billed whether or not it is assigned.

odx floating-ip create --type ipv4 --name ip-1 --location fra1
odx floating-ip assign ip-1 web-1

Assigning routes the address to the server's public interface. The address does not configure itself inside the server: you have to add it to the network interface and announce it.

Configure the floating IP in the server and send a gratuitous ARP

After assigning a floating IPv4 address, add it to the server's public interface and announce it once with a gratuitous ARP. Until the server announces it, traffic may still go to the server that held the address before.

ip addr add 203.0.113.7/32 dev eth0
arping -U -c 3 -I eth0 203.0.113.7     # Ubuntu/Debian: apt install iputils-arping

Rebooting the server after you have made the address permanent has the same effect as the arping.

ip addr add does not survive a reboot. To make the address permanent on Ubuntu, add it to netplan, for example in /etc/netplan/60-floating-ip.yaml, and run netplan apply:

/etc/netplan/60-floating-ip.yaml
network:
  version: 2
  ethernets:
    eth0:
      addresses:
        - 203.0.113.7/32

The interface may have another name than eth0 on your image; check with ip addr. For a floating IPv6 address, add it the same way with its prefix length (ip -6 addr add 2001:db8::7/128 dev eth0).

When you move a floating IP to another server, remove it from the old server and configure and announce it on the new one.

For a server reachable through a public address that should move between public-interface servers, use a floating IP. For a private-only server that needs a stable public IPv4 address, use an Elastic IP.

Outgoing email (port 25)

Outgoing connections to TCP port 25 (SMTP between mail servers) are blocked for every public address: primary IPs, floating IPs, Elastic IPs and NAT gateways, over IPv4 and IPv6. The block sits in the network in front of your server, so firewalls and server settings cannot change it. This keeps the platform's addresses off spam blocklists.

  • Sending through a mail provider works. Submission ports 587 (STARTTLS) and 465 (TLS) are open, so applications and mail servers can relay through services such as Amazon SES, Postmark, Mailgun or your own provider's SMTP server.
  • Receiving mail is not affected. Inbound connections to port 25 on your server are allowed (open the port in your firewall if you use one).
  • Running your own outgoing mail server needs port 25 opened for its address. Open a support ticket with the category Technical, name the IP address and tell us what you send. Set its reverse DNS first. We open it for established accounts with a clear use.

On this page