Concepts
Floating IPs and firewalls
Public IPv4 addresses you can move between servers in about a second, and per-server stateful firewalls for IPv4 and IPv6.
Floating IPs#
A floating IP is a public IPv4 address held by your account and forwarded 1:1, inbound and outbound, to a server. Moving it to another server takes effect within about a second, which makes it the simplest way to fail a service over or to keep an address across a rebuild. Stockholm works differently: see below.
ankra-cloud floating-ips allocate --zone <zone> --server <server-id> --wait
ankra-cloud floating-ips assign <floating-ip-id> --server <other-server-id> --wait
ankra-cloud floating-ips release <floating-ip-id> --wait
A floating IP's target says where it forwards:
public(the default): the server's public interface.private:<network_id>: the server's interface on that private network, which must be attached to a router with NAT enabled. The address then enters and leaves through that NAT gateway, so an IPv6-only server can still own a public IPv4.
While a floating IP forwards to a private interface, turning off that router's NAT, detaching the network from the router or detaching the server from the network answers 409; unassign the floating IP first.
Allocating with a server_id checks the target first and allocates and assigns in one step, so a refused assignment
keeps no address. A floating IP costs €4.00 a month, billed per hour from allocation to release. These floating IPs
count against your floating IP limit, 1 per account by default; Settings, Quotas shows it and takes a request for
more. Ankra assigns the address: you choose the location, not the range.
Floating IPs in Stockholm#
In se-sto1 a floating IP is an address your account keeps, and assigning it makes it the server's own public IPv4. So:
- Allocate first, then assign. A
--serverat allocation is refused there. - Assigning or unassigning restarts a running server, so it is not instant failover. The API says so with
requires_restarton the floating IP. - The server must not hold another public IPv4. Remove it first.
- To move the address, unassign it and assign it to the other server. Unassigning, or deleting the server, leaves the address on your account.
- It counts against your public IPv4 limit, 3 addresses per account by default, and not against your floating IP limit. Each one counts once, whether it is assigned or kept spare, and the IPv4 addresses your servers hold count under the same limit. So you can reserve several addresses yourself while servers and reserved addresses together stay within it; past it the allocation answers 422 and names the limit.
- It is billed once, as a floating IP.
ankra-cloud floating-ips allocate --zone se-sto1 --wait
ankra-cloud floating-ips assign <floating-ip-id> --server <server-id> --wait
Firewalls#
Every server has one stateful firewall, applied on the host in front of all its interfaces. Changes apply within seconds, also to running servers.
{
"enabled": true,
"default_inbound": "drop",
"default_outbound": "accept",
"rules": [
{ "direction": "inbound", "action": "accept", "protocol": "tcp", "port_start": 443, "port_end": 443, "comment": "https" },
{ "direction": "inbound", "action": "accept", "protocol": "tcp", "port_start": 22, "port_end": 22, "remote_cidr": "2001:db8:1234::/48", "comment": "ssh from the office" },
{ "direction": "inbound", "action": "accept", "protocol": "icmp" }
]
}
- Rules apply in order and the first match decides; otherwise the direction's default applies.
- Established and related traffic is always allowed, so replies to outbound connections come back.
protocolistcp,udp,icmpor empty for any. Ports needtcporudp;0means any port.remote_cidris an IPv4 or IPv6 address or CIDR, or empty for any.
Replace the whole firewall with PUT /v1/servers/{id}/firewall (or ankra-cloud firewall set <server-id> --file firewall.json); read it with GET /v1/servers/{id}/firewall.
Independently of your rules, every interface may only send from its own MAC and IP addresses (anti-spoofing), and ICMPv6 neighbour discovery and packet-too-big always pass. The metadata service is not affected by the firewall.