# OpenStack networking

Networking on OpenStack differs from [TUhost](https://www.it.tuwien.ac.at/services/netzwerk-und-server/tuhost-virtual-server-hosting).
Your private networks cannot be connected directly (layer 2/VLAN) to the institutional network. In exchange, virtual
machines hosted on OpenStack are exempt from machine registration requirements.

## Public and private networks

You can either attach an instance to the public network directly, or place it on a **private network** with a private
IP range. Private networks are useful to conserve public IP addresses. To connect a private network to the outside
world, you create a **router**.

## Routers and floating IPs

A **router** connects your private networks to the public network and provides NAT from your private address range to a
public IP. A **floating IP** is a public address you can allocate and move from one instance to another. Instances on a
private network get a floating IP when they need to be reachable from outside.

!!! tip
    Allocate only as many floating IPs as you need and release them when done. You can find your floating IPs under
    **Project → Network → Floating IPs**.

## Load balancers

You can create **load balancers** to distribute incoming connections across one or more instances. This is handled by
the Octavia service.

## Security groups

Security groups act as firewalls for your instances. Each instance **port** is assigned to a security group that
governs its *ingress* and *egress* traffic. The `default` security group allows **no inbound traffic at all**. If your
workload needs inbound connections (other than basic maintenance from within the network), you must add rules to the
default group or attach an additional security group with the required rules.

## DNS

We manage the DNS zones `datalab.tuwien.ac.at` and `dl.hpc.tuwien.ac.at` and can provide entries in these domains.

### Floating IP DNS entries

Every floating IP has a DNS entry in the public floating IP ranges, following this scheme for the `128.130.194.0/24`
range:

```
s1.datalab.tuwien.ac.at   = 128.130.194.1
s2.datalab.tuwien.ac.at   = 128.130.194.2
...
s111.datalab.tuwien.ac.at = 128.130.194.111
```

The same scheme applies to the `128.130.202.0/24` range. This lets you reach an instance by its name instead of
remembering its IP address. These are names for floating IPs, not for the underlying compute nodes (which you never
interact with directly).

### Custom DNS entries

If you want to use a DNS entry from the domain of your institute, create a CNAME record pointing to the correct
floating IP DNS entry.